From 47c75b207822a00604ccaa09b54a862e5d6c44a5 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 3 Dec 2019 19:23:18 +0100 Subject: [PATCH] Add --no-dynamic-buildrequires options And set Fedora's default behavior is to enable DynamicBuildRequires. All Fedora crates use dynamic BuildRequires and are built only in Rawhide and is unlikely that anybody is building hundreds of crates outside of Fedora infrastructure. Closes: https://pagure.io/fedora-rust/rust2rpm/issue/97 Signed-off-by: Igor Gnatenko --- rust2rpm/__main__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index 52c1d75..a3e9411 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -239,6 +239,8 @@ def main(): help="Activate all available features") parser.add_argument("--dynamic-buildrequires", action="store_true", help="Use dynamic BuildRequires feature") + parser.add_argument("--no-dynamic-buildrequires", action="store_true", + help="Do not use dynamic BuildRequires feature") parser.add_argument("--suffix", action="store", help="Package suffix") parser.add_argument("crate", help="crates.io name\n" @@ -319,6 +321,9 @@ def main(): else: kwargs["pkg_release"] = "1%{?dist}" + if args.target == "fedora" and not args.no_dynamic_buildrequires: + args.dynamic_buildrequires = True + kwargs["generate_buildrequires"] = args.dynamic_buildrequires if args.target in {"opensuse", "fedora"}: