mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
build: export matching patches (#41287)
* build: make patches/config.json an array of objects This file was previously an object of patch_dir keys to repo values; Now is an array of objects containing `patch_dir` and `repo` properties. This makes other per-target properties (e.g. `grep`) possible. Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: include Note metadata when exporting patches Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: support keyword filtering in export_patches() Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: add optional `--grep` arg to git-export-patches script Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: update export_all_patches to understand new config file Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: update export_all_patches to understand new config file chore: make lint happy Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: make patches/config.json an array of objects chore: fix oops Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: remove support for the old file format There is more code using config.json than I thought, so the effort-to-reward of supporting the old format is not worth it. Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: update apply_all_patches to understand new config file Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: update lint.js to understand new config file Co-authored-by: Charles Kerr <charles@charleskerr.com> * build: update patches-mtime-cache.py to understand new config file Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: update apply_all_patches to understand new config file fix: oops Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: update apply_all_patches to understand new config file fix minor syntax wart Co-authored-by: Charles Kerr <charles@charleskerr.com> * fixup! build: support keyword filtering in export_patches() refactor: use idiomatic python Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: warn if config.json has an invalid repo Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
@@ -12,7 +12,9 @@ from lib.patches import patch_from_dir
|
||||
|
||||
|
||||
def patched_file_paths(patches_config):
|
||||
for patch_dir, repo in patches_config.items():
|
||||
for target in patches_config:
|
||||
patch_dir = target.get('patch_dir')
|
||||
repo = target.get('repo')
|
||||
for line in patch_from_dir(patch_dir).split("\n"):
|
||||
if line.startswith("+++"):
|
||||
yield posixpath.join(repo, line[6:])
|
||||
|
||||
Reference in New Issue
Block a user