aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/fpm-newer-clamp-fix.patch
blob: 9fbb15ee29780fce5836183beb7eb85d2a6c12eb (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
046405f73da2fb9b89ca4a3ad455b56b3e826aa'>tests: import-utils: Ignore extra keyword arguments.Ricardo Wurmus * tests/import-utils.scm ("recursive-import", "recursive-import: skip false packages (toplevel)", "recursive-import: skip false packages (dependency)"): Do not try to match all arguments. 2022-11-18import/utils: spdx-string->license: Support '+' operator.Philip McGrath Previously, '+' was supported only via special cases for deprecated GNU identifiers like 'GPL-N+'. This commit adds support for other uses of '+', such as 'AFL-2.0+' and 'LPPL-1.0+'. Strictly speaking, '+' is an operator, not part of the SPDX license identifier, but it is useful to handle it here. * guix/import/utils.scm (spdx-string->license): Support '+' operator. * tests/import-utils.scm ("spdx-string->license"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2022-11-18import/utils: spdx-string->license: Match case-insensitively.Philip McGrath SPDX specifies that license identifiers (unlike the 'AND', 'OR', and 'WITH' operators) are matched case-insensitively. * guix/import/utils.scm (%spdx-license-identifiers): New variable. (spdx-string->license): Search in '%spdx-license-identifiers' using 'string-ci=?'. * tests/import-utils.scm ("spdx-string->license"): New test. Co-authored-by: Ludovic Courtès <ludo@gnu.org> 2022-10-05tests: Add new test cases for beautify-description.Ricardo Wurmus * tests/import-utils.scm ("beautify-description: use double spacing"): Update. ("beautify-description: remove single quotes", "beautify-description: escape @"): New tests. 2022-09-29import/utils: alist->package: Include properties.itd * guix/import/utils.scm (alist->package): Process properties field in input data and include it in the generated package. * tests/import-utils.scm ("alist->package with properties"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>