mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
bin/package: do not use previously compiled shell
The package script searches for a good shell to run the build scripts, preferring a ksh. But it also finds any recently compiled development version of ksh in arch/*/bin that may be broken, or have debug code, etc. -- and uses that in preference to anything else. This is quite capable of breaking the build process. The way to get around it is to do something like bin/package make SHELL=/bin/ksh which is annoying to have to keep doing. bin/package, src/cmd/INIT/package.sh: - When finding a good shell, use the saved user path ($path), not the current $PATH which includes arch/$HOSTTYPE/bin. Prefix this temporary path with `getconf PATH`, the system's default path, so that known-good system shells are found first.
This commit is contained in:
parent
42092187a7
commit
e08ca80d15
2 changed files with 34 additions and 42 deletions
38
bin/package
38
bin/package
|
@ -3076,31 +3076,27 @@ cat $INITROOT/$i.sh
|
||||||
|
|
||||||
# grab a decent default shell
|
# grab a decent default shell
|
||||||
|
|
||||||
|
checksh "$SHELL" || KEEP_SHELL=0
|
||||||
case $KEEP_SHELL in
|
case $KEEP_SHELL in
|
||||||
0) executable "$SHELL" || SHELL=
|
0) save_PATH=$PATH
|
||||||
case $SHELL in
|
if PATH=`getconf PATH 2>/dev/null`
|
||||||
?*) checksh $SHELL || SHELL= ;;
|
then PATH=$PATH:$path
|
||||||
esac
|
else PATH=/bin:/usr/bin:/sbin:/usr/sbin:$path
|
||||||
case $SHELL in
|
fi
|
||||||
''|/bin/*|/usr/bin/*)
|
for i in ksh ksh93 mksh yash bash sh
|
||||||
case $SHELL in
|
do if onpath "$i" && checksh "$_onpath_"
|
||||||
'') SHELL=/bin/sh ;;
|
then SHELL=$_onpath_
|
||||||
esac
|
KEEP_SHELL=1
|
||||||
for i in ksh sh bash
|
break
|
||||||
do if onpath $i && checksh $_onpath_
|
|
||||||
then SHELL=$_onpath_
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
*/*ksh) if executable $KSH
|
|
||||||
then SHELL=$KSH
|
|
||||||
fi
|
fi
|
||||||
;;
|
done
|
||||||
|
PATH=$save_PATH
|
||||||
|
unset save_PATH
|
||||||
|
case $KEEP_SHELL in
|
||||||
|
0) echo "Cannot find good default shell, please supply SHELL=/path/to/shell" >&2
|
||||||
|
exit 1 ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*) checksh $SHELL || SHELL=/bin/sh
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
export SHELL
|
export SHELL
|
||||||
$show SHELL=$SHELL
|
$show SHELL=$SHELL
|
||||||
|
|
|
@ -3075,31 +3075,27 @@ cat $INITROOT/$i.sh
|
||||||
|
|
||||||
# grab a decent default shell
|
# grab a decent default shell
|
||||||
|
|
||||||
|
checksh "$SHELL" || KEEP_SHELL=0
|
||||||
case $KEEP_SHELL in
|
case $KEEP_SHELL in
|
||||||
0) executable "$SHELL" || SHELL=
|
0) save_PATH=$PATH
|
||||||
case $SHELL in
|
if PATH=`getconf PATH 2>/dev/null`
|
||||||
?*) checksh $SHELL || SHELL= ;;
|
then PATH=$PATH:$path
|
||||||
esac
|
else PATH=/bin:/usr/bin:/sbin:/usr/sbin:$path
|
||||||
case $SHELL in
|
fi
|
||||||
''|/bin/*|/usr/bin/*)
|
for i in ksh ksh93 mksh yash bash sh
|
||||||
case $SHELL in
|
do if onpath "$i" && checksh "$_onpath_"
|
||||||
'') SHELL=/bin/sh ;;
|
then SHELL=$_onpath_
|
||||||
esac
|
KEEP_SHELL=1
|
||||||
for i in ksh sh bash
|
break
|
||||||
do if onpath $i && checksh $_onpath_
|
|
||||||
then SHELL=$_onpath_
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
*/*ksh) if executable $KSH
|
|
||||||
then SHELL=$KSH
|
|
||||||
fi
|
fi
|
||||||
;;
|
done
|
||||||
|
PATH=$save_PATH
|
||||||
|
unset save_PATH
|
||||||
|
case $KEEP_SHELL in
|
||||||
|
0) echo "Cannot find good default shell, please supply SHELL=/path/to/shell" >&2
|
||||||
|
exit 1 ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*) checksh $SHELL || SHELL=/bin/sh
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
export SHELL
|
export SHELL
|
||||||
$show SHELL=$SHELL
|
$show SHELL=$SHELL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue