Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .conf files to the files to relocate #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cerbero/build/fridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
5 changes: 4 additions & 1 deletion cerbero/packages/distarchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down