[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OpenBSD 3.3 pkg_add fails to add dependencies - patch supplied



Under OpenBSD 3.3 we are seeing pkg_add fail to install some
packages for example kdebase-3.1p0.tgz fails.

This happens because kdebase depends on a package that also depends
on a package that is not installed. pkg_add loses track of where
to install packages from after it gets to the second level of
recursive install.

The work around is to:

          PKG_PATH=`pwd` pkg_add kdebase-3.1p0.tgz

You may want to add this to the 3.3 FAQ.

This patch against the 3.3 src fixes the root cause by eliminating the
code that looks in ../All for more packages. This is fine on FreeBSD
that uses a hierarchical layout, which OpenBSD does not use.

Index: file.c
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_install/lib/file.c,v
retrieving revision 1.15
diff -c -r1.15 file.c
*** file.c	9 Jul 2001 07:05:03 -0000	1.15
--- file.c	2 May 2003 15:56:39 -0000
***************
*** 389,400 ****
  
  		cp = strrchr(tmp, '/');
  		if (cp) {
- 			*cp = '\0';	/* chop name */
- 			cp = strrchr(tmp, '/');
- 		}
- 		if (cp) {
  			*(cp + 1) = '\0';
- 			strlcat(tmp, "All/", sizeof tmp);
  			strlcat(tmp, ensure_tgz(fname), sizeof tmp);
  			if (ispkgpattern(tmp)) {
  				cp=findbestmatchingname(dirname_of(tmp),
--- 389,395 ----

Barry