]> mj.ucw.cz Git - libucw.git/commitdiff
"-nt" behaves randomly on non-existent files, so check existence first.
authorMartin Mares <mj@ucw.cz>
Wed, 18 Jul 2007 08:48:01 +0000 (10:48 +0200)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Wed, 18 Jul 2007 08:48:01 +0000 (10:48 +0200)
build/install-includes

index 33e2c9a9ffb15679d2f874313d9eb46063eb4622..1737b46ab59140d105d29ce8f811c931e805c4fa 100755 (executable)
@@ -1,13 +1,13 @@
 #!/bin/sh
 # A simple installer of include files
-# (c) 2005 Martin Mares <mj@ucw.cz>
+# (c) 2005--2007 Martin Mares <mj@ucw.cz>
 
 set -e
 SRC=$1
 DEST=$2
 shift 2
 while [ -n "$1" ] ; do
-       if [ "$SRC/$1" -nt "$DEST/$1" ] ; then
+       if [ ! -f "$DEST/$1" -o "$SRC/$1" -nt "$DEST/$1" ] ; then
                echo "INC $SRC/$1 -> $DEST/$1"
                mkdir -p $DEST/`dirname $1`
                cp $SRC/$1 $DEST/$1