From fd27b55e3942af9ab1fc5cf418e0b756badfe433 Mon Sep 17 00:00:00 2001 From: Richard Dale Date: Thu, 27 Jun 2013 11:26:01 +0100 Subject: Don't delete meta file when some files from a chunk are kept --- strip-gplv3.configure | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'strip-gplv3.configure') 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) -- cgit v1.2.1