diff options
author | Steven Barth <steven@midlink.org> | 2008-03-30 19:25:31 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-03-30 19:25:31 +0000 |
commit | 1bf67dcd798e6edc859e74c77b194928d7f63fbe (patch) | |
tree | 8df67a3ac9228a72daac8149d16c075ad9686038 /src/ffluci/model | |
parent | 9b4e269bea4db2e75d3d33757a53d2ab89bf05bf (diff) |
* Moved exec, execl from ffluci.util to ffluci.sys
* Introduced stub for ffluci.model.ipkg
Diffstat (limited to 'src/ffluci/model')
-rw-r--r-- | src/ffluci/model/cbi/admin_wifi/devices.lua | 4 | ||||
-rw-r--r-- | src/ffluci/model/ipkg.lua | 29 | ||||
-rw-r--r-- | src/ffluci/model/uci.lua | 7 |
3 files changed, 35 insertions, 5 deletions
diff --git a/src/ffluci/model/cbi/admin_wifi/devices.lua b/src/ffluci/model/cbi/admin_wifi/devices.lua index 7ef794c7e..0b1b9a2ff 100644 --- a/src/ffluci/model/cbi/admin_wifi/devices.lua +++ b/src/ffluci/model/cbi/admin_wifi/devices.lua @@ -1,5 +1,4 @@ -- ToDo: Translate, Add descriptions and help texts -require("ffluci.util") m = Map("wireless", "Geräte") @@ -16,8 +15,9 @@ t:value("atheros") t:value("mac80211") t:value("prism2") --[[ +require("ffluci.sys") local c = ". /etc/functions.sh;for i in /lib/wifi/*;do . $i;done;echo $DRIVERS" -for driver in ffluci.util.execl(c)[1]:gmatch("[^ ]+") do +for driver in ffluci.sys.execl(c)[1]:gmatch("[^ ]+") do t:value(driver) end ]]-- diff --git a/src/ffluci/model/ipkg.lua b/src/ffluci/model/ipkg.lua new file mode 100644 index 000000000..a0ca8a827 --- /dev/null +++ b/src/ffluci/model/ipkg.lua @@ -0,0 +1,29 @@ +--[[ +FFLuCI - IPKG wrapper library + +Description: +Wrapper for the ipkg Package manager + +Any return value of false or nil can be interpreted as an error + +FileId: +$Id$ + +License: +Copyright 2008 Steven Barth <steven@midlink.org> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +]]-- +module("ffluci.model.ipkg", package.seeall) +require("ffluci.sys") diff --git a/src/ffluci/model/uci.lua b/src/ffluci/model/uci.lua index 6585c66cb..94a385c7e 100644 --- a/src/ffluci/model/uci.lua +++ b/src/ffluci/model/uci.lua @@ -32,6 +32,7 @@ limitations under the License. module("ffluci.model.uci", package.seeall) require("ffluci.util") require("ffluci.fs") +require("ffluci.sys") -- The OS uci command ucicmd = "uci" @@ -135,7 +136,7 @@ end -- Internal functions -- function Session._uci(self, cmd) - local res = ffluci.util.exec(self.ucicmd .. " 2>/dev/null " .. cmd) + local res = ffluci.sys.exec(self.ucicmd .. " 2>/dev/null " .. cmd) if res:len() == 0 then return nil @@ -145,7 +146,7 @@ function Session._uci(self, cmd) end function Session._uci2(self, cmd) - local res = ffluci.util.exec(self.ucicmd .. " 2>&1 " .. cmd) + local res = ffluci.sys.exec(self.ucicmd .. " 2>&1 " .. cmd) if res:len() > 0 then return false, res @@ -155,7 +156,7 @@ function Session._uci2(self, cmd) end function Session._uci3(self, cmd) - local res = ffluci.util.execl(self.ucicmd .. " 2>&1 " .. cmd) + local res = ffluci.sys.execl(self.ucicmd .. " 2>&1 " .. cmd) if res[1]:sub(1, ucicmd:len() + 1) == ucicmd .. ":" then return nil, res[1] end |