From 26109e3a63094d7f2042b1895dd29802c1442870 Mon Sep 17 00:00:00 2001 From: flz Date: Thu, 12 Jun 2008 15:21:13 +0000 Subject: - add: Keep dependent packages too if -K is specified. - updating: terminating '\n' is not part of the package origin. - bump PKG_INSTALL_VERSION to 20080612. PR: bin/119368 [1], bin/124459 [2] Submitted by: gcooper [1], Beat Gatzi [2] MFC after: 3 days --- usr.sbin/pkg_install/add/perform.c | 2 +- usr.sbin/pkg_install/lib/lib.h | 2 +- usr.sbin/pkg_install/updating/main.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.sbin/pkg_install') diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index b8ba1a9..b4130d1 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -344,7 +344,7 @@ pkg_do(char *pkg) if (!Force) ++code; } - else if (vsystem("(pwd; /bin/cat +CONTENTS) | %s %s %s -S", PkgAddCmd, Verbose ? "-v" : "", PrefixRecursive ? prefixArg : "")) { + else if (vsystem("(pwd; /bin/cat +CONTENTS) | %s %s %s %s -S", PkgAddCmd, Verbose ? "-v" : "", PrefixRecursive ? prefixArg : "", KeepPackage ? "-K" : "")) { warnx("pkg_add of dependency '%s' failed%s", p->name, Force ? " (proceeding anyway)" : "!"); if (!Force) diff --git a/usr.sbin/pkg_install/lib/lib.h b/usr.sbin/pkg_install/lib/lib.h index d1477e5..545cd3c 100644 --- a/usr.sbin/pkg_install/lib/lib.h +++ b/usr.sbin/pkg_install/lib/lib.h @@ -105,7 +105,7 @@ * Version of the package tools - increase only when some * functionality used by bsd.port.mk is changed, added or removed */ -#define PKG_INSTALL_VERSION 20080530 +#define PKG_INSTALL_VERSION 20080612 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) diff --git a/usr.sbin/pkg_install/updating/main.c b/usr.sbin/pkg_install/updating/main.c index 238eee3..e189c01 100644 --- a/usr.sbin/pkg_install/updating/main.c +++ b/usr.sbin/pkg_install/updating/main.c @@ -175,6 +175,8 @@ main(int argc, char *argv[]) if((curr = (INSTALLEDPORT *) malloc(sizeof(INSTALLEDPORT))) == NULL) (void)exit(EXIT_FAILURE); + if (pname[strlen(pname) - 1] == '\n') + pname[strlen(pname) - 1] = '\0'; strlcpy (curr->name, pname, strlen(pname)+1); curr->next = head; head = curr; -- cgit v1.1