pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install Sync with src, version 20060424:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d3bab9867acd
branches:  trunk
changeset: 511859:d3bab9867acd
user:      dillo <dillo%pkgsrc.org@localhost>
date:      Mon Apr 24 13:52:04 2006 +0000

description:
Sync with src, version 20060424:
        Add support for creating summary file containing all information
        about a package repository needed by package managing software.
        This allows better use of remote binary package repositories.

        Discussed on tech-pkg.

diffstat:

 pkgtools/pkg_install/PLIST                      |    4 +-
 pkgtools/pkg_install/files/add/perform.c        |   24 +-----
 pkgtools/pkg_install/files/info/info.h          |    4 +-
 pkgtools/pkg_install/files/info/main.c          |   12 +-
 pkgtools/pkg_install/files/info/perform.c       |   19 +++-
 pkgtools/pkg_install/files/info/pkg_info.1      |   13 ++-
 pkgtools/pkg_install/files/info/pkg_info.cat1   |    9 +-
 pkgtools/pkg_install/files/info/show.c          |   90 ++++++++++++++++++++-
 pkgtools/pkg_install/files/lib/Makefile.in      |   11 ++-
 pkgtools/pkg_install/files/lib/defs.h           |   22 ++++-
 pkgtools/pkg_install/files/lib/lib.h            |    3 +-
 pkgtools/pkg_install/files/lib/pkg_summary.5    |  102 ++++++++++++++++++++++++
 pkgtools/pkg_install/files/lib/pkg_summary.cat5 |   82 +++++++++++++++++++
 pkgtools/pkg_install/files/lib/var.c            |   52 +++++++++++-
 pkgtools/pkg_install/files/lib/version.h        |    4 +-
 15 files changed, 402 insertions(+), 49 deletions(-)

diffs (truncated from 788 to 300 lines):

diff -r 5c6bafd0b2e7 -r d3bab9867acd pkgtools/pkg_install/PLIST
--- a/pkgtools/pkg_install/PLIST        Mon Apr 24 10:49:12 2006 +0000
+++ b/pkgtools/pkg_install/PLIST        Mon Apr 24 13:52:04 2006 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.7 2006/01/06 19:46:26 rillig Exp $
+@comment $NetBSD: PLIST,v 1.8 2006/04/24 13:52:04 dillo Exp $
 man/cat1/linkfarm.0
 man/cat1/pkg_add.0
 man/cat1/pkg_admin.0
@@ -6,6 +6,7 @@
 man/cat1/pkg_delete.0
 man/cat1/pkg_info.0
 man/cat1/pkg_view.0
+man/cat5/pkg_summary.0
 man/man1/linkfarm.1
 man/man1/pkg_add.1
 man/man1/pkg_admin.1
@@ -13,6 +14,7 @@
 man/man1/pkg_delete.1
 man/man1/pkg_info.1
 man/man1/pkg_view.1
+man/man5/pkg_summary.5
 sbin/linkfarm
 sbin/pkg_add
 sbin/pkg_admin
diff -r 5c6bafd0b2e7 -r d3bab9867acd pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c  Mon Apr 24 10:49:12 2006 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c  Mon Apr 24 13:52:04 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.40 2006/04/06 06:49:30 reed Exp $        */
+/*     $NetBSD: perform.c,v 1.41 2006/04/24 13:52:04 dillo Exp $       */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -14,7 +14,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.40 2006/04/06 06:49:30 reed Exp $");
+__RCSID("$NetBSD: perform.c,v 1.41 2006/04/24 13:52:04 dillo Exp $");
 #endif
 #endif
 
@@ -75,26 +75,6 @@
 
 static lfile_head_t files;
 
