Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/pkg_install/dist pkg_install-20091115:



details:   https://anonhg.NetBSD.org/src/rev/0d65fe0e309c
branches:  trunk
changeset: 748807:0d65fe0e309c
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Nov 05 18:39:00 2009 +0000

description:
pkg_install-20091115:
Completely ignore @src in pkg_create. Silently ignore the -L option.
The combination of -I and -p are used by pkgsrc for the same result.

Do not overwrite a string with itself using snprintf. This breaks
setting the pkgdb directory internally on Linux. Explicitly check
if the string is the same and otherwise just use xstrdup.

Add support to query arbitrary variables with pkg_admin config-var.

diffstat:

 external/bsd/pkg_install/dist/admin/main.c        |  11 ++++++++---
 external/bsd/pkg_install/dist/create/build.c      |  12 +++---------
 external/bsd/pkg_install/dist/create/create.h     |   3 +--
 external/bsd/pkg_install/dist/create/main.c       |   9 ++++-----
 external/bsd/pkg_install/dist/create/perform.c    |  11 ++---------
 external/bsd/pkg_install/dist/create/pkg_create.1 |  17 +++++------------
 external/bsd/pkg_install/dist/create/pl.c         |   8 ++------
 external/bsd/pkg_install/dist/lib/license.c       |   4 ++--
 external/bsd/pkg_install/dist/lib/parse-config.c  |  21 +++++++++++++++------
 external/bsd/pkg_install/dist/lib/pkgdb.c         |  14 +++++++++-----
 external/bsd/pkg_install/dist/lib/version.h       |   4 ++--
 11 files changed, 53 insertions(+), 61 deletions(-)

diffs (truncated from 374 to 300 lines):

diff -r 6bb25f6ed1bb -r 0d65fe0e309c external/bsd/pkg_install/dist/admin/main.c
--- a/external/bsd/pkg_install/dist/admin/main.c        Thu Nov 05 18:28:10 2009 +0000
+++ b/external/bsd/pkg_install/dist/admin/main.c        Thu Nov 05 18:39:00 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.1.1.11 2009/10/08 16:19:59 joerg Exp $      */
+/*     $NetBSD: main.c,v 1.1.1.12 2009/11/05 18:39:00 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.1.1.11 2009/10/08 16:19:59 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.1.1.12 2009/11/05 18:39:00 joerg Exp $");
 
 /*-
  * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -422,7 +422,12 @@
                usage();
        }
 
-       pkg_install_config();
+       /*
+        * config-var is reading the config file implicitly,
+        * so skip it here.
+        */
+       if (strcasecmp(argv[0], "config-var") != 0)
+               pkg_install_config();
 
        if (use_default_sfx)
                (void) strlcpy(sfx, DEFAULT_SFX, sizeof(sfx));
