svn commit: trunk/busybox/applets

vapier at busybox.net vapier at busybox.net
Wed Jun 7 18:08:27 UTC 2006


Author: vapier
Date: 2006-06-07 11:08:25 -0700 (Wed, 07 Jun 2006)
New Revision: 15319

Log:
add support for cleaning out previous busybox install

Modified:
   trunk/busybox/applets/install.sh


Changeset:
Modified: trunk/busybox/applets/install.sh
===================================================================
--- trunk/busybox/applets/install.sh	2006-06-07 17:27:46 UTC (rev 15318)
+++ trunk/busybox/applets/install.sh	2006-06-07 18:08:25 UTC (rev 15319)
@@ -9,9 +9,11 @@
 	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 @@
 		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




More information about the busybox-cvs mailing list