summaryrefslogtreecommitdiff
path: root/strip-gplv3.configure
diff options
context:
space:
mode:
authorRichard Dale <richard.dale@codethink.co.uk>2013-06-27 11:26:01 +0100
committerRichard Dale <richard.dale@codethink.co.uk>2013-06-27 11:26:01 +0100
commitfd27b55e3942af9ab1fc5cf418e0b756badfe433 (patch)
treec6800298831208734681448e3f0b9940be776d4b /strip-gplv3.configure
parent9803db01c6d9c624a68e37cee0829176e0906b3b (diff)
downloaddefinitions-fd27b55e3942af9ab1fc5cf418e0b756badfe433.tar.gz
Don't delete meta file when some files from a chunk are kept
Diffstat (limited to 'strip-gplv3.configure')
-rwxr-xr-xstrip-gplv3.configure6
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)