add a --noclobber flag
This commit is contained in:
parent
81514ecca3
commit
e3fdf2431a
@ -10,10 +10,12 @@ if [ -z "$prefix" ]; then
|
|||||||
fi
|
fi
|
||||||
h=`sort busybox.links | uniq`
|
h=`sort busybox.links | uniq`
|
||||||
cleanup="0"
|
cleanup="0"
|
||||||
|
noclobber="0"
|
||||||
case "$2" in
|
case "$2" in
|
||||||
--hardlinks) linkopts="-f";;
|
--hardlinks) linkopts="-f";;
|
||||||
--symlinks) linkopts="-fs";;
|
--symlinks) linkopts="-fs";;
|
||||||
--cleanup) cleanup="1";;
|
--cleanup) cleanup="1";;
|
||||||
|
--noclobber) noclobber="1";;
|
||||||
"") h="";;
|
"") h="";;
|
||||||
*) echo "Unknown install option: $2"; exit 1;;
|
*) echo "Unknown install option: $2"; exit 1;;
|
||||||
esac
|
esac
|
||||||
@ -81,8 +83,12 @@ for i in $h ; do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
echo " $prefix$i -> $bb_path"
|
if [ "$noclobber" = "0" ] || [ ! -e "$prefix$i" ]; then
|
||||||
ln $linkopts $bb_path $prefix$i || exit 1
|
echo " $prefix$i -> $bb_path"
|
||||||
|
ln $linkopts $bb_path $prefix$i || exit 1
|
||||||
|
else
|
||||||
|
echo " $prefix$i already exists"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user