Browse Source

Add upgrade directories that don't exist on dest in copy mode.

resolves #353
master
poikilos 5 years ago
parent
commit
96a25a0b91
  1. 16
      minetestenv-in-place.rc

16
minetestenv-in-place.rc

@ -240,23 +240,27 @@ upgradeAndMerge(){
# Remove the old version (the one to upgrade and # Remove the old version (the one to upgrade and
# keep if $UPGRADE_MODE is not move, otherwise the # keep if $UPGRADE_MODE is not move, otherwise the
# one to upgrade and later move to upgrades_base_path!) # one to upgrade and later move to upgrades_base_path!)
rm -Rf "$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME" || customExit "* rm -Rf \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" failed." rm -Rf "$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME" || customExit "* rm -Rf \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" failed while replacing the destination."
if [ "@$UPGRADE_MODE" = "@move" ]; then if [ "@$UPGRADE_MODE" = "@move" ]; then
#if [ "@$QUIET" != "@true" ]; then #if [ "@$QUIET" != "@true" ]; then
# echo " - moving $SUB_PATH..." # echo " - moving $SUB_PATH..."
#fi #fi
mv "$SUB_PATH" "$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME" || customExit "mv \"$SUB_PATH\" \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" failed for the SUB_PATH directory on the destination" mv "$SUB_PATH" "$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME" || customExit "mv \"$SUB_PATH\" \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" failed for the SUB_PATH directory to replace the destination"
else else
cp -R "$SUB_PATH" "$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME" || customExit "cp -R \"$SUB_PATH\" \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" failed for the SUB_PATH directory on the destination" # echo " - copying \"$SUB_PATH\" to \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" to replace destination..."
cp -R "$SUB_PATH" "$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME" || customExit "cp -R \"$SUB_PATH\" \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" failed for the SUB_PATH directory to replace the destination"
fi fi
else else
if [ "@$UPGRADE_MODE" = "@move" ]; then
#echo " - moving $SUB_PATH..."
if [ ! -d "$OLD_VERSION_PATH/$UPGRADE_TYPE" ]; then if [ ! -d "$OLD_VERSION_PATH/$UPGRADE_TYPE" ]; then
mkdir -p "$OLD_VERSION_PATH/$UPGRADE_TYPE" mkdir -p "$OLD_VERSION_PATH/$UPGRADE_TYPE"
fi fi
mv "$SUB_PATH" "$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME" || customExit "mv \"$SUB_PATH\" \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" for the SUB_PATH directory that is not on the destination." if [ "@$UPGRADE_MODE" = "@move" ]; then
#echo " - moving $SUB_PATH..."
mv "$SUB_PATH" "$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME" || customExit "mv \"$SUB_PATH\" \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" for the SUB_PATH directory that was not on the destination."
# ^ so that rmdir doesn't fail below. # ^ so that rmdir doesn't fail below.
else
# echo " - copying \"$SUB_PATH\" to \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" not on destination..."
cp -R "$SUB_PATH" "$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME" || customExit "mv \"$SUB_PATH\" \"$OLD_VERSION_PATH/$UPGRADE_TYPE/$SUB_NAME\" for the SUB_PATH directory that was not on the destination."
fi fi
fi fi
else else

Loading…
Cancel
Save