Changeset 4245

Show
Ignore:
Timestamp:
02/17/09 03:37:18 (4 years ago)
Author:
jow
Message:

libs/ipkg: use -force-defaults to ensure non-interactive execution

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/libs/ipkg/luasrc/model/ipkg.lua

    r3761 r4245  
    2222local error = error 
    2323 
    24 local ipkg = "opkg" 
     24local ipkg = "opkg -force-defaults" 
    2525 
    2626--- LuCI IPKG/OPKG call abstraction library 
     
    3535        pkg = pkg .. " '" .. v:gsub("'", "") .. "'" 
    3636    end 
    37      
     37 
    3838    local c = ipkg.." "..cmd.." "..pkg.." >/dev/null 2>&1" 
    3939    local r = os.execute(c) 
    40     return (r == 0), r   
     40    return (r == 0), r 
    4141end 
    4242 
    4343-- Internal parser function 
    44 local function _parselist(rawdata)   
     44local function _parselist(rawdata) 
    4545    if type(rawdata) ~= "function" then 
    4646        error("IPKG: Invalid rawdata given") 
    4747    end 
    48      
     48 
    4949    local data = {} 
    5050    local c = {} 
    5151    local l = nil 
    52      
     52 
    5353    for line in rawdata do 
    5454        if line:sub(1, 1) ~= " " then 
    5555            local key, val = line:match("(.-): ?(.*)%s*") 
    56              
     56 
    5757            if key and val then 
    5858                if key == "Package" then 
     
    7474        end 
    7575    end 
    76      
     76 
    7777    return data 
    7878end 
     
    8484        cmd = cmd .. " '" .. pkg:gsub("'", "") .. "'" 
    8585    end 
    86      
     86 
    8787    -- IPKG sometimes kills the whole machine because it sucks 
    8888    -- Therefore we have to use a sucky approach too and use 
     
    148148    return _action("upgrade") 
    149149end 
    150