From 471de730c4e0822fab5a551af38a7148c5da4266 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Thu, 3 Apr 2014 09:09:15 +0000 Subject: Fix strip-gplv3.configure. Updating the configuration extension to make it works with the artifacts produced by chunk splitting. Is a temporary fix. This should be done adding chunk splitting and stratum splitting rules. --- strip-gplv3.configure | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/strip-gplv3.configure b/strip-gplv3.configure index b0a1ff5f..5be060bf 100755 --- a/strip-gplv3.configure +++ b/strip-gplv3.configure @@ -51,17 +51,21 @@ class StripGPLv3ConfigureExtension(cliapp.Application): def process_args(self, args): target_root = args[0] + meta_dir = os.path.join(target_root, 'baserock') for chunk in self.gplv3_chunks: - self.remove_chunk(target_root, chunk[0], chunk[1]) + regex = os.path.join(meta_dir, "%s-[^-]\+\.meta" % chunk[0]) + artifacts = self.runcmd(['find', meta_dir, '-regex', regex]) + + for artifact in artifacts.split(): + self.remove_chunk(target_root, artifact, chunk[1]) os.remove(os.path.join(target_root, 'usr', 'bin', 'awk')) os.symlink(os.path.join(os.sep, 'bin', 'busybox'), os.path.join(target_root, 'usr', 'bin', 'awk')) def remove_chunk(self, target_root, chunk, pattern): - chunk_meta_path = os.path.join(target_root, 'baserock', - chunk + '.meta') + chunk_meta_path = os.path.join(target_root, 'baserock', chunk) with open(chunk_meta_path, 'r') as f: chunk_meta_data = json.load(f) @@ -76,8 +80,6 @@ class StripGPLv3ConfigureExtension(cliapp.Application): self.remove_content_entry(target_root, content_entry) 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