-/*
- * Some systems such as OpenBSD-3.6 do not provide PRIu64.
- * Others such as AIX-4.3.2 have a broken PRIu64 which includes
- * a leading "%".
- */
-#ifdef NEED_PRI_MACRO
-#  ifdef PRIu64
-#    undef PRIu64
-#  endif
-#  if SIZEOF_INT == 8
-#    define PRIu64 "u"
-#  elif SIZEOF_LONG == 8
-#    define PRIu64 "lu"
-#  elif SIZEOF_LONG_LONG == 8
-#    define PRIu64 "llu"
-#  else
-#    error "unable to find a suitable PRIu64"
-#  endif
-#endif
-
 /* used in build information */
 enum {
        Good,
diff -r 5c6bafd0b2e7 -r d3bab9867acd pkgtools/pkg_install/files/info/info.h
--- a/pkgtools/pkg_install/files/info/info.h    Mon Apr 24 10:49:12 2006 +0000
+++ b/pkgtools/pkg_install/files/info/info.h    Mon Apr 24 13:52:04 2006 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: info.h,v 1.9 2005/11/05 13:20:09 wiz Exp $ */
+/* $NetBSD: info.h,v 1.10 2006/04/24 13:52:04 dillo Exp $ */
 
 /* from FreeBSD Id: info.h,v 1.10 1997/02/22 16:09:40 peter Exp */
 
@@ -52,6 +52,7 @@
 #define SHOW_ALL_SIZE          0x10000
 #define SHOW_BLD_DEPENDS       0x20000
 #define SHOW_BI_VAR            0x40000
+#define SHOW_SUMMARY           0x80000
 
 enum which {
     WHICH_ALL,
@@ -78,5 +79,6 @@
 extern void show_depends(char *, package_t *);
 extern void show_bld_depends(char *, package_t *);
 extern void show_index(char *, char *, char *);
+extern void show_summary(package_t *, const char *);
 
 #endif                         /* _INST_INFO_H_INCLUDE */
diff -r 5c6bafd0b2e7 -r d3bab9867acd pkgtools/pkg_install/files/info/main.c
--- a/pkgtools/pkg_install/files/info/main.c    Mon Apr 24 10:49:12 2006 +0000
+++ b/pkgtools/pkg_install/files/info/main.c    Mon Apr 24 13:52:04 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.14 2005/11/05 13:20:09 wiz Exp $    */
+/*     $NetBSD: main.c,v 1.15 2006/04/24 13:52:04 dillo Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static char *rcsid = "from FreeBSD Id: main.c,v 1.14 1997/10/08 07:47:26 charnier Exp";
 #else
-__RCSID("$NetBSD: main.c,v 1.14 2005/11/05 13:20:09 wiz Exp $");
+__RCSID("$NetBSD: main.c,v 1.15 2006/04/24 13:52:04 dillo Exp $");
 #endif
 #endif
 
@@ -50,7 +50,7 @@
 #include "lib.h"
 #include "info.h"
 
-static const char Options[] = ".aBbcDde:fFhIiK:kLl:mNnpQ:qRrsSuvV";
+static const char Options[] = ".aBbcDde:fFhIiK:kLl:mNnpQ:qRrsSuvVX";
 
 int     Flags = 0;
 enum which Which = WHICH_LIST;
@@ -68,7 +68,7 @@
 usage(void)
 {
        fprintf(stderr, "%s\n%s\n%s\n%s\n",
-           "usage: pkg_info [-BbcDdFfhIikLmNnpqRrSsVv] [-e package] [-K pkg_dbdir] [-l prefix]",
+           "usage: pkg_info [-BbcDdFfhIikLmNnpqRrSsVvX] [-e package] [-K pkg_dbdir] [-l prefix]",
            "                pkg-name [...]",
            "       pkg_info [-a | -u] [flags]",
            "       pkg_info -Q variable pkg-name [pkg-name ...]");
@@ -205,6 +205,10 @@
                        show_version();
                        /* NOTREACHED */
 
+               case 'X':
+                       Flags |= SHOW_SUMMARY;
+                       break;
+
                case 'h':
                case '?':
                default:
diff -r 5c6bafd0b2e7 -r d3bab9867acd pkgtools/pkg_install/files/info/perform.c
--- a/pkgtools/pkg_install/files/info/perform.c Mon Apr 24 10:49:12 2006 +0000
+++ b/pkgtools/pkg_install/files/info/perform.c Mon Apr 24 13:52:04 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.27 2006/04/04 06:28:22 wiz Exp $ */
+/*     $NetBSD: perform.c,v 1.28 2006/04/24 13:52:05 dillo Exp $       */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -14,7 +14,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.27 2006/04/04 06:28:22 wiz Exp $");
+__RCSID("$NetBSD: perform.c,v 1.28 2006/04/24 13:52:05 dillo Exp $");
 #endif
 #endif
 
@@ -76,6 +76,7 @@
        int     code = 0;
        lfile_t *lfp;
        int     result;
+       char   *binpkgfile = NULL;
 
        if (IS_URL(pkg)) {
                if ((cp = fileGetURL(pkg)) != NULL) {
@@ -96,6 +97,7 @@
                        strlcpy(fname, pkg, sizeof(fname));
                }
                cp = fname;
+               binpkgfile = fname;
        }
 
        if (cp) {
@@ -109,6 +111,8 @@
                                 */
                                char *cp2;
 
+                               binpkgfile = NULL;
+
                                if ((cp2 = fileGetURL(cp)) != NULL) {
                                        strlcpy(fname, cp2, sizeof(fname));
                                        isTMP = TRUE;
@@ -131,9 +135,9 @@
                                        LFILE_ADD(&files, lfp, MTREE_FNAME);
                                if (Flags & SHOW_BUILD_VERSION)
                                        LFILE_ADD(&files, lfp, BUILD_VERSION_FNAME);
-                               if (Flags & SHOW_BUILD_INFO)
+                               if (Flags & (SHOW_BUILD_INFO|SHOW_SUMMARY))
                                        LFILE_ADD(&files, lfp, BUILD_INFO_FNAME);
-                               if (Flags & SHOW_PKG_SIZE)
+                               if (Flags & (SHOW_PKG_SIZE|SHOW_SUMMARY))
                                        LFILE_ADD(&files, lfp, SIZE_PKG_FNAME);
                                if (Flags & SHOW_ALL_SIZE)
                                        LFILE_ADD(&files, lfp, SIZE_ALL_FNAME);
@@ -232,12 +236,15 @@
                fclose(fp);
 
                /* Start showing the package contents */
-               if (!Quiet) {
+               if (!Quiet && !(Flags & SHOW_SUMMARY)) {
                        printf("%sInformation for %s:\n\n", InfoPrefix, pkg);
                        if (fexists(PRESERVE_FNAME)) {
                                printf("*** PACKAGE MAY NOT BE DELETED ***\n");
                        }
                }
+               if (Flags & SHOW_SUMMARY) {
+                       show_summary(&plist, binpkgfile);
+               }
                if (Flags & SHOW_COMMENT) {
                        show_file(pkg, "Comment:\n", COMMENT_FNAME, TRUE);
                }
@@ -305,7 +312,7 @@
                        show_file(pkg, "Size in bytes including required pkgs: ",
                                  SIZE_ALL_FNAME, TRUE);
                }
-               if (!Quiet) {
+               if (!Quiet && !(Flags & SHOW_SUMMARY)) {
                        if (fexists(PRESERVE_FNAME)) {
                                printf("*** PACKAGE MAY NOT BE DELETED ***\n\n");
                        }
diff -r 5c6bafd0b2e7 -r d3bab9867acd pkgtools/pkg_install/files/info/pkg_info.1
--- a/pkgtools/pkg_install/files/info/pkg_info.1        Mon Apr 24 10:49:12 2006 +0000
+++ b/pkgtools/pkg_install/files/info/pkg_info.1        Mon Apr 24 13:52:04 2006 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_info.1,v 1.17 2005/11/05 13:20:09 wiz Exp $
+.\" $NetBSD: pkg_info.1,v 1.18 2006/04/24 13:52:05 dillo Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -17,7 +17,7 @@
 .\"
 .\"     @(#)pkg_info.1
 .\"
-.Dd November 1, 2005
+.Dd April 15, 2006
 .Dt PKG_INFO 1
 .Os
 .Sh NAME
@@ -25,7 +25,7 @@
 .Nd a utility for displaying information on software packages
 .Sh SYNOPSIS
 .Nm
-.Op Fl BbcDdFfhIikLmNnpqRrSsVv
+.Op Fl BbcDdFfhIikLmNnpqRrSsVvX
 .Op Fl e Ar package
 .Op Fl K Ar pkg_dbdir
 .Op Fl l Ar prefix
@@ -179,6 +179,13 @@
 Print version number and exit.
 .It Fl v
 Turn on verbose output.
+.It Fl X
+Print summary information for each package.
+The summary format is
+described in
+.Xr pkg_summary 5 .
+Its primary use is to contain all information about the contents of a
+(remote) binary package repository needed by package managing software.
 .El
 .Sh TECHNICAL DETAILS
 Package info is either extracted from package files named on the
diff -r 5c6bafd0b2e7 -r d3bab9867acd pkgtools/pkg_install/files/info/pkg_info.cat1
--- a/pkgtools/pkg_install/files/info/pkg_info.cat1     Mon Apr 24 10:49:12 2006 +0000
+++ b/pkgtools/pkg_install/files/info/pkg_info.cat1     Mon Apr 24 13:52:04 2006 +0000
@@ -4,7 +4,7 @@
      ppkkgg__iinnffoo -- a utility for displaying information on software packages
 
 SSYYNNOOPPSSIISS
-     ppkkgg__iinnffoo [--BBbbccDDddFFffhhIIiikkLLmmNNnnppqqRRrrSSssVVvv] [--ee _p_a_c_k_a_g_e] [--KK _p_k_g___d_b_d_i_r]
+     ppkkgg__iinnffoo [--BBbbccDDddFFffhhIIiikkLLmmNNnnppqqRRrrSSssVVvvXX] [--ee _p_a_c_k_a_g_e] [--KK _p_k_g___d_b_d_i_r]
               [--ll _p_r_e_f_i_x] _p_k_g_-_n_a_m_e _._._.
      ppkkgg__iinnffoo [--aa | --uu] [flags]
      ppkkgg__iinnffoo [--QQ _v_a_r_i_a_b_l_e] _p_k_g_-_n_a_m_e _._._.
@@ -115,6 +115,11 @@
 
      --vv      Turn on verbose output.
 
+     --XX      Print summary information for each package.  The summary format
+             is described in pkg_summary(5).  Its primary use is to contain
+             all information about the contents of a (remote) binary package
+             repository needed by package managing software.
+
 TTEECCHHNNIICCAALL DDEETTAAIILLSS
      Package info is either extracted from package files named on the command
      line, or from already installed package information in
@@ -192,4 +197,4 @@
              NetBSD wildcard dependency processing, pkgdb, depends displaying,
              pkg size display etc.
 
-NetBSD 3.0                     November 1, 2005                     NetBSD 3.0
+NetBSD 3.0                      April 15, 2006                      NetBSD 3.0
diff -r 5c6bafd0b2e7 -r d3bab9867acd pkgtools/pkg_install/files/info/show.c
--- a/pkgtools/pkg_install/files/info/show.c    Mon Apr 24 10:49:12 2006 +0000
+++ b/pkgtools/pkg_install/files/info/show.c    Mon Apr 24 13:52:04 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: show.c,v 1.9 2005/11/05 13:20:09 wiz Exp $     */
+/*     $NetBSD: show.c,v 1.10 2006/04/24 13:52:05 dillo Exp $  */
 



Home | Main Index | Thread Index | Old Index