-- acf model for displaying logfiles recusivly module (..., package.seeall) require("fs") require("format") -- no initializer in model - use controller.init for that -- ############################################################### -- Private functions local function querycmd ( cmdline ) local cmd = io.popen( cmdline ) local cmd_result = cmd:read("*a") or "unknown" cmd:close() return cmd_result end -- ############################################################### -- Public functions get = function (self) local svnurl = "svn://svn.alpinelinux.org/acf/" return querycmd("/usr/bin/svn list -v " .. svnurl ) end update = function (self) local svnurl = "svn://svn.alpinelinux.org/acf/" local updates = {} local cmdresult = {} updates.svnurl = svnurl for list in string.gmatch((querycmd("/usr/bin/svn list " .. svnurl )), "%S+") do local updateresult = "" if (list == "core/") then updateresult = querycmd("/usr/bin/svn up /usr/share/acf/ 2>&1") elseif ( fs.is_dir("/usr/share/acf/app/" .. list)) then updateresult = querycmd("/usr/bin/svn up /usr/share/acf/app/" .. list .. " 2>&1") elseif (list ~= "sandbox/") then updateresult = querycmd("/usr/bin/svn co " .. svnurl .. list .."trunk/ /usr/share/acf/app/" .. list .. " 2>&1") end -- Hide projects without updates if (string.match(updateresult, "^At revision.*")) then updateresult = "" end table.insert(cmdresult, {name=list, updates=updateresult}) end updates.cmdresult = cmdresult return updates end diffs = function (self) local svnurl = "svn://svn.alpinelinux.org/acf/" local updates = {} local cmdresult = {} updates.svnurl = svnurl table.insert(cmdresult, {name="INFORMATION", updates="
Important information.
In the following output all html-brackets < and > are replaced to [ and ].
This is to be able to display the diffs in text (perhibit the browser to display the diff as graphics).