X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fmodel%2Fcbi%2Fadmin_system%2Fipkg.lua;h=b01b5dbb3e60fcf41a4b8aa3d3fbe3f4f9767a6a;hp=e9ff5b1460bcef3c071aa62f7b8ecd6f631d7a88;hb=a42c0bb6182fdde7591d1f1b163a9a3354b45f5a;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92 diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/ipkg.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/ipkg.lua index e9ff5b146..b01b5dbb3 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/ipkg.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/ipkg.lua @@ -1,21 +1,12 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth -Copyright 2008-2011 Jo-Philipp Wich - -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 - -$Id$ -]]-- +-- Copyright 2008 Steven Barth +-- Copyright 2008-2011 Jo-Philipp Wich +-- Licensed to the public under the Apache License 2.0. local ipkgfile = "/etc/opkg.conf" +local distfeeds = "/etc/opkg/distfeeds.conf" +local customfeeds = "/etc/opkg/customfeeds.conf" -f = SimpleForm("ipkgconf", translate("OPKG-Configuration")) +f = SimpleForm("ipkgconf", translate("OPKG-Configuration"), translate("General options for opkg")) f:append(Template("admin_system/ipkg")) @@ -33,4 +24,38 @@ function f.handle(self, state, data) return true end -return f +g = SimpleForm("distfeedconf", translate("Distribution feeds"), + translate("Build/distribution specific feed definitions. This file will NOT be preserved in any sysupgrade.")) + +d = g:field(TextValue, "lines2") +d.rows = 10 +function d.cfgvalue() + return nixio.fs.readfile(distfeeds) or "" +end + +function d.write(self, section, data) + return nixio.fs.writefile(distfeeds, data:gsub("\r\n", "\n")) +end + +function g.handle(self, state, data) + return true +end + +h = SimpleForm("customfeedconf", translate("Custom feeds"), + translate("Custom feed definitions, e.g. private feeds. This file can be preserved in a sysupgrade.")) + +c = h:field(TextValue, "lines3") +c.rows = 10 +function c.cfgvalue() + return nixio.fs.readfile(customfeeds) or "" +end + +function c.write(self, section, data) + return nixio.fs.writefile(customfeeds, data:gsub("\r\n", "\n")) +end + +function h.handle(self, state, data) + return true +end + +return f, g, h