From 7f7252093ffdd080d0e3f3faa7a4a9ccda51e616 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sun, 9 Jan 2022 12:20:41 +1300 Subject: [PATCH] emacs.pkgs.melpa*: Fix version numbers with negative numbers --- .../editors/emacs/elisp-packages/libgenerated.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix b/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix index 8ecce11a7421..d49e18c8a3e0 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix @@ -69,7 +69,10 @@ in { melpaBuild { inherit pname ename commit; version = if isNull version then "" else - lib.concatStringsSep "." (map toString version); + lib.concatStringsSep "." (map toString + # Hack: Melpa archives contains versions with parse errors such as [ 4 4 -4 413 ] which should be 4.4-413 + # This filter method is still technically wrong, but it's computationally cheap enough and tapers over the issue + (builtins.filter (n: n > 0) version)); # TODO: Broken should not result in src being null (hack to avoid eval errors) src = if (isNull sha256 || broken) then null else lib.getAttr fetcher (fetcherGenerators args sourceArgs);