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-20080407:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cddebf7b0fd2
branches:  trunk
changeset: 540737:cddebf7b0fd2
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Apr 07 13:07:14 2008 +0000

description:
pkg_install-20080407:
Add command to print effective value of configuration variables.
Remove FETCH_CMD variable from pkg_admin, it is not used.

diffstat:

 pkgtools/pkg_install/files/admin/admin.h        |   2 +-
 pkgtools/pkg_install/files/admin/config.c       |  19 +++++++++++++++----
 pkgtools/pkg_install/files/admin/main.c         |  16 +++++++++++-----
 pkgtools/pkg_install/files/admin/pkg_admin.1    |   6 +++++-
 pkgtools/pkg_install/files/admin/pkg_admin.cat1 |   4 ++++
 pkgtools/pkg_install/files/lib/version.h        |   4 ++--
 6 files changed, 38 insertions(+), 13 deletions(-)

diffs (164 lines):

diff -r d80d27f5e4f1 -r cddebf7b0fd2 pkgtools/pkg_install/files/admin/admin.h
--- a/pkgtools/pkg_install/files/admin/admin.h  Mon Apr 07 09:43:52 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/admin.h  Mon Apr 07 13:07:14 2008 +0000
@@ -37,7 +37,6 @@
 extern const char *pkg_vulnerabilities_dir;
 extern const char *pkg_vulnerabilities_file;
 extern const char *pkg_vulnerabilities_url;
-extern const char *fetch_cmd;
 extern const char *ignore_advisories;
 extern const char tnf_vulnerability_base[];
 
@@ -50,5 +49,6 @@
 void   fetch_pkg_vulnerabilities(int, char **);
 
 void   pkg_install_config(const char *);
+void   pkg_install_show_variable(const char *);
 
 void   usage(void);
diff -r d80d27f5e4f1 -r cddebf7b0fd2 pkgtools/pkg_install/files/admin/config.c
--- a/pkgtools/pkg_install/files/admin/config.c Mon Apr 07 09:43:52 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/config.c Mon Apr 07 13:07:14 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: config.c,v 1.3 2008/03/21 14:47:53 joerg Exp $ */
+/*     $NetBSD: config.c,v 1.4 2008/04/07 13:07:14 joerg Exp $ */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: config.c,v 1.3 2008/03/21 14:47:53 joerg Exp $");
+__RCSID("$NetBSD: config.c,v 1.4 2008/04/07 13:07:14 joerg Exp $");
 #endif
 
 /*-
@@ -53,7 +53,6 @@
 const char *pkg_vulnerabilities_dir;
 const char *pkg_vulnerabilities_file;
 const char *pkg_vulnerabilities_url;
-const char *fetch_cmd = FTP_CMD;
 const char *ignore_advisories = NULL;
 const char tnf_vulnerability_base[] = "ftp://ftp.NetBSD.org/pub/NetBSD/packages/vulns";;
 
@@ -65,7 +64,6 @@
        { "PKGVULNDIR", &pkg_vulnerabilities_dir },
        { "PKGVULNURL", &pkg_vulnerabilities_url },
        { "IGNORE_URL", &ignore_advisories },
-       { "FETCH_CMD", &fetch_cmd },
        { NULL, NULL }
 };
 
@@ -97,3 +95,16 @@
                        err(EXIT_FAILURE, "asprintf failed");
        }
 }
+
+void
+pkg_install_show_variable(const char *var_name)
+{
+       struct config_variable *var;
+
+       for (var = config_variables; var->name != NULL; ++var) {
+               if (strcmp(var->name, var_name) != 0)
+                       continue;
+               if (*var->var != NULL)
+                       puts(*var->var);
+       }
+}
diff -r d80d27f5e4f1 -r cddebf7b0fd2 pkgtools/pkg_install/files/admin/main.c
--- a/pkgtools/pkg_install/files/admin/main.c   Mon Apr 07 09:43:52 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/main.c   Mon Apr 07 13:07:14 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.40 2008/03/23 01:04:47 dsainty Exp $        */
+/*     $NetBSD: main.c,v 1.41 2008/04/07 13:07:14 joerg Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.40 2008/03/23 01:04:47 dsainty Exp $");
+__RCSID("$NetBSD: main.c,v 1.41 2008/04/07 13:07:14 joerg Exp $");
 #endif
 
 /*-
@@ -113,9 +113,10 @@
            " pmatch pattern pkg          - returns true if pkg matches pattern, otherwise false\n"
            " fetch-pkg-vulnerabilities [-s] - fetch new vulnerability file\n"
            " check-pkg-vulnerabilities [-s] <file> - check syntax and checksums of the vulnerability file\n"
-           " audit [-es] [-t type] ...\n"
-           " audit-pkg [-es] [-t type] ...\n"
-           " audit-batch [-es] [-t type] ...\n",
+           " audit [-es] [-t type] ...       - check installed packages for vulnerabilities\n"
+           " audit-pkg [-es] [-t type] ...   - check listed packages for vulnerabilities\n"
+           " audit-batch [-es] [-t type] ... - check packages in listed files for vulnerabilities\n"
+           " config-var name                 - print current value of the configuration variable\n",
            getprogname());
        exit(EXIT_FAILURE);
 }
@@ -521,6 +522,11 @@
        } else if (strcasecmp(argv[0], "unset") == 0) {
                argv++;         /* "unset" */
                set_unset_variable(argv, TRUE);
