From e27e68bda62ae9cb85a39404297f66739ae2b3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 29 Nov 2021 14:33:23 +0100 Subject: [PATCH] Fix handling of rpmautospec detection Fixup for 7e0afd5da2fc25c0c3bc2639bbcd402df49ad698: the condition was updated in one place, but not in the other we used the original args.rpmautospec value. --- rust2rpm/__main__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index c4f4ef4..14aff8e 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -426,10 +426,8 @@ def main(): kwargs["auto_changelog_entry"] = not args.no_auto_changelog_entry - if args.rpmautospec: - kwargs["rpmautospec"] = True - else: - kwargs["rpmautospec"] = detect_rpmautospec(default_target, spec_file) + rpmautospec = args.rpmautospec or detect_rpmautospec(default_target, spec_file) + kwargs["rpmautospec"] = rpmautospec if args.target in {"fedora", "mageia", "opensuse"}: kwargs["include_build_requires"] = True @@ -449,7 +447,7 @@ def main(): kwargs["spec_copyright_year"] = time.strftime("%Y") kwargs["pkg_release"] = "0" kwargs["rust_group"] = "Development/Libraries/Rust" - elif args.rpmautospec: + elif rpmautospec: kwargs["pkg_release"] = "%autorelease" else: kwargs["pkg_release"] = "1%{?dist}"