pkgsrc-Users archive

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

CDPATH and the bootstrap script


Recently, a colleauge of mine ran into a problem with the bootstrap
script when invoked as pkgsrc/bootstrap/bootstrap on a Linux (SLES 11)
system. The error is as follows:

===> running: /usr/bin/sed -e 's|@DEFAULT_INSTALL_MODE@|'0755'|'
/move_fs/pkgsrc/2014Q2/pkgsrc/sysutils/install-sh/files/ >
/usr/bin/sed: read error on /move_fs/pkgsrc/2014Q2/pkgsrc/bootstrap: Is
a directory
pkgsrc/bootstrap/bootstrap: line 276:
Permission denied
===> exited with status 126

The script would run fine if invoked from the bootstrap directory, but
not when invoked with a relative path. After some investigation, the
problem was found to be due to bash's behaviour when CDPATH is set;
cd'ing to a relative directory with CDPATH set has the side-effect of
printing the current working directory.

Thus, in the bootstrap script,

        bootstrapdir=$(cd $bootstrapdir && pwd)

causes bootstrapdir to have _two_ values when /bin/sh is really bash and
CDPATH is set.

A trivial solution is to set CDPATH to an empty string in the bootstrap

Iain Morgan

Home | Main Index | Thread Index | Old Index