From: Jo-Philipp Wich Date: Sat, 15 Oct 2011 03:10:19 +0000 (+0000) Subject: libs/ipkg: give caller more control over filter pattern X-Git-Tag: 0.11.0~1537 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=f83cdb1b8bff33f47867af8941d4aabcda1575f4 libs/ipkg: give caller more control over filter pattern --- diff --git a/libs/ipkg/luasrc/model/ipkg.lua b/libs/ipkg/luasrc/model/ipkg.lua index 73fa3c305..d0d9788fd 100644 --- a/libs/ipkg/luasrc/model/ipkg.lua +++ b/libs/ipkg/luasrc/model/ipkg.lua @@ -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