Whitespace / formatting / bracket cleanup.
[oweals/busybox.git] / install.sh
index 236f62a568e32c71d2426b0a36a0d755fdd05177..8cfae3740cd9afc2dafc8517fe4e753d5f3824c7 100755 (executable)
@@ -1,8 +1,7 @@
 #!/bin/sh
 
-set -e
-set -x
-if [ "$1" = "" ]; then
+prefix=$1
+if [ "$prefix" = "" ]; then
     echo "No installation directory, aborting."
     exit 1;
 fi
@@ -11,17 +10,16 @@ if [ "$2" = "--hardlinks" ]; then
 else
     linkopts="-fs"
 fi
-prefix=$1
 h=`sort busybox.links | uniq`
 
 
-rm -f $1/bin/busybox
-mkdir -p $1/bin
-install -m 755 busybox $1/bin/busybox
+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`
-       mkdir -p $prefix/$appdir
+       mkdir -p $prefix/$appdir || exit 1
        if [ "$2" = "--hardlinks" ]; then
            bb_path="$prefix/bin/busybox"
        else
@@ -44,8 +42,8 @@ for i in $h ; do
                ;;
            esac
        fi
-       echo "  $prefix$i -> /bin/busybox"
-       ln $linkopts $bb_path $prefix$i
+       echo "  $prefix$i -> $bb_path"
+       ln $linkopts $bb_path $prefix$i || exit 1
 done
 
 exit 0