[m-rev.] for review: make backup of installed compiler before install

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Feb 15 18:28:15 AEDT 2005


On 15-Feb-2005, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> Index: tools/test_mercury
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
> retrieving revision 1.249
> diff -u -r1.249 test_mercury
> --- tools/test_mercury	26 Jan 2005 15:56:05 -0000	1.249
> +++ tools/test_mercury	15 Feb 2005 06:13:03 -0000
> @@ -728,6 +728,12 @@
>          true)	cd mercury || { false; exit 1; } ;;
>      esac
>  
> +    # 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

You need to remove any $INSTALL_DIR/* $INSTALL_DIR/../mercury_install_backup
first, if it exists, otherwise the cp will do the wrong thing.

>      # Previously we had lots of special case code here for installing on
>      # IRIX systems.   We don't currently have any IRIX boxes, and this 
>      # code was a bit of a pain to maintain.  If we ever get an IRIX box
> @@ -775,6 +781,8 @@
>  	    ;;
>          *)
>  	    date >> $TESTDIR/logs/install-failed."$TEST_ID"
> +	    # restore the previous installation
> +	    cp -rf $INSTALL_DIR/../mercury_install_backup/* $INSTALL_DIR
>  	    ;;
>      esac

This will create a directory called mercury_install_backup inside $INSTALL_DIR.
You need to remove $INSTALL_DIR first.

Zoltan.
--------------------------------------------------------------------------
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