fix backwards inst() compat

master
Harald Hoyer 2009-09-14 19:33:54 +02:00
parent 4839a7995e
commit 94dcc5b8d8
1 changed files with 15 additions and 9 deletions

View File

@ -260,15 +260,21 @@ inst_rules() {
# general purpose installation function
# Same args as above.
inst() {
if (($# != 1 && $# != 2 && $# != 3 )); then
derror "inst only takes 1 or 2 or 3 arguments"
exit 1
fi
if [[ $# = 3 ]]; then
[[ -z $initdir ]] && initdir=$2;
export initdir
set $1 $3
fi
case $# in
1) ;;
2)
[[ -z $initdir ]] && [[ -d $2 ]] && export initdir=$2
[[ $initdir = $2 ]] && set $1
;;
3)
[[ -z $initdir ]] && export initdir=$2
set $1 $3
;;
*)
derror "inst only takes 1 or 2 or 3 arguments"
exit 1
;;
esac
for x in inst_symlink inst_script inst_binary inst_simple; do
$x "$@" && return 0
done