+       } else if (strcasecmp(argv[0], "config-var") == 0) {
+               argv++;
+               if (argv == NULL || argv[1] != NULL)
+                       errx(EXIT_FAILURE, "config-var takes exactly one argument");
+               pkg_install_show_variable(argv[0]);
        }
 #ifndef BOOTSTRAP
        else if (strcasecmp(argv[0], "fetch-pkg-vulnerabilities") == 0) {
diff -r d80d27f5e4f1 -r cddebf7b0fd2 pkgtools/pkg_install/files/admin/pkg_admin.1
--- a/pkgtools/pkg_install/files/admin/pkg_admin.1      Mon Apr 07 09:43:52 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.1      Mon Apr 07 13:07:14 2008 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_admin.1,v 1.16 2008/03/13 16:35:30 joerg Exp $
+.\"    $NetBSD: pkg_admin.1,v 1.17 2008/04/07 13:07:14 joerg Exp $
 .\"
 .\" Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -164,6 +164,10 @@
 If
 .Fl s
 is given, also check the embedded signature.
+.It Cm config-var Ar variable
+Print the current value of
+.Ar variable
+as used after parsing the configuration file.
 .It Cm delete Ar pkg ...
 For each listed package, remove all file entries in the package database that
 belong to the package.
diff -r d80d27f5e4f1 -r cddebf7b0fd2 pkgtools/pkg_install/files/admin/pkg_admin.cat1
--- a/pkgtools/pkg_install/files/admin/pkg_admin.cat1   Mon Apr 07 09:43:52 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/pkg_admin.cat1   Mon Apr 07 13:07:14 2008 +0000
@@ -90,6 +90,10 @@
              Check format and hashes in the pkg-vulnerabilties file _f_i_l_e.  If
              --ss is given, also check the embedded signature.
 
+     ccoonnffiigg--vvaarr _v_a_r_i_a_b_l_e
+             Print the current value of _v_a_r_i_a_b_l_e as used after parsing the
+             configuration file.
+
      ddeelleettee _p_k_g _._._.
              For each listed package, remove all file entries in the package
              database that belong to the package.  This should be used only by
diff -r d80d27f5e4f1 -r cddebf7b0fd2 pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Mon Apr 07 09:43:52 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Mon Apr 07 13:07:14 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.98 2008/04/04 15:21:32 joerg Exp $       */
+/*     $NetBSD: version.h,v 1.99 2008/04/07 13:07:14 joerg Exp $       */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -33,6 +33,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION "20080402"
+#define PKGTOOLS_VERSION "20080407"
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index