Fix header installation.
[nivanova/samba-autobuild/.git] / source4 / script / installswat.sh
old mode 100644 (file)
new mode 100755 (executable)
index 8632b34..4304e3e
@@ -1,34 +1,31 @@
 #!/bin/sh
 
 SWATDIR=$1
-SRCDIR=$2/
+SRCDIR=$2
 
 echo Installing swat files in $SWATDIR
 
 cd $SRCDIR/../swat || exit 1
 
+mkdir -p $SWATDIR || exit 1
+
 installdir() {
-    dir=$1
-    ext=$2
-    mkdir -p $SWATDIR/$dir || exit 1
-    for f in $dir/*.$ext; do
-       echo Installing $f
-       cp $f $SWATDIR/$dir/ || exit 1
+    for f in $*; do
+       dname=`dirname $f`
+       echo "Installing $f in $dname"
+       test -d $SWATDIR/$dname || mkdir -p $SWATDIR/$dname || exit 1
+       cp $f $SWATDIR/$dname/ || exit 1
        chmod 0644 $SWATDIR/$f || exit 1
     done
 }
 
-installdir . esp
-installdir . ico
-installdir esptest esp
-installdir esptest js
-installdir images png
-installdir images gif
-installdir scripting ejs
-installdir scripting esp
-installdir scripting js
-installdir style css
-installdir docs js
+installdir `find . -name '*.js'`
+installdir `find . -name '*.esp'`
+installdir `find . -name '*.css'`
+installdir `find . -name '*.png'`
+installdir `find . -name '*.ico'`
+installdir `find . -name '*.gif'`
+installdir `find . -name '*.ejs'`
 
 cat << EOF
 ======================================================================