From owner-freebsd-ports Sun Jul 19 06:20:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA14759 for freebsd-ports-outgoing; Sun, 19 Jul 1998 06:20:05 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from smtp11.bellglobal.com (smtp11.bellglobal.com [204.101.251.53]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA14730 for ; Sun, 19 Jul 1998 06:20:02 -0700 (PDT) (envelope-from tim@localhost.my.domain) Received: from localhost.my.domain (ppp6476.on.bellglobal.com [206.172.208.68]) by smtp11.bellglobal.com (8.8.5/8.8.5) with ESMTP id JAA00186; Sun, 19 Jul 1998 09:19:17 -0400 (EDT) Received: (from tim@localhost) by localhost.my.domain (8.8.8/8.8.8) id HAA20378; Sun, 19 Jul 1998 07:20:00 -0400 (EDT) (envelope-from tim) Message-ID: <19980719072000.B20184@zappo> Date: Sun, 19 Jul 1998 07:20:00 -0400 From: Tim Vanderhoek To: Sue Blake Cc: Chuck Robey , freebsd-ports@FreeBSD.ORG Subject: Re: questions about packages References: <19980718171423.58388@welearn.com.au> <19980719001610.45098@welearn.com.au> <19980718134825.C11959@zappo> <19980719082019.63071@welearn.com.au> <19980718175516.A18192@zappo> <19980719111914.25963@welearn.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <19980719111914.25963@welearn.com.au>; from Sue Blake on Sun, Jul 19, 1998 at 11:19:14AM +1000 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sun, Jul 19, 1998 at 11:19:14AM +1000, Sue Blake wrote: > On Sat, Jul 18, 1998 at 05:55:17PM -0400, Tim Vanderhoek wrote: > > On Sun, Jul 19, 1998 at 08:20:19AM +1000, Sue Blake wrote: > > > > To add the dependencies. Instead of using pkg_*'s normal dependency > > handling, you would just call pkg_add from within the iscript to add > > the "dependencies". > > Why? Ah, do you mean to go pkg_add /cdrom/whatever/package.tgz? > Hmmm... risky... Why? This would let you first check that the cdrom is even mounted. > What about the other way round... maybe... if you mounted the CD and > worked from /packages/All/ and went pkg_add /path/package.tgz then > would it be able to pick up all of its dependencies? I mean, perhaps Wouldn't this increase the total number of commands the user must enter? > pkg_add looks in the current working directory for them, in which case > this wouldn't be toooo terribly hard to organise. At least we'd know for > sure that the cdrom was mounted! :-) "Hmm... I can't get the cd mounted. I'm just going to skip to the next command and see what happens, now." If pkg_add(1) fails to find a dependency, it only prints a soft error message. Working from either a depends or install script, you can do pretty much whatever your want. :) So far as where pkg_add(1) looks for dependency packages....that can always be changed if needed (although not for 2.2.7-RELEASE, obviously). Hmm... Maybe it should have a "look for dependencies here" logical^H^H^H^H^H^H^Henv. variable. Maybe it does and its not documented... :) Hmm... Browsing the source, I'm not sure if jkh actually intended a failed dependency to be a soft error, or not... :) auto-dependency-search: if (isFile (orig_pkg_name) && not_defined ($PKG_ADD_BASE)) { /* This probably doesn't work for recursive dependencies... Jordan? */ if (fexists ("`pwd`/dependency.tgz")) goto found-it!; tmp = chop_off_two_'/'s (orig_pkg_name); if (fexists ("${tmp}/All/dependency.tgz")) goto found-it!; /* Check each path in $PKG_PATH, multiple paths delimited by ':' */ split (/:/, ${PKG_PATH}); while ($_ = shift @_) { if (fexists ($_/dependency.tgz)) goto found-it!; } /* This one's wierd, isn't it? :) */ } else if (isURL (dependency) && isURL (orig_pkg_name)) { if (urlexists (dependency)) goto found-it!; } else if (isURL (orig_pkg_name)) { tmp = chof_off_two_'/'s (orig_pkg_name); if (urlexists ("${tmp}/All/dependency.tgz")) goto found-it!; } else if (is_defined ($PKG_ADD_BASE) && in_SLAVE_mode) { if (urlexists ("${PKG_ADD_BASE}dependency")) /* yes, you read * that right... */ goto found-it!; } else goto bomb; found-it!: goto yay!-do-it!; CAVEAT: Don't trust any of this without testing it at least a little, first... :) -- This .sig is not innovative, witty, or profund. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message