summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-09-29 18:01:28 +0000
committerTed Trask <ttrask01@yahoo.com>2008-09-29 18:01:28 +0000
commit2066d2d00fa2b39810d3c0fcaee629af8f5448fb (patch)
tree22c8c3a6ca3a4b47c8c599f29ff37118f6881cd5
parentfaeaa58e505a7f8aa1d159b04753da0315e94968 (diff)
downloadacf-alpine-conf-2066d2d00fa2b39810d3c0fcaee629af8f5448fb.tar.bz2
acf-alpine-conf-2066d2d00fa2b39810d3c0fcaee629af8f5448fb.tar.xz
Removed getopts library and added functionality to format library as opts_to_table, table_to_opts, parse_configfile2, update_configfile2, get_section, and set_section. New functions work on strings, not files. Modified all code using getopts to use format instead. Fixed nil string bugs in TCPProxy. Fixed forward only bug in DNSCache.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-conf/trunk@1535 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--lbu-model.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/lbu-model.lua b/lbu-model.lua
index 0ff1b96..bda4b8c 100644
--- a/lbu-model.lua
+++ b/lbu-model.lua
@@ -4,7 +4,6 @@ module (..., package.seeall)
require("modelfunctions")
require("fs")
require("format")
-require("getopts")
require("validator")
-- Set variables
@@ -172,7 +171,7 @@ end
local was_mounted
local mnt
local function mount()
- local configopts = getopts.getoptsfromfile(configfile, "") or {}
+ local configopts = format.parse_configfile2(fs.read_file(configfile), "") or {}
mnt = "/media/"..configopts.LBU_MEDIA
local f = io.popen("grep "..mnt.." /proc/mounts")
local cmdresult = f:read("*a")
@@ -233,9 +232,9 @@ function getconfig (configcontents)
local config = {}
local configopts = {}
if configcontents then
- configopts = getopts.getoptsfromfile(configcontents, "") or {}
+ configopts = format.parse_configfile2(configcontents, "") or {}
elseif (fs.is_file(configfile)) then
- configopts = getopts.getoptsfromfile(configfile, "") or {}
+ configopts = format.parse_configfile2(fs.read_file(configfile), "") or {}
end
config["LBU_MEDIA"] = cfe({
value=configopts.LBU_MEDIA or "",