aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-06-07 18:12:27 +0000
committerMike Frysinger <vapier@gentoo.org>2006-06-07 18:12:27 +0000
commite3fdf2431a6baa4ee999b25e3d3f3d8fc4f32dc1 (patch)
tree86ef65755dea822a5e05e7a3ad3e88a9ecb13b6f
parent81514ecca37fdd0d158377287a45db8aaa926d67 (diff)
downloadbusybox-w32-e3fdf2431a6baa4ee999b25e3d3f3d8fc4f32dc1.tar.gz
busybox-w32-e3fdf2431a6baa4ee999b25e3d3f3d8fc4f32dc1.tar.bz2
busybox-w32-e3fdf2431a6baa4ee999b25e3d3f3d8fc4f32dc1.zip
add a --noclobber flag
-rwxr-xr-xapplets/install.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/applets/install.sh b/applets/install.sh
index 1cd97bba3..4ec96c254 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -10,10 +10,12 @@ if [ -z "$prefix" ]; then
10fi 10fi
11h=`sort busybox.links | uniq` 11h=`sort busybox.links | uniq`
12cleanup="0" 12cleanup="0"
13noclobber="0"
13case "$2" in 14case "$2" in
14 --hardlinks) linkopts="-f";; 15 --hardlinks) linkopts="-f";;
15 --symlinks) linkopts="-fs";; 16 --symlinks) linkopts="-fs";;
16 --cleanup) cleanup="1";; 17 --cleanup) cleanup="1";;
18 --noclobber) noclobber="1";;
17 "") h="";; 19 "") h="";;
18 *) echo "Unknown install option: $2"; exit 1;; 20 *) echo "Unknown install option: $2"; exit 1;;
19esac 21esac
@@ -81,8 +83,12 @@ for i in $h ; do
81 ;; 83 ;;
82 esac 84 esac
83 fi 85 fi
84 echo " $prefix$i -> $bb_path" 86 if [ "$noclobber" = "0" ] || [ ! -e "$prefix$i" ]; then
85 ln $linkopts $bb_path $prefix$i || exit 1 87 echo " $prefix$i -> $bb_path"
88 ln $linkopts $bb_path $prefix$i || exit 1
89 else
90 echo " $prefix$i already exists"
91 fi
86done 92done
87 93
88exit 0 94exit 0