Subject: Re: pkgsrc installing binary packages
To: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 05/02/2001 22:24:26
~On Thu, 3 May 2001, Hubert Feyrer wrote:

> Try the patch below to make 'bin-install' set PKG_PATH automatically for
> now. It's a quick hack but might indeed work. Let me know if/if not.
...

> set DEPENDS_TARGET=bin-install.

Thanks. This worked to use the binary package for one of the
dependencies. But it had dependencies too that I wish it would fall back
to using regular pkgsrc.

 rainier:/usr/pkgsrc/games/pacman$ make
 ===> Validating dependencies for Pacman-0.3
 => Checksum OK for Pacman-0.3-CVS-00-11-17.tar.gz.
 ===> Extracting for Pacman-0.3
 ===> Required package ClanLib>=0.2.2: NOT found
 ===> Verifying bin-install for ../../graphics/clanlib
 Installing from binary pkg /usr/pkg/pkgsrc/packages/All/ClanLib-0.4.4.tgz
 pkg_add: pkg `MesaLib-3.4' required, but `MesaLib-3.2.1' found installed.
 pkg_add: Please resolve this conflict!
 *** Error code 1


Now trying your patch... it wouldn't work because PKG_PATH not set for
ftp and it found the first package locally. I want it to be smart -- use
local if it is available, fall back to a remote copy, then as a last
resort build from source.

So I moved the local package.

 ===> Verifying bin-install for ../../graphics/clanlib

 ftp: The `CWD ' command (without a directory), which is required by
      RFC 1738 to support the empty directory in the URL pathname (`//'),
      conflicts with the server's conformance to RFC 959.
      Try the same URL without the `//' in the URL pathname.

 pkg_add: prompt failed - wrong dir?

Okay, logging shows:
ftp -detv ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/All//usr/pkg/pkgsrc/packages/All/

Now I see:
PKGFILE?=               ${PKGREPOSITORY}/${PKGNAME}${PKG_SUFX}

So I changed your PKGFILE to ${PKGNAME}${PKG_SUFX} and that was fixed.

Now to try another package, because ...
 pkg_add: pkg `MesaLib-3.4' required, but `MesaLib-3.2.1' found installed.
 pkg_add: Please resolve this conflict!
(Aaaagggh! A bunch of installed packages depend on MesaLib.)

Also, so I tried sharity-light. A binary package was not available.
And it did not fall back to use source:

 rainier:/usr/pkgsrc/net/sharity-light$ make bin-install 2>&1 | tee LOG
 release: 1.5 arch: i386
 ftp -detv ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/All/

 ftp> prompt off
 trying PKG_PATH ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5/i386/All
 Spawning FTP coprocess

 ftp> nlist sharity-light-1.2.tgz /var/tmp/pkg.17062a
 pkg_add: nlist failed!

 ftp> nlist sharity-light-1.2-*.t[bg]z /var/tmp/pkg.17062b
 Reusing FDs 4/5 for communication to FTP coprocess
 pkg_add: nlist failed!
 pkg_add: can't find package 'sharity-light-1.2.tgz'

 ftp> close
 pkg_add: 1 package addition(s) failed
 *** Error code 1

Thanks for the patch. It does help.

   Jeremy C. Reed
   http://www.reedmedia.net/