mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-05-04 17:36:12 +02:00
base-files: sysupgrade: -u option was broken with apk
The check of files from packages was only checking opkg files. Check for apk as well and fail if both are missing. Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Link: https://github.com/openwrt/openwrt/pull/17847 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
parent
2c146f29e8
commit
37c5aade23
@ -201,12 +201,17 @@ build_list_of_backup_overlay_files() {
|
||||
|
||||
# do not backup files from packages, except those listed
|
||||
# in conffiles and keep.d
|
||||
{
|
||||
if [ -f /usr/lib/opkg/status ]; then
|
||||
find /usr/lib/opkg/info -type f -name "*.list" -exec cat {} \;
|
||||
find /usr/lib/opkg/info -type f -name "*.control" -exec sed \
|
||||
-ne '/^Alternatives/{s/^Alternatives: //;s/, /\n/g;p}' {} \; |
|
||||
cut -f2 -d:
|
||||
} | grep -v -x -F -f $conffiles |
|
||||
elif [ -d /lib/apk/packages ]; then
|
||||
find /lib/apk/packages -type f -name "*.list" -exec cat {} \;
|
||||
find /lib/apk/packages -type f -name "*.alternatives" -exec cat {} \; |
|
||||
tr ' ' '\n' |
|
||||
cut -f2 -d:
|
||||
fi | grep -v -x -F -f $conffiles |
|
||||
grep -v -x -F -f $keepfiles | sort -u > "$packagesfiles"
|
||||
rm -f "$keepfiles" "$conffiles"
|
||||
fi
|
||||
@ -302,6 +307,9 @@ create_backup_archive() {
|
||||
\( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \
|
||||
\( -exec echo {} unknown \; \) \
|
||||
\) | sed -e 's,.*/,,;s/\.list /\t/')" || ret=1
|
||||
else
|
||||
echo "Failed to detect installed packages metadata files." >&2
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user