diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2013-06-27 11:26:01 +0100 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2013-06-27 11:26:01 +0100 |
commit | fd27b55e3942af9ab1fc5cf418e0b756badfe433 (patch) | |
tree | c6800298831208734681448e3f0b9940be776d4b | |
parent | 9803db01c6d9c624a68e37cee0829176e0906b3b (diff) | |
download | definitions-fd27b55e3942af9ab1fc5cf418e0b756badfe433.tar.gz |
Don't delete meta file when some files from a chunk are kept
-rwxr-xr-x | strip-gplv3.configure | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/strip-gplv3.configure b/strip-gplv3.configure index 3672d55a..44af2739 100755 --- a/strip-gplv3.configure +++ b/strip-gplv3.configure @@ -65,11 +65,15 @@ class StripGPLv3ConfigureExtension(cliapp.Application): if not 'contents' in chunk_meta_data: raise cliapp.AppError('Chunk %s does not have a "contents" list' % chunk) + updated_contents = [] for content_entry in reversed(chunk_meta_data['contents']): pat = re.compile(pattern) if len(pattern) == 0 or not pat.match(content_entry): self.remove_content_entry(target_root, content_entry) - os.remove(chunk_meta_path) + else: + updated_contents.append(content_entry) + if len(updated_contents) == 0: + os.remove(chunk_meta_path) def remove_content_entry(self, target_root, content_entry): entry_path = os.path.join(target_root, './' + content_entry) |