diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-03-13 22:28:36 -0400 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-03-28 22:22:41 -0400 |
commit | 7e5c0dc8746c673a31266394987ec026cd99bb24 (patch) | |
tree | b4fde2e62a7815a14f088cba8ebabab3655efba0 /gnu/packages/patches/fpm-newer-clamp-fix.patch | |
parent | 5a693a3235a01e8ce6258ec57d31a36856858a45 (diff) | |
download | guix-7e5c0dc8746c673a31266394987ec026cd99bb24.tar guix-7e5c0dc8746c673a31266394987ec026cd99bb24.tar.gz |
gnu: Add fpm.
* gnu/packages/package-management.scm (fpm): New variable.
* gnu/packages/patches/fpm-newer-clamp-fix.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
Diffstat (limited to 'gnu/packages/patches/fpm-newer-clamp-fix.patch')
-rw-r--r-- | gnu/packages/patches/fpm-newer-clamp-fix.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gnu/packages/patches/fpm-newer-clamp-fix.patch b/gnu/packages/patches/fpm-newer-clamp-fix.patch new file mode 100644 index 0000000000..9fbb15ee29 --- /dev/null +++ b/gnu/packages/patches/fpm-newer-clamp-fix.patch @@ -0,0 +1,33 @@ +Retrieved from: https://github.com/jordansissel/fpm/pull/1561.patch + +From 956a218a7b35de08ea35da3b702ffdc716656b68 Mon Sep 17 00:00:00 2001 +From: Jordan Sissel <jls@semicomplete.com> +Date: Mon, 15 Oct 2018 21:05:47 -0700 +Subject: [PATCH] Check if an option has a default value before we try to look + it up. + +This fixes fpm when used with clamp 1.3.0 or above. + +Fixes #1543 +--- + lib/fpm/command.rb | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/lib/fpm/command.rb b/lib/fpm/command.rb +index a204001e1..a99ddb627 100644 +--- a/lib/fpm/command.rb ++++ b/lib/fpm/command.rb +@@ -394,7 +394,12 @@ def execute + set = proc do |object, attribute| + # if the package's attribute is currently nil *or* the flag setting for this + # attribute is non-default, use the value. +- if object.send(attribute).nil? || send(attribute) != send("default_#{attribute}") ++ ++ # Not all options have a default value, so we assume `nil` if there's no default. (#1543) ++ # In clamp >= 1.3.0, options without `:default => ..` will not have any # `default_xyz` ++ # methods generated, so we need to check for the presence of this method first. ++ default = respond_to?("default_#{attribute}") ? send("default_#{attribute}") : nil ++ if object.send(attribute).nil? || send(attribute) != default + logger.info("Setting from flags: #{attribute}=#{send(attribute)}") + object.send("#{attribute}=", send(attribute)) + end |