def check_patches(series, patch_files, run_checkpatch, verbose): """Run some checks on a set of patches This santiy-checks the patman tags like Series-version and runs the patches through checkpatch Args: series (Series): Series object for this series (set of patches) patch_files (list): List of patch filenames, each a string, e.g. ['0001_xxx.patch', '0002_yyy.patch'] run_checkpatch (bool): True to run checkpatch.pl verbose (bool): True to print out every line of the checkpatch output as it is parsed Returns: bool: True if the patches had no errors, False if they did """ # Do a few checks on the series series.DoChecks() # Check the patches, and run them through 'git am' just to be sure if run_checkpatch: ok = checkpatch.CheckPatches(verbose, patch_files) else: ok = True return ok
if options.count: series = patchstream.GetMetaData(options.start, options.count) cover_fname, args = gitutil.CreatePatches(options.start, options.count, series) # Fix up the patch files to our liking, and insert the cover letter patchstream.FixPatches(series, args) if cover_fname and series.get('cover'): patchstream.InsertCoverLetter(cover_fname, series, options.count) # Do a few checks on the series series.DoChecks() # Check the patches, and run them through 'git am' just to be sure if options.check_patch: ok = checkpatch.CheckPatches(options.verbose, args) else: ok = True cc_file = series.MakeCcFile(options.process_tags, cover_fname, not options.ignore_bad_tags, options.add_maintainers, options.limit) # Email the patches out (giving the user time to check / cancel) cmd = '' its_a_go = ok or options.ignore_errors if its_a_go: cmd = gitutil.EmailPatches(series, cover_fname, args, options.dry_run,