From fab5bc9861cfeb663c295bca1814b01379598cc0 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Tue, 26 Jan 2010 02:49:21 +0100 Subject: [PATCH] xen-create-image: Don't delete configuration file if it already exists. (Closes: #520177) --- bin/xen-create-image | 5 +++-- debian/changelog | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index f85899e..ec278dd 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -3483,7 +3483,8 @@ sub runXenConfigCreation logprint("The Xen configuration file $file exists\n"); logprint("Specify --force to force overwriting it.\n"); logprint("Aborting\n"); - $FAIL = 1; + # FAIL = 2 will keep existing config file + $FAIL = 2; exit 127; } } @@ -3748,7 +3749,7 @@ sub END # Did we fail? If so then we should remove the broken installation, # unless "--keep" was specified. # - if ( $FAIL && ( !$CONFIG{ 'keep' } ) ) + if ( ($FAIL == 1) && ( !$CONFIG{ 'keep' } ) ) { # diff --git a/debian/changelog b/debian/changelog index 586c8d7..9cb1ffa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ xen-tools (4.2-1) UNRELEASED; urgency=low * Make sure, MAKEDEV is found in either /dev/ or /sbin/ (Closes: #502798, #515228) * Change rinse path to /usr/sbin/. (Closes: #511211) + * Don't delete configuration file if it already exists when + xen-create-image is run. (Closes: #520177) --