diff options
Diffstat (limited to 'acfupdate-model.lua')
-rw-r--r-- | acfupdate-model.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/acfupdate-model.lua b/acfupdate-model.lua index 82ee059..b713c18 100644 --- a/acfupdate-model.lua +++ b/acfupdate-model.lua @@ -85,3 +85,28 @@ status = function (self) updates.cmdresult = cmdresult return updates end +log = function (self) + local svnurl = "svn://svn.alpinelinux.org/acf/" + local updates = {} + local cmdresult = {} + local enddate = tostring(os.date("%Y-%m-%d", (os.time() - (3600 * 24) * 7))) + local svnresult = querycmd("/usr/bin/svn log -v -rHEAD:{".. enddate .. "} " .. svnurl ) +-- for k,v in pairs(format.string_to_table("r%d+%s+", svnresult)) do + local svnheader = os.date("%Y-%m-%d") + local svnupdates = "" + table.insert(cmdresult, {name="INFORMATION", updates="<p>This is the result of svn log 1 week back in time.</p><p> svn log -v -rHEAD:{".. enddate .. "} " .. svnurl .. "</p>"}) + + for v in string.gmatch(svnresult,"(.-\n)") do + local svnheader_tmp = string.match(v, "r%d+%s+.-(%d+%-%d+%-%d+)") + if (svnheader_tmp) and (svnheader_tmp ~= svnheader) then + table.insert(cmdresult,{ + ["updates"] = svnupdates, + ["name"] = svnheader, }) + svnheader = svnheader_tmp + svnupdates = "" + end + svnupdates = svnupdates .. v + end + updates.cmdresult = cmdresult + return updates +end |