X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=bin%2Fminstall;h=130025829ba727210ab8eef55b15b8412eeb9879;hb=9db647bb7ac5b8e560c49222b4e0c98a3acc4672;hp=210c2758d3700093e8fb52846eb9515ebd0efe9c;hpb=bce82efe1fc57f88dc050f5c13508b2e442b7a0d;p=mesa.git diff --git a/bin/minstall b/bin/minstall index 210c2758d37..130025829ba 100755 --- a/bin/minstall +++ b/bin/minstall @@ -42,6 +42,8 @@ if [ $# -ge 2 ] ; then exit 0 fi + PWDSAVE=`pwd` + # determine file's type if [ -h "$FILE" ] ; then #echo $FILE is a symlink @@ -57,7 +59,6 @@ if [ $# -ge 2 ] ; then FILE=`basename "$FILE"` # Go to $DEST and make the link - PWDSAVE="$PWD" cd "$DEST" # pushd $RM "$FILE" $SYMLINK "$TARGET" "$FILE" @@ -65,8 +66,11 @@ if [ $# -ge 2 ] ; then elif [ -f "$FILE" ] ; then #echo "$FILE" is a regular file - $RM "$DEST/$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"