diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-06-07 18:12:27 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-06-07 18:12:27 +0000 |
commit | e3fdf2431a6baa4ee999b25e3d3f3d8fc4f32dc1 (patch) | |
tree | 86ef65755dea822a5e05e7a3ad3e88a9ecb13b6f | |
parent | 81514ecca37fdd0d158377287a45db8aaa926d67 (diff) | |
download | busybox-w32-e3fdf2431a6baa4ee999b25e3d3f3d8fc4f32dc1.tar.gz busybox-w32-e3fdf2431a6baa4ee999b25e3d3f3d8fc4f32dc1.tar.bz2 busybox-w32-e3fdf2431a6baa4ee999b25e3d3f3d8fc4f32dc1.zip |
add a --noclobber flag
-rwxr-xr-x | applets/install.sh | 10 |
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 | |||
10 | fi | 10 | fi |
11 | h=`sort busybox.links | uniq` | 11 | h=`sort busybox.links | uniq` |
12 | cleanup="0" | 12 | cleanup="0" |
13 | noclobber="0" | ||
13 | case "$2" in | 14 | case "$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;; |
19 | esac | 21 | esac |
@@ -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 | ||
86 | done | 92 | done |
87 | 93 | ||
88 | exit 0 | 94 | exit 0 |