From b80b83826f49e17eab5e71d796be1f47a65e3815 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sun, 31 Mar 2013 23:52:20 +0200 Subject: [PATCH] apply patches more robustly Treat each directory with only files as a patchdir. Signed-off-by: Johannes Berg --- gentree.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gentree.py b/gentree.py index 492631049b89..8a5acb4cc979 100755 --- a/gentree.py +++ b/gentree.py @@ -186,19 +186,17 @@ def main(): patchdirs = [] for root, dirs, files in os.walk(os.path.join(source_dir, 'patches')): - for f in files: - if f.endswith('.patch'): - patchdirs.append(root) - break + if not dirs: + patchdirs.append(root) patchdirs.sort() for pdir in patchdirs: l = os.listdir(pdir) - if 'INFO' in l: - l.remove('INFO') printed = False for pfile in l: pfile = os.path.join(pdir, pfile) p = patch.fromfile(pfile) + if not p: + continue patched_file = '/'.join(p.items[0].source.split('/')[1:]) fullfn = os.path.join(args.outdir, patched_file) if not os.path.exists(fullfn): -- 2.30.2