summaryrefslogtreecommitdiff
path: root/applets/install.sh
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-06-07 18:08:25 +0000
committerMike Frysinger <vapier@gentoo.org>2006-06-07 18:08:25 +0000
commit81514ecca37fdd0d158377287a45db8aaa926d67 (patch)
treec8d20c6db30079bea85ed80a15d096d439a7f5a1 /applets/install.sh
parent74b29a107fe9cd48319c3ea767e5b8dead1f31e7 (diff)
downloadbusybox-81514ecca37fdd0d158377287a45db8aaa926d67.tar.gz
add support for cleaning out previous busybox install
Diffstat (limited to 'applets/install.sh')
-rwxr-xr-xapplets/install.sh18
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
exit 1;
fi
h=`sort busybox.links | uniq`
+cleanup="0"
case "$2" in
--hardlinks) linkopts="-f";;
--symlinks) linkopts="-fs";;
+ --cleanup) cleanup="1";;
"") h="";;
*) echo "Unknown install option: $2"; exit 1;;
esac
@@ -34,6 +36,22 @@ if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then
fi
done
fi
+
+if [ "$cleanup" = "1" ] && [ -e "$prefix/bin/busybox" ]; then
+ inode=`ls -i "$prefix/bin/busybox" | awk '{print $1}'`
+ sub_shell_it=`
+ cd "$prefix"
+ for d in usr/sbin usr/bin sbin bin ; do
+ pd=$PWD
+ if [ -d "$d" ]; then
+ cd $d
+ ls -iL . | grep "^ *$inode" | awk '{print $2}' | env -i xargs rm -f
+ fi
+ cd "$pd"
+ done
+ `
+fi
+
rm -f $prefix/bin/busybox || exit 1
mkdir -p $prefix/bin || exit 1
install -m 755 busybox $prefix/bin/busybox || exit 1