luci-app-package-manager: fix 'Update lists' button for apk
authorHannu Nyman <hannu.nyman@iki.fi>
Sat, 2 Nov 2024 11:46:14 +0000 (13:46 +0200)
committerHannu Nyman <hannu.nyman@iki.fi>
Sat, 2 Nov 2024 11:50:38 +0000 (13:50 +0200)
Fix the button "Update lists..." to actually update package lists
instead of trying to upgrade all packages when using apk.
(No change for opkg.)

Note: the package upgrade button remains inactive with apk. It still
launches 'apk install' command, which does not work for upgrade.

Also remove whitespace from line end.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
applications/luci-app-package-manager/root/usr/libexec/package-manager-call

index 789759d40cab5b5c236365acc53c840cfafa69a0..7667b8e8ce592503c2abd54108e7e73f5e76ea6a 100755 (executable)
@@ -27,7 +27,7 @@ case "$action" in
                        find "${lists_dir:-/usr/lib/opkg/lists}" -type f '!' -name '*.sig' | xargs -r gzip -cd
                fi
        ;;
-       install|update|remove)
+       install|update|upgrade|remove)
                (
                        cmd="$ipkg_bin"
 
@@ -38,12 +38,15 @@ case "$action" in
                                                action="add"
                                        ;;
                                        update)
+                                               action="update"
+                                       ;;
+                                       upgrade)
                                                action="upgrade"
                                        ;;
                                        remove)
                                                action="del"
                                        ;;
-                               esac                                                    
+                               esac
                        fi
 
                        # APK have --autoremove enabled by default and
@@ -104,7 +107,7 @@ case "$action" in
                rm -f /tmp/ipkg.lock /tmp/ipkg.err /tmp/ipkg.out
        ;;
        *)
-               echo "Usage: $0 {list-installed|list-available}"       >&2
+               echo "Usage: $0 {list-installed|list-available|update}" >&2
                echo "       $0 {install|upgrade|remove} pkg[ pkg...]" >&2
                exit 1
        ;;