From cef3203f735103a2e0e1ddefdf8686c94c712ec9 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 19 Dec 2017 12:25:16 -0200 Subject: Use util.warning instead of printerr with "Warning: " --- src/luarocks/build.lua | 2 +- src/luarocks/cmd/install.lua | 2 +- src/luarocks/cmd/new_version.lua | 4 ++-- src/luarocks/core/vers.lua | 2 +- src/luarocks/fs/lua.lua | 2 +- src/luarocks/fs/unix.lua | 2 +- src/luarocks/repos.lua | 2 +- src/luarocks/upload/api.lua | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index 74135379..e2419e55 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua @@ -180,7 +180,7 @@ function build.build_rockspec(rockspec_file, need_to_fetch, minimal_mode, deps_m end if deps_mode == "none" then - util.printerr("Warning: skipping dependency checks.") + util.warning("skipping dependency checks.") else local ok, err, errcode = deps.fulfill_dependencies(rockspec, deps_mode) if err then diff --git a/src/luarocks/cmd/install.lua b/src/luarocks/cmd/install.lua index 8b4a154b..018e9246 100644 --- a/src/luarocks/cmd/install.lua +++ b/src/luarocks/cmd/install.lua @@ -66,7 +66,7 @@ function install.install_binary_rock(rock_file, deps_mode) end if deps_mode == "none" then - util.printerr("Warning: skipping dependency checks.") + util.warning("skipping dependency checks.") else ok, err, errcode = deps.check_external_deps(rockspec, "install") if err then return nil, err, errcode end diff --git a/src/luarocks/cmd/new_version.lua b/src/luarocks/cmd/new_version.lua index 5149f924..f1181d40 100644 --- a/src/luarocks/cmd/new_version.lua +++ b/src/luarocks/cmd/new_version.lua @@ -59,7 +59,7 @@ end local function check_url_and_update_md5(out_rs) local file, temp_dir = fetch.fetch_url_at_temp_dir(out_rs.source.url, "luarocks-new-version-"..out_rs.package) if not file then - util.printerr("Warning: invalid URL - "..temp_dir) + util.warning("invalid URL - "..temp_dir) return true, false end @@ -118,7 +118,7 @@ local function update_source_section(out_rs, url, tag, old_ver, new_ver) return nil, md5_changed end if md5_changed then - util.printerr("Warning: URL is the same, but MD5 has changed. Old rockspec is broken.") + util.warning("URL is the same, but MD5 has changed. Old rockspec is broken.") end return true end diff --git a/src/luarocks/core/vers.lua b/src/luarocks/core/vers.lua index 864cc5b5..c8c66a1f 100644 --- a/src/luarocks/core/vers.lua +++ b/src/luarocks/core/vers.lua @@ -115,7 +115,7 @@ function vers.parse_version(vstring) -- extract a word token, rest = v:match("^(%a+)[%.%-%_]*(.*)") if not token then - util.printerr("Warning: version number '"..v.."' could not be parsed.") + util.warning("version number '"..v.."' could not be parsed.") version[i] = 0 break end diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index 7b6505c2..8fe2466c 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua @@ -696,7 +696,7 @@ function fs_lua.download(url, filename, cache) end if https_err then if not downloader_warning then - util.printerr("Warning: falling back to "..cfg.downloader.." - install luasec to get native HTTPS support") + util.warning("falling back to "..cfg.downloader.." - install luasec to get native HTTPS support") downloader_warning = true end return fs.use_downloader(url, filename, cache) diff --git a/src/luarocks/fs/unix.lua b/src/luarocks/fs/unix.lua index 89e3ec73..daa60c15 100644 --- a/src/luarocks/fs/unix.lua +++ b/src/luarocks/fs/unix.lua @@ -104,7 +104,7 @@ function unix.is_actual_binary(filename) local first = file:read(2) file:close() if not first then - util.printerr("Warning: could not read "..filename) + util.warning("could not read "..filename) return true end return first ~= "#!" diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index 1abb5628..c20d3589 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua @@ -300,7 +300,7 @@ function repos.deploy_files(name, version, wrap_bin_scripts, deps_mode) backup = backup.."~" until not fs.exists(backup) -- Slight race condition here, but shouldn't be a problem. - util.printerr("Warning: "..suffixed_target.." is not tracked by this installation of LuaRocks. Moving it to "..backup) + util.warning(suffixed_target.." is not tracked by this installation of LuaRocks. Moving it to "..backup) local move_ok, move_err = fs.move(suffixed_target, backup) if not move_ok then return nil, move_err end end diff --git a/src/luarocks/upload/api.lua b/src/luarocks/upload/api.lua index 99162e75..ff00850e 100644 --- a/src/luarocks/upload/api.lua +++ b/src/luarocks/upload/api.lua @@ -62,7 +62,7 @@ function Api:check_version() return nil, "Your upload client is too out of date to continue, please upgrade LuaRocks." end if res.version ~= tool_version then - util.printerr("Warning: Your LuaRocks is out of date, consider upgrading.") + util.warning("your LuaRocks is out of date, consider upgrading.") end end return true -- cgit v1.2.3-55-g6feb