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

Michael Wybrow mjwybrow at cs.mu.OZ.AU
Tue Aug 16 17:28:39 AEST 2005


On Tue, 16 Aug 2005, Ralph Becket wrote:
>
> 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


'basename' looks wrong here, I think it should be 'dirname'.


Cheers,
Michael
--------------------------------------------------------------------------
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