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

base-files: sysupgrade: do not hide tar errors

tar stderr was probably discarded only to remove this message:

  tar: removing leading '/' from member names

However, together with that, any other error would also be discarded.
It is easier to fix that allowing the error message to be printed.

In sysupgrade, the backup file list only uses absolute paths. That way,
the solution is to remove the leading '/' from all files (sed) and chdir
to / (option -C /)

Signed-off-by: Luiz Angelo Daros de Luca <[email protected]>
Luiz Angelo Daros de Luca 3 лет назад
Родитель
Сommit
14ac91c68c
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      package/base-files/files/sbin/sysupgrade

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

@@ -257,7 +257,8 @@ do_save_conffiles() {
 
 	v "Saving config files..."
 	[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
-	tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null
+	sed -i -e 's,^/,,' "$CONFFILES"
+	tar c${TAR_V}zf "$conf_tar" -C / -T "$CONFFILES"
 	if [ "$?" -ne 0 ]; then
 		echo "Failed to create the configuration backup."
 		rm -f "$conf_tar"