pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files pkg_install-20091006:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/61d74204e9b7
branches:  trunk
changeset: 399880:61d74204e9b7
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Oct 07 12:53:26 2009 +0000

description:
pkg_install-20091006:
- restore pkg_add -f functionality for missing dependencies (PR 42001)
- pkg_admin rebuild should count packages correctly (he@), also count @pkgdb
- fix gpg-sign-package syntax in pkg_admin(1)
- change default URL for pkg-vulnerabilities to use HTTP

diffstat:

 pkgtools/pkg_install/files/add/add.h                    |   4 +-
 pkgtools/pkg_install/files/add/main.c                   |   6 +-
 pkgtools/pkg_install/files/add/perform.c                |  19 +++++--
 pkgtools/pkg_install/files/admin/main.c                 |  38 ++++++++++------
 pkgtools/pkg_install/files/admin/pkg_admin.1            |   7 +-
 pkgtools/pkg_install/files/admin/pkg_admin.cat1         |   5 +-
 pkgtools/pkg_install/files/lib/parse-config.c           |   6 +-
 pkgtools/pkg_install/files/lib/pkg_install.conf.5.in    |   4 +-
 pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in |   2 +-
 pkgtools/pkg_install/files/lib/version.h                |   4 +-
 10 files changed, 59 insertions(+), 36 deletions(-)

diffs (truncated from 311 to 300 lines):

diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/add/add.h
--- a/pkgtools/pkg_install/files/add/add.h      Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/add/add.h      Wed Oct 07 12:53:26 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: add.h,v 1.15 2009/08/16 14:26:46 joerg Exp $ */
+/* $NetBSD: add.h,v 1.16 2009/10/07 12:53:26 joerg Exp $ */
 
 /* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp  */
 
@@ -39,6 +39,8 @@
 extern int LicenseCheck;
 extern int Replace;
 
+extern Boolean ForceDepends;
+
 int     make_hierarchy(char *);
 void    apply_perms(char *, char **, int);
 
diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/add/main.c
--- a/pkgtools/pkg_install/files/add/main.c     Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/add/main.c     Wed Oct 07 12:53:26 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.21 2009/09/11 18:00:13 joerg Exp $  */
+/*     $NetBSD: main.c,v 1.22 2009/10/07 12:53:26 joerg Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: main.c,v 1.21 2009/09/11 18:00:13 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.22 2009/10/07 12:53:26 joerg Exp $");
 
 /*
  *
@@ -51,6 +51,7 @@
 Boolean NoInstall = FALSE;
 Boolean NoRecord = FALSE;
 Boolean Automatic = FALSE;
+Boolean ForceDepends = FALSE;
 
 int    LicenseCheck = 0;
 int     Replace = 0;
@@ -89,6 +90,7 @@
 
                case 'f':
                        Force = TRUE;
+                       ForceDepends = TRUE;
                        break;
 
                case 'I':
diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c  Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c  Wed Oct 07 12:53:26 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.90 2009/08/16 14:26:46 joerg Exp $       */
+/*     $NetBSD: perform.c,v 1.91 2009/10/07 12:53:26 joerg Exp $       */
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -6,7 +6,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: perform.c,v 1.90 2009/08/16 14:26:46 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.91 2009/10/07 12:53:26 joerg Exp $");
 
 /*-
  * Copyright (c) 2003 Grant Beattie <grant%NetBSD.org@localhost>
@@ -1034,12 +1034,19 @@
                                continue;
                        }
                        if (pkg_do(p->name, 1, 0)) {
-                               warnx("Can't install dependency %s", p->name);
-                               status = -1;
-                               break;
+                               if (ForceDepends) {
+                                       warnx("Can't install dependency %s, "
+                                           "continuing", p->name);
+                                       continue;
+                               } else {
+                                       warnx("Can't install dependency %s",
+                                           p->name);
+                                       status = -1;
+                                       break;
+                               }
                        }
                        best_installed = find_best_matching_installed_pkg(p->name);
-                       if (best_installed == NULL && Force) {
+                       if (best_installed == NULL && ForceDepends) {
                                warnx("Missing dependency %s ignored", p->name);
                                continue;
                        } else if (best_installed == NULL) {
diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/admin/main.c
--- a/pkgtools/pkg_install/files/admin/main.c   Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/admin/main.c   Wed Oct 07 12:53:26 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.55 2009/08/16 21:10:14 joerg Exp $  */
+/*     $NetBSD: main.c,v 1.56 2009/10/07 12:53:26 joerg Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: main.c,v 1.55 2009/08/16 21:10:14 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.56 2009/10/07 12:53:26 joerg Exp $");
 
 /*-
  * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -82,6 +82,12 @@
 
 #define DEFAULT_SFX    ".t[bg]z"       /* default suffix for ls{all,best} */
 
