Skip to content

Commit f7c952a

Browse files
committed
Suppress the build spawning if --trust-cache is set
1 parent 613f2ee commit f7c952a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

bconds.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ def parse_args():
419419
default=False,
420420
help="Don't refresh the gitrepo of each existing component, just send new components scratchbuilds and downloads srpms."
421421
)
422+
parser.add_argument(
423+
'--trust-cache',
424+
action='store_true',
425+
default=False,
426+
help="Trust cached BuildRequires data and skip builds for packages already in cache."
427+
)
422428
parser.add_argument(
423429
'packages',
424430
nargs='*',
@@ -430,11 +436,19 @@ def parse_args():
430436
if __name__ == '__main__':
431437
args = parse_args()
432438

439+
read_bconds_cache_if_exists()
440+
433441
# build everything
434442
something_was_submitted = False
435443
for component_name, bcond_config in each_bcond_name_config():
436444
if args.packages and component_name not in args.packages:
437445
continue
446+
447+
# If trusting cache and buildrequires already exists, skip build
448+
if args.trust_cache and 'buildrequires' in bcond_config:
449+
log(f'• {component_name} ({bcond_config["id"]}): Using cached BuildRequires, skipping build')
450+
continue
451+
438452
something_was_submitted |= scratchbuild_patched_if_needed(component_name, bcond_config, no_git_refresh=args.no_git_refresh)
439453

440454
# download everything until there's nothing downloaded

0 commit comments

Comments
 (0)