mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-10 06:52:53 +00:00
base-files: sysupgrade: add saving list of installed packages for APK
Add support for saving list of installed packages for APK in the same way we do it for OPKG. Unlike OPKG, we dont generate .control files for packages so lets use .list files instead. Fixes: #16947 Link: https://github.com/openwrt/openwrt/pull/17123 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
da7ab64f1f
commit
cee18af704
@ -279,11 +279,19 @@ create_backup_archive() {
|
|||||||
if [ "$SAVE_INSTALLED_PKGS" -eq 1 ]; then
|
if [ "$SAVE_INSTALLED_PKGS" -eq 1 ]; then
|
||||||
# Format: pkg-name<TAB>{rom,overlay,unknown}
|
# Format: pkg-name<TAB>{rom,overlay,unknown}
|
||||||
# rom is used for pkgs in /rom, even if updated later
|
# rom is used for pkgs in /rom, even if updated later
|
||||||
tar_print_member "$INSTALLED_PACKAGES" "$(find /usr/lib/opkg/info -name "*.control" \( \
|
if [ -d "/usr/lib/opkg/info" ]; then
|
||||||
\( -exec test -f /rom/{} \; -exec echo {} rom \; \) -o \
|
tar_print_member "$INSTALLED_PACKAGES" "$(find /usr/lib/opkg/info -name "*.control" \( \
|
||||||
\( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \
|
\( -exec test -f /rom/{} \; -exec echo {} rom \; \) -o \
|
||||||
\( -exec echo {} unknown \; \) \
|
\( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \
|
||||||
\) | sed -e 's,.*/,,;s/\.control /\t/')" || ret=1
|
\( -exec echo {} unknown \; \) \
|
||||||
|
\) | sed -e 's,.*/,,;s/\.control /\t/')" || ret=1
|
||||||
|
elif [ -d "/lib/apk/packages" ]; then
|
||||||
|
tar_print_member "$INSTALLED_PACKAGES" "$(find /lib/apk/packages -name "*.list" \( \
|
||||||
|
\( -exec test -f /rom/{} \; -exec echo {} rom \; \) -o \
|
||||||
|
\( -exec test -f /overlay/upper/{} \; -exec echo {} overlay \; \) -o \
|
||||||
|
\( -exec echo {} unknown \; \) \
|
||||||
|
\) | sed -e 's,.*/,,;s/\.list /\t/')" || ret=1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user