From 91907b066f5813988b85f67f2a19e9c31a42fd0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 3 Jul 2022 15:55:33 +0200 Subject: [PATCH] Use just a single field for handling of --build-requires Having two fields in the args structure is super ugly. Let's just use one field, and assign True or False to it. No change in function. --- rust2rpm/__main__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index a6e6e80..6867ab5 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -391,8 +391,10 @@ def main(): parser.add_argument("--all-features", action="store_true", help="Activate all available features") parser.add_argument("--dynamic-buildrequires", action="store_true", + default=None, help="Use dynamic BuildRequires feature") - parser.add_argument("--no-dynamic-buildrequires", action="store_true", + parser.add_argument("--no-dynamic-buildrequires", action="store_false", + dest="dynamic_buildrequires", help="Do not use dynamic BuildRequires feature") parser.add_argument("--suffix", action="store", help="Package suffix") @@ -497,8 +499,8 @@ def main(): else: kwargs["pkg_release"] = "1%{?dist}" - if args.target == "fedora" and not args.no_dynamic_buildrequires: - args.dynamic_buildrequires = True + if args.dynamic_buildrequires is None: + args.dynamic_buildrequires = args.target == "fedora" kwargs["generate_buildrequires"] = args.dynamic_buildrequires