diff options
Diffstat (limited to 'source3/script')
-rwxr-xr-x | source3/script/installbin.sh | 12 | ||||
-rwxr-xr-x | source3/script/installdirs.sh | 16 | ||||
-rwxr-xr-x | source3/script/installmodules.sh | 20 |
3 files changed, 27 insertions, 21 deletions
diff --git a/source3/script/installbin.sh b/source3/script/installbin.sh index f9fd5298c0..2f15ce595a 100755 --- a/source3/script/installbin.sh +++ b/source3/script/installbin.sh @@ -15,13 +15,13 @@ shift for p in $*; do p2=`basename $p` - echo Installing $p as $BINDIR/$p2 - if [ -f $BINDIR/$p2 ]; then - rm -f $BINDIR/$p2.old - mv $BINDIR/$p2 $BINDIR/$p2.old + echo Installing $p as $DESTDIR/$BINDIR/$p2 + if [ -f $DESTDIR/$BINDIR/$p2 ]; then + rm -f $DESTDIR/$BINDIR/$p2.old + mv $DESTDIR/$BINDIR/$p2 $DESTDIR/$BINDIR/$p2.old fi - cp $p $BINDIR/ - chmod $INSTALLPERMS $BINDIR/$p2 + cp $p $DESTDIR/$BINDIR/ + chmod $INSTALLPERMS $DESTDIR/$BINDIR/$p2 # this is a special case, mount needs this in a specific location if [ $p2 = smbmount ]; then diff --git a/source3/script/installdirs.sh b/source3/script/installdirs.sh index 1db46b82ff..db38a11b67 100755 --- a/source3/script/installdirs.sh +++ b/source3/script/installdirs.sh @@ -1,14 +1,18 @@ #!/bin/sh -while ( test -n "$1" ); do +INSTALLPERMS=$1 +DESTDIR=`echo $2 | sed 's/\/\//\//g'` +shift +shift - DIRNAME=`echo $1 | sed 's/\/\//\//g'` - if [ ! -d $DIRNAME ]; then - mkdir -p $DIRNAME +for dir in $@; do + DIRNAME=`echo $dir | sed 's/\/\//\//g'` + if [ ! -d $DESTDIR/$DIRNAME ]; then + mkdir -m $INSTALLPERMS -p $DESTDIR/$DIRNAME fi - if [ ! -d $DIRNAME ]; then - echo Failed to make directory $1 + if [ ! -d $DESTDIR/$DIRNAME ]; then + echo "Failed to make directory $DESTDIR/$DIRNAME " exit 1 fi diff --git a/source3/script/installmodules.sh b/source3/script/installmodules.sh index f7c7473338..4ea8fde327 100755 --- a/source3/script/installmodules.sh +++ b/source3/script/installmodules.sh @@ -1,17 +1,19 @@ #!/bin/sh INSTALLPERMS=$1 -BASEDIR=`echo $2 | sed 's/\/\//\//g'` -LIBDIR=`echo $3 | sed 's/\/\//\//g'` +DESTDIR=`echo $2 | sed 's/\/\//\//g'` +BASEDIR=`echo $3 | sed 's/\/\//\//g'` +LIBDIR=`echo $4 | sed 's/\/\//\//g'` +shift shift shift shift for d in $BASEDIR $LIBDIR; do -if [ ! -d $d ]; then -mkdir $d -if [ ! -d $d ]; then - echo Failed to make directory $d +if [ ! -d $DESTDIR/$d ]; then +mkdir $DESTDIR/$d +if [ ! -d $DESTDIR/$d ]; then + echo Failed to make directory $DESTDIR/$d exit 1 fi fi @@ -19,9 +21,9 @@ done for p in $*; do p2=`basename $p` - echo Installing $p as $LIBDIR/$p2 - cp -f $p $LIBDIR/ - chmod $INSTALLPERMS $LIBDIR/$p2 + echo Installing $p as $DESTDIR/$LIBDIR/$p2 + cp -f $p $DESTDIR/$LIBDIR/ + chmod $INSTALLPERMS $DESTDIR/$LIBDIR/$p2 done exit 0 |