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 Fix a bug in pkg_add's -P h...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/14e4e5d6780e
branches:  trunk
changeset: 397600:14e4e5d6780e
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Aug 16 14:26:46 2009 +0000

description:
Fix a bug in pkg_add's -P handling. For dependencies the pkgdb path was
computed incorrectly and included destdir more than once.

Fix the ACTIVE_FTP option to actually set the "a" flag and not the old
"p" flag.

diffstat:

 pkgtools/pkg_install/files/add/add.h          |   3 ++-
 pkgtools/pkg_install/files/add/main.c         |  21 ++++++++++++++++++---
 pkgtools/pkg_install/files/add/perform.c      |  12 +++++-------
 pkgtools/pkg_install/files/lib/parse-config.c |   6 +++---
 pkgtools/pkg_install/files/lib/version.h      |   4 ++--
 5 files changed, 30 insertions(+), 16 deletions(-)

diffs (160 lines):

diff -r 1c76ae584272 -r 14e4e5d6780e pkgtools/pkg_install/files/add/add.h
--- a/pkgtools/pkg_install/files/add/add.h      Sun Aug 16 14:25:26 2009 +0000
+++ b/pkgtools/pkg_install/files/add/add.h      Sun Aug 16 14:26:46 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: add.h,v 1.14 2009/08/06 16:53:34 joerg Exp $ */
+/* $NetBSD: add.h,v 1.15 2009/08/16 14:26:46 joerg Exp $ */
 
 /* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp  */
 
@@ -25,6 +25,7 @@
 #ifndef _INST_ADD_H_INCLUDE
 #define _INST_ADD_H_INCLUDE
 
+extern const char *PlainPkgdb;
 extern char *Destdir;
 extern char *OverrideMachine;
 extern char *Prefix;
diff -r 1c76ae584272 -r 14e4e5d6780e pkgtools/pkg_install/files/add/main.c
--- a/pkgtools/pkg_install/files/add/main.c     Sun Aug 16 14:25:26 2009 +0000
+++ b/pkgtools/pkg_install/files/add/main.c     Sun Aug 16 14:26:46 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.19 2009/08/06 16:53:34 joerg Exp $  */
+/*     $NetBSD: main.c,v 1.20 2009/08/16 14:26:46 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.19 2009/08/06 16:53:34 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.20 2009/08/16 14:26:46 joerg Exp $");
 
 /*
  *
@@ -44,6 +44,7 @@
 
 static char Options[] = "AIK:LP:RVW:fhm:np:t:uvw:";
 
+const char *PlainPkgdb = NULL;
 char   *Destdir = NULL;
 char   *OverrideMachine = NULL;
 char   *Prefix = NULL;
@@ -73,6 +74,7 @@
 {
        int     ch, error=0;
        lpkg_head_t pkgs;
+       const char *pkgdb = NULL;
 
        setprogname(argv[0]);
        while ((ch = getopt(argc, argv, Options)) != -1) {
@@ -97,7 +99,7 @@
                        break;
 
                case 'K':
-                       _pkgdb_setPKGDB_DIR(optarg);
+                       pkgdb = optarg;
                        break;
 
                case 'L':
@@ -153,6 +155,19 @@
 
        pkg_install_config();
 
+       if (pkgdb == NULL)
+               pkgdb = _pkgdb_getPKGDB_DIR();
+       PlainPkgdb = xstrdup(pkgdb);
+
+       if (Destdir != NULL) {
+               char *pkgdbdir;
+
+               pkgdbdir = xasprintf("%s/%s", Destdir, pkgdb);
+               _pkgdb_setPKGDB_DIR(pkgdbdir);
+               free(pkgdbdir);
+       } else
+               _pkgdb_setPKGDB_DIR(pkgdb);
+
        process_pkg_path();
        TAILQ_INIT(&pkgs);
 
diff -r 1c76ae584272 -r 14e4e5d6780e pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c  Sun Aug 16 14:25:26 2009 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c  Sun Aug 16 14:26:46 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.89 2009/08/06 16:53:34 joerg Exp $       */
+/*     $NetBSD: perform.c,v 1.90 2009/08/16 14:26:46 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.89 2009/08/06 16:53:34 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.90 2009/08/16 14:26:46 joerg Exp $");
 
 /*-
  * Copyright (c) 2003 Grant Beattie <grant%NetBSD.org@localhost>
@@ -1322,14 +1322,12 @@
                pkg->logdir = xstrdup(pkg->prefix);
                _pkgdb_setPKGDB_DIR(dirname_of(pkg->logdir));
        } else {
-               pkg->logdir = xasprintf("%s/%s", _pkgdb_getPKGDB_DIR(),
-                   pkg->pkgname);
+               pkg->logdir = xasprintf("%s/%s", PlainPkgdb, pkg->pkgname);
        }
 
-       if (Destdir != NULL) {
+       if (Destdir != NULL)
                pkg->install_logdir = xasprintf("%s/%s", Destdir, pkg->logdir);
-               _pkgdb_setPKGDB_DIR(dirname_of(pkg->install_logdir));
-       } else
+       else
                pkg->install_logdir = xstrdup(pkg->logdir);
 
        if (NoRecord && !Fake) {
diff -r 1c76ae584272 -r 14e4e5d6780e pkgtools/pkg_install/files/lib/parse-config.c
--- a/pkgtools/pkg_install/files/lib/parse-config.c     Sun Aug 16 14:25:26 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/parse-config.c     Sun Aug 16 14:26:46 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse-config.c,v 1.6 2009/08/06 16:53:34 joerg Exp $   */
+/*     $NetBSD: parse-config.c,v 1.7 2009/08/16 14:26:46 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.6 2009/08/06 16:53:34 joerg Exp $");
+__RCSID("$NetBSD: parse-config.c,v 1.7 2009/08/16 14:26:46 joerg Exp $");
 
 /*-
  * Copyright (c) 2008 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -133,7 +133,7 @@
 
        snprintf(fetch_flags, sizeof(fetch_flags), "%s%s%s",
            (verbose_netio && *verbose_netio) ? "v" : "",
-           (active_ftp && *active_ftp) ? "" : "p",
+           (active_ftp && *active_ftp) ? "a" : "",
            (ignore_proxy && *ignore_proxy) ? "d" : "");
 }
 
diff -r 1c76ae584272 -r 14e4e5d6780e pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Sun Aug 16 14:25:26 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Sun Aug 16 14:26:46 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.134 2009/08/06 16:53:34 joerg Exp $      */
+/*     $NetBSD: version.h,v 1.135 2009/08/16 14:26:46 joerg Exp $      */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION "20090806"
+#define PKGTOOLS_VERSION "20090816"
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index