diff -r 6bb25f6ed1bb -r 0d65fe0e309c external/bsd/pkg_install/dist/create/build.c
--- a/external/bsd/pkg_install/dist/create/build.c      Thu Nov 05 18:28:10 2009 +0000
+++ b/external/bsd/pkg_install/dist/create/build.c      Thu Nov 05 18:39:00 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: build.c,v 1.1.1.6 2009/08/06 16:55:20 joerg Exp $      */
+/*     $NetBSD: build.c,v 1.1.1.7 2009/11/05 18:39:02 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: build.c,v 1.1.1.6 2009/08/06 16:55:20 joerg Exp $");
+__RCSID("$NetBSD: build.c,v 1.1.1.7 2009/11/05 18:39:02 joerg Exp $");
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -298,13 +298,7 @@
        for (p = plist->head; p; p = p->next) {
                if (p->type == PLIST_FILE) {
                        write_normal_file(p->name, archive, resolver, owner, group);
-               } else if (p->type == PLIST_CWD || p->type == PLIST_SRC) {
-                       
-                       /* XXX let PLIST_SRC override PLIST_CWD */
-                       if (p->type == PLIST_CWD && p->next != NULL &&
-                           p->next->type == PLIST_SRC) {
-                               continue;
-                       }
+               } else if (p->type == PLIST_CWD) {
                        chdir(p->name);
                } else if (p->type == PLIST_IGNORE) {
                        p = p->next;
diff -r 6bb25f6ed1bb -r 0d65fe0e309c external/bsd/pkg_install/dist/create/create.h
--- a/external/bsd/pkg_install/dist/create/create.h     Thu Nov 05 18:28:10 2009 +0000
+++ b/external/bsd/pkg_install/dist/create/create.h     Thu Nov 05 18:39:00 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: create.h,v 1.1.1.4 2009/08/06 16:55:20 joerg Exp $ */
+/* $NetBSD: create.h,v 1.1.1.5 2009/11/05 18:39:02 joerg Exp $ */
 
 /* from FreeBSD Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp */
 
@@ -51,7 +51,6 @@
 extern char *SizePkg;
 extern char *SizeAll;
 extern char *Preserve;
-extern char *SrcDir;
 extern char *realprefix;
 extern char *DefaultOwner;
 extern char *DefaultGroup;
diff -r 6bb25f6ed1bb -r 0d65fe0e309c external/bsd/pkg_install/dist/create/main.c
--- a/external/bsd/pkg_install/dist/create/main.c       Thu Nov 05 18:28:10 2009 +0000
+++ b/external/bsd/pkg_install/dist/create/main.c       Thu Nov 05 18:39:00 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.1.1.5 2009/08/06 16:55:21 joerg Exp $       */
+/*     $NetBSD: main.c,v 1.1.1.6 2009/11/05 18:39:02 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.1.1.5 2009/08/06 16:55:21 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.1.1.6 2009/11/05 18:39:02 joerg Exp $");
 
 /*
  * FreeBSD install - a package for the installation and maintainance
@@ -43,7 +43,6 @@
 char   *SizePkg = NULL;
 char   *SizeAll = NULL;
 char   *Preserve = NULL;
-char   *SrcDir = NULL;
 char   *DefaultOwner = NULL;
 char   *DefaultGroup = NULL;
 char   *realprefix = NULL;
@@ -61,7 +60,7 @@
            "usage: pkg_create [-ElOUVv] [-B build-info-file] [-b build-version-file]\n"
             "                  [-C cpkgs] [-D displayfile] [-F compression] \n"
            "                  [-I realprefix] [-i iscript]\n"
-            "                  [-K pkg_dbdir] [-k dscript] [-L SrcDir]\n"
+            "                  [-K pkg_dbdir] [-k dscript]\n"
             "                  [-n preserve-file] [-P dpkgs] [-p prefix] [-r rscript]\n"
             "                  [-S size-all-file] [-s size-pkg-file]\n"
            "                  [-T buildpkgs] [-u owner] [-g group]\n"
@@ -147,7 +146,7 @@
                        break;
 
                case 'L':
-                       SrcDir = optarg;
+                       warnx("Obsolete -L option ignored");
                        break;
 
                case 'u':
diff -r 6bb25f6ed1bb -r 0d65fe0e309c external/bsd/pkg_install/dist/create/perform.c
--- a/external/bsd/pkg_install/dist/create/perform.c    Thu Nov 05 18:28:10 2009 +0000
+++ b/external/bsd/pkg_install/dist/create/perform.c    Thu Nov 05 18:39:00 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.1.1.4 2009/08/06 16:55:21 joerg Exp $    */
+/*     $NetBSD: perform.c,v 1.1.1.5 2009/11/05 18:39:02 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: perform.c,v 1.1.1.4 2009/08/06 16:55:21 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.1.1.5 2009/11/05 18:39:02 joerg Exp $");
 
 /*
  * FreeBSD install - a package for the installation and maintainance
@@ -168,13 +168,6 @@
 
        plist.head = plist.tail = NULL;
 
-       /* If a SrcDir override is set, add it now */
-       if (SrcDir) {
-               if (Verbose && !PlistOnly)
-                       printf("Using SrcDir value of %s\n", (realprefix) ? realprefix : SrcDir);
-               add_plist(&plist, PLIST_SRC, SrcDir);
-       }
-
        /* Stick the dependencies, if any, at the top */
        if (Pkgdeps)
                register_depends(&plist, Pkgdeps, 0);
diff -r 6bb25f6ed1bb -r 0d65fe0e309c external/bsd/pkg_install/dist/create/pkg_create.1
--- a/external/bsd/pkg_install/dist/create/pkg_create.1 Thu Nov 05 18:28:10 2009 +0000
+++ b/external/bsd/pkg_install/dist/create/pkg_create.1 Thu Nov 05 18:39:00 2009 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_create.1,v 1.1.1.5 2009/05/17 21:21:07 joerg Exp $
+.\" $NetBSD: pkg_create.1,v 1.1.1.6 2009/11/05 18:39:02 joerg Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -24,7 +24,7 @@
 .\" [jkh] Took John's changes back and made some additional extensions for
 .\" better integration with FreeBSD's new ports collection.
 .\"
-.Dd May 13, 2009
+.Dd November 15, 2009
 .Dt PKG_CREATE 1
 .Os
 .Sh NAME
@@ -64,9 +64,6 @@
 .Op Fl k Ar dscript
 .Ek
 .Bk -words
-.Op Fl L Ar SrcDir
-.Ek
-.Bk -words
 .Op Fl n Ar preserve-file
 .Ek
 .Bk -words
@@ -211,9 +208,6 @@
 This can be any executable program (or shell script).
 It will be invoked automatically
 when the package is later (if ever) de-installed.
-.It Fl L Ar SrcDir
-This sets the package's @src directive; see below for a description
-of what this does.
 .It Fl l
 Check that any symbolic links which are to be placed in the package are
 relative to the current prefix.
@@ -333,11 +327,10 @@
 .Cm @cd
 is also an alias for this command.
 .It Cm @src Ar directory
-Set the internal directory pointer for _creation only_ to
-.Ar directory .
-That is to say that it overrides
+This command is supported for compatibility only.
+It was formerly used to override
 .Cm @cwd
-for package creation but not extraction.
+during package creation.
 .It Cm @exec Ar command
 Execute
 .Ar command
diff -r 6bb25f6ed1bb -r 0d65fe0e309c external/bsd/pkg_install/dist/create/pl.c
--- a/external/bsd/pkg_install/dist/create/pl.c Thu Nov 05 18:28:10 2009 +0000
+++ b/external/bsd/pkg_install/dist/create/pl.c Thu Nov 05 18:39:00 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pl.c,v 1.1.1.3 2009/04/24 14:16:59 joerg Exp $ */
+/*     $NetBSD: pl.c,v 1.1.1.4 2009/11/05 18:39:03 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: pl.c,v 1.1.1.3 2009/04/24 14:16:59 joerg Exp $");
+__RCSID("$NetBSD: pl.c,v 1.1.1.4 2009/11/05 18:39:03 joerg Exp $");
 
 /*
  * FreeBSD install - a package for the installation and maintainance
@@ -86,7 +86,6 @@
        char    target[MaxPathSize + SymlinkHeaderLen];
        char    name[MaxPathSize];
        char   *cwd = NULL;
-       char   *srcdir = NULL;
        char   *pkgname = NULL;
        int     cc;
 
@@ -105,9 +104,6 @@
                case PLIST_IGNORE:
                        p = p->next;
                        break;
-               case PLIST_SRC:
-                       srcdir = p->name;
-                       break;
                case PLIST_PKGDIR:
                        if (cwd == NULL)
                                errx(2, "@pkgdir without preceding @cwd found");
diff -r 6bb25f6ed1bb -r 0d65fe0e309c external/bsd/pkg_install/dist/lib/license.c
--- a/external/bsd/pkg_install/dist/lib/license.c       Thu Nov 05 18:28:10 2009 +0000
+++ b/external/bsd/pkg_install/dist/lib/license.c       Thu Nov 05 18:39:00 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: license.c,v 1.1.1.5 2009/08/06 16:55:29 joerg Exp $    */
+/*     $NetBSD: license.c,v 1.1.1.6 2009/11/05 18:39:05 joerg Exp $    */
 
 /*-
  * Copyright (c) 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -50,7 +50,7 @@
     "gnu-fdl-v1.1 gnu-fdl-v1.2 gnu-fdl-v1.3 "
     "gnu-gpl-v2 gnu-lgpl-v2 gnu-lgpl-v2.1 "
     "gnu-gpl-v3 gnu-lgpl-v3 "
-    "original-bsd modified-bsd "
+    "original-bsd modified-bsd 2-clause-bsd "
     "x11 mit miros "
     "apache-1.1 apache-2.0 "
     "artistic artistic-2.0 "
diff -r 6bb25f6ed1bb -r 0d65fe0e309c external/bsd/pkg_install/dist/lib/parse-config.c
--- a/external/bsd/pkg_install/dist/lib/parse-config.c  Thu Nov 05 18:28:10 2009 +0000
+++ b/external/bsd/pkg_install/dist/lib/parse-config.c  Thu Nov 05 18:39:00 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse-config.c,v 1.1.1.8 2009/10/15 13:01:26 joerg Exp $       */
+/*     $NetBSD: parse-config.c,v 1.1.1.9 2009/11/05 18:39:06 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.1.1.8 2009/10/15 13:01:26 joerg Exp $");
+__RCSID("$NetBSD: parse-config.c,v 1.1.1.9 2009/11/05 18:39:06 joerg Exp $");
 
 /*-
  * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -99,6 +99,7 @@
        { "PKGVULNURL", &pkg_vulnerabilities_url },
        { "VERBOSE_NETIO", &verbose_netio },
        { "VERIFIED_INSTALLATION", &verified_installation },
+       { NULL, NULL }, /* For use by pkg_install_show_variable */
        { NULL, NULL }
 };
 
@@ -198,11 +199,19 @@
 pkg_install_show_variable(const char *var_name)
 {
        struct config_variable *var;
+       const char *tmp_value = NULL;
 
        for (var = config_variables; var->name != NULL; ++var) {
-               if (strcmp(var->name, var_name) != 0)
-                       continue;



Home | Main Index | Thread Index | Old Index