diff options
-rw-r--r-- | acfupdate-model.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/acfupdate-model.lua b/acfupdate-model.lua index 7923c01..894889a 100644 --- a/acfupdate-model.lua +++ b/acfupdate-model.lua @@ -2,6 +2,7 @@ module (..., package.seeall) require("fs") +require("format") -- no initializer in model - use controller.init for that -- ############################################################### @@ -48,6 +49,7 @@ diffs = function (self) local updates = {} local cmdresult = {} updates.svnurl = svnurl + table.insert(cmdresult, {name="INFORMATION", updates="<p class=attention>Important information.</p><p>In the following output all html-brackets < and > are replaced to [ and ].<BR>This is to be able to display the diffs in text (perhibit the browser to display the diff as graphics).</p>"}) for list in string.gmatch((querycmd("/usr/bin/svn list " .. svnurl )), "%S+") do local updateresult = "" if (list == "core/") then @@ -55,6 +57,9 @@ diffs = function (self) elseif ( fs.is_dir("/usr/share/acf/app/" .. list)) then updateresult = querycmd("/usr/bin/svn diff /usr/share/acf/app/" .. list .. " 2>&1") end + updateresult = format.search_replace({updateresult},"<","[") + updateresult = format.search_replace(updateresult,">","]") + updateresult = table.concat(updateresult, "\n") table.insert(cmdresult, {name=list, updates=updateresult}) end updates.cmdresult = cmdresult |