Просмотр исходного кода

base-files: abort sysupgrade if file specified with --restore-config is not found

SVN-Revision: 37624
Jo-Philipp Wich 12 лет назад
Родитель
Сommit
2a1ccf1830
2 измененных файлов с 7 добавлено и 2 удалено
  1. 1 1
      package/base-files/Makefile
  2. 6 1
      package/base-files/files/sbin/sysupgrade

+ 1 - 1
package/base-files/Makefile

@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/version.mk
 
 
 PKG_NAME:=base-files
 PKG_NAME:=base-files
-PKG_RELEASE:=144
+PKG_RELEASE:=145
 
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
 PKG_BUILD_DEPENDS:=opkg/host

+ 6 - 1
package/base-files/files/sbin/sysupgrade

@@ -140,7 +140,12 @@ if [ -n "$CONF_BACKUP" ]; then
 	exit $?
 	exit $?
 fi
 fi
 
 
-if [ -f "$CONF_RESTORE" ] || [ "$CONF_RESTORE" = "-" ]; then
+if [ -n "$CONF_RESTORE" ]; then
+	if [ "$CONF_RESTORE" != "-" ] && [ ! -f "$CONF_RESTORE" ]; then
+		echo "Backup archive '$CONF_RESTORE' not found."
+		exit 1
+	fi
+
 	[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
 	[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
 	tar -C / -x${TAR_V}zf "$CONF_RESTORE"
 	tar -C / -x${TAR_V}zf "$CONF_RESTORE"
 	exit $?
 	exit $?