pkgsrc-Changes archive

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

Re: CVS commit: pkgsrc/shells/zsh



* On 2020-12-04 at 15:23 GMT, Ryo ONODERA wrote:

> +--- Completion/BSD/Command/_bsd_pkg.orig     2019-05-06 03:42:37.000000000 +0000
> ++++ Completion/BSD/Command/_bsd_pkg
> +@@ -31,7 +31,14 @@ _bsd_pkg_pkgfiles() {
> + 
> + (( $+functions[_bsd_pkg_pkgs] )) ||
> + _bsd_pkg_pkgs() {
> +-  compadd "$@" - ${PKG_DBDIR:-/var/db/pkg}/*(/:t)
> ++  case $OSTYPE in
> ++  netbsd*)
> ++    compadd "$@" - ${PKG_DBDIR:-/usr/pkg/pkgdb}/*(/:t)
> ++    ;;
> ++  *)
> ++    compadd "$@" - ${PKG_DBDIR:-/var/db/pkg}/*(/:t)
> ++    ;;
> ++  esac

This is going to be wrong on so many systems.  Two better ways of
doing this would be:

 * SUBST the correct value at build time.

 * Call `pkg_admin config-var PKG_DBDIR` to calculate it at runtime.

Certainly the "/var/db/pkg" default for non-NetBSD is almost certainly
never going to be correct, you would have to specify that exact
location at bootstrap time, overriding any defaults.

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com



Home | Main Index | Thread Index | Old Index