From b5ee7f79b2d0e54209d714a5eca640d338e17ac6 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Sun, 22 May 2016 19:45:57 +0300 Subject: write-rockspec: infer git and hg urls from local repos --- src/luarocks/write_rockspec.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/luarocks/write_rockspec.lua b/src/luarocks/write_rockspec.lua index abfca322..9b6593b6 100644 --- a/src/luarocks/write_rockspec.lua +++ b/src/luarocks/write_rockspec.lua @@ -3,6 +3,7 @@ local write_rockspec = {} package.loaded["luarocks.write_rockspec"] = write_rockspec +local cfg = require("luarocks.cfg") local dir = require("luarocks.dir") local fetch = require("luarocks.fetch") local fs = require("luarocks.fs") @@ -111,6 +112,32 @@ local function detect_mit_license(data) return sum == 78656 end +local simple_scm_protocols = { + git = true, ["git+http"] = true, ["git+https"] = true, + hg = true, ["hg+http"] = true, ["hg+https"] = true +} + +local function detect_url_from_command(program, args, directory) + local command = fs.Q(cfg.variables[program:upper()]).. " "..args + local pipe = io.popen(fs.command_at(directory, fs.quiet_stderr(command))) + if not pipe then return nil end + local url = pipe:read("*a"):match("^([^\r\n]+)") + pipe:close() + if not url then return nil end + if not util.starts_with(url, program.."://") then + url = program.."+"..url + end + + if simple_scm_protocols[dir.split_url(url)] then + return url + end +end + +local function detect_scm_url(directory) + return detect_url_from_command("git", "config --get remote.origin.url", directory) or + detect_url_from_command("hg", "paths default", directory) +end + local function show_license(rockspec) local fd = open_file("COPYING") or open_file("LICENSE") or open_file("MIT-LICENSE.txt") if not fd then return nil end @@ -290,6 +317,8 @@ function write_rockspec.run(...) else local_dir = nil end + else + rockspec.source.url = detect_scm_url(local_dir) or rockspec.source.url end if not local_dir then -- cgit v1.2.3-55-g6feb From 24fa7d2c2c8f9032b66a290be0d2d2623c6904b4 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Mon, 23 May 2016 14:01:37 +0300 Subject: write-rockspec: improve homepage detection * Perform detection later to take into account URL inferred from local scm repo. * Support more protocols instead of just 'git://'. * Support Bitbucket and Gitlab in addition to Github. * Strip trailing '.git'. --- src/luarocks/write_rockspec.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/luarocks/write_rockspec.lua b/src/luarocks/write_rockspec.lua index 9b6593b6..213d1b01 100644 --- a/src/luarocks/write_rockspec.lua +++ b/src/luarocks/write_rockspec.lua @@ -266,10 +266,6 @@ function write_rockspec.run(...) version = version or "scm" local filename = flags["output"] or dir.path(fs.current_dir(), name:lower().."-"..version.."-1.rockspec") - - if not flags["homepage"] and url_or_dir:match("^git://github.com") then - flags["homepage"] = "http://"..url_or_dir:match("^[^:]+://(.*)") - end local rockspec = { rockspec_format = flags["rockspec-format"], @@ -324,6 +320,19 @@ function write_rockspec.run(...) if not local_dir then local_dir = "." end + + if not flags["homepage"] then + local url_protocol, url_path = dir.split_url(rockspec.source.url) + + if simple_scm_protocols[url_protocol] then + for _, domain in ipairs({"github.com", "bitbucket.org", "gitlab.com"}) do + if util.starts_with(url_path, domain) then + rockspec.description.homepage = "https://"..url_path:gsub("%.git$", "") + break + end + end + end + end local libs = nil if flags["lib"] then -- cgit v1.2.3-55-g6feb From f41e1da03b2c2aaf4c145ff83d10dfa07c2395ca Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Wed, 25 May 2016 11:09:15 +0300 Subject: luarocks make: move rockspec picking into an util function --- src/luarocks/make.lua | 59 ++++------------------------------------------ src/luarocks/util.lua | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 55 deletions(-) diff --git a/src/luarocks/make.lua b/src/luarocks/make.lua index 78c43d91..5058da79 100644 --- a/src/luarocks/make.lua +++ b/src/luarocks/make.lua @@ -49,33 +49,6 @@ To install rocks, you'll normally want to use the "install" and ]] ---- Collect rockspecs located in a subdirectory. --- @param versions table: A table mapping rock names to newest rockspec versions. --- @param paths table: A table mapping rock names to newest rockspec paths. --- @param unnamed_paths table: An array of rockspec paths that don't contain rock --- name and version in regular format. --- @param subdir string: path to subdirectory. -local function collect_rockspecs(versions, paths, unnamed_paths, subdir) - if fs.is_dir(subdir) then - for file in fs.dir(subdir) do - file = dir.path(subdir, file) - - if file:match("rockspec$") and fs.is_file(file) then - local rock, version = path.parse_name(file) - - if rock then - if not versions[rock] or deps.compare_versions(version, versions[rock]) then - versions[rock] = version - paths[rock] = file - end - else - table.insert(unnamed_paths, file) - end - end - end - end -end - --- Driver function for "make" command. -- @param name string: A local rockspec. -- @return boolean or (nil, string, exitcode): True if build was successful; nil and an @@ -85,34 +58,10 @@ function make.run(...) assert(type(rockspec) == "string" or not rockspec) if not rockspec then - -- Try to infer default rockspec name. - local versions, paths, unnamed_paths = {}, {}, {} - -- Look for rockspecs in some common locations. - collect_rockspecs(versions, paths, unnamed_paths, ".") - collect_rockspecs(versions, paths, unnamed_paths, "rockspec") - collect_rockspecs(versions, paths, unnamed_paths, "rockspecs") - - if #unnamed_paths > 0 then - -- There are rockspecs not following "name-version.rockspec" format. - -- More than one are ambiguous. - if #unnamed_paths > 1 then - return nil, "Please specify which rockspec file to use." - else - rockspec = unnamed_paths[1] - end - else - local rock = next(versions) - - if rock then - -- If there are rockspecs for multiple rocks it's ambiguous. - if next(versions, rock) then - return nil, "Please specify which rockspec file to use." - else - rockspec = paths[rock] - end - else - return nil, "Argument missing: please specify a rockspec to use on current directory." - end + local err + rockspec, err = util.get_default_rockspec() + if not rockspec then + return nil, err end end if not rockspec:match("rockspec$") then diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 520625c0..2f419a3d 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua @@ -520,6 +520,71 @@ function util.announce_install(rockspec) util.printout() end +--- Collect rockspecs located in a subdirectory. +-- @param versions table: A table mapping rock names to newest rockspec versions. +-- @param paths table: A table mapping rock names to newest rockspec paths. +-- @param unnamed_paths table: An array of rockspec paths that don't contain rock +-- name and version in regular format. +-- @param subdir string: path to subdirectory. +local function collect_rockspecs(versions, paths, unnamed_paths, subdir) + local fs = require("luarocks.fs") + local dir = require("luarocks.dir") + local path = require("luarocks.path") + local deps = require("luarocks.deps") + + if fs.is_dir(subdir) then + for file in fs.dir(subdir) do + file = dir.path(subdir, file) + + if file:match("rockspec$") and fs.is_file(file) then + local rock, version = path.parse_name(file) + + if rock then + if not versions[rock] or deps.compare_versions(version, versions[rock]) then + versions[rock] = version + paths[rock] = file + end + else + table.insert(unnamed_paths, file) + end + end + end + end +end + +--- Get default rockspec name for commands that take optional rockspec name. +-- @return string or (nil, string): path to the rockspec or nil and error message. +function util.get_default_rockspec() + local versions, paths, unnamed_paths = {}, {}, {} + -- Look for rockspecs in some common locations. + collect_rockspecs(versions, paths, unnamed_paths, ".") + collect_rockspecs(versions, paths, unnamed_paths, "rockspec") + collect_rockspecs(versions, paths, unnamed_paths, "rockspecs") + + if #unnamed_paths > 0 then + -- There are rockspecs not following "name-version.rockspec" format. + -- More than one are ambiguous. + if #unnamed_paths > 1 then + return nil, "Please specify which rockspec file to use." + else + return unnamed_paths[1] + end + else + local rock = next(versions) + + if rock then + -- If there are rockspecs for multiple rocks it's ambiguous. + if next(versions, rock) then + return nil, "Please specify which rockspec file to use." + else + return paths[rock] + end + else + return nil, "Argument missing: please specify a rockspec to use on current directory." + end + end +end + -- from http://lua-users.org/wiki/SplitJoin -- by PhilippeLhoste function util.split_string(str, delim, maxNb) -- cgit v1.2.3-55-g6feb From 22c8993ebe5f509ee55b8af6b7a8be147b3884e6 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Wed, 25 May 2016 11:17:14 +0300 Subject: luarocks new-version: make rockspec arg optional Infer it same way `luarocks make` does. --- src/luarocks/new_version.lua | 13 +++++++++---- test/testing.sh | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/luarocks/new_version.lua b/src/luarocks/new_version.lua index 6969d4b2..3382b85c 100644 --- a/src/luarocks/new_version.lua +++ b/src/luarocks/new_version.lua @@ -11,13 +11,14 @@ local fs = require("luarocks.fs") local type_check = require("luarocks.type_check") new_version.help_summary = "Auto-write a rockspec for a new version of a rock." -new_version.help_arguments = "[--tag=] {|} [] []" +new_version.help_arguments = "[--tag=] [|] [] []" new_version.help = [[ This is a utility function that writes a new rockspec, updating data from a previous one. If a package name is given, it downloads the latest rockspec from the -default server. If a rockspec is given, it uses it instead. +default server. If a rockspec is given, it uses it instead. If no argument +is given, it looks for a rockspec same way 'luarocks make' does. If the version number is not given and tag is passed using --tag, it is used as the version, with 'v' removed from beginning. @@ -125,12 +126,16 @@ end function new_version.run(...) local flags, input, version, url = util.parse_flags(...) if not input then - return nil, "Missing argument: expected package or rockspec. "..util.see_help("new_version") + local err + input, err = util.get_default_rockspec() + if not input then + return nil, err + end end assert(type(input) == "string") local filename = input - if not input:match(".rockspec$") then + if not input:match("rockspec$") then local err filename, err = download.download("rockspec", input) if not filename then diff --git a/test/testing.sh b/test/testing.sh index f56f2aa9..cb10441c 100755 --- a/test/testing.sh +++ b/test/testing.sh @@ -363,7 +363,6 @@ fail_unpack_noarg() { $luarocks unpack; } fail_upload_noarg() { $luarocks upload; } fail_remove_noarg() { $luarocks remove; } fail_doc_noarg() { $luarocks doc; } -fail_new_version_noarg() { $luarocks new_version; } fail_build_invalid() { $luarocks build invalid; } fail_download_invalid() { $luarocks download invalid; } @@ -446,6 +445,7 @@ test_make_pack_binary_rock() { rm -rf ./lxsh-${verrev_lxsh} && $luarocks downlo test_new_version() { $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version ./luacov-${version_luacov}-1.rockspec 0.2 && rm ./luacov-0.*; } test_new_version_url() { $luarocks download --rockspec abelhas 1.0 && $luarocks new_version ./abelhas-1.0-1.rockspec 1.1 https://github.com/downloads/ittner/abelhas/abelhas-1.1.tar.gz && rm ./abelhas-*; } test_new_version_tag() { $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version ./luacov-${version_luacov}-1.rockspec --tag v0.3 && rm ./luacov-0.3-1.rockspec; } +test_new_version_tag_without_arg() { rm -rf ./*rockspec && $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version --tag v0.3 && rm ./luacov-0.3-1.rockspec; } test_pack() { $luarocks list && $luarocks pack luacov && rm ./luacov-*.rock; } test_pack_src() { $luarocks install $luasec && $luarocks download --rockspec luasocket && $luarocks pack ./luasocket-${verrev_luasocket}.rockspec && rm ./luasocket-${version_luasocket}-*.rock; } -- cgit v1.2.3-55-g6feb From 3d21d6c12585109ef041a3389f8da1c05347aa09 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Mon, 30 May 2016 22:15:14 +0300 Subject: luarocks.persist: put pairs with number values on one line Instead of pairs with number keys. Keeps parsed version representation compact but puts items in regular arrays each on its own line. --- src/luarocks/persist.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/luarocks/persist.lua b/src/luarocks/persist.lua index 354b17c3..9407b2a4 100644 --- a/src/luarocks/persist.lua +++ b/src/luarocks/persist.lua @@ -147,7 +147,7 @@ write_table = function(out, tbl, level, field_order) end write_value(out, v, level, sub_order) - if type(k) == "number" then + if type(v) == "number" then sep = ", " indent = false else -- cgit v1.2.3-55-g6feb From 2cfc2c252304626ace9ad1700d056640a20770d2 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Tue, 31 May 2016 16:09:01 +0300 Subject: Remove unused imports in luarocks.make --- src/luarocks/make.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/luarocks/make.lua b/src/luarocks/make.lua index 5058da79..6a74f6fe 100644 --- a/src/luarocks/make.lua +++ b/src/luarocks/make.lua @@ -9,8 +9,6 @@ package.loaded["luarocks.make"] = make local build = require("luarocks.build") local fs = require("luarocks.fs") -local dir = require("luarocks.dir") -local path = require("luarocks.path") local util = require("luarocks.util") local cfg = require("luarocks.cfg") local fetch = require("luarocks.fetch") -- cgit v1.2.3-55-g6feb From d524b515c67ceded00a15c2617283f81a2f21f7c Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Tue, 31 May 2016 16:31:28 +0300 Subject: Remove commented module() calls --- src/luarocks/add.lua | 1 - src/luarocks/admin_remove.lua | 1 - src/luarocks/build.lua | 1 - src/luarocks/build/builtin.lua | 1 - src/luarocks/build/cmake.lua | 1 - src/luarocks/build/command.lua | 1 - src/luarocks/build/make.lua | 1 - src/luarocks/cache.lua | 1 - src/luarocks/command_line.lua | 1 - src/luarocks/deps.lua | 1 - src/luarocks/dir.lua | 1 - src/luarocks/doc.lua | 1 - src/luarocks/download.lua | 1 - src/luarocks/fetch.lua | 1 - src/luarocks/fetch/cvs.lua | 1 - src/luarocks/fetch/git.lua | 1 - src/luarocks/fetch/git_file.lua | 1 - src/luarocks/fetch/git_http.lua | 1 - src/luarocks/fetch/hg.lua | 1 - src/luarocks/fetch/sscm.lua | 1 - src/luarocks/fetch/svn.lua | 1 - src/luarocks/fs.lua | 1 - src/luarocks/fs/unix.lua | 1 - src/luarocks/fs/unix/tools.lua | 1 - src/luarocks/fs/win32.lua | 1 - src/luarocks/fs/win32/tools.lua | 1 - src/luarocks/help.lua | 1 - src/luarocks/index.lua | 1 - src/luarocks/install.lua | 1 - src/luarocks/lint.lua | 1 - src/luarocks/list.lua | 1 - src/luarocks/make.lua | 1 - src/luarocks/make_manifest.lua | 1 - src/luarocks/manif.lua | 1 - src/luarocks/manif_core.lua | 1 - src/luarocks/pack.lua | 1 - src/luarocks/path.lua | 1 - src/luarocks/persist.lua | 1 - src/luarocks/purge.lua | 1 - src/luarocks/refresh_cache.lua | 1 - src/luarocks/remove.lua | 1 - src/luarocks/repos.lua | 1 - src/luarocks/search.lua | 1 - src/luarocks/show.lua | 1 - src/luarocks/tools/patch.lua | 1 - src/luarocks/tools/tar.lua | 1 - src/luarocks/type_check.lua | 1 - src/luarocks/unpack.lua | 1 - src/luarocks/util.lua | 1 - src/luarocks/validate.lua | 1 - src/luarocks/write_rockspec.lua | 1 - 51 files changed, 51 deletions(-) diff --git a/src/luarocks/add.lua b/src/luarocks/add.lua index ccd303e6..bea2d861 100644 --- a/src/luarocks/add.lua +++ b/src/luarocks/add.lua @@ -1,7 +1,6 @@ --- Module implementing the luarocks-admin "add" command. -- Adds a rock or rockspec to a rocks server. ---module("luarocks.add", package.seeall) local add = {} package.loaded["luarocks.add"] = add diff --git a/src/luarocks/admin_remove.lua b/src/luarocks/admin_remove.lua index 5a1cf20b..59ca4975 100644 --- a/src/luarocks/admin_remove.lua +++ b/src/luarocks/admin_remove.lua @@ -1,7 +1,6 @@ --- Module implementing the luarocks-admin "remove" command. -- Removes a rock or rockspec from a rocks server. ---module("luarocks.admin_remove", package.seeall) local admin_remove = {} package.loaded["luarocks.admin_remove"] = admin_remove diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index c62e4694..edf4efb4 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua @@ -1,7 +1,6 @@ --- Module implementing the LuaRocks "build" command. -- Builds a rock, compiling its C parts if any. ---module("luarocks.build", package.seeall) local build = {} package.loaded["luarocks.build"] = build diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index b6062bd7..b6f53271 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua @@ -1,6 +1,5 @@ --- A builtin build system: back-end to provide a portable way of building C-based Lua modules. ---module("luarocks.build.builtin", package.seeall) local builtin = {} local unpack = unpack or table.unpack diff --git a/src/luarocks/build/cmake.lua b/src/luarocks/build/cmake.lua index 7b16fa51..da5a31f1 100644 --- a/src/luarocks/build/cmake.lua +++ b/src/luarocks/build/cmake.lua @@ -1,6 +1,5 @@ --- Build back-end for CMake-based modules. ---module("luarocks.build.cmake", package.seeall) local cmake = {} local fs = require("luarocks.fs") diff --git a/src/luarocks/build/command.lua b/src/luarocks/build/command.lua index 650e3236..62dbc282 100644 --- a/src/luarocks/build/command.lua +++ b/src/luarocks/build/command.lua @@ -1,6 +1,5 @@ --- Build back-end for raw listing of commands in rockspec files. ---module("luarocks.build.command", package.seeall) local command = {} local fs = require("luarocks.fs") diff --git a/src/luarocks/build/make.lua b/src/luarocks/build/make.lua index 0da183e9..69e73c2e 100644 --- a/src/luarocks/build/make.lua +++ b/src/luarocks/build/make.lua @@ -1,6 +1,5 @@ --- Build back-end for using Makefile-based packages. ---module("luarocks.build.make", package.seeall) local make = {} local unpack = unpack or table.unpack diff --git a/src/luarocks/cache.lua b/src/luarocks/cache.lua index fb6344d8..4a95f70e 100644 --- a/src/luarocks/cache.lua +++ b/src/luarocks/cache.lua @@ -1,7 +1,6 @@ --- Module handling the LuaRocks local cache. -- Adds a rock or rockspec to a rocks server. ---module("luarocks.cache", package.seeall) local cache = {} package.loaded["luarocks.cache"] = cache diff --git a/src/luarocks/command_line.lua b/src/luarocks/command_line.lua index a016fc72..b3284534 100644 --- a/src/luarocks/command_line.lua +++ b/src/luarocks/command_line.lua @@ -1,6 +1,5 @@ --- Functions for command-line scripts. ---module("luarocks.command_line", package.seeall) local command_line = {} local unpack = unpack or table.unpack diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 536b6c51..44998220 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua @@ -11,7 +11,6 @@ -- comparison criteria is the source code of this module, but the -- test/test_deps.lua file included with LuaRocks provides some -- insights on what these criteria are. ---module("luarocks.deps", package.seeall) local deps = {} package.loaded["luarocks.deps"] = deps diff --git a/src/luarocks/dir.lua b/src/luarocks/dir.lua index 2ef9881e..f72ebd6c 100644 --- a/src/luarocks/dir.lua +++ b/src/luarocks/dir.lua @@ -1,6 +1,5 @@ --- Generic utilities for handling pathnames. ---module("luarocks.dir", package.seeall) local dir = {} package.loaded["luarocks.dir"] = dir diff --git a/src/luarocks/doc.lua b/src/luarocks/doc.lua index 53ed0116..62e80232 100644 --- a/src/luarocks/doc.lua +++ b/src/luarocks/doc.lua @@ -1,7 +1,6 @@ --- Module implementing the LuaRocks "doc" command. -- Shows documentation for an installed rock. ---module("luarocks.doc", package.seeall) local doc = {} package.loaded["luarocks.doc"] = doc diff --git a/src/luarocks/download.lua b/src/luarocks/download.lua index 6d95d8fd..181aca75 100644 --- a/src/luarocks/download.lua +++ b/src/luarocks/download.lua @@ -1,7 +1,6 @@ --- Module implementing the luarocks "download" command. -- Download a rock from the repository. ---module("luarocks.download", package.seeall) local download = {} package.loaded["luarocks.download"] = download diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua index 2c028771..dfa6f191 100644 --- a/src/luarocks/fetch.lua +++ b/src/luarocks/fetch.lua @@ -1,6 +1,5 @@ --- Functions related to fetching and loading local and remote files. ---module("luarocks.fetch", package.seeall) local fetch = {} package.loaded["luarocks.fetch"] = fetch diff --git a/src/luarocks/fetch/cvs.lua b/src/luarocks/fetch/cvs.lua index ccf928c4..ece711b6 100644 --- a/src/luarocks/fetch/cvs.lua +++ b/src/luarocks/fetch/cvs.lua @@ -1,6 +1,5 @@ --- Fetch back-end for retrieving sources from CVS. ---module("luarocks.fetch.cvs", package.seeall) local cvs = {} local unpack = unpack or table.unpack diff --git a/src/luarocks/fetch/git.lua b/src/luarocks/fetch/git.lua index a635f190..f61d89e9 100644 --- a/src/luarocks/fetch/git.lua +++ b/src/luarocks/fetch/git.lua @@ -1,6 +1,5 @@ --- Fetch back-end for retrieving sources from GIT. ---module("luarocks.fetch.git", package.seeall) local git = {} local unpack = unpack or table.unpack diff --git a/src/luarocks/fetch/git_file.lua b/src/luarocks/fetch/git_file.lua index 0144bc2e..8d46bbca 100644 --- a/src/luarocks/fetch/git_file.lua +++ b/src/luarocks/fetch/git_file.lua @@ -1,6 +1,5 @@ --- Fetch back-end for retrieving sources from local Git repositories. ---module("luarocks.fetch.git_file", package.seeall) local git_file = {} local git = require("luarocks.fetch.git") diff --git a/src/luarocks/fetch/git_http.lua b/src/luarocks/fetch/git_http.lua index 4ecd4816..d85e2572 100644 --- a/src/luarocks/fetch/git_http.lua +++ b/src/luarocks/fetch/git_http.lua @@ -7,7 +7,6 @@ -- source = { url = "git+http://example.com/foo.git" } -- Prefer using the normal git:// fetch mode as it is more widely -- available in older versions of LuaRocks. ---module("luarocks.fetch.git_http", package.seeall) local git_http = {} local git = require("luarocks.fetch.git") diff --git a/src/luarocks/fetch/hg.lua b/src/luarocks/fetch/hg.lua index 518130b4..4cf8d028 100644 --- a/src/luarocks/fetch/hg.lua +++ b/src/luarocks/fetch/hg.lua @@ -1,6 +1,5 @@ --- Fetch back-end for retrieving sources from HG. ---module("luarocks.fetch.hg", package.seeall) local hg = {} local unpack = unpack or table.unpack diff --git a/src/luarocks/fetch/sscm.lua b/src/luarocks/fetch/sscm.lua index 53ae86a3..5add10db 100644 --- a/src/luarocks/fetch/sscm.lua +++ b/src/luarocks/fetch/sscm.lua @@ -1,6 +1,5 @@ --- Fetch back-end for retrieving sources from Surround SCM Server ---module("luarocks.fetch.sscm", package.seeall) local sscm = {} local fs = require("luarocks.fs") diff --git a/src/luarocks/fetch/svn.lua b/src/luarocks/fetch/svn.lua index 755e5e32..29bce1b5 100644 --- a/src/luarocks/fetch/svn.lua +++ b/src/luarocks/fetch/svn.lua @@ -1,6 +1,5 @@ --- Fetch back-end for retrieving sources from Subversion. ---module("luarocks.fetch.svn", package.seeall) local svn = {} local unpack = unpack or table.unpack diff --git a/src/luarocks/fs.lua b/src/luarocks/fs.lua index f3d86a13..54cc7d73 100644 --- a/src/luarocks/fs.lua +++ b/src/luarocks/fs.lua @@ -7,7 +7,6 @@ local pairs = pairs ---module("luarocks.fs", package.seeall) local fs = {} package.loaded["luarocks.fs"] = fs diff --git a/src/luarocks/fs/unix.lua b/src/luarocks/fs/unix.lua index 520b3e99..5c6b542c 100644 --- a/src/luarocks/fs/unix.lua +++ b/src/luarocks/fs/unix.lua @@ -1,6 +1,5 @@ --- Unix implementation of filesystem and platform abstractions. ---module("luarocks.fs.unix", package.seeall) local unix = {} local fs = require("luarocks.fs") diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua index 84bd53fd..7a67fb22 100644 --- a/src/luarocks/fs/unix/tools.lua +++ b/src/luarocks/fs/unix/tools.lua @@ -1,6 +1,5 @@ --- fs operations implemented with third-party tools for Unix platform abstractions. ---module("luarocks.fs.unix.tools", package.seeall) local tools = {} local fs = require("luarocks.fs") diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua index 74f3ed69..8debaeef 100644 --- a/src/luarocks/fs/win32.lua +++ b/src/luarocks/fs/win32.lua @@ -1,7 +1,6 @@ --- Windows implementation of filesystem and platform abstractions. -- Download http://unxutils.sourceforge.net/ for Windows GNU utilities -- used by this module. ---module("luarocks.fs.win32", package.seeall) local win32 = {} local fs = require("luarocks.fs") diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua index 9cb6d47a..1d47fa59 100644 --- a/src/luarocks/fs/win32/tools.lua +++ b/src/luarocks/fs/win32/tools.lua @@ -2,7 +2,6 @@ --- fs operations implemented with third-party tools for Windows platform abstractions. -- Download http://unxutils.sourceforge.net/ for Windows GNU utilities -- used by this module. ---module("luarocks.fs.win32.tools", package.seeall) local tools = {} local fs = require("luarocks.fs") diff --git a/src/luarocks/help.lua b/src/luarocks/help.lua index 5a2681a3..0f66f64b 100644 --- a/src/luarocks/help.lua +++ b/src/luarocks/help.lua @@ -4,7 +4,6 @@ -- uses a global table called "commands" to find commands -- to show help for; each command should be represented by a -- table containing "help" and "help_summary" fields. ---module("luarocks.help", package.seeall) local help = {} local util = require("luarocks.util") diff --git a/src/luarocks/index.lua b/src/luarocks/index.lua index 116bdfd2..e1f563ef 100644 --- a/src/luarocks/index.lua +++ b/src/luarocks/index.lua @@ -1,6 +1,5 @@ --- Module which builds the index.html page to be used in rocks servers. ---module("luarocks.index", package.seeall) local index = {} package.loaded["luarocks.index"] = index diff --git a/src/luarocks/install.lua b/src/luarocks/install.lua index e3ab6fac..f78c6a0d 100644 --- a/src/luarocks/install.lua +++ b/src/luarocks/install.lua @@ -1,6 +1,5 @@ --- Module implementing the LuaRocks "install" command. -- Installs binary rocks. ---module("luarocks.install", package.seeall) local install = {} package.loaded["luarocks.install"] = install diff --git a/src/luarocks/lint.lua b/src/luarocks/lint.lua index 091c8de4..81d8bab2 100644 --- a/src/luarocks/lint.lua +++ b/src/luarocks/lint.lua @@ -1,7 +1,6 @@ --- Module implementing the LuaRocks "lint" command. -- Utility function that checks syntax of the rockspec. ---module("luarocks.lint", package.seeall) local lint = {} package.loaded["luarocks.lint"] = lint diff --git a/src/luarocks/list.lua b/src/luarocks/list.lua index 8affc52f..09fa9ad7 100644 --- a/src/luarocks/list.lua +++ b/src/luarocks/list.lua @@ -1,7 +1,6 @@ --- Module implementing the LuaRocks "list" command. -- Lists currently installed rocks. ---module("luarocks.list", package.seeall) local list = {} package.loaded["luarocks.list"] = list diff --git a/src/luarocks/make.lua b/src/luarocks/make.lua index 6a74f6fe..9d675884 100644 --- a/src/luarocks/make.lua +++ b/src/luarocks/make.lua @@ -3,7 +3,6 @@ -- Builds sources in the current directory, but unlike "build", -- it does not fetch sources, etc., assuming everything is -- available in the current directory. ---module("luarocks.make", package.seeall) local make = {} package.loaded["luarocks.make"] = make diff --git a/src/luarocks/make_manifest.lua b/src/luarocks/make_manifest.lua index b6e65bf8..3d9a6bac 100644 --- a/src/luarocks/make_manifest.lua +++ b/src/luarocks/make_manifest.lua @@ -1,7 +1,6 @@ --- Module implementing the luarocks-admin "make_manifest" command. -- Compile a manifest file for a repository. ---module("luarocks.make_manifest", package.seeall) local make_manifest = {} package.loaded["luarocks.make_manifest"] = make_manifest diff --git a/src/luarocks/manif.lua b/src/luarocks/manif.lua index bc202be3..e30c2a33 100644 --- a/src/luarocks/manif.lua +++ b/src/luarocks/manif.lua @@ -2,7 +2,6 @@ -- Manifest files describe the contents of a LuaRocks tree or server. -- They are loaded into manifest tables, which are then used for -- performing searches, matching dependencies, etc. ---module("luarocks.manif", package.seeall) local manif = {} package.loaded["luarocks.manif"] = manif diff --git a/src/luarocks/manif_core.lua b/src/luarocks/manif_core.lua index 610f9860..5c8928d4 100644 --- a/src/luarocks/manif_core.lua +++ b/src/luarocks/manif_core.lua @@ -1,7 +1,6 @@ --- Core functions for querying manifest files. -- This module requires no specific 'fs' functionality. ---module("luarocks.manif_core", package.seeall) local manif_core = {} package.loaded["luarocks.manif_core"] = manif_core diff --git a/src/luarocks/pack.lua b/src/luarocks/pack.lua index e4498f5a..685b84bd 100644 --- a/src/luarocks/pack.lua +++ b/src/luarocks/pack.lua @@ -1,7 +1,6 @@ --- Module implementing the LuaRocks "pack" command. -- Creates a rock, packing sources or binaries. ---module("luarocks.pack", package.seeall) local pack = {} package.loaded["luarocks.pack"] = pack diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua index bc7ab63b..dafc64e7 100644 --- a/src/luarocks/path.lua +++ b/src/luarocks/path.lua @@ -2,7 +2,6 @@ --- LuaRocks-specific path handling functions. -- All paths are configured in this module, making it a single -- point where the layout of the local installation is defined in LuaRocks. ---module("luarocks.path", package.seeall) local path = {} local dir = require("luarocks.dir") diff --git a/src/luarocks/persist.lua b/src/luarocks/persist.lua index 9407b2a4..c2adb570 100644 --- a/src/luarocks/persist.lua +++ b/src/luarocks/persist.lua @@ -3,7 +3,6 @@ -- saving tables into files. -- Implemented separately to avoid interdependencies, -- as it is used in the bootstrapping stage of the cfg module. ---module("luarocks.persist", package.seeall) local persist = {} package.loaded["luarocks.persist"] = persist diff --git a/src/luarocks/purge.lua b/src/luarocks/purge.lua index bd5494f6..0be6ef21 100644 --- a/src/luarocks/purge.lua +++ b/src/luarocks/purge.lua @@ -1,7 +1,6 @@ --- Module implementing the LuaRocks "purge" command. -- Remove all rocks from a given tree. ---module("luarocks.purge", package.seeall) local purge = {} package.loaded["luarocks.purge"] = purge diff --git a/src/luarocks/refresh_cache.lua b/src/luarocks/refresh_cache.lua index 193e5994..cc5b9c33 100644 --- a/src/luarocks/refresh_cache.lua +++ b/src/luarocks/refresh_cache.lua @@ -1,6 +1,5 @@ --- Module implementing the luarocks-admin "refresh_cache" command. ---module("luarocks.refresh_cache", package.seeall) local refresh_cache = {} package.loaded["luarocks.refresh_cache"] = refresh_cache diff --git a/src/luarocks/remove.lua b/src/luarocks/remove.lua index 4aff3946..7a559f8f 100644 --- a/src/luarocks/remove.lua +++ b/src/luarocks/remove.lua @@ -1,7 +1,6 @@ --- Module implementing the LuaRocks "remove" command. -- Uninstalls rocks. ---module("luarocks.remove", package.seeall) local remove = {} package.loaded["luarocks.remove"] = remove diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index b6d5825a..86126a13 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua @@ -1,6 +1,5 @@ --- Functions for managing the repository on disk. ---module("luarocks.repos", package.seeall) local repos = {} package.loaded["luarocks.repos"] = repos diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua index 6c0020c0..4ec0c65e 100644 --- a/src/luarocks/search.lua +++ b/src/luarocks/search.lua @@ -1,7 +1,6 @@ --- Module implementing the LuaRocks "search" command. -- Queries LuaRocks servers. ---module("luarocks.search", package.seeall) local search = {} package.loaded["luarocks.search"] = search diff --git a/src/luarocks/show.lua b/src/luarocks/show.lua index ae41a513..1dc01cc0 100644 --- a/src/luarocks/show.lua +++ b/src/luarocks/show.lua @@ -1,6 +1,5 @@ --- Module implementing the LuaRocks "show" command. -- Shows information about an installed rock. ---module("luarocks.show", package.seeall) local show = {} package.loaded["luarocks.show"] = show diff --git a/src/luarocks/tools/patch.lua b/src/luarocks/tools/patch.lua index debaf636..44d00ef8 100644 --- a/src/luarocks/tools/patch.lua +++ b/src/luarocks/tools/patch.lua @@ -8,7 +8,6 @@ -- Project home: http://code.google.com/p/python-patch/ . -- Version 0.1 ---module("luarocks.tools.patch", package.seeall) local patch = {} local fs = require("luarocks.fs") diff --git a/src/luarocks/tools/tar.lua b/src/luarocks/tools/tar.lua index b2bd930a..637a6c95 100644 --- a/src/luarocks/tools/tar.lua +++ b/src/luarocks/tools/tar.lua @@ -1,6 +1,5 @@ --- A pure-Lua implementation of untar (unpacking .tar archives) ---module("luarocks.tools.tar", package.seeall) local tar = {} local fs = require("luarocks.fs") diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua index 65b4fc15..82763401 100644 --- a/src/luarocks/type_check.lua +++ b/src/luarocks/type_check.lua @@ -1,7 +1,6 @@ --- Type-checking functions. -- Functions and definitions for doing a basic lint check on files -- loaded by LuaRocks. ---module("luarocks.type_check", package.seeall) local type_check = {} package.loaded["luarocks.type_check"] = type_check diff --git a/src/luarocks/unpack.lua b/src/luarocks/unpack.lua index d90f0571..4afe4547 100644 --- a/src/luarocks/unpack.lua +++ b/src/luarocks/unpack.lua @@ -1,7 +1,6 @@ --- Module implementing the LuaRocks "unpack" command. -- Unpack the contents of a rock. ---module("luarocks.unpack", package.seeall) local unpack = {} package.loaded["luarocks.unpack"] = unpack diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 2f419a3d..f7e9b1ae 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua @@ -4,7 +4,6 @@ -- inside specific functions) to avoid interdependencies, -- as this is used in the bootstrapping stage of luarocks.cfg. ---module("luarocks.util", package.seeall) local util = {} local unpack = unpack or table.unpack diff --git a/src/luarocks/validate.lua b/src/luarocks/validate.lua index e6e09c33..24c6f835 100644 --- a/src/luarocks/validate.lua +++ b/src/luarocks/validate.lua @@ -1,6 +1,5 @@ --- Sandboxed test of build/install of all packages in a repository (unfinished and disabled). ---module("luarocks.validate", package.seeall) local validate = {} package.loaded["luarocks.validate"] = validate diff --git a/src/luarocks/write_rockspec.lua b/src/luarocks/write_rockspec.lua index 213d1b01..79902bb4 100644 --- a/src/luarocks/write_rockspec.lua +++ b/src/luarocks/write_rockspec.lua @@ -1,5 +1,4 @@ ---module("luarocks.write_rockspec", package.seeall) local write_rockspec = {} package.loaded["luarocks.write_rockspec"] = write_rockspec -- cgit v1.2.3-55-g6feb