diff options
author | Luiz Angelo Daros de Luca <luizluca@gmail.com> | 2022-10-19 23:12:49 -0300 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2024-02-19 12:41:40 +0100 |
commit | 14ac91c68c0e17b8ec705256f0d9092bfb899466 (patch) | |
tree | 34adcbeac89139a53cd2cd6624384d86e616e91e /package/base-files | |
parent | 0ef927472148a7b6639d2e2382b78bfe8f37b80f (diff) | |
download | openwrt-14ac91c68c0e17b8ec705256f0d9092bfb899466.tar.gz openwrt-14ac91c68c0e17b8ec705256f0d9092bfb899466.tar.bz2 openwrt-14ac91c68c0e17b8ec705256f0d9092bfb899466.zip |
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 <luizluca@gmail.com>
Diffstat (limited to 'package/base-files')
-rwxr-xr-x | package/base-files/files/sbin/sysupgrade | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 9315091302..eba11ce78e 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/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" |