From 6191206292c640c050fe4d28dfc9e0e879956145 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Wed, 20 Dec 2017 16:05:17 +0100 Subject: [PATCH] Add .conf files to the files to relocate --- cerbero/build/fridge.py | 2 +- cerbero/packages/distarchive.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cerbero/build/fridge.py b/cerbero/build/fridge.py index 437ad6746..3e95a3fe2 100644 --- a/cerbero/build/fridge.py +++ b/cerbero/build/fridge.py @@ -101,7 +101,7 @@ def extract_binary(self, recipe): tar.extractall(self.config.prefix) for member in tar.getmembers(): # Simple sed for .la and .pc files - if os.path.splitext(member.name)[1] in ['.la', '.pc'] or ( + if os.path.splitext(member.name)[1] in DistArchive.RELOCATABLE_EXTENSIONS or ( 'bin' in os.path.splitext(member.name)[0] and is_text_file(os.path.join(self.config.prefix, member.name))): shell.replace(os.path.join(self.config.prefix, member.name), {"CERBERO_PREFIX": self.config.prefix}) diff --git a/cerbero/packages/distarchive.py b/cerbero/packages/distarchive.py index 37979d6b0..061618188 100644 --- a/cerbero/packages/distarchive.py +++ b/cerbero/packages/distarchive.py @@ -33,6 +33,8 @@ class DistArchive(PackagerBase): ''' Creates a distribution archive ''' + RELOCATABLE_EXTENSIONS = ['.la', '.pc', '.conf'] + def __init__(self, config, package, store, archive_type): PackagerBase.__init__(self, config, package, store) self.package = package @@ -113,7 +115,8 @@ def _create_tarball(self, filename, files, package_prefix, relocatable): filepath = os.path.join(self.prefix, f) arcname = os.path.join(package_prefix, f) if relocatable and not os.path.islink(filepath): - if os.path.splitext(f)[1] in ['.la', '.pc'] or ('bin' in os.path.splitext(f)[0] and is_text_file(filepath)): + if os.path.splitext(f)[1] in self.RELOCATABLE_EXTENSIONS or ( + 'bin' in os.path.splitext(f)[0] and is_text_file(filepath)): with open(filepath, 'r') as fo: content = fo.read() content = replace_prefix(self.config.prefix, content, "CERBERO_PREFIX")