diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-06-07 18:08:25 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-06-07 18:08:25 +0000 |
commit | 81514ecca37fdd0d158377287a45db8aaa926d67 (patch) | |
tree | c8d20c6db30079bea85ed80a15d096d439a7f5a1 /applets | |
parent | 74b29a107fe9cd48319c3ea767e5b8dead1f31e7 (diff) | |
download | busybox-w32-81514ecca37fdd0d158377287a45db8aaa926d67.tar.gz busybox-w32-81514ecca37fdd0d158377287a45db8aaa926d67.tar.bz2 busybox-w32-81514ecca37fdd0d158377287a45db8aaa926d67.zip |
add support for cleaning out previous busybox install
Diffstat (limited to 'applets')
-rwxr-xr-x | applets/install.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/applets/install.sh b/applets/install.sh index 8bf488619..1cd97bba3 100755 --- a/applets/install.sh +++ b/applets/install.sh | |||
@@ -9,9 +9,11 @@ if [ -z "$prefix" ]; then | |||
9 | exit 1; | 9 | exit 1; |
10 | fi | 10 | fi |
11 | h=`sort busybox.links | uniq` | 11 | h=`sort busybox.links | uniq` |
12 | cleanup="0" | ||
12 | case "$2" in | 13 | case "$2" in |
13 | --hardlinks) linkopts="-f";; | 14 | --hardlinks) linkopts="-f";; |
14 | --symlinks) linkopts="-fs";; | 15 | --symlinks) linkopts="-fs";; |
16 | --cleanup) cleanup="1";; | ||
15 | "") h="";; | 17 | "") h="";; |
16 | *) echo "Unknown install option: $2"; exit 1;; | 18 | *) echo "Unknown install option: $2"; exit 1;; |
17 | esac | 19 | esac |
@@ -34,6 +36,22 @@ if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then | |||
34 | fi | 36 | fi |
35 | done | 37 | done |
36 | fi | 38 | fi |
39 | |||
40 | if [ "$cleanup" = "1" ] && [ -e "$prefix/bin/busybox" ]; then | ||
41 | inode=`ls -i "$prefix/bin/busybox" | awk '{print $1}'` | ||
42 | sub_shell_it=` | ||
43 | cd "$prefix" | ||
44 | for d in usr/sbin usr/bin sbin bin ; do | ||
45 | pd=$PWD | ||
46 | if [ -d "$d" ]; then | ||
47 | cd $d | ||
48 | ls -iL . | grep "^ *$inode" | awk '{print $2}' | env -i xargs rm -f | ||
49 | fi | ||
50 | cd "$pd" | ||
51 | done | ||
52 | ` | ||
53 | fi | ||
54 | |||
37 | rm -f $prefix/bin/busybox || exit 1 | 55 | rm -f $prefix/bin/busybox || exit 1 |
38 | mkdir -p $prefix/bin || exit 1 | 56 | mkdir -p $prefix/bin || exit 1 |
39 | install -m 755 busybox $prefix/bin/busybox || exit 1 | 57 | install -m 755 busybox $prefix/bin/busybox || exit 1 |