diff options
Diffstat (limited to 'ipsutils/config.py')
-rw-r--r-- | ipsutils/config.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ipsutils/config.py b/ipsutils/config.py index 756d8fa..eed142c 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() @@ -56,7 +57,7 @@ class Config(object): for line in file(ipsfile).readlines(): parts = shlex.split(line) if key + ":" in parts: - key_dict[key] = parts[1] + key_dict[key] = line[line.find(':')+1:].lstrip(' ').rstrip('\n').rstrip(' ') #Drop using the original file in favor of a StringIO buffer #Because we need room to breathe without rewriting the file @@ -76,8 +77,8 @@ class Config(object): for line in ipsfile_output: parts = shlex.split(line) if key + ":" in parts: - key_dict[key] = parts[1] - + key_dict[key] = line[line.find(':')+1:].lstrip(' ').rstrip('\n').rstrip(' ') + #Parse user defined scripts by section and store them in script_dict found_data = False code_section = ['%build', '%prep', '%install', '%transforms'] @@ -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 """ |