Date: Sat, 12 Apr 2003 13:50:16 -0700 (PDT) From: Dominic Marks <dom@cus.org.uk> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/46830: Make pkg_add respect prefix for dependancies Message-ID: <200304122050.h3CKoGdS077548@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/46830; it has been noted by GNATS. From: Dominic Marks <dom@cus.org.uk> To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: bin/46830: Make pkg_add respect prefix for dependancies Date: Sat, 12 Apr 2003 21:41:19 +0100 Hey, Here is a better patch than the original one. Index: perform.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/add/perform.c,v retrieving revision 1.73 diff -u -r1.73 perform.c --- perform.c 2002/09/03 06:59:33 1.73 +++ perform.c 2003/04/12 20:37:01 @@ -19,7 +19,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.sbin/pkg_install/add/perform.c,v 1.73 2002/09/03 06:59:33 sobomax Exp $"); +__FBSDID("$FreeBSD: src/usr.sbin/pkg_install/add/perform.c,v 1.57.2.15 2002/09/25 23:22:13 bmah Exp $"); #include <err.h> #include <paths.h> @@ -68,7 +68,7 @@ char extract_contents[FILENAME_MAX]; char *where_to, *extract; FILE *cfile; - int code; + int code, rv; PackingList p; struct stat sb; int inPlace; @@ -271,7 +271,7 @@ ext = strrchr(pkg_fullname, '.'); if (ext == NULL) - ext = ".tbz"; + ext = ".tgz"; snprintf(path, FILENAME_MAX, "%s/%s%s", getenv("_TOP"), p->name, ext); if (fexists(path)) cp = path; @@ -280,12 +280,19 @@ if (cp) { if (Verbose) printf("Loading it from %s.\n", cp); - if (vsystem("pkg_add %s'%s'", Verbose ? "-v " : "", cp)) { - warnx("autoload of dependency '%s' failed%s", - cp, Force ? " (proceeding anyway)" : "!"); - if (!Force) - ++code; - } + if (Prefix == NULL) { + rv = vsystem("pkg_add %s'%s'", + Verbose ? "-v " : "", cp); + } else { + rv = vsystem("pkg_add %s -p '%s' '%s'", + Verbose ? "-v" : "", Prefix, cp); + } + if (rv) { + warnx("autoload of dependency '%s' failed%s", + cp, Force ? " (proceeding anyway)" : "!"); + if (!Force) + ++code; + } } else { warnx("could not find package %s %s", -- Dominic <dom at cus.org.uk> <d.marks at student.umist.ac.uk>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304122050.h3CKoGdS077548>