Fixed update_patches.py to now delete old patch files that have no working src relation

This commit is contained in:
LexManos 2012-04-06 02:04:02 -07:00
parent b94ad38ec3
commit cf0ce3b086

View file

@ -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'):