summaryrefslogtreecommitdiffstats
path: root/contrib/libgmp/move-if-change
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libgmp/move-if-change')
-rwxr-xr-xcontrib/libgmp/move-if-change15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/libgmp/move-if-change b/contrib/libgmp/move-if-change
new file mode 100755
index 0000000..ee9e355
--- /dev/null
+++ b/contrib/libgmp/move-if-change
@@ -0,0 +1,15 @@
+#!/bin/sh
+if
+test -r $2
+then
+if
+cmp $1 $2 > /dev/null
+then
+echo $2 is unchanged
+rm -f $1
+else
+mv -f $1 $2
+fi
+else
+mv -f $1 $2
+fi
OpenPOWER on IntegriCloud