[m-rev.] Fix test_mercury to use mv rather than cp for backups

Ralph Becket rafe at cs.mu.OZ.AU
Tue Aug 16 17:08:34 AEST 2005


Estimated hours taken: 0.3
Branches: main

tools/test_mercury:
	Use mv rather than cp to handle the backup directory.
	The cp approach fails when disk space is at a premium.

Index: test_mercury
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
retrieving revision 1.252
diff -u -r1.252 test_mercury
--- test_mercury	21 Jun 2005 15:18:04 -0000	1.252
+++ test_mercury	16 Aug 2005 07:04:42 -0000
@@ -732,8 +732,9 @@
     # Make a backup copy of the current installation which we will restore
     # if the new installation fails.
 
-    mkdir -p $INSTALL_DIR/../mercury_install_backup
-    cp -rf $INSTALL_DIR/* $INSTALL_DIR/../mercury_install_backup
+    BACKUP_DIR=`basename $INSTALL_DIR`/mercury_install_backup
+    mv $INSTALL_DIR $BACKUP_DIR
+    mkdir -p $INSTALL_DIR
 
     # Previously we had lots of special case code here for installing on
     # IRIX systems.   We don't currently have any IRIX boxes, and this 
@@ -783,7 +784,8 @@
         *)
 	    date >> $TESTDIR/logs/install-failed."$TEST_ID"
 	    # restore the previous installation
-	    cp -rf $INSTALL_DIR/../mercury_install_backup/* $INSTALL_DIR
+	    rm -rf $INSTALL_DIR
+	    mv $BACKUP_DIR $INSTALL_DIR
 	    ;;
     esac
 esac
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list