summaryrefslogtreecommitdiff
path: root/source3/script/installdirs.sh
diff options
context:
space:
mode:
authorLars Müller <lmuelle@samba.org>2006-02-22 21:41:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:10:20 -0500
commitca0e155ef015adfaf6a9c38518e8d60adcc3fdf9 (patch)
tree6523ffbc460d0ed56f6c3b57f05f27ba7704587d /source3/script/installdirs.sh
parent202bc164ca11539a62a7e894330265df90319828 (diff)
downloadsamba-ca0e155ef015adfaf6a9c38518e8d60adcc3fdf9.tar.gz
samba-ca0e155ef015adfaf6a9c38518e8d60adcc3fdf9.tar.bz2
samba-ca0e155ef015adfaf6a9c38518e8d60adcc3fdf9.zip
r13642: Fix install* scripts to use DESTDIR.
Always pass the INSTALLPERMS and DESTDIR as first and second arg to the scripts. No longer prepend DESTDIR to the remaining args. To fix bug #3282 it is important _not_ to prepend DESTDIR to the source of the sym link pointing to smbmount. (This used to be commit c38adf71317f2c898ee10cad8068e942835199c9)
Diffstat (limited to 'source3/script/installdirs.sh')
-rwxr-xr-xsource3/script/installdirs.sh16
1 files changed, 10 insertions, 6 deletions
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