opkginstall.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. --- a/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
  2. +++ b/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
  3. @@ -880,7 +880,7 @@ function handleOpkg(ev)
  4. _('Waiting for the <em>opkg %h</em> command to complete…').format(cmd))
  5. ]);
  6. - var argv = [ cmd, '--force-removal-of-dependent-packages' ];
  7. + var argv = [ cmd, '--force-removal-of-dependent-packages', '--force-overwrite', '--force-checksum' ];
  8. if (rem && rem.checked)
  9. argv.push('--autoremove');
  10. --- a/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
  11. +++ b/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
  12. @@ -15,6 +15,7 @@ case "$action" in
  13. ;;
  14. install|update|remove)
  15. (
  16. + source /etc/profile.d/opkginstall.sh;
  17. opkg="opkg"
  18. while [ -n "$1" ]; do
  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');