From: Martin Mares Date: Wed, 18 Jul 2007 08:48:01 +0000 (+0200) Subject: "-nt" behaves randomly on non-existent files, so check existence first. X-Git-Tag: holmes-import~506^2~48^2 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=988f7b23856aa4154cfd9022edd684a0ba1bc24a;p=libucw.git "-nt" behaves randomly on non-existent files, so check existence first. --- diff --git a/build/install-includes b/build/install-includes index 33e2c9a9..1737b46a 100755 --- a/build/install-includes +++ b/build/install-includes @@ -1,13 +1,13 @@ #!/bin/sh # A simple installer of include files -# (c) 2005 Martin Mares +# (c) 2005--2007 Martin Mares 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