]> mj.ucw.cz Git - libucw.git/blobdiff - build/installer
Doc. system: fix deflist asciidoc formatting
[libucw.git] / build / installer
index 30aef1e137e678a905ae7faf86d2722be9cfa0b8..39e62e61be2d068d632482b9fb765f8eccf2ced1 100755 (executable)
@@ -1,31 +1,38 @@
 #!/bin/sh
 set -e
 DEST=`eval echo $1`
-shift
 echo "Installing to $DEST"
-if [ ! -d $DEST/cf ] ; then
-       echo "Creating $DEST and the whole directory hierarchy under it."
-       mkdir -p $DEST/{cf,db,index,log,tmp}
-fi
-echo "Installing binaries..."
-rm -rf $DEST/{bin,lib}
-mkdir -p $DEST/{bin,lib}
-cp -aL run/bin/* $DEST/bin/
-cp -aL run/lib/* $DEST/lib/
+for d in "" cf $SH_EXTRA_RUNDIRS ; do
+       if [ ! -d $DEST/$d ] ; then
+               echo "Creating $DEST/$d"
+               mkdir -p $DEST/$d
+       fi
+done
+for d in $SH_INSTALL_RUNDIRS ; do
+       echo "Installing to $DEST/$d"
+       rm -rf $DEST/$d
+       mkdir -p $DEST/$d
+       cp -aL run/$d/* $DEST/$d/
+done
 echo "Installing config files..."
-for a in "$@" ; do
+for a in $SH_CONFIGS ; do
        if [ -f run/cf/$a ] ; then
                if [ ! -f $DEST/cf/$a ] ; then
                        echo "cf/$a: new, installed"
                        cp run/cf/$a $DEST/cf/$a
-               elif [ $a == catalog-rules ] ; then
+               elif [ $a = catalog-rules ] ; then
                        echo "cf/$a: will be regenerated automatically"
                elif diff -u $DEST/cf/$a run/cf/$a ; then
                        echo "cf/$a: no differences"
                else
                        echo -n "cf/$a differs, replace it [Yn]? "
-                       read x
-                       if [ -z "$x" -o "$x" == "y" -o "$x" == "Y" ] ; then
+                       if [ -z "$SH_AUTO_CONFIRM" ] ; then
+                               read x
+                       else
+                               x="$SH_AUTO_CONFIRM"
+                               echo "$x"
+                       fi
+                       if [ -z "$x" -o "$x" = "y" -o "$x" = "Y" ] ; then
                                echo "cf/$a: replacing and keeping the old version as cf/$a.old"
                                mv $DEST/cf/$a $DEST/cf/$a.old
                                cp run/cf/$a $DEST/cf/$a