1 -- Copyright 2008 Steven Barth <steven@midlink.org>
2 -- Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org>
3 -- Licensed to the public under the Apache License 2.0.
5 local ipkgfile = "/etc/opkg.conf"
6 local distfeeds = "/etc/opkg/distfeeds.conf"
7 local customfeeds = "/etc/opkg/customfeeds.conf"
9 f = SimpleForm("ipkgconf", translate("OPKG-Configuration"), translate("General options for opkg"))
11 f:append(Template("admin_system/ipkg"))
13 t = f:field(TextValue, "lines")
17 return nixio.fs.readfile(ipkgfile) or ""
20 function t.write(self, section, data)
21 return nixio.fs.writefile(ipkgfile, data:gsub("\r\n", "\n"))
24 function f.handle(self, state, data)
28 g = SimpleForm("distfeedconf", translate("Distribution feeds"),
29 translate("Build/distribution specific feed definitions. This file will NOT be preserved in any sysupgrade."))
31 d = g:field(TextValue, "lines2")
35 return nixio.fs.readfile(distfeeds) or ""
38 function d.write(self, section, data)
39 return nixio.fs.writefile(distfeeds, data:gsub("\r\n", "\n"))
42 function g.handle(self, state, data)
46 h = SimpleForm("customfeedconf", translate("Custom feeds"),
47 translate("Custom feed definitions, e.g. private feeds. This file can be preserved in a sysupgrade."))
49 c = h:field(TextValue, "lines3")
53 return nixio.fs.readfile(customfeeds) or ""
56 function c.write(self, section, data)
57 return nixio.fs.writefile(customfeeds, data:gsub("\r\n", "\n"))
60 function h.handle(self, state, data)