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 <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2019-12-03 19:23:18 +01:00
parent a6bde5599a
commit 47c75b2078
No known key found for this signature in database
GPG key ID: 695714BD1BBC5F4C

View file

@ -239,6 +239,8 @@ def main():
help="Activate all available features") help="Activate all available features")
parser.add_argument("--dynamic-buildrequires", action="store_true", parser.add_argument("--dynamic-buildrequires", action="store_true",
help="Use dynamic BuildRequires feature") 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", parser.add_argument("--suffix", action="store",
help="Package suffix") help="Package suffix")
parser.add_argument("crate", help="crates.io name\n" parser.add_argument("crate", help="crates.io name\n"
@ -319,6 +321,9 @@ def main():
else: else:
kwargs["pkg_release"] = "1%{?dist}" 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 kwargs["generate_buildrequires"] = args.dynamic_buildrequires
if args.target in {"opensuse", "fedora"}: if args.target in {"opensuse", "fedora"}: