From 4b42533d909216130ea55a2da08febe822810065 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Jan 15 2022 07:27:56 +0000 Subject: Cleanup dynamic BR handling Signed-off-by: Maxwell G --- diff --git a/go2rpm/__main__.py b/go2rpm/__main__.py index df15eba..1971ef2 100644 --- a/go2rpm/__main__.py +++ b/go2rpm/__main__.py @@ -607,18 +607,20 @@ def main(): # Prepare the repo set_repo_version(git_local_path, version, tag, commit) - # Get BuildRequires and filter them out of test BuildRequires - buildrequires = to_list(get_buildrequires(forge, subdir)) - buildrequires = [ipath for ipath in buildrequires if goipath not in ipath] - test_buildrequires = list( - set(to_list(get_test_buildrequires(forge, subdir))).difference( - set(buildrequires) + if args.no_dynamic_buildrequires: + # Get BuildRequires and filter them out of test BuildRequires + buildrequires = to_list(get_buildrequires(forge, subdir)) + buildrequires = [ipath for ipath in buildrequires if goipath not in ipath] + test_buildrequires = list( + set(to_list(get_test_buildrequires(forge, subdir))).difference( + set(buildrequires) + ) ) - ) - test_buildrequires = [ipath for ipath in test_buildrequires if goipath not in ipath] - - if not args.no_dynamic_buildrequires: + test_buildrequires = [ipath for ipath in test_buildrequires if goipath not in ipath] + else: args.dynamic_buildrequires = True + buildrequires = [] + test_buildrequires = [] description = asyncio.run(get_description(forge)) if description is not None: