X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=build%2Finstaller;h=30aef1e137e678a905ae7faf86d2722be9cfa0b8;hb=1b5d27e82345dfb08c1a3b16940ae0ce09a266ec;hp=607c9f74b3140aab80a628f8a6b026fee35a0e2f;hpb=e6c909a9dca799f278fcf84efc96fe39d308d33b;p=libucw.git diff --git a/build/installer b/build/installer index 607c9f74..30aef1e1 100755 --- a/build/installer +++ b/build/installer @@ -1,32 +1,37 @@ #!/bin/sh set -e -DEST=$1 +DEST=`eval echo $1` +shift echo "Installing to $DEST" -if [ ! -d $DEST/bin ] ; then +if [ ! -d $DEST/cf ] ; then echo "Creating $DEST and the whole directory hierarchy under it." - mkdir -p $DEST/{bin,cf,db,index,log,tmp} + mkdir -p $DEST/{cf,db,index,log,tmp} fi echo "Installing binaries..." -rm -f $DEST/bin/* -cp run/bin/* $DEST/bin/ +rm -rf $DEST/{bin,lib} +mkdir -p $DEST/{bin,lib} +cp -aL run/bin/* $DEST/bin/ +cp -aL run/lib/* $DEST/lib/ 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 "$@" ; 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 + 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