Changeset 4245
- Timestamp:
- 02/17/09 03:37:18 (4 years ago)
- Files:
-
- 1 modified
-
luci/trunk/libs/ipkg/luasrc/model/ipkg.lua (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/libs/ipkg/luasrc/model/ipkg.lua
r3761 r4245 22 22 local error = error 23 23 24 local ipkg = "opkg "24 local ipkg = "opkg -force-defaults" 25 25 26 26 --- LuCI IPKG/OPKG call abstraction library … … 35 35 pkg = pkg .. " '" .. v:gsub("'", "") .. "'" 36 36 end 37 37 38 38 local c = ipkg.." "..cmd.." "..pkg.." >/dev/null 2>&1" 39 39 local r = os.execute(c) 40 return (r == 0), r 40 return (r == 0), r 41 41 end 42 42 43 43 -- Internal parser function 44 local function _parselist(rawdata) 44 local function _parselist(rawdata) 45 45 if type(rawdata) ~= "function" then 46 46 error("IPKG: Invalid rawdata given") 47 47 end 48 48 49 49 local data = {} 50 50 local c = {} 51 51 local l = nil 52 52 53 53 for line in rawdata do 54 54 if line:sub(1, 1) ~= " " then 55 55 local key, val = line:match("(.-): ?(.*)%s*") 56 56 57 57 if key and val then 58 58 if key == "Package" then … … 74 74 end 75 75 end 76 76 77 77 return data 78 78 end … … 84 84 cmd = cmd .. " '" .. pkg:gsub("'", "") .. "'" 85 85 end 86 86 87 87 -- IPKG sometimes kills the whole machine because it sucks 88 88 -- Therefore we have to use a sucky approach too and use … … 148 148 return _action("upgrade") 149 149 end 150
