summaryrefslogtreecommitdiff
path: root/strip-gplv3.configure
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-04-03 09:09:15 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-04-03 18:22:39 +0100
commit471de730c4e0822fab5a551af38a7148c5da4266 (patch)
treefd3c73a88a52eb7927d674a84241d216c3591481 /strip-gplv3.configure
parent145242a808f4f7cffbd03224c895bbd1ac6b6df9 (diff)
downloaddefinitions-471de730c4e0822fab5a551af38a7148c5da4266.tar.gz
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.
Diffstat (limited to 'strip-gplv3.configure')
-rwxr-xr-xstrip-gplv3.configure12
1 files 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)