From 9e22d74930ab684e1a17d24b0c5a50ab35d609f6 Mon Sep 17 00:00:00 2001 From: "Matthieu C." <886074+teto@users.noreply.github.com> Date: Sun, 21 Apr 2024 16:04:53 +0200 Subject: luarocks-packages.csv: changed repo by rockspec uri This is a breaking change that converts the 'src' csv column (a git URI) to a 'rockspec' fullpath uri. before this, luarocks-nix would clone the repo and look for rockspecs with a brittle algorithm. This removes the ambiguity on which rockspec to package while allowing to remove a bunch of brittle code from luarocks-nix. --- pkgs/development/lua-modules/updater/updater.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'pkgs/development/lua-modules') diff --git a/pkgs/development/lua-modules/updater/updater.py b/pkgs/development/lua-modules/updater/updater.py index 407b4104b774c..f0a91a313919a 100755 --- a/pkgs/development/lua-modules/updater/updater.py +++ b/pkgs/development/lua-modules/updater/updater.py @@ -49,8 +49,8 @@ FOOTER = """ class LuaPlugin: name: str """Name of the plugin, as seen on luarocks.org""" - src: str - """address to the git repository""" + rockspec: str + """Full path towards the rockspec""" ref: Optional[str] """git reference (branch name/tag)""" version: Optional[str] @@ -103,7 +103,7 @@ class LuaEditor(pluginupdate.Editor): f.write(HEADER) header2 = textwrap.dedent( """ - { stdenv, lib, fetchurl, fetchgit, callPackage, ... } @ args: + { stdenv, lib, fetchurl, fetchgit, callPackage, ... }: final: prev: { """ @@ -171,16 +171,17 @@ def generate_pkg_nix(plug: LuaPlugin): if plug.maintainers: cmd.append(f"--maintainers={plug.maintainers}") - if plug.src != "": - if plug.src is None: + if plug.rockspec != "": + if plug.ref or plug.version: msg = ( - "src must be set when 'version' is set to \"src\" for package %s" + "'version' and 'ref' will be ignored as the rockspec is hardcoded for package %s" % plug.name ) - log.error(msg) - raise RuntimeError(msg) - log.debug("Updating from source %s", plug.src) - cmd.append(plug.src) + log.warn(msg) + + log.debug("Updating from rockspec %s", plug.rockspec) + cmd.append(plug.rockspec) + # update the plugin from luarocks else: cmd.append(plug.name) -- cgit 1.4.1