From f478fe6c4351749520730f65550f29b57eb107fb Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 14 Sep 2022 14:26:36 +0200 Subject: luci-mod-system: drop unused Lua code Drop an unused, leftover Lua cbi model from the system module. Signed-off-by: Jo-Philipp Wich --- .../luasrc/model/cbi/admin_system/backupfiles.lua | 87 ---------------------- 1 file changed, 87 deletions(-) delete mode 100644 modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua (limited to 'modules') diff --git a/modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua b/modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua deleted file mode 100644 index 91c6549163..0000000000 --- a/modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua +++ /dev/null @@ -1,87 +0,0 @@ --- Copyright 2008 Steven Barth --- Copyright 2011 Jo-Philipp Wich --- Licensed to the public under the Apache License 2.0. - -if luci.http.formvalue("cbid.luci.1._list") then - luci.http.redirect(luci.dispatcher.build_url("admin/system/flashops/backupfiles") .. "?display=list") -elseif luci.http.formvalue("cbid.luci.1._edit") then - luci.http.redirect(luci.dispatcher.build_url("admin/system/flashops/backupfiles") .. "?display=edit") - return -end - -m = SimpleForm("luci", translate("Backup file list")) -m:append(Template("admin_system/backupfiles")) - -if luci.http.formvalue("display") ~= "list" then - f = m:section(SimpleSection, nil, translate("This is a list of shell glob patterns for matching files and directories to include during sysupgrade. Modified files in /etc/config/ and certain other configurations are automatically preserved.")) - - l = f:option(Button, "_list", translate("Show current backup file list")) - l.inputtitle = translate("Open list...") - l.inputstyle = "apply" - - c = f:option(TextValue, "_custom") - c.forcewrite = true - c.rmempty = true - c.cols = 70 - c.rows = 30 - - c.cfgvalue = function(self, section) - return nixio.fs.readfile("/etc/sysupgrade.conf") - end - - m.handle = function(self, state, data) - if state == FORM_VALID then - if data._custom then - nixio.fs.writefile("/etc/sysupgrade.conf", data._custom:gsub("\r\n", "\n")) - else - nixio.fs.writefile("/etc/sysupgrade.conf", "") - end - end - return true - end -else - m.submit = false - m.reset = false - - f = m:section(SimpleSection, nil, translate("Below is the determined list of files to backup. It consists of changed configuration files marked by opkg, essential base files and the user defined backup patterns.")) - - l = f:option(Button, "_edit", translate("Back to configuration")) - l.inputtitle = translate("Close list...") - l.inputstyle = "link" - - - d = f:option(DummyValue, "_detected") - d.rawhtml = true - d.cfgvalue = function(s) - local list = io.popen( - "( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' /etc/sysupgrade.conf " .. - "/lib/upgrade/keep.d/* 2>/dev/null) -type f 2>/dev/null; " .. - "opkg list-changed-conffiles ) | sort -u" - ) - - if list then - local files = { "
    " } - - while true do - local ln = list:read("*l") - if not ln then - break - else - files[#files+1] = "
  • " - files[#files+1] = luci.xml.pcdata(ln) - files[#files+1] = "
  • " - end - end - - list:close() - files[#files+1] = "
" - - return table.concat(files, "") - end - - return "" .. translate("No files found") .. "" - end - -end - -return m -- cgit v1.2.3