summaryrefslogtreecommitdiffstats
path: root/fetchmail-model.lua
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
commit38e9a058e30495487112517bf0a8365d3e909db8 (patch)
treeede7efef579ba20415fe0e22664ee7d337e2f850 /fetchmail-model.lua
parent08e37117699ccc375c39891aa8aab4288645a405 (diff)
downloadacf-fetchmail-38e9a058e30495487112517bf0a8365d3e909db8.tar.bz2
acf-fetchmail-38e9a058e30495487112517bf0a8365d3e909db8.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/fetchmail/trunk@1535 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'fetchmail-model.lua')
-rw-r--r--fetchmail-model.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/fetchmail-model.lua b/fetchmail-model.lua
index 8aa114f..fa7dbf2 100644
--- a/fetchmail-model.lua
+++ b/fetchmail-model.lua
@@ -4,7 +4,7 @@ module(..., package.seeall)
require("modelfunctions")
require("posix")
require("fs")
-require("getopts")
+require("format")
require("validator")
-- Set variables
@@ -338,7 +338,7 @@ function getconfig()
end
end
- local confd = getopts.getoptsfromfile(confdfile, "", "polling_period")
+ local confd = format.parse_configfile2(fs.read_file(confdfile), "", "polling_period")
if confd then
interval.value = confd
end
@@ -376,7 +376,7 @@ function updateconfig(conf)
posix.chmod(configfile, "rwx--x---")
config = nil
- getopts.setoptsinfile(confdfile, "", "polling_period", '"'..conf.value.interval.value..'"')
+ fs.write_file(confdfile, format.update_configfile2(fs.read_file(confdfile) or "", "", "polling_period", '"'..conf.value.interval.value..'"'))
else
conf.errtxt = "Failed to set configuration"
end