From 9b25031cb29bd59561e550daccb69935834d7d63 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 3 Mar 2020 15:19:21 +0100 Subject: luci-app-opkg: rework backend operations Introduce a new /usr/libexec/opkg-call helper and invoke it via cgi-io instead of ubus. This is required to be able to reload rpcd without timing out currently running opkg ubus calls. Signed-off-by: Jo-Philipp Wich --- .../luci-app-opkg/htdocs/luci-static/resources/view/opkg.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'applications/luci-app-opkg/htdocs/luci-static/resources/view') diff --git a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js index 59ca2cd951..fcb7dc652c 100644 --- a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js +++ b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js @@ -872,7 +872,7 @@ function handleOpkg(ev) _('Waiting for the opkg %h command to complete…').format(cmd)) ]); - var argv = [ '--force-removal-of-dependent-packages' ]; + var argv = [ cmd, '--force-removal-of-dependent-packages' ]; if (rem && rem.checked) argv.push('--autoremove'); @@ -880,12 +880,10 @@ function handleOpkg(ev) if (owr && owr.checked) argv.push('--force-overwrite'); - argv.push(cmd); - if (pkg != null) argv.push(pkg); - fs.exec('/bin/opkg', argv).then(function(res) { + fs.exec_direct('/usr/libexec/opkg-call', argv, 'json').then(function(res) { dlg.removeChild(dlg.lastChild); if (res.stdout) @@ -957,8 +955,8 @@ function downloadLists() { return Promise.all([ callMountPoints(), - fs.exec_direct('/usr/libexec/opkg-list', [ 'available' ]), - fs.exec_direct('/usr/libexec/opkg-list', [ 'installed' ]) + fs.exec_direct('/usr/libexec/opkg-call', [ 'list-available' ]), + fs.exec_direct('/usr/libexec/opkg-call', [ 'list-installed' ]) ]); } -- cgit v1.2.3