From cf4ed29e5a0741a965eb0a5d50ac14951c5292d0 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Wed, 17 May 2023 19:59:44 +0200 Subject: [PATCH] conf: fix reading lib+default.requires from rust2rpm.conf The "default" feature is always implicitly defined, so it can always be used in rust2rpm.conf. However, previous to this commit, it was not loaded correctly if the crate did not explicitly define a "default" feature. --- rust2rpm/conf.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rust2rpm/conf.py b/rust2rpm/conf.py index d4d4ce2..08b70a9 100644 --- a/rust2rpm/conf.py +++ b/rust2rpm/conf.py @@ -95,10 +95,13 @@ class Rust2RpmConf: "lib.requires", "bin.requires", ] + + # the "default" feature is always implicitly defined + if "default" not in features: + features.add("default") + for feature in features: valid_keys.append(f"lib+{feature}.requires") - if "default" not in features: - valid_keys.append(f"lib+default.requires") # check section names for section in conf.keys():