@@ -348,10 +348,11 @@ def should_skip(file):
348348 # Run template command on the input file
349349 bf_outfile = os .path .join (BOOTC_IMAGE_DIR , bootcfile )
350350 run_template_cmd (bf_path , bf_outfile , dry_run )
351- # Templating may generate an empty file or in dry-run mode the file may not exist
352- if not os .path .exists (bf_outfile ) or (not dry_run and not common .file_has_valid_lines (bf_outfile )):
353- common .print_msg (f"Skipping { bootcfile } file (not created or empty)" )
354- return
351+ # Templating may generate an empty file
352+ if not dry_run :
353+ if not common .file_has_valid_lines (bf_outfile ):
354+ common .print_msg (f"Skipping an empty { bootcfile } file" )
355+ return
355356
356357 common .print_msg (f"Processing { bootcfile } with logs in { bf_logfile } " )
357358 start_process_bootc_image = time .time ()
@@ -461,10 +462,6 @@ def ostree_rev_in_registry(ce_imgref):
461462 # Run template command on the input file
462463 ce_outfile = os .path .join (BOOTC_IMAGE_DIR , containerfile )
463464 run_template_cmd (ce_path , ce_outfile , dry_run )
464- # Templating may generate an empty file or in dry-run mode the file may not exist
465- if not os .path .exists (ce_outfile ) or (not dry_run and not common .file_has_valid_lines (ce_outfile )):
466- common .print_msg (f"Skipping { containerfile } file (not created or empty)" )
467- return
468465
469466 common .print_msg (f"Processing { containerfile } with logs in { ce_logfile } " )
470467 start_process_container_encapsulate = time .time ()
@@ -615,7 +612,7 @@ def main():
615612 args .template = os .path .abspath (args .template )
616613 dir2process = os .path .dirname (args .template )
617614 pattern = os .path .basename (args .template )
618- # Make sure the input directory exists (only if specified for group_dir )
615+ # Make sure the input directory exists (only if specified)
619616 if dir2process and not os .path .isdir (dir2process ):
620617 raise Exception (f"The input directory '{ dir2process } ' does not exist" )
621618 # Make sure the local RPM repository exists
@@ -659,8 +656,8 @@ def main():
659656 if BREW_NIGHTLY_RELEASE_VERSION :
660657 extract_container_images (BREW_NIGHTLY_RELEASE_VERSION , BREW_REPO , CONTAINER_LIST , args .dry_run )
661658 # Sort the images list, only leaving unique entries
662- if os . path . exists (CONTAINER_LIST ):
663- common . sort_uniq_file ( CONTAINER_LIST )
659+ common . sort_uniq_file (CONTAINER_LIST )
660+
664661 # Process package source templates
665662 ipkgdir = f"{ SCRIPTDIR } /../package-sources-bootc"
666663 for ifile in os .listdir (ipkgdir ):
0 commit comments