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.
This commit is contained in:
Fabio Valentini 2023-05-17 19:59:44 +02:00
parent a4f4b0df93
commit cf4ed29e5a
No known key found for this signature in database
GPG key ID: 5AC5F572E5D410AF

View file

@ -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():