From 74a140e4b4d99fd15239bb0152bdfa0c8a6dccea Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 15 Nov 2012 20:59:09 +0000 Subject: [PATCH] modules/admin-full: use luci.model.ipkg.find() to support searching packages by description --- .../admin-full/luasrc/view/admin_system/packages.htm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/admin-full/luasrc/view/admin_system/packages.htm b/modules/admin-full/luasrc/view/admin_system/packages.htm index 73a35bec9..00b4be486 100644 --- a/modules/admin-full/luasrc/view/admin_system/packages.htm +++ b/modules/admin-full/luasrc/view/admin_system/packages.htm @@ -9,8 +9,6 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -$Id$ - -%> <%- local bit = require "bit" @@ -35,16 +33,18 @@ local free_byte = space_free * fstat.frsize local filter = { } +local opkg_list = luci.model.ipkg.list_all local querypat if query and #query > 0 then - querypat = "*%s*" % query + querypat = '*%s*' % query + opkg_list = luci.model.ipkg.find end local letterpat if letter == 35 then - letterpat = "[^a-zA-Z]*" + letterpat = "[^a-z]*" else - letterpat = string.char(91, letter, letter + 32, 93, 42) -- '[' 'A' 'a' ']' '*' + letterpat = string.char(letter, 42) -- 'A' '*' end -%> @@ -173,7 +173,7 @@ end <%:Version%> <%:Description%> - <% local empty = true; luci.model.ipkg.list_all(querypat or letterpat, function(n, v, d) if filter[n] then return end; empty = false %> + <% local empty = true; opkg_list(querypat or letterpat, function(n, v, d) if filter[n] then return end; empty = false %> <%:Install%> <%=luci.util.pcdata(n)%> -- 2.25.1