]> xenbits.xen.org Git - xenclient/build.git/commitdiff
XC-364: Fix 'upgrade' for 'file' type objects
authorChristopher Clark <christopher.clark@citrix.com>
Thu, 24 Sep 2009 19:46:59 +0000 (12:46 -0700)
committerChristopher Clark <christopher.clark@citrix.com>
Thu, 24 Sep 2009 19:46:59 +0000 (12:46 -0700)
Delete the old file type prior to doing the upgrade.
Probably breaks the notion of doing a revert-to-prior
version, unfortunately.

target/generic/target_xenclient_installer_skeleton/install/stages/Upgrade
target/generic/target_xenclient_installer_skeleton/install/stages/functions

index 460151e35d36c6c2590e08559bd7e0e7ece8f037..835fdda9dcdc74f174d18a8da3ff0528de8903a3 100755 (executable)
@@ -52,7 +52,7 @@ do_cmd lvrename "${NEW_ROOT_DEV}" "${ROOT_DEV}" >&2 || exit ${Abort}
 mixedgauge "Upgrading..." 75
 do_cmd sync >&2 || exit ${Abort}
 
-upgrade_iovm()
+upgrade_iovm_and_files()
 {
     case "${COMPONENT}" in
     iovm)
@@ -69,7 +69,7 @@ upgrade_iovm()
     ;;
     esac
 }
-iterate_over_packages upgrade_iovm
+iterate_over_packages upgrade_iovm_and_files
 
 GRUB_ACTIVE_PARTITION="hd0,1"
 XC_PARTITION=$( pvdisplay -c | awk -F: '{ if ( $2 == "xenclient" ) print $1; }' )
index 33645317a52125ad291eff0dc0129256519a80ca..580f5315e79110d12d413ef5ade92387542fa2dd 100644 (file)
@@ -378,6 +378,7 @@ install_file()
     do_cmd mount /dev/xenclient/storage /mnt/xenclient/storage >&2 || file_unwind || return 1
 
     mkdir -p $(dirname "/mnt/xenclient/${DST}")                    || file_unwind || return 1
+    rm -f "/mnt/xenclient/${DST}" 2>/dev/null                 # ignore errors on this command.
     cp "${SRC}" "/mnt/xenclient/${DST}"                            || file_unwind || return 1
 
     file_unwind