Subject: Re: Broken PKG_PATH semantics on pkg_add
To: None <abs@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-pkg
Date: 08/30/2002 10:25:37
From: David Brownlee <abs@netbsd.org>
Date: Thu, 29 Aug 2002 22:46:52 +0100 (BST)
> > in addition, if you do pkg_add somedir/pkg (a relative path),
> > ./somedir/somedir/pkg will be searched.
> > i think it isn't your intent.
> >
> 	path_new_entry() calls getcwd() in that case so it still gets
> 	an absolute path.

in the case, lp_name points to "somddir/pkg" and
searched in "/absolute_path_of/somedir".
so "/absolute_path_of/somedir/somedir/pkg" will be found
while maybe you want "/absolute_path_of/somedir/pkg".

> > path_prepend_from_pkgname and path_remove_first are
> > a little hackish, IMO. i think what to do is:
> > 1. dynamically alloc a temporary pathhead instead of using
> >    one global PkgPath.
> > 2. add a new temporary entry from pkgname to it.
> > 3. then pass it to installprereq.
> > 4. free a temporary pathhead.

> 	Do you mean to change the original code to pass PkgPath around
> 	everywhere its used and to create a local copy and prepend the
> 	path to that?

yes.

> 	Oh if only the original code has just bundled everything up in
> 	nice object like structs and passed them around :)

yes. :)

---
YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>