From 34abef358862d5e7fb151f74e33bc5e79b40698b Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 9 Jul 2013 15:25:03 -0400 Subject: Implement 'badpath' keyword to circumvent evil archivers (aka programmers) --- ipsutils/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipsutils/config.py') 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 """ -- cgit