garypang13 4 anni fa
parent
commit
8e2d9da3db
2 ha cambiato i file con 115 aggiunte e 74 eliminazioni
  1. 0 74
      devices/common/patches/opkg.patch
  2. 115 0
      devices/common/patches/opkginstall.patch

+ 0 - 74
devices/common/patches/opkg.patch

@@ -1,74 +0,0 @@
-From 955488467c8f86aa1994d9a9cccd9dfe7922e459 Mon Sep 17 00:00:00 2001
-From: kiddin9 <[email protected]>
-Date: Tue, 27 Oct 2020 13:48:23 +0800
-Subject: [PATCH] Update opkg.js
-
----
- .../htdocs/luci-static/resources/view/opkg.js            | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js b/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
-index a5abfc168c..e139370fe5 100644
---- a/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
-+++ b/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
-@@ -232,7 +232,7 @@ function display(pattern)
- 			var avail = packages.available.pkgs[name],
- 			    inst  = packages.installed.pkgs[name];
- 
--			if (!inst || !inst.installed)
-+			if (!inst || !inst.installed || pkg.name.includes('luci-app-opkg') || (!pkg.name.includes('luci-app') && !pkg.name.includes('luci-theme') && !pkg.name.includes('default-settings')))
- 				continue;
- 
- 			if (!avail || compareVersion(avail.version, pkg.version) <= 0)
-@@ -260,6 +260,9 @@ function display(pattern)
- 			}, _('Remove…'));
- 		}
- 		else {
-+			if (pkg.name.includes('luci-i18n'))
-+			   continue;
-+
- 			var inst = packages.installed.pkgs[name];
- 
- 			ver = truncateVersion(pkg.version || '-');
-@@ -370,6 +373,12 @@ function handleMode(ev)
- 
- 	currentDisplayMode = tab.getAttribute('data-mode');
- 
-+	if (currentDisplayMode == "updates"){
-+	var filterv = document.querySelector('input[name="filter"]')
-+	if ( filterv.value == "luci-app-")
-+		filterv.value = ""
-+	}
-+
- 	display(document.querySelector('input[name="filter"]').value);
- 
- 	ev.target.blur();
-@@ -687,7 +696,7 @@ function handleInstall(ev)
- 		errs || inst || '',
- 		E('div', { 'class': 'right' }, [
- 			E('label', { 'class': 'cbi-checkbox', 'style': 'float:left' }, [
--				E('input', { 'id': 'overwrite-cb', 'type': 'checkbox', 'name': 'overwrite', 'disabled': isReadonlyView }), ' ',
-+				E('input', { 'id': 'overwrite-cb', 'type': 'checkbox', 'name': 'overwrite', 'checked': 'checked', 'disabled': isReadonlyView }), ' ',
- 				E('label', { 'for': 'overwrite-cb' }), ' ',
- 				_('Overwrite files from other package(s)')
- 			]),
-@@ -881,6 +890,10 @@ function handleOpkg(ev)
- 		]);
- 
- 		var argv = [ cmd, '--force-removal-of-dependent-packages' ];
-+		
-+		argv.push('--force-checksum');
-+		
-+		argv.push('--force-depends');
- 
- 		if (rem && rem.checked)
- 			argv.push('--autoremove');
-@@ -1027,7 +1040,7 @@ return view.extend({
- 				E('div', {}, [
- 					E('label', {}, _('Filter') + ':'),
- 					E('span', { 'class': 'control-group' }, [
--						E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': query, 'keyup': handleKeyUp }),
-+						E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': 'luci-app-', 'keyup': handleKeyUp }),
- 						E('button', { 'class': 'btn cbi-button', 'click': handleReset }, [ _('Clear') ])
- 					])
- 				]),

+ 115 - 0
devices/common/patches/opkginstall.patch

@@ -1,3 +1,107 @@
+--- a/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
++++ b/package/feeds/luci/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
+@@ -232,7 +232,7 @@ function display(pattern)
+ 			var avail = packages.available.pkgs[name],
+ 			    inst  = packages.installed.pkgs[name];
+ 
+-			if (!inst || !inst.installed)
++			if (!inst || !inst.installed || pkg.name.includes('luci-app-opkg') || (!pkg.name.includes('luci-app') && !pkg.name.includes('luci-theme') && !pkg.name.includes('default-settings')))
+ 				continue;
+ 
+ 			if (!avail || compareVersion(avail.version, pkg.version) <= 0)
+@@ -245,6 +245,7 @@ function display(pattern)
+ 			btn = E('div', {
+ 				'class': 'btn cbi-button-positive',
+ 				'data-package': name,
++				'action': 'upgrade',
+ 				'click': handleInstall
+ 			}, _('Upgrade…'));
+ 		}
+@@ -260,6 +261,9 @@ function display(pattern)
+ 			}, _('Remove…'));
+ 		}
+ 		else {
++			if (pkg.name.includes('kmod') || pkg.name.includes('luci-i18n'))
++			   continue;
++
+ 			var inst = packages.installed.pkgs[name];
+ 
+ 			ver = truncateVersion(pkg.version || '-');
+@@ -268,12 +272,14 @@ function display(pattern)
+ 				btn = E('div', {
+ 					'class': 'btn cbi-button-action',
+ 					'data-package': name,
++					'action': 'install',
+ 					'click': handleInstall
+ 				}, _('Install…'));
+ 			else if (inst.installed && inst.version != pkg.version)
+ 				btn = E('div', {
+ 					'class': 'btn cbi-button-positive',
+ 					'data-package': name,
++					'action': 'upgrade',
+ 					'click': handleInstall
+ 				}, _('Upgrade…'));
+ 			else
+@@ -370,6 +376,12 @@ function handleMode(ev)
+ 
+ 	currentDisplayMode = tab.getAttribute('data-mode');
+ 
++	if (currentDisplayMode == "updates"){
++	var filterv = document.querySelector('input[name="filter"]')
++	if ( filterv.value == "luci-app-")
++		filterv.value = ""
++	}
++
+ 	display(document.querySelector('input[name="filter"]').value);
+ 
+ 	ev.target.blur();
+@@ -631,6 +643,7 @@ function handleReset(ev)
+ function handleInstall(ev)
+ {
+ 	var name = ev.target.getAttribute('data-package'),
++		action = ev.target.getAttribute('action'),
+ 	    pkg = packages.available.pkgs[name],
+ 	    depcache = {},
+ 	    size;
+@@ -687,7 +700,7 @@ function handleInstall(ev)
+ 		errs || inst || '',
+ 		E('div', { 'class': 'right' }, [
+ 			E('label', { 'class': 'cbi-checkbox', 'style': 'float:left' }, [
+-				E('input', { 'id': 'overwrite-cb', 'type': 'checkbox', 'name': 'overwrite', 'disabled': isReadonlyView }), ' ',
++				E('input', { 'id': 'overwrite-cb', 'type': 'checkbox', 'name': 'overwrite', 'checked': 'checked', 'disabled': isReadonlyView }), ' ',
+ 				E('label', { 'for': 'overwrite-cb' }), ' ',
+ 				_('Overwrite files from other package(s)')
+ 			]),
+@@ -697,7 +710,7 @@ function handleInstall(ev)
+ 			}, _('Cancel')),
+ 			' ',
+ 			E('div', {
+-				'data-command': 'install',
++				'data-command': action,
+ 				'data-package': name,
+ 				'class': 'btn cbi-button-action',
+ 				'click': handleOpkg,
+@@ -881,6 +894,10 @@ function handleOpkg(ev)
+ 		]);
+ 
+ 		var argv = [ cmd, '--force-removal-of-dependent-packages' ];
++		
++		argv.push('--force-checksum');
++		
++		argv.push('--force-depends');
+ 
+ 		if (rem && rem.checked)
+ 			argv.push('--autoremove');
+@@ -1027,7 +1044,7 @@ return view.extend({
+ 				E('div', {}, [
+ 					E('label', {}, _('Filter') + ':'),
+ 					E('span', { 'class': 'control-group' }, [
+-						E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': query, 'keyup': handleKeyUp }),
++						E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': 'luci-app-', 'keyup': handleKeyUp }),
+ 						E('button', { 'class': 'btn cbi-button', 'click': handleReset }, [ _('Clear') ])
+ 					])
+ 				]),
+
 --- a/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
 +++ b/package/feeds/luci/luci-app-opkg/root/usr/libexec/opkg-call
 @@ -19,7 +19,7 @@ case "$action" in
@@ -45,6 +149,17 @@
  
  		rm -f /tmp/opkg.lock /tmp/opkg.err /tmp/opkg.out
 
+--- a/package/feeds/luci/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json
++++ b/package/feeds/luci/luci-app-opkg/root/usr/share/rpcd/acl.d/luci-app-opkg.json
+@@ -20,6 +20,7 @@
+ 				"/usr/libexec/opkg-call install *": [ "exec" ],
+ 				"/usr/libexec/opkg-call remove *": [ "exec" ],
+ 				"/usr/libexec/opkg-call update *": [ "exec" ],
++				"/usr/libexec/opkg-call upgrade *": [ "exec" ],
+ 				"/etc/opkg.conf": [ "write" ],
+ 				"/etc/opkg/*.conf": [ "write" ],
+ 				"/tmp/upload.ipk": [ "write" ]
+
 --- a/package/base-files/files/lib/functions.sh
 +++ b/package/base-files/files/lib/functions.sh
 @@ -199,6 +199,10 @@ default_prerm() {