libs/ipkg: give caller more control over filter pattern
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 15 Oct 2011 03:10:19 +0000 (03:10 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 15 Oct 2011 03:10:19 +0000 (03:10 +0000)
libs/ipkg/luasrc/model/ipkg.lua

index 73fa3c3..d0d9788 100644 (file)
@@ -158,7 +158,9 @@ end
 
 -- List helper
 function _list(action, pat, cb)
-       local fd = io.popen(ipkg .. " " .. action .. (pat and " '*" .. pat:gsub("'", "") .. "*'" or ""))
+       local fd = io.popen(ipkg .. " " .. action ..
+               (pat and (" '%s'" % pat:gsub("'", "")) or "")) -- .. " | grep -vE '^ '")
+
        if fd then
                local name, version, desc
                while true do