aboutsummaryrefslogtreecommitdiff
path: root/ipsutils
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2013-07-09 15:25:03 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2013-07-09 15:25:03 -0400
commit34abef358862d5e7fb151f74e33bc5e79b40698b (patch)
tree49e3f43651a13ba48ef764af331baf96584f0aa5 /ipsutils
parent3e916a8d425c07a91b628f65b1a77c30aa7a442b (diff)
downloadipsutils-34abef358862d5e7fb151f74e33bc5e79b40698b.tar.gz
Implement 'badpath' keyword to circumvent evil archivers (aka programmers)
Diffstat (limited to 'ipsutils')
-rw-r--r--ipsutils/config.py6
-rw-r--r--ipsutils/env.py5
2 files changed, 9 insertions, 2 deletions
diff --git a/ipsutils/config.py b/ipsutils/config.py
index 756d8fa..3f4dc08 100644
--- a/ipsutils/config.py
+++ b/ipsutils/config.py
@@ -38,6 +38,7 @@ class Config(object):
key_dict['arch'] = ''
key_dict['classification'] = ''
key_dict['description'] = ''
+ key_dict['badpath'] = ''
#Define valid build script sections in SPEC file
script_dict = collections.OrderedDict()
@@ -88,7 +89,7 @@ class Config(object):
continue
if line.startswith('#'):
continue
- parts = shlex.split(line)
+ parts = shlex.split(line, posix=False)
if '%end' in parts:
found_data = False
if section in parts:
@@ -103,6 +104,9 @@ class Config(object):
if not self.check_keywords():
exit(1)
+ def _quote(self, s):
+ return "'" + s.replace("'", "'\\''") + "'"
+
def check_keywords(self):
"""Validate SPEC file's FMRI section
"""
diff --git a/ipsutils/env.py b/ipsutils/env.py
index ce9dd21..0551b3c 100644
--- a/ipsutils/env.py
+++ b/ipsutils/env.py
@@ -46,9 +46,12 @@ class Environment(config.Config):
'PKGS': self.pathgen('PKGS'),
'SPKGS': self.pathgen('SPKGS')
}
+
# complete_name is required to build proper path names.
- # The use of "self" in this case may be deprecated in the future.
self.complete_name = self.key_dict['name'] + '-' + self.key_dict['version']
+ if self.key_dict['badpath']:
+ self.complete_name = self.key_dict['badpath']
+
# Dictionary of package-level directories
self.env_pkg = {
'BUILDROOT': os.path.join(self.env['BUILDROOT'], self.complete_name),