-for i in $h ; do
- appdir=`dirname $i`
- mkdir -p $prefix/$appdir || exit 1
- if [ "$2" = "--hardlinks" ]; then
- bb_path="$prefix/bin/busybox"
+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
+ `
+ exit 0
+fi
+
+rm -f "$prefix/bin/busybox" || exit 1
+mkdir -p "$prefix/bin" || exit 1
+install -m 755 busybox "$prefix/bin/busybox" || exit 1
+
+for i in $h; do
+ appdir=`dirname "$i"`
+ app=`basename "$i"`
+ mkdir -p "$prefix/$appdir" || exit 1
+ if [ "$scriptwrapper" = "y" ]; then
+ if [ "$swrapall" != "y" ] && [ "$i" = "/bin/sh" ]; then
+ ln $linkopts busybox "$prefix/$i" || exit 1
+ else
+ rm -f "$prefix/$i"
+ echo "#!/bin/busybox" >"$prefix/$i"
+ chmod +x "$prefix/$i"
+ fi
+ echo " $prefix/$i"
+ elif [ "$binaries" = "y" ]; then
+ # Copy the binary over rather
+ if [ -e $sharedlib_dir/$app ]; then
+ if [ "$noclobber" = "0" ] || [ ! -e "$prefix/$i" ]; then
+ echo " Copying $sharedlib_dir/$app to $prefix/$i"
+ cp -pPR $sharedlib_dir/$app $prefix/$i || exit 1
+ else
+ echo " $prefix/$i already exists"
+ fi
+ else
+ echo "Error: Could not find $sharedlib_dir/$app"
+ exit 1
+ fi