opkginstall.patch 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. --- a/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
  2. +++ b/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
  3. @@ -15,6 +15,7 @@ case "$action" in
  4. ;;
  5. install|update|remove)
  6. (
  7. + source /etc/profile.d/opkginstall.sh;
  8. opkg="opkg"
  9. while [ -n "$1" ]; do
  10. @@ -34,6 +35,9 @@ case "$action" in
  11. if flock -x 200; then
  12. $opkg $action "$@" </dev/null >/tmp/opkg.out 2>/tmp/opkg.err
  13. + sed -i "/resolve_conffiles/d" /tmp/opkg.err || true
  14. + sed -i "/uci: Entry not found/d" /tmp/opkg.err || true
  15. + [ "`cat /tmp/opkg.err`" == "Collected errors:" ] && rm -f /tmp/opkg.err || true
  16. code=$?
  17. stdout=$(cat /tmp/opkg.out)
  18. stderr=$(cat /tmp/opkg.err)
  19. --- a/package/feeds/luci/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
  20. +++ b/package/feeds/luci/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
  21. @@ -203,6 +203,7 @@ return view.extend({
  22. }, this, ev.target))
  23. .then(L.bind(function(btn, res) {
  24. var keep = E('input', { type: 'checkbox' }),
  25. + keep_opkg = E('input', { type: 'checkbox' }),
  26. force = E('input', { type: 'checkbox' }),
  27. is_valid = res[1].valid,
  28. is_forceable = res[1].forceable,
  29. @@ -220,6 +221,10 @@ return view.extend({
  30. body.push(E('p', {}, E('label', { 'class': 'btn' }, [
  31. keep, ' ', _('Keep settings and retain the current configuration')
  32. ])));
  33. + body.push(E('p', {}, E('label', { 'class': 'btn' }, [
  34. + keep_opkg, ' ', _('Retain the current packages')
  35. + ])));
  36. + keep_opkg.checked = true;
  37. if (!is_valid || is_too_big)
  38. body.push(E('hr'));
  39. @@ -257,7 +262,7 @@ return view.extend({
  40. var cntbtn = E('button', {
  41. 'class': 'btn cbi-button-action important',
  42. - 'click': ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep, force),
  43. + 'click': ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep, keep_opkg, force),
  44. 'disabled': (!is_valid || is_too_big) ? true : null
  45. }, [ _('Continue') ]);
  46. @@ -282,7 +287,7 @@ return view.extend({
  47. }, this, ev.target));
  48. },
  49. - handleSysupgradeConfirm: function(btn, keep, force, ev) {
  50. + handleSysupgradeConfirm: function(btn, keep, keep_opkg, force, ev) {
  51. btn.firstChild.data = _('Flashing…');
  52. ui.showModal(_('Flashing…'), [
  53. @@ -294,6 +299,9 @@ return view.extend({
  54. if (!keep.checked)
  55. opts.push('-n');
  56. + if (keep_opkg.checked)
  57. + opts.push('-k');
  58. +
  59. if (force.checked)
  60. opts.push('--force');
  61. --- a/package/feeds/luci/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
  62. +++ b/package/feeds/luci/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
  63. @@ -140,6 +140,7 @@
  64. "/sbin/sysupgrade --force /tmp/firmware.bin": [ "exec" ],
  65. "/sbin/sysupgrade -n --force /tmp/firmware.bin": [ "exec" ],
  66. "/sbin/sysupgrade -n /tmp/firmware.bin": [ "exec" ],
  67. + "/sbin/sysupgrade -k /tmp/firmware.bin": [ "exec" ],
  68. "/sbin/sysupgrade --restore-backup /tmp/backup.tar.gz": [ "exec" ],
  69. "/sbin/sysupgrade --test /tmp/firmware.bin": [ "exec" ],
  70. "/sbin/sysupgrade /tmp/firmware.bin": [ "exec" ],