summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-opkg/root/usr
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2024-10-23 01:29:10 +0200
committerPaul Donald <newtwen+github@gmail.com>2024-10-24 00:05:19 +0200
commitbcd13b918e2f30b8d19027a06e3d773a1b0ec4c0 (patch)
tree6c2b5a5971bbb37255393efeb8ebc4e9d60e8fe1 /applications/luci-app-opkg/root/usr
parent591911d1723037ecf8cd0f5e5961bc1d9fc7a1df (diff)
luci-app-package-manager: rename from luci-app-opkg and add APK support
Rename luci-app-opkg to luci-app-package-manager and add APK support to it. The idea is to adapt APK to mimic OPKG output to require minimal changes to the luci app. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to 'applications/luci-app-opkg/root/usr')
-rwxr-xr-xapplications/luci-app-opkg/root/usr/libexec/opkg-call59
-rw-r--r--applications/luci-app-opkg/root/usr/share/luci/menu.d/luci-app-opkg.json13
-rw-r--r--applications/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json30
3 files changed, 0 insertions, 102 deletions
diff --git a/applications/luci-app-opkg/root/usr/libexec/opkg-call b/applications/luci-app-opkg/root/usr/libexec/opkg-call
deleted file mode 100755
index 1234b70330..0000000000
--- a/applications/luci-app-opkg/root/usr/libexec/opkg-call
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-
-. /usr/share/libubox/jshn.sh
-
-action=$1
-shift
-
-case "$action" in
- list-installed)
- cat /usr/lib/opkg/status
- ;;
- list-available)
- lists_dir=$(sed -rne 's#^lists_dir \S+ (\S+)#\1#p' /etc/opkg.conf /etc/opkg/*.conf 2>/dev/null | tail -n 1)
- find "${lists_dir:-/usr/lib/opkg/lists}" -type f '!' -name '*.sig' | xargs -r gzip -cd
- ;;
- install|update|remove)
- (
- opkg="opkg"
-
- while [ -n "$1" ]; do
- case "$1" in
- --autoremove|--force-overwrite|--force-removal-of-dependent-packages)
- opkg="$opkg $1"
- shift
- ;;
- -*)
- shift
- ;;
- *)
- break
- ;;
- esac
- done
-
- if flock -x 200; then
- $opkg $action "$@" </dev/null >/tmp/opkg.out 2>/tmp/opkg.err
- code=$?
- stdout=$(cat /tmp/opkg.out)
- stderr=$(cat /tmp/opkg.err)
- else
- code=255
- stderr="Failed to acquire lock"
- fi
-
- json_init
- json_add_int code $code
- [ -n "$stdout" ] && json_add_string stdout "$stdout"
- [ -n "$stderr" ] && json_add_string stderr "$stderr"
- json_dump
- ) 200>/tmp/opkg.lock
-
- rm -f /tmp/opkg.lock /tmp/opkg.err /tmp/opkg.out
- ;;
- *)
- echo "Usage: $0 {list-installed|list-available}" >&2
- echo " $0 {install|upgrade|remove} pkg[ pkg...]" >&2
- exit 1
- ;;
-esac
diff --git a/applications/luci-app-opkg/root/usr/share/luci/menu.d/luci-app-opkg.json b/applications/luci-app-opkg/root/usr/share/luci/menu.d/luci-app-opkg.json
deleted file mode 100644
index 3d06a257cb..0000000000
--- a/applications/luci-app-opkg/root/usr/share/luci/menu.d/luci-app-opkg.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "admin/system/opkg": {
- "title": "Software",
- "order": 30,
- "action": {
- "type": "view",
- "path": "opkg"
- },
- "depends": {
- "acl": [ "luci-app-opkg" ]
- }
- }
-}
diff --git a/applications/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json b/applications/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json
deleted file mode 100644
index 649666c260..0000000000
--- a/applications/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "luci-app-opkg": {
- "description": "Grant access to opkg management",
- "read": {
- "cgi-io": [ "exec" ],
- "file": {
- "/usr/libexec/opkg-list installed": [ "exec" ],
- "/usr/libexec/opkg-list available": [ "exec" ],
- "/usr/libexec/opkg-call list-installed": [ "exec" ],
- "/usr/libexec/opkg-call list-available": [ "exec" ],
- "/etc/opkg.conf": [ "read" ],
- "/etc/opkg/*.conf": [ "read" ]
- },
- "ubus": {
- "luci": [ "getMountPoints" ]
- }
- },
- "write": {
- "file": {
- "/usr/libexec/opkg-call install": [ "exec" ],
- "/usr/libexec/opkg-call install *": [ "exec" ],
- "/usr/libexec/opkg-call remove *": [ "exec" ],
- "/usr/libexec/opkg-call update": [ "exec" ],
- "/etc/opkg.conf": [ "write" ],
- "/etc/opkg/*.conf": [ "write" ],
- "/tmp/upload.ipk": [ "write" ]
- }
- }
- }
-}