summaryrefslogtreecommitdiff
path: root/bin/minstall
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-05-21 07:52:13 -0600
committerBrian Paul <brianp@vmware.com>2009-05-21 07:52:13 -0600
commitd2f4c2b6327832ce59dde5d7741a656b5ff5c46d (patch)
tree9ede1e888eae19f280de913afd2e98196ec1abcc /bin/minstall
parent042d9a513213b1fa356c0d80abc62b9327e0bcc2 (diff)
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.
Diffstat (limited to 'bin/minstall')
-rwxr-xr-xbin/minstall7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/minstall b/bin/minstall
index 8ee96089fa6..130025829ba 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"