From e6c909a9dca799f278fcf84efc96fe39d308d33b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 16 Jul 2002 21:54:51 +0000 Subject: [PATCH] Added an "install" target. --- build/installer | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 build/installer diff --git a/build/installer b/build/installer new file mode 100755 index 00000000..607c9f74 --- /dev/null +++ b/build/installer @@ -0,0 +1,34 @@ +#!/bin/sh +set -e +DEST=$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/ +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" + else + echo -n "$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 + else + echo "$a: installing the new version as $a.dist" + cp $a $DEST/$a.dist + fi + fi + fi +done +echo "Done." -- 2.39.2