summaryrefslogtreecommitdiffstats
path: root/build-aux
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-12-06 22:19:06 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2012-12-07 10:46:05 +0100
commit63ab32635aac24e6a8fd78598f60b56f31987e4a (patch)
treee5a4374b0c13eb86ca3eb954eb2cd94c8b8c8c3c /build-aux
parent8a5547adb5e94f56be5c30d4eb5de3ce9568fb0e (diff)
downloadmsitools-63ab32635aac24e6a8fd78598f60b56f31987e4a.zip
msitools-63ab32635aac24e6a8fd78598f60b56f31987e4a.tar.gz
msitools-63ab32635aac24e6a8fd78598f60b56f31987e4a.tar.xz
add skeleton for autotest testsuite
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/move-if-change17
1 files changed, 17 insertions, 0 deletions
diff --git a/build-aux/move-if-change b/build-aux/move-if-change
new file mode 100755
index 0000000..03dd02e
--- /dev/null
+++ b/build-aux/move-if-change
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Like mv $1 $2, but if the files are the same, just delete $1.
+# Status is zero if successful, nonzero otherwise.
+#
+# Copyright (C) 2011 Free Software Foundation, Inc.
+# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+# This is free software: you are free to change and redistribute it.
+# There is NO WARRANTY, to the extent permitted by law."
+
+if test -r "$2" && cmp -- "$1" "$2" >/dev/null; then
+ rm -f -- "$1"
+else
+ if mv -f -- "$1" "$2"; then :; else
+ # Ignore failure due to a concurrent move-if-change.
+ test -r "$2" && cmp -- "$1" "$2" >/dev/null && rm -f -- "$1"
+ fi
+fi