From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 12 13:50:20 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43AE737B401 for ; Sat, 12 Apr 2003 13:50:20 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 59A7643FDD for ; Sat, 12 Apr 2003 13:50:19 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h3CKoGUp077549 for ; Sat, 12 Apr 2003 13:50:16 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h3CKoGdS077548; Sat, 12 Apr 2003 13:50:16 -0700 (PDT) Date: Sat, 12 Apr 2003 13:50:16 -0700 (PDT) Message-Id: <200304122050.h3CKoGdS077548@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Dominic Marks Subject: Re: bin/46830: Make pkg_add respect prefix for dependancies X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dominic Marks List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2003 20:50:20 -0000 The following reply was made to PR bin/46830; it has been noted by GNATS. From: Dominic Marks 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 -__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 #include @@ -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