Mesa (master): minstall: Don't copy over an identical file
Brian Paul
brianp at kemper.freedesktop.org
Thu May 21 22:58:00 UTC 2009
Module: Mesa
Branch: master
Commit: d2f4c2b6327832ce59dde5d7741a656b5ff5c46d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d2f4c2b6327832ce59dde5d7741a656b5ff5c46d
Author: Carl Worth <cworth at cworth.org>
Date: Thu May 21 07:52:13 2009 -0600
minstall: Don't copy over an identical file
The rationale here is to avoid updating a timestamp for a file that
hasn't changed. Needless updates of the timestamp can ripple into
other projects, (xserver, etc.), useless recompiling due to a
'make install' in mesa that didn't actually change anything.
---
bin/minstall | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/bin/minstall b/bin/minstall
index 8ee9608..1300258 100755
--- a/bin/minstall
+++ b/bin/minstall
@@ -66,8 +66,11 @@ if [ $# -ge 2 ] ; then
elif [ -f "$FILE" ] ; then
#echo "$FILE" is a regular file
- $RM "$DEST/`basename $FILE`"
- cp "$FILE" "$DEST"
+ # Only copy if the files differ
+ if ! cmp -s $FILE $DEST/`basename $FILE`; then
+ $RM "$DEST/`basename $FILE`"
+ cp "$FILE" "$DEST"
+ fi
if [ $MODE ] ; then
FILE=`basename "$FILE"`
chmod $MODE "$DEST/$FILE"
More information about the mesa-commit
mailing list