diff options
author | joerg <joerg@pkgsrc.org> | 2009-08-16 14:26:46 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-08-16 14:26:46 +0000 |
commit | 83bceb29dafd62139f9648ee6ab2de7362162567 (patch) | |
tree | 3fc5f143da153f56dfebb45e935598ba41625d15 /pkgtools | |
parent | 928c445d4156cbe4924dc48bb9e1aa553e575a9d (diff) | |
download | pkgsrc-83bceb29dafd62139f9648ee6ab2de7362162567.tar.gz |
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 (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/files/add/add.h | 3 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/add/main.c | 21 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/add/perform.c | 12 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/parse-config.c | 6 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/version.h | 4 |
5 files changed, 30 insertions, 16 deletions
diff --git a/pkgtools/pkg_install/files/add/add.h b/pkgtools/pkg_install/files/add/add.h index 2324110e142..74221f3b38d 100644 --- a/pkgtools/pkg_install/files/add/add.h +++ b/pkgtools/pkg_install/files/add/add.h @@ -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 --git a/pkgtools/pkg_install/files/add/main.c b/pkgtools/pkg_install/files/add/main.c index b6d383c61b5..aa20a44bec1 100644 --- a/pkgtools/pkg_install/files/add/main.c +++ b/pkgtools/pkg_install/files/add/main.c @@ -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 @@ __RCSID("$NetBSD: main.c,v 1.19 2009/08/06 16:53:34 joerg Exp $"); 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 @@ main(int argc, char **argv) { 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 @@ main(int argc, char **argv) break; case 'K': - _pkgdb_setPKGDB_DIR(optarg); + pkgdb = optarg; break; case 'L': @@ -153,6 +155,19 @@ main(int argc, char **argv) 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 --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c index 4fd1da15359..299ecb0647a 100644 --- a/pkgtools/pkg_install/files/add/perform.c +++ b/pkgtools/pkg_install/files/add/perform.c @@ -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> @@ -1322,14 +1322,12 @@ pkg_do(const char *pkgpath, int mark_automatic, int top_level) 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 --git a/pkgtools/pkg_install/files/lib/parse-config.c b/pkgtools/pkg_install/files/lib/parse-config.c index 082ef23511c..fe9a6ee1214 100644 --- a/pkgtools/pkg_install/files/lib/parse-config.c +++ b/pkgtools/pkg_install/files/lib/parse-config.c @@ -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>. @@ -133,7 +133,7 @@ pkg_install_config(void) 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 --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h index b8b08849479..d3cd3e88d85 100644 --- a/pkgtools/pkg_install/files/lib/version.h +++ b/pkgtools/pkg_install/files/lib/version.h @@ -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_ */ |