+struct pkgdb_count {
+       size_t files;
+       size_t directories;
+       size_t packages;
+};
+
 static const char Options[] = "C:K:SVbd:qs:v";
 
 int    quiet, verbose;
@@ -138,12 +144,13 @@
        char *PkgName, *dirp;
        char            file[MaxPathSize];
        char            dir[MaxPathSize];
-       int             tmp, *cnt;
+       struct pkgdb_count *count;
 
        if (!pkgdb_open(ReadWrite))
                err(EXIT_FAILURE, "cannot open pkgdb");
 
-       cnt = vp != NULL ? vp : &tmp;
+       count = vp;
+       ++count->packages;
 
        PkgDBDir = _pkgdb_getPKGDB_DIR();
        contents = pkgdb_pkg_file(pkgdir, CONTENTS_FNAME);
@@ -175,12 +182,12 @@
                                }
                        } else {
                                pkgdb_store(file, PkgName);
-                               (*cnt)++;
+                               ++count->files;
                        }
                        break;
                case PLIST_PKGDIR:
                        add_pkgdir(PkgName, dirp, p->name);
-                       (*cnt)++;
+                       ++count->directories;
                        break;
                case PLIST_CWD:
                        if (strcmp(p->name, ".") != 0) {
@@ -231,10 +238,11 @@
 rebuild(void)
 {
        char            cachename[MaxPathSize];
-       int             pkgcnt, filecnt;
+       struct pkgdb_count count;
 
-       pkgcnt = 0;
-       filecnt = 0;
+       count.files = 0;
+       count.directories = 0;
+       count.packages = 0;
 
        (void) _pkgdb_getPKGDB_FILE(cachename, sizeof(cachename));
        if (unlink(cachename) != 0 && errno != ENOENT)
@@ -242,12 +250,14 @@
 
        setbuf(stdout, NULL);
 
-       iterate_pkg_db(add_pkg, &filecnt);
+       iterate_pkg_db(add_pkg, &count);
 
        printf("\n");
-       printf("Stored %d file%s from %d package%s in %s.\n",
-           filecnt, filecnt == 1 ? "" : "s",
-           pkgcnt, pkgcnt == 1 ? "" : "s",
+       printf("Stored %zu file%s and %zu explizit director%s"
+           " from %zu package%s in %s.\n",
+           count.files, count.files == 1 ? "" : "s",
+           count.directories, count.directories == 1 ? "y" : "ies",
+           count.packages, count.packages == 1 ? "" : "s",
            cachename);
 }
 
@@ -415,7 +425,7 @@
        pkg_install_config();
 
        if (use_default_sfx)
-               (void) snprintf(sfx, sizeof(sfx), "%s", DEFAULT_SFX);
+               (void) strlcpy(sfx, DEFAULT_SFX, sizeof(sfx));
 
        if (strcasecmp(argv[0], "pmatch") == 0) {
 
diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/admin/pkg_admin.1
--- a/pkgtools/pkg_install/files/admin/pkg_admin.1      Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.1      Wed Oct 07 12:53:26 2009 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_admin.1,v 1.27 2009/08/17 05:06:38 wiz Exp $
+.\"    $NetBSD: pkg_admin.1,v 1.28 2009/10/07 12:53:26 joerg Exp $
 .\"
 .\" Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -289,10 +289,11 @@
 Packages that are not installed directly by the user but pulled in as
 dependencies are marked by setting
 .Dq automatic=YES .
-.It Cm gpg-sign-package pkg
+.It Cm gpg-sign-package pkg spkg
 Sign the binary package
 .Ar pkg
-using GPG.
+using GPG and write the result to
+.Ar spkg .
 .It Cm x509-sign-package pkg spkg key cert
 Sign the binary package
 .Ar pkg
diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/admin/pkg_admin.cat1
--- a/pkgtools/pkg_install/files/admin/pkg_admin.cat1   Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.cat1   Wed Oct 07 12:53:26 2009 +0000
@@ -194,8 +194,9 @@
              Packages that are not installed directly by the user but pulled
              in as dependencies are marked by setting ``automatic=YES''.
 
-     ggppgg--ssiiggnn--ppaacckkaaggee ppkkgg
-             Sign the binary package _p_k_g using GPG.
+     ggppgg--ssiiggnn--ppaacckkaaggee ppkkgg ssppkkgg
+             Sign the binary package _p_k_g using GPG and write the result to
+             _s_p_k_g.
 
      xx550099--ssiiggnn--ppaacckkaaggee ppkkgg ssppkkgg kkeeyy cceerrtt
              Sign the binary package _p_k_g using the key _k_e_y and the certificate
diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/lib/parse-config.c
--- a/pkgtools/pkg_install/files/lib/parse-config.c     Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/parse-config.c     Wed Oct 07 12:53:26 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse-config.c,v 1.9 2009/08/16 21:10:53 joerg Exp $   */
+/*     $NetBSD: parse-config.c,v 1.10 2009/10/07 12:53:27 joerg Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: parse-config.c,v 1.9 2009/08/16 21:10:53 joerg Exp $");
+__RCSID("$NetBSD: parse-config.c,v 1.10 2009/10/07 12:53:27 joerg Exp $");
 
 /*-
  * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -70,7 +70,7 @@
 const char *pkg_vulnerabilities_file;
 const char *pkg_vulnerabilities_url;
 const char *ignore_advisories = NULL;
-const char tnf_vulnerability_base[] = "ftp://ftp.NetBSD.org/pub/NetBSD/packages/vulns";;
+const char tnf_vulnerability_base[] = "http://ftp.NetBSD.org/pub/NetBSD/packages/vulns";;
 const char *acceptable_licenses = NULL;
 
 static struct config_variable {
diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/lib/pkg_install.conf.5.in
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in      Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in      Wed Oct 07 12:53:26 2009 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_install.conf.5.in,v 1.9 2009/08/06 18:16:33 wiz Exp $
+.\"    $NetBSD: pkg_install.conf.5.in,v 1.10 2009/10/07 12:53:27 joerg Exp $
 .\"
 .\" Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -146,7 +146,7 @@
 file when running
 .Dl Ic pkg_admin fetch-pkg-vulnerabilities
 The default is
-.Pa ftp://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities.gz
+.Pa http://ftp.NetBSD.org/pub/NetBSD/packages/vulns/pkg-vulnerabilities.gz
 .Em Note :
 Usually, only the compression type should be changed.
 Currently supported are uncompressed files and files compressed by
diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in   Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.cat5.in   Wed Oct 07 12:53:26 2009 +0000
@@ -111,7 +111,7 @@
              when running
                    ppkkgg__aaddmmiinn ffeettcchh--ppkkgg--vvuullnneerraabbiilliittiieess
              The default is
-             
_f_t_p_:_/_/_f_t_p_._N_e_t_B_S_D_._o_r_g_/_p_u_b_/_N_e_t_B_S_D_/_p_a_c_k_a_g_e_s_/_v_u_l_n_s_/_p_k_g_-_v_u_l_n_e_r_a_b_i_l_i_t_i_e_s_._g_z
+             
_h_t_t_p_:_/_/_f_t_p_._N_e_t_B_S_D_._o_r_g_/_p_u_b_/_N_e_t_B_S_D_/_p_a_c_k_a_g_e_s_/_v_u_l_n_s_/_p_k_g_-_v_u_l_n_e_r_a_b_i_l_i_t_i_e_s_._g_z
              _N_o_t_e: Usually, only the compression type should be changed.  Cur-
              rently supported are uncompressed files and files compressed by
              bzip2(1) (_._b_z_2) or gzip(1) (_._g_z).
diff -r 6e5ff20a1c14 -r 61d74204e9b7 pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Wed Oct 07 11:38:50 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Wed Oct 07 12:53:26 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.137 2009/09/11 18:00:13 joerg Exp $      */
+/*     $NetBSD: version.h,v 1.138 2009/10/07 12:53:27 joerg Exp $      */



Home | Main Index | Thread Index | Old Index