- 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 <beat@chruetertee.ch> [2]
MFC after:	3 days
This commit is contained in:
Florent Thoumie 2008-06-12 15:21:13 +00:00
parent 436f2e5275
commit c55100c9ba
3 changed files with 4 additions and 2 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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;