Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lua-luarocks for openSUSE:Factory checked in at 2021-12-20 21:06:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lua-luarocks (Old) and /work/SRC/openSUSE:Factory/.lua-luarocks.new.2520 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lua-luarocks" Mon Dec 20 21:06:08 2021 rev:9 rq:941408 version:3.8.0 Changes: -------- --- /work/SRC/openSUSE:Factory/lua-luarocks/lua-luarocks.changes 2021-06-18 10:13:39.373983931 +0200 +++ /work/SRC/openSUSE:Factory/.lua-luarocks.new.2520/lua-luarocks.changes 2021-12-20 21:06:10.038928951 +0100 @@ -1,0 +2,11 @@ +Sat Dec 18 15:07:53 UTC 2021 - Callum Farmer <gm...@opensuse.org> + +- Update to version 3.8.0: + * Support GitHub's protocol security changes transparently + * luarocks test has a new flag --prepare that checks, downloads + and installs the tool requirements and rockspec dependencies + but does not run the test suite for the rockspec being tested. + * Code tweaks so that LuaRocks can run on a Lua interpreter + built without the debug library. + +------------------------------------------------------------------- Old: ---- luarocks-3.7.0.tar.gz New: ---- luarocks-3.8.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lua-luarocks.spec ++++++ --- /var/tmp/diff_new_pack.qbLak7/_old 2021-12-20 21:06:10.722929447 +0100 +++ /var/tmp/diff_new_pack.qbLak7/_new 2021-12-20 21:06:10.726929449 +0100 @@ -20,13 +20,19 @@ %define flavor @BUILD_FLAVOR@%{nil} %define mod_name luarocks %define lua_value %(echo "%{flavor}" |sed -e 's:lua::') -Version: 3.7.0 +%if "%{flavor}" == "" +Name: lua-%{mod_name} +ExclusiveArch: do_not_build +%else +Name: %{flavor}-%{mod_name} +%endif +Version: 3.8.0 Release: 0 Summary: A deployment and management system for Lua modules License: MIT Group: Development/Languages/Other URL: https://luarocks.org -Source: https://luarocks.org/releases/%{mod_name}-%{version}.tar.gz +Source0: https://luarocks.org/releases/%{mod_name}-%{version}.tar.gz BuildRequires: %{flavor}-devel BuildRequires: curl BuildRequires: openssl @@ -37,12 +43,6 @@ Requires: unzip BuildArch: noarch %lua_provides -%if "%{flavor}" == "" -Name: lua-%{mod_name} -ExclusiveArch: do_not_build -%else -Name: %{flavor}-%{mod_name} -%endif Requires(post): update-alternatives Requires(postun): update-alternatives @@ -56,7 +56,7 @@ repositories, and multiple local rocks trees. %prep -%setup -q -n %{mod_name}-%{version} +%autosetup -n %{mod_name}-%{version} %build # Not an autotools based system ++++++ luarocks-3.7.0.tar.gz -> luarocks-3.8.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/.github/ISSUE_TEMPLATE/bug_report.md new/luarocks-3.8.0/.github/ISSUE_TEMPLATE/bug_report.md --- old/luarocks-3.7.0/.github/ISSUE_TEMPLATE/bug_report.md 1970-01-01 01:00:00.000000000 +0100 +++ new/luarocks-3.8.0/.github/ISSUE_TEMPLATE/bug_report.md 2021-11-08 16:30:37.000000000 +0100 @@ -0,0 +1,31 @@ +--- +name: Bugs +about: Bugs and unintented behaviour +labels: 'bug' + +--- + +### Please read the following before submitting: +- Please do NOT submit bug reports for questions. Ask questions in the [Gitter + chat-room](https://gitter.im/luarocks/luarocks). +- Please do NOT submit duplicate bug reports. Look through the [issue + tracker](https://github.com/luarocks/luarocks/issues) before submitting. + +### Please fill out the following: +- **Platform:** + - Windows/Linux/MacOS. + +- **LuaRocks version:** + - `luarocks --version` + +- **Configuration file:** + - Please try to produce with the default configuration. + - If you cannot reproduce with the default configuration, please try to find + the minimal configuration to reproduce. + - Upload the config to a pastebin such as gist.github.com. + +- **LuaRocks output from when the issue occurred:** + - Use the `--verbose` flag. + +- **Description:** + - The steps you took in plain English to reproduce the problem. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/.github/ISSUE_TEMPLATE/enhancement.md new/luarocks-3.8.0/.github/ISSUE_TEMPLATE/enhancement.md --- old/luarocks-3.7.0/.github/ISSUE_TEMPLATE/enhancement.md 1970-01-01 01:00:00.000000000 +0100 +++ new/luarocks-3.8.0/.github/ISSUE_TEMPLATE/enhancement.md 2021-11-08 16:30:37.000000000 +0100 @@ -0,0 +1,11 @@ +--- +name: Enhancements +about: New functionality +labels: 'enhancement' + +--- + +### Please fill out the following: +- **Description:** + - Please describe in plain English what the enhancement is and what the use case + is. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/CHANGELOG.md new/luarocks-3.8.0/CHANGELOG.md --- old/luarocks-3.7.0/CHANGELOG.md 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/CHANGELOG.md 2021-11-08 16:30:37.000000000 +0100 @@ -1,3 +1,56 @@ +## What's new in LuaRocks 3.7.0 + +* Improved connectivity resiliency + * LuaRocks can now use mirrors for downloading rocks even if downloading + the manifest from the main server succeeds. + In previous versions, LuaRocks would check whether to use a mirror in the first + download operation, when it fetches the manifest. Once the server + (luarocks.org or one of its default mirrors) was chosen, it would stick with + it for the rest of the command. + The resulting behavior was that if the manifest fails to load, it switches to + a mirror and continues from there. But if the manifest fetches ok and the then + actual rock download fails, it would give up, instead of trying that in a + mirror as well. + Now, it retries every download on a mirror whenever the base URL matches one + configured in cfg.rocks_servers. The original behavior was satisfactory if + there was complete downtime in the main server, but this new behavior should + make the CLI much more resilient with regard to any intermittent failures + happening on the main server. +* On Unix, it now respects environment variables $XDG_CACHE_HOME and $XDG_CONFIG_HOME + * This means the user's configuration typically resides in ~/.config/luarocks/ + as per the XDG standard + * The legacy path ~/.luarocks/ continues to be tested first, for backwards + compatibility +* Fixes check for the default Lua version set in the user's home configuration +* Fixes an issue on Windows where it would incorrectly revoke permissions + from the current user when installing + +## What's new in LuaRocks 3.6.0 + +* Adds a double-check step to verify that all files from a rock are installed +* Improve resilience of the manifest reader to deal with manifests + written with older versions of LuaRocks lower than 3.0 +* `luarocks pack` now checks that the directory inside the archive being packed + as a `.src.rock` actually exists, refusing to pack an invalid rock from + a badly configured rockspec. +* Fixes behavior of `luarocks pack` when the `url` entry of a rockspec + points to a bare file. +* Remove an entry from the manifest if the rock itself is already missing +* The `configure` script now checks that the version of `lua.h` + found matches that of the Lua interpreter detected or configured +* Fixes the renaming of scripts when multiple versions are installed +* Fixes availability check for `svn` for rockspecs using Subversion +* Fixes for running with an empty PATH environment variable +* Portability improvements: + * Windows: vcvarsall.bat output is now properly redirected to NUL + meaning that the output of `luarocks path` can be used in scripts + * Fixes autodetection for Cygwin + * Handles macOS versions greater than 10.10 + * Adds platform specific configurations for NetBSD + * Respects CC/CFLAGS/LDFLAGS on FreeBSD +* Luacheck now runs on the LuaRocks CI +* Distributed binaries are built using Lua 5.3 + ## What's new in LuaRocks 3.5.0 This is a small release: @@ -57,7 +110,7 @@ This is a bugfix release: * Fix downgrades of rocks containing directories: stop it - from creating spurious 0-byte files where directories have been + from creating spurious 0-byte files where directories have been * Fix error message when attempting to copy a file that is missing * Detect OpenBSD-specific dependency paths @@ -330,7 +383,7 @@ LuaRocks in a "project directory": * it creates a `lua_modules` directory in the current directory for storing rocks - * it creates a `.luarocks/config-5.x.lua` local configuration file + * it creates a `.luarocks/config-5.x.lua` local configuration file * it creates `lua` and `luarocks` wrapper scripts in the current directory that are configured to use `lua_modules` and `.luarocks/config-5.x.lua` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/README.md new/luarocks-3.8.0/README.md --- old/luarocks-3.7.0/README.md 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/README.md 2021-11-08 16:30:37.000000000 +0100 @@ -2,7 +2,7 @@ A package manager for Lua modules. -[](https://travis-ci.org/luarocks/luarocks) +[](https://travis-ci.com/luarocks/luarocks) [](https://ci.appveyor.com/project/hishamhm/luarocks/branch/master) [](https://codecov.io/gh/luarocks/luarocks/branch/master) [](https://gitter.im/luarocks/luarocks) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/configure new/luarocks-3.8.0/configure --- old/luarocks-3.7.0/configure 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/configure 2021-11-08 16:30:37.000000000 +0100 @@ -320,7 +320,7 @@ done echo -BLUE "Configuring LuaRocks version 3.7.0..." +BLUE "Configuring LuaRocks version 3.8.0..." echo echo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/luarocks-3.7.0-1.rockspec new/luarocks-3.8.0/luarocks-3.7.0-1.rockspec --- old/luarocks-3.7.0/luarocks-3.7.0-1.rockspec 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/luarocks-3.7.0-1.rockspec 1970-01-01 01:00:00.000000000 +0100 @@ -1,38 +0,0 @@ -rockspec_format = "3.0" -package = "luarocks" -version = "3.7.0-1" -source = { - url = "git+https://github.com/luarocks/luarocks", - tag = "v3.7.0" -} -description = { - summary = "A package manager for Lua modules.", - detailed = [[ - LuaRocks allows you to install Lua modules as self-contained - packages called "rocks", which also contain version dependency - information. This information is used both during installation, - so that when one rock is requested all rocks it depends on are - installed as well, and at run time, so that when a module is - required, the correct version is loaded. LuaRocks supports both - local and remote repositories, and multiple local rocks trees. - ]], - homepage = "http://www.luarocks.org", - issues_url = "https://github.com/luarocks/luarocks/issues", - maintainer = "Hisham Muhammad", - license = "MIT", -} -test_dependencies = { - "luacov", - "busted-htest", -} -test = { - type = "busted", - platforms = { - windows = { - flags = { "--exclude-tags=ssh,git,unix" } - }, - unix = { - flags = { "--exclude-tags=ssh,git" } - } - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/luarocks-3.8.0-1.rockspec new/luarocks-3.8.0/luarocks-3.8.0-1.rockspec --- old/luarocks-3.7.0/luarocks-3.8.0-1.rockspec 1970-01-01 01:00:00.000000000 +0100 +++ new/luarocks-3.8.0/luarocks-3.8.0-1.rockspec 2021-11-08 16:30:37.000000000 +0100 @@ -0,0 +1,38 @@ +rockspec_format = "3.0" +package = "luarocks" +version = "3.8.0-1" +source = { + url = "git+https://github.com/luarocks/luarocks", + tag = "v3.8.0" +} +description = { + summary = "A package manager for Lua modules.", + detailed = [[ + LuaRocks allows you to install Lua modules as self-contained + packages called "rocks", which also contain version dependency + information. This information is used both during installation, + so that when one rock is requested all rocks it depends on are + installed as well, and at run time, so that when a module is + required, the correct version is loaded. LuaRocks supports both + local and remote repositories, and multiple local rocks trees. + ]], + homepage = "http://www.luarocks.org", + issues_url = "https://github.com/luarocks/luarocks/issues", + maintainer = "Hisham Muhammad", + license = "MIT", +} +test_dependencies = { + "luacov", + "busted-htest", +} +test = { + type = "busted", + platforms = { + windows = { + flags = { "--exclude-tags=ssh,git,unix" } + }, + unix = { + flags = { "--exclude-tags=ssh,git" } + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/spec/build_spec.lua new/luarocks-3.8.0/spec/build_spec.lua --- old/luarocks-3.7.0/spec/build_spec.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/spec/build_spec.lua 2021-11-08 16:30:37.000000000 +0100 @@ -138,8 +138,8 @@ describe("basic builds", function() it("luacov diff version", function() - assert.is_true(run.luarocks_bool("build luacov 0.13.0-1")) - assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luacov/0.13.0-1/luacov-0.13.0-1.rockspec")) + assert.is_true(run.luarocks_bool("build luacov 0.15.0-1")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luacov/0.15.0-1/luacov-0.15.0-1.rockspec")) end) it("command stdlib", function() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/spec/list_spec.lua new/luarocks-3.8.0/spec/list_spec.lua --- old/luarocks-3.7.0/spec/list_spec.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/spec/list_spec.lua 2021-11-08 16:30:37.000000000 +0100 @@ -22,13 +22,13 @@ it("--porcelain", function() local output = run.luarocks("list --porcelain") - assert.is.truthy(output:find("luacov\t0.13.0-1\tinstalled\t" .. testing_paths.testing_sys_rocks, 1, true)) + assert.is.truthy(output:find("luacov\t0.15.0-1\tinstalled\t" .. testing_paths.testing_sys_rocks, 1, true)) end) it("shows version number", function() local output = run.luarocks("list") assert.is.truthy(output:find("luacov")) - assert.matches("0.13.0-1", output, 1, true) + assert.matches("0.15.0-1", output, 1, true) end) it("LuaRocks install outdated and list it", function() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/spec/new_version_spec.lua new/luarocks-3.8.0/spec/new_version_spec.lua --- old/luarocks-3.7.0/spec/new_version_spec.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/spec/new_version_spec.lua 2021-11-08 16:30:37.000000000 +0100 @@ -41,8 +41,8 @@ describe("more complex tests", function() it("of luacov", function() - assert.is_true(run.luarocks_bool("download --rockspec luacov 0.13.0")) - assert.is_true(run.luarocks_bool("new_version luacov-0.13.0-1.rockspec 0.2")) + assert.is_true(run.luarocks_bool("download --rockspec luacov 0.15.0")) + assert.is_true(run.luarocks_bool("new_version luacov-0.15.0-1.rockspec 0.2")) assert.is.truthy(lfs.attributes("luacov-0.2-1.rockspec")) test_env.remove_files(lfs.currentdir(), "luacov%-") end) @@ -55,8 +55,8 @@ end) it("of luacov with tag", function() - assert.is_true(run.luarocks_bool("download --rockspec luacov 0.13.0")) - assert.is_true(run.luarocks_bool("new_version luacov-0.13.0-1.rockspec --tag v0.3")) + assert.is_true(run.luarocks_bool("download --rockspec luacov 0.15.0")) + assert.is_true(run.luarocks_bool("new_version luacov-0.15.0-1.rockspec --tag v0.3")) assert.is.truthy(lfs.attributes("luacov-0.3-1.rockspec")) test_env.remove_files(lfs.currentdir(), "luacov%-") end) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/spec/show_spec.lua new/luarocks-3.8.0/spec/show_spec.lua --- old/luarocks-3.7.0/spec/show_spec.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/spec/show_spec.lua 2021-11-08 16:30:37.000000000 +0100 @@ -48,12 +48,12 @@ it("rockspec of luacov", function() local output = run.luarocks("show --rockspec luacov") - assert.is.truthy(output:match("luacov--0.13.0--1.rockspec")) + assert.is.truthy(output:match("luacov--0.15.0--1.rockspec")) end) it("mversion of luacov", function() local output = run.luarocks("show --mversion luacov") - assert.is.truthy(output:match("0.13.0--1")) + assert.is.truthy(output:match("0.15.0--1")) end) it("rock tree of luacov", function() @@ -74,8 +74,8 @@ end) it("old version of luacov", function() - run.luarocks("install luacov 0.13.0") - run.luarocks_bool("show luacov 0.13.0") + run.luarocks("install luacov 0.15.0") + run.luarocks_bool("show luacov 0.15.0") end) it("can find by substring", function() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/spec/test_spec.lua new/luarocks-3.8.0/spec/test_spec.lua --- old/luarocks-3.7.0/spec/test_spec.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/spec/test_spec.lua 2021-11-08 16:30:37.000000000 +0100 @@ -70,6 +70,32 @@ -- Assert that busted ran, whether successfully or not assert.match("%d+ success.* / %d+ failure.* / %d+ error.* / %d+ pending", output) end) + + it("prepare", function() + finally(function() + -- delete downloaded and unpacked files + lfs.chdir(testing_paths.testrun_dir) + test_env.remove_dir("busted_project-0.1-1") + os.remove("busted_project-0.1-1.src.rock") + end) + + -- make luassert + assert.is_true(run.luarocks_bool("download --server="..testing_paths.fixtures_repo_dir.." busted_project 0.1-1")) + assert.is_true(run.luarocks_bool("unpack busted_project-0.1-1.src.rock")) + lfs.chdir("busted_project-0.1-1/busted_project") + assert.is_true(run.luarocks_bool("make")) + + run.luarocks_bool("remove busted") + local prepareOutput = run.luarocks_bool("test --prepare") + assert.is_true(run.luarocks_bool("show busted")) + + -- Assert that "test --prepare" run successfully + assert.is_true(prepareOutput) + + local output = run.luarocks("test") + assert.not_match(tostring(prepareOutput), output) + + end) end) end) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/spec/upload_spec.lua new/luarocks-3.8.0/spec/upload_spec.lua --- old/luarocks-3.7.0/spec/upload_spec.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/spec/upload_spec.lua 2021-11-08 16:30:37.000000000 +0100 @@ -46,6 +46,14 @@ print(run.luarocks("upload " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec " .. test_env.openssl_dirs .. " --api-key=123 --sign", {LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/luarocks_site.lua"})) end) + it("with .rockspec and .src.rock", function() + assert.is_true(run.luarocks_bool("upload " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.src.rock " .. test_env.openssl_dirs, {LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/luarocks_site.lua"})) + end) + + it("with arguments .src.rock and .rockspec out of order", function() + assert.is_false(run.luarocks_bool("upload " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.src.rock " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec " .. test_env.openssl_dirs, {LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/luarocks_site.lua"})) + end) + it("rockspec with api-key and skip-pack", function() assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec " .. test_env.openssl_dirs .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/luarocks_site.lua"})) end) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/spec/util/test_env.lua new/luarocks-3.8.0/spec/util/test_env.lua --- old/luarocks-3.7.0/spec/util/test_env.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/spec/util/test_env.lua 2021-11-08 16:30:37.000000000 +0100 @@ -940,8 +940,8 @@ end -- luacov is needed for both minimal or full environment - table.insert(urls, "/luacov-0.13.0-1.rockspec") - table.insert(urls, "/luacov-0.13.0-1.src.rock") + table.insert(urls, "/luacov-0.15.0-1.rockspec") + table.insert(urls, "/luacov-0.15.0-1.src.rock") table.insert(urls, "/cluacov-0.1.1-1.rockspec") table.insert(urls, "/cluacov-0.1.1-1.src.rock") table.insert(rocks, "luacov") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/argparse.lua new/luarocks-3.8.0/src/luarocks/argparse.lua --- old/luarocks-3.7.0/src/luarocks/argparse.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/argparse.lua 2021-11-08 16:30:37.000000000 +0100 @@ -2067,6 +2067,9 @@ end local function xpcall_error_handler(err) + if not debug then + return tostring(err) + end return tostring(err) .. "\noriginal " .. debug.traceback("", 2):sub(2) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/cmd/test.lua new/luarocks-3.8.0/src/luarocks/cmd/test.lua --- old/luarocks-3.7.0/src/luarocks/cmd/test.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/cmd/test.lua 2021-11-08 16:30:37.000000000 +0100 @@ -23,7 +23,8 @@ :args("?") cmd:argument("args", "Test suite arguments.") :args("*") - + cmd:flag("--prepare", "Only install dependencies needed for testing only, but do not run the test") + cmd:option("--test-type", "Specify the test suite type manually if it was ".. "not specified in the rockspec and it could not be auto-detected.") :argname("<type>") @@ -31,7 +32,7 @@ function cmd_test.command(args) if args.rockspec and args.rockspec:match("rockspec$") then - return test.run_test_suite(args.rockspec, args.test_type, args.args) + return test.run_test_suite(args.rockspec, args.test_type, args.args, args.prepare) end table.insert(args.args, 1, args.rockspec) @@ -40,8 +41,8 @@ if not rockspec then return nil, err end - - return test.run_test_suite(rockspec, args.test_type, args.args) + + return test.run_test_suite(rockspec, args.test_type, args.args, args.prepare) end return cmd_test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/cmd/upload.lua new/luarocks-3.8.0/src/luarocks/cmd/upload.lua --- old/luarocks-3.7.0/src/luarocks/cmd/upload.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/cmd/upload.lua 2021-11-08 16:30:37.000000000 +0100 @@ -14,6 +14,8 @@ :summary("Upload a rockspec to the public rocks repository.") cmd:argument("rockspec", "Rockspec for the rock to upload.") + cmd:argument("src-rock", "A corresponding .src.rock file; if not given it will be generated.") + :args("?") cmd:flag("--skip-pack", "Do not pack and send source rock.") cmd:option("--api-key", "Pass an API key. It will be stored for subsequent uses.") @@ -73,19 +75,22 @@ end local rock_fname - if not args.skip_pack and not is_dev_version(rockspec.version) then + if args.src_rock then + rock_fname = args.src_rock + elseif not args.skip_pack and not is_dev_version(rockspec.version) then util.printout("Packing " .. tostring(rockspec.package)) rock_fname, err = pack.pack_source_rock(args.rockspec) if not rock_fname then return nil, err end - if args.sign then - rock_sigfname, err = signing.sign_file(rock_fname) - if err then - return nil, "Failed signing rock: " .. err - end - util.printout("Signed packed rock: "..rock_sigfname) + end + + if rock_fname and args.sign then + rock_sigfname, err = signing.sign_file(rock_fname) + if err then + return nil, "Failed signing rock: " .. err end + util.printout("Signed packed rock: "..rock_sigfname) end local multipart = require("luarocks.upload.multipart") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/cmd.lua new/luarocks-3.8.0/src/luarocks/cmd.lua --- old/luarocks-3.7.0/src/luarocks/cmd.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/cmd.lua 2021-11-08 16:30:37.000000000 +0100 @@ -146,6 +146,9 @@ end local function error_handler(err) + if not debug then + return err + end local mode = "Arch.: " .. (cfg and cfg.arch or "unknown") if package.config:sub(1, 1) == "\\" then if cfg and cfg.fs_use_modules then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/core/cfg.lua new/luarocks-3.8.0/src/luarocks/core/cfg.lua --- old/luarocks-3.7.0/src/luarocks/core/cfg.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/core/cfg.lua 2021-11-08 16:30:37.000000000 +0100 @@ -20,8 +20,8 @@ -------------------------------------------------------------------------------- -local program_version = "3.7.0" -local program_series = "3.7" +local program_version = "3.8.0" +local program_series = "3.8" local major_version = (program_version:match("([^.]%.[^.])")) or program_series local is_windows = package.config:sub(1,1) == "\\" @@ -50,6 +50,9 @@ } local function detect_sysconfdir() + if not debug then + return + end local src = debug.getinfo(1, "S").source:gsub("\\", "/"):gsub("/+", "/") if src:sub(1, 1) == "@" then src = src:sub(2) @@ -477,6 +480,11 @@ if platforms.openbsd then defaults.arch = "openbsd-"..target_cpu + defaults.gcc_rpath = false + defaults.variables.CC = os.getenv("CC") or "cc" + defaults.variables.CFLAGS = os.getenv("CFLAGS") or defaults.variables.CFLAGS + defaults.variables.LD = defaults.variables.CC + defaults.variables.LIBFLAG = (os.getenv("LDFLAGS") or "").." -shared" end if platforms.netbsd then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/core/util.lua new/luarocks-3.8.0/src/luarocks/core/util.lua --- old/luarocks-3.7.0/src/luarocks/core/util.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/core/util.lua 2021-11-08 16:30:37.000000000 +0100 @@ -67,7 +67,10 @@ local function basic_serialize(o) local so = tostring(o) if type(o) == "function" then - local info = debug.getinfo(o, "S") + local info = debug and debug.getinfo(o, "S") + if not info then + return ("%q"):format(so) + end -- info.name is nil because o is not a calling level if info.what == "C" then return ("%q"):format(so .. ", C function") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/deps.lua new/luarocks-3.8.0/src/luarocks/deps.lua --- old/luarocks-3.7.0/src/luarocks/deps.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/deps.lua 2021-11-08 16:30:37.000000000 +0100 @@ -223,7 +223,7 @@ local search = require("luarocks.search") local install = require("luarocks.cmd.install") - local url, search_err = search.find_suitable_rock(dep, true) + local url, search_err = search.find_suitable_rock(dep) if not url then return nil, "Could not satisfy dependency "..tostring(dep)..": "..search_err end @@ -373,7 +373,7 @@ -- @param files The array of constructed names local function add_all_patterns(file, patterns, files) for _, pattern in ipairs(patterns) do - table.insert(files, (pattern:gsub("?", file))) + table.insert(files, {#files + 1, (pattern:gsub("?", file))}) end end @@ -425,7 +425,7 @@ add_all_patterns(matched, patterns, files) end end - table.insert(files, file) + table.insert(files, {#files + 1, file}) end end @@ -460,16 +460,17 @@ local found = false table.sort(files, function(a, b) - if (not a:match("%*")) and b:match("%*") then + if (not a[2]:match("%*")) and b[2]:match("%*") then return true - elseif a:match("%*") and (not b:match("%*")) then + elseif a[2]:match("%*") and (not b[2]:match("%*")) then return false else - return a < b + return a[1] < b[1] end end) - for _, f in ipairs(files) do + for _, fa in ipairs(files) do + local f = fa[2] -- small convenience hack if f:match("%.so$") or f:match("%.dylib$") or f:match("%.dll$") then f = f:gsub("%.[^.]+$", "."..cfg.external_lib_extension) @@ -711,8 +712,13 @@ end function deps.check_lua_libdir(vars) + local fs = require("luarocks.fs") local ljv = util.get_luajit_version() + if vars.LUA_LIBDIR and vars.LUALIB and fs.exists(dir.path(vars.LUA_LIBDIR, vars.LUALIB)) then + return true + end + local shortv = cfg.lua_version:gsub("%.", "") local libnames = { "lua" .. cfg.lua_version, @@ -729,7 +735,9 @@ local ok = check_external_dependency("LUA", { library = libnames }, vars, "build", cache) vars.LUA_INCDIR = save_LUA_INCDIR if ok then - vars.LUALIB = vars.LUA_LIBDIR_FILE + if fs.exists(dir.path(vars.LUA_LIBDIR, vars.LUA_LIBDIR_FILE)) then + vars.LUALIB = vars.LUA_LIBDIR_FILE + end return true end return nil, "Failed finding Lua library. You may need to configure LUA_LIBDIR.", "dependency" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/fetch.lua new/luarocks-3.8.0/src/luarocks/fetch.lua --- old/luarocks-3.7.0/src/luarocks/fetch.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/fetch.lua 2021-11-08 16:30:37.000000000 +0100 @@ -502,6 +502,14 @@ assert(type(extract) == "boolean") assert(type(dest_dir) == "string" or not dest_dir) + -- auto-convert git://github.com URLs to use git+https + -- see https://github.blog/2021-09-01-improving-git-protocol-security-github/ + if rockspec.source.url:match("^git://github%.com/") + or rockspec.source.url:match("^git://www%.github%.com/") then + rockspec.source.url = rockspec.source.url:gsub("^git://", "git+https://") + rockspec.source.protocol = "git+https" + end + local protocol = rockspec.source.protocol local ok, proto if dir.is_basic_protocol(protocol) then @@ -522,6 +530,7 @@ return nil, "Can't download "..rockspec.source.url.." -- only downloading from "..cfg.only_sources_from end end + return proto.get_sources(rockspec, extract, dest_dir) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/fs/win32/tools.lua new/luarocks-3.8.0/src/luarocks/fs/win32/tools.lua --- old/luarocks-3.7.0/src/luarocks/fs/win32/tools.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/fs/win32/tools.lua 2021-11-08 16:30:37.000000000 +0100 @@ -271,12 +271,22 @@ local ok -- Grant permissions available to all users - ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant:r Everyone:" .. others_perms) + ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant:r *S-1-1-0:" .. others_perms) if not ok then return false, "Failed setting permission " .. mode .. " for " .. scope end + -- Grant permissions available only to the current user - ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant %USERNAME%:" .. my_perms) + ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant \"%USERNAME%\":" .. my_perms) + + -- This may not be necessary if the above syntax is correct, + -- but I couldn't really test the extra quotes above, so if that + -- fails we try again with the syntax used in previous releases + -- just to be on the safe side + if not ok then + ok = fs.execute_quiet(vars.ICACLS .. " " .. fs.Q(filename) .. " /inheritance:d /grant %USERNAME%:" .. my_perms) + end + if not ok then return false, "Failed setting permission " .. mode .. " for " .. scope end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/loader.lua new/luarocks-3.8.0/src/luarocks/loader.lua --- old/luarocks-3.7.0/src/luarocks/loader.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/loader.lua 2021-11-08 16:30:37.000000000 +0100 @@ -43,8 +43,8 @@ -- a global. -- Detect when being called via -lluarocks.loader; this is -- most likely a wrapper. - local info = debug.getinfo(2, "nS") - if info.what == "C" and not info.name then + local info = debug and debug.getinfo(2, "nS") + if info and info.what == "C" and not info.name then luarocks = { loader = loader } temporary_global = true -- For the other half of this hack, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/test.lua new/luarocks-3.8.0/src/luarocks/test.lua --- old/luarocks-3.7.0/src/luarocks/test.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/test.lua 2021-11-08 16:30:37.000000000 +0100 @@ -33,7 +33,7 @@ end -- Run test suite as configured in rockspec in the current directory. -function test.run_test_suite(rockspec_arg, test_type, args) +function test.run_test_suite(rockspec_arg, test_type, args, prepare) local rockspec if type(rockspec_arg) == "string" then local err, errcode @@ -68,7 +68,11 @@ return nil, "failed loading test execution module " .. mod_name end - return test_mod.run_tests(rockspec.test, args) + if prepare then + return test_mod.run_tests(rockspec_arg, {"--version"}) + else + return test_mod.run_tests(rockspec.test, args) + end end return test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/luarocks-3.7.0/src/luarocks/util.lua new/luarocks-3.8.0/src/luarocks/util.lua --- old/luarocks-3.7.0/src/luarocks/util.lua 2021-04-13 23:53:36.000000000 +0200 +++ new/luarocks-3.8.0/src/luarocks/util.lua 2021-11-08 16:30:37.000000000 +0100 @@ -23,7 +23,6 @@ local pack = table.pack or function(...) return { n = select("#", ...), ... } end local scheduled_functions = {} -local debug = require("debug") --- Schedule a function to be executed upon program termination. -- This is useful for actions such as deleting temporary directories @@ -198,7 +197,7 @@ local i = 1 local last, cur = default, default while i do - local dbg = debug.getinfo(i,"S") + local dbg = debug and debug.getinfo(i,"S") if not dbg then break end last = cur cur = dbg.source