X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=build%2Finstaller;h=30aef1e137e678a905ae7faf86d2722be9cfa0b8;hb=1b5d27e82345dfb08c1a3b16940ae0ce09a266ec;hp=12e54772a233e7c5e93b2d54df164a5d9f7256ce;hpb=6e66ef30e1eee9391c0e44e3c08f5e160dfbbad2;p=libucw.git diff --git a/build/installer b/build/installer index 12e54772..30aef1e1 100755 --- a/build/installer +++ b/build/installer @@ -1,6 +1,7 @@ #!/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." @@ -12,23 +13,25 @@ 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