1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

build system: fix detection of default system directories

src/cmd/INIT/iffe.sh:
- Fix "standard system directories" for the cmd test, which were
  hardcoded as bin, /etc, /usr/bin, /usr/etc, /usr/ucb. That's both
  unportable and antiquated. Replace this with the path output by
  'getconf PATH'.
- Add fixes from modernish for 'getconf PATH' output to compensate
  for bugs/shortcomigns in NixOS and AIX. Source:
  9e4bf5eb/lib/modernish/aux/defpath.sh
  Ref.: https://github.com/NixOS/nixpkgs/issues/65512

src/lib/libast/comp/conf.tab: PATH:
- Add the NixOS and AIX default path fixes here too; this fixes
  'command -p' and the builtin 'getconf PATH' on these systems.

bin/package, src/cmd/INIT/package.sh:
- Re-support being launched with just the command name 'package' in
  the command line (if the 'package' command is in $PATH). At least
  one other script in the build system does this. (re: 6cc2f6a0)
- Go back three levels (../../..) if we were invoked from
  arch/*/bin/package, otherwise we won't find src/cmd/ksh93/SHOPT.sh.
This commit is contained in:
Martijn Dekker 2021-02-03 16:58:35 +00:00
parent be33942415
commit f5eaf217ed
4 changed files with 143 additions and 40 deletions

View file

@ -43,11 +43,31 @@ case $0 in
*) echo "this script must live in bin/" >&2
exit 1 ;;
esac
cd .. || exit
case $mydir in
*/arch/*/*/bin)
cd .. ;;
*/arch/*/bin)
cd ../../.. ;;
*) cd .. ;;
esac || exit
unset mydir ;;
package)
echo "this script must be invoked with a direct path, e.g. bin/package" >&2
exit 1 ;;
me=`command -v package` || me=`which package` || exit
mydir=`echo "$me" | sed 's,/package$,,'`
cd "$mydir" || exit
case $PWD in
*/bin) ;;
*) echo "this script must live in bin/" >&2
exit 1 ;;
esac
case $mydir in
*/arch/*/*/bin)
cd .. ;;
*/arch/*/bin)
cd ../../.. ;;
*) cd .. ;;
esac || exit
unset me mydir ;;
*)
echo "this script must be named 'package'" >&2
exit 1 ;;