From cf0ce3b08696bfd19133ead534d2f7548948b7cb Mon Sep 17 00:00:00 2001 From: LexManos Date: Fri, 6 Apr 2012 02:04:02 -0700 Subject: [PATCH] Fixed update_patches.py to now delete old patch files that have no working src relation --- forge/update_patches.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/forge/update_patches.py b/forge/update_patches.py index f363c1a73..69313d0c0 100644 --- a/forge/update_patches.py +++ b/forge/update_patches.py @@ -54,7 +54,14 @@ def main(): if os.path.isfile(patch_file): print 'Deleting empty patch: ' + patch_file os.remove(patch_file) - + + for path, _, filelist in os.walk('patches', followlinks=True): + for cur_file in fnmatch.filter(filelist, '*.patch'): + src_file = os.path.normpath(os.path.join(work, path[8:], cur_file[:-6])) + if not os.path.isfile(src_file): + print 'Deleting empty patch: %s' % os.path.join(path, cur_file) + os.remove(os.path.join(path, cur_file)) + cleanDirs('patches') print 'Grabing copy of Conf' if os.path.exists('conf'):