X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=build%2Finstaller;h=b5bf16f20f9b699d18733b52193cbc4b7097e6a2;hb=ca1d58bec2ba0740e7f67a533833b4c9f838853d;hp=607c9f74b3140aab80a628f8a6b026fee35a0e2f;hpb=e6c909a9dca799f278fcf84efc96fe39d308d33b;p=libucw.git diff --git a/build/installer b/build/installer index 607c9f74..b5bf16f2 100755 --- a/build/installer +++ b/build/installer @@ -1,32 +1,39 @@ #!/bin/sh set -e -DEST=$1 +DEST=`eval echo $1` echo "Installing to $DEST" -if [ ! -d $DEST/bin ] ; then - echo "Creating $DEST and the whole directory hierarchy under it." - mkdir -p $DEST/{bin,cf,db,index,log,tmp} -fi -echo "Installing binaries..." -rm -f $DEST/bin/* -cp run/bin/* $DEST/bin/ +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 cf/* ; do - if [ -f $a ] ; then - if [ ! -f $DEST/$a ] ; then - echo "$a: new, installed" - cp $a $DEST/$a - elif diff -u $DEST/$a $a ; then - echo "$a: no differences" +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 + 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 "$a differs, replace it [Yn]? " + echo -n "cf/$a differs, replace it [Yn]? " read x - if [ -z "$x" -o "$x" == "y" -o "$x" == "Y" ] ; then - echo "$a: replacing and keeping the old version as $a.old" - mv $DEST/$a $DEST/$a.old - cp $a $DEST/$a + 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 else - echo "$a: installing the new version as $a.dist" - cp $a $DEST/$a.dist + echo "cf/$a: installing the new version as cf/$a.dist" + cp run/cf/$a $DEST/cf/$a.dist fi fi fi