summaryrefslogtreecommitdiff
path: root/source/script/installdirs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'source/script/installdirs.sh')
-rwxr-xr-xsource/script/installdirs.sh21
1 files changed, 10 insertions, 11 deletions
diff --git a/source/script/installdirs.sh b/source/script/installdirs.sh
index 1db46b82ff2..062b34b8c69 100755
--- a/source/script/installdirs.sh
+++ b/source/script/installdirs.sh
@@ -1,19 +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
-
- shift;
done
-
-
-