Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jul 1998 07:20:00 -0400
From:      Tim Vanderhoek <ac199@hwcn.org>
To:        Sue Blake <sue@welearn.com.au>
Cc:        Chuck Robey <chuckr@Glue.umd.edu>, freebsd-ports@FreeBSD.ORG
Subject:   Re: questions about packages
Message-ID:  <19980719072000.B20184@zappo>
In-Reply-To: <19980719111914.25963@welearn.com.au>; from Sue Blake on Sun, Jul 19, 1998 at 11:19:14AM %2B1000
References:  <19980718171423.58388@welearn.com.au> <Pine.BSF.3.96.980718050959.18866M-100000@localhost> <19980719001610.45098@welearn.com.au> <19980718134825.C11959@zappo> <19980719082019.63071@welearn.com.au> <19980718175516.A18192@zappo> <19980719111914.25963@welearn.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980719072000.B20184>