[Pkg-ocaml-maint-commits] r6192 - /trunk/projects/git-guide/d-o-m-mrconfig.sh

glondu-guest at users.alioth.debian.org glondu-guest at users.alioth.debian.org
Wed Feb 18 12:20:01 UTC 2009


Author: glondu-guest
Date: Wed Feb 18 12:20:01 2009
New Revision: 6192

URL: http://svn.debian.org/wsvn/?sc=1&rev=6192
Log:
Make a backup when the output file already exists

Modified:
    trunk/projects/git-guide/d-o-m-mrconfig.sh

Modified: trunk/projects/git-guide/d-o-m-mrconfig.sh
URL: http://svn.debian.org/wsvn/trunk/projects/git-guide/d-o-m-mrconfig.sh?rev=6192&op=diff
==============================================================================
--- trunk/projects/git-guide/d-o-m-mrconfig.sh (original)
+++ trunk/projects/git-guide/d-o-m-mrconfig.sh Wed Feb 18 12:20:01 2009
@@ -30,8 +30,10 @@
 
 msg "Generating mrconfig file in $OUTPUT"
 
-# Reset output file (is this necessary?)
-echo "" > $OUTPUT
+# Backup the output file if it exists
+if [ -f $OUTPUT ]; then
+    mv $OUTPUT ${OUTPUT}\~
+fi
 
 # Sections for Git repositories
 for i in $GIT_PKGS; do
@@ -61,5 +63,12 @@
 checkout = svn co $SVN_REPODIR/tools
 "
 
+if [ -f ${OUTPUT}\~ ] && diff -u ${OUTPUT}\~ ${OUTPUT}; then
+    rm ${OUTPUT}\~
+    echo "I: no changes"
+else
+    echo "I: $OUTPUT changed!"
+fi
+
 # Finish
 msg "all done, enjoy: mr -c $OUTPUT [checkout,update,...]"




More information about the Pkg-ocaml-maint-commits mailing list