Date: Sat, 12 Apr 2003 14:10:11 -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: <200304122110.h3CLABDt086134@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, dom@cus.org.uk Cc: Subject: Re: bin/46830: Make pkg_add respect prefix for dependancies Date: Sat, 12 Apr 2003 22:01:33 +0100 Hey, I didn't quite get the diff right last time, forgetting that there are now differences between pkg_add in 4 and 5. Also GNATS seems to have completely lost my first attempt at a followup. Here is a better diff: I'm hoping it will apply cleanly to pkg_add in 4 and 5. Index: perform.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/add/perform.c,v retrieving revision 1.57.2.15 diff -u -3 -p -u -r1.57.2.15 perform.c --- perform.c 25 Sep 2002 23:22:13 -0000 1.57.2.15 +++ perform.c 12 Apr 2003 20:57:03 -0000 @@ -68,7 +68,7 @@ pkg_do(char *pkg) char extract_contents[FILENAME_MAX]; char *where_to, *extract; FILE *cfile; - int code; + int code, rv; PackingList p; struct stat sb; int inPlace; @@ -280,12 +280,19 @@ pkg_do(char *pkg) 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", Thanks, -- 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?200304122110.h3CLABDt086134>