# HG changeset patch # User bsw # Date 1340893862 -7200 # Node ID f49cdfb725670864a4101840ec10b2d1a7293a56 # Parent 161cebfc44d4b0fedba04f9770f5cef1e1e818ac Migration of extos calls from os.* to extos.* comleted diff -r 161cebfc44d4 -r f49cdfb72567 app/main/draft/diff.lua --- a/app/main/draft/diff.lua Thu Jun 28 16:16:02 2012 +0200 +++ b/app/main/draft/diff.lua Thu Jun 28 16:31:02 2012 +0200 @@ -73,7 +73,7 @@ new_draft_file:write("\n") new_draft_file:close() -local output, err, status = os.pfilter(nil, "sh", "-c", "diff -U 1000000000 '" .. old_draft_filename .. "' '" .. new_draft_filename .. "' | grep -v ^--- | grep -v ^+++ | grep -v ^@") +local output, err, status = extos.pfilter(nil, "sh", "-c", "diff -U 1000000000 '" .. old_draft_filename .. "' '" .. new_draft_filename .. "' | grep -v ^--- | grep -v ^+++ | grep -v ^@") os.remove(old_draft_filename) os.remove(new_draft_filename) diff -r 161cebfc44d4 -r f49cdfb72567 app/main/index/document.lua --- a/app/main/index/document.lua Thu Jun 28 16:16:02 2012 +0200 +++ b/app/main/index/document.lua Thu Jun 28 16:31:02 2012 +0200 @@ -17,7 +17,7 @@ util.help("index.document", _"Download documents") -local file_list = os.listdir(config.document_dir) +local file_list = extos.listdir(config.document_dir) local tmp = {} for i, filename in ipairs(file_list) do diff -r 161cebfc44d4 -r f49cdfb72567 app/main/index/download.lua --- a/app/main/index/download.lua Thu Jun 28 16:16:02 2012 +0200 +++ b/app/main/index/download.lua Thu Jun 28 16:31:02 2012 +0200 @@ -25,7 +25,7 @@ } -local file_list = os.listdir(config.download_dir) +local file_list = extos.listdir(config.download_dir) local tmp = {} for i, filename in ipairs(file_list) do diff -r 161cebfc44d4 -r f49cdfb72567 config/default.lua --- a/config/default.lua Thu Jun 28 16:16:02 2012 +0200 +++ b/config/default.lua Thu Jun 28 16:31:02 2012 +0200 @@ -1,13 +1,3 @@ --- forward compatibility for webmcp 1.2 -if not os.pfilter then - os.pfilter = extos.pfilter -end -if not os.listdir then - os.listdir = extos.listdir -end -if not os.crypt then - os.crypt = extos.crypt -end config.app_name = "LiquidFeedback" config.app_version = "2.beta12" @@ -39,8 +29,8 @@ config.member_image_content_type = "image/jpeg" config.member_image_convert_func = { - avatar = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end, - photo = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end + avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end, + photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end } config.member_image_default_file = { diff -r 161cebfc44d4 -r f49cdfb72567 config/example.lua --- a/config/example.lua Thu Jun 28 16:16:02 2012 +0200 +++ b/config/example.lua Thu Jun 28 16:31:02 2012 +0200 @@ -39,8 +39,8 @@ config.member_image_content_type = "image/jpeg" config.member_image_convert_func = { - avatar = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end, - photo = function(data) return os.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end + avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end, + photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end } config.member_image_default_file = { diff -r 161cebfc44d4 -r f49cdfb72567 env/format/wiki_text.lua --- a/env/format/wiki_text.lua Thu Jun 28 16:16:02 2012 +0200 +++ b/env/format/wiki_text.lua Thu Jun 28 16:31:02 2012 +0200 @@ -1,7 +1,7 @@ function format.wiki_text(wiki_text, formatting_engine) local formatting_engine = formatting_engine or "rocketwiki" local html, errmsg, exitcode = assert( - os.pfilter(wiki_text, config.formatting_engine_executeables[formatting_engine]) + extos.pfilter(wiki_text, config.formatting_engine_executeables[formatting_engine]) ) if exitcode > 0 then error("Wiki parser process returned with error code " .. tostring(exitcode)) diff -r 161cebfc44d4 -r f49cdfb72567 env/net/curl.lua --- a/env/net/curl.lua Thu Jun 28 16:16:02 2012 +0200 +++ b/env/net/curl.lua Thu Jun 28 16:31:02 2012 +0200 @@ -1,5 +1,5 @@ function net.curl(url) - local stdout, errmsg, status = os.pfilter(nil, "curl", url) + local stdout, errmsg, status = extos.pfilter(nil, "curl", url) if not stdout then error("Error while executing curl: " .. errmsg) end diff -r 161cebfc44d4 -r f49cdfb72567 model/member.lua --- a/model/member.lua Thu Jun 28 16:16:02 2012 +0200 +++ b/model/member.lua Thu Jun 28 16:31:02 2012 +0200 @@ -270,20 +270,20 @@ end function Member.object:set_password(password) - local hash = os.crypt( + local hash = extos.crypt( password, "$1$" .. multirand.string( 8, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./" ) ) - assert(hash, "os.crypt failed") + assert(hash, "extos.crypt failed") self.password = hash end function Member.object:check_password(password) if type(password) == "string" and type(self.password) == "string" then - return os.crypt(password, self.password) == self.password + return extos.crypt(password, self.password) == self.password else return false end