opkginstall.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. @@ -19,7 +19,7 @@ case "$action" in
  4. while [ -n "$1" ]; do
  5. case "$1" in
  6. - --autoremove|--force-overwrite|--force-removal-of-dependent-packages)
  7. + --autoremove|--force-overwrite|--force-removal-of-dependent-packages|--force-checksum|--force-depends)
  8. opkg="$opkg $1"
  9. shift
  10. ;;
  11. @@ -34,6 +34,11 @@ case "$action" in
  12. if flock -x 200; then
  13. $opkg $action "$@" </dev/null >/tmp/opkg.out 2>/tmp/opkg.err
  14. + sed -i "/resolve_conffiles/d" /tmp/opkg.err || true
  15. + sed -i "/uci: Entry not found/d" /tmp/opkg.err || true
  16. + sed -i "/Existing conffile/d" /tmp/opkg.err || true
  17. + sed -i "/Couldn't unlink/d" /tmp/opkg.err || true
  18. + [ "`cat /tmp/opkg.err`" == "Collected errors:" ] && rm -f /tmp/opkg.err || true
  19. code=$?
  20. stdout=$(cat /tmp/opkg.out)
  21. stderr=$(cat /tmp/opkg.err)
  22. --- a/package/base-files/files/lib/functions.sh
  23. +++ b/package/base-files/files/lib/functions.sh
  24. @@ -199,6 +199,10 @@ default_prerm() {
  25. fi
  26. done
  27. + grep -q '"nas",' /usr/lib/lua/luci/controller/*.lua ||
  28. + sed -i '/_("NAS")/d' /usr/lib/lua/luci/controller/turboacc.lua
  29. + rm -Rf /tmp/luci-*
  30. +
  31. return $ret
  32. }
  33. @@ -250,6 +254,9 @@ default_postinst() {
  34. ret=$?
  35. fi
  36. + grep -q '"nas",' /usr/lib/lua/luci/controller/*.lua && ! grep -q '_("NAS")' /usr/lib/lua/luci/controller/*.lua &&
  37. + sed -i 's/local page/local page\nentry({"admin", "nas"}, firstchild(), _("NAS") , 45).dependent = false/' /usr/lib/lua/luci/controller/turboacc.lua
  38. +
  39. if [ -d "$root/rootfs-overlay" ]; then
  40. cp -R $root/rootfs-overlay/. $root/
  41. rm -fR $root/rootfs-overlay/
  42. @@ -272,7 +279,7 @@ default_postinst() {
  43. uci commit
  44. fi
  45. - rm -f /tmp/luci-indexcache
  46. + rm -Rf /tmp/luci-*
  47. fi
  48. local shell="$(command -v bash)"
  49. @@ -287,6 +294,8 @@ default_postinst() {
  50. fi
  51. done
  52. + /etc/init.d/ucitrack reload
  53. +
  54. return $ret
  55. }
  56. --- a/package/feeds/luci/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
  57. +++ b/package/feeds/luci/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
  58. @@ -203,6 +203,7 @@ return view.extend({
  59. }, this, ev.target))
  60. .then(L.bind(function(btn, res) {
  61. var keep = E('input', { type: 'checkbox' }),
  62. + keep_opkg = E('input', { type: 'checkbox' }),
  63. force = E('input', { type: 'checkbox' }),
  64. is_valid = res[1].valid,
  65. is_forceable = res[1].forceable,
  66. @@ -220,6 +221,10 @@ return view.extend({
  67. body.push(E('p', {}, E('label', { 'class': 'btn' }, [
  68. keep, ' ', _('Keep settings and retain the current configuration')
  69. ])));
  70. + body.push(E('p', {}, E('label', { 'class': 'btn' }, [
  71. + keep_opkg, ' ', _('Retain the current packages')
  72. + ])));
  73. + keep_opkg.checked = true;
  74. if (!is_valid || is_too_big)
  75. body.push(E('hr'));
  76. @@ -257,7 +262,7 @@ return view.extend({
  77. var cntbtn = E('button', {
  78. 'class': 'btn cbi-button-action important',
  79. - 'click': ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep, force),
  80. + 'click': ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn, keep, keep_opkg, force),
  81. 'disabled': (!is_valid || is_too_big) ? true : null
  82. }, [ _('Continue') ]);
  83. @@ -282,7 +287,7 @@ return view.extend({
  84. }, this, ev.target));
  85. },
  86. - handleSysupgradeConfirm: function(btn, keep, force, ev) {
  87. + handleSysupgradeConfirm: function(btn, keep, keep_opkg, force, ev) {
  88. btn.firstChild.data = _('Flashing…');
  89. ui.showModal(_('Flashing…'), [
  90. @@ -294,6 +299,9 @@ return view.extend({
  91. if (!keep.checked)
  92. opts.push('-n');
  93. + if (keep_opkg.checked)
  94. + opts.push('-k');
  95. +
  96. if (force.checked)
  97. opts.push('--force');
  98. --- a/package/feeds/luci/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
  99. +++ b/package/feeds/luci/luci-mod-system/root/usr/share/rpcd/acl.d/luci-mod-system.json
  100. @@ -140,6 +140,7 @@
  101. "/sbin/sysupgrade --force /tmp/firmware.bin": [ "exec" ],
  102. "/sbin/sysupgrade -n --force /tmp/firmware.bin": [ "exec" ],
  103. "/sbin/sysupgrade -n /tmp/firmware.bin": [ "exec" ],
  104. + "/sbin/sysupgrade -k /tmp/firmware.bin": [ "exec" ],
  105. "/sbin/sysupgrade --restore-backup /tmp/backup.tar.gz": [ "exec" ],
  106. "/sbin/sysupgrade --test /tmp/firmware.bin": [ "exec" ],
  107. "/sbin/sysupgrade /tmp/firmware.bin": [ "exec" ],