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}"