From: Michael Tremer Date: Thu, 22 Dec 2011 10:25:01 +0000 (+0100) Subject: Add a hack so you cannot append new strings in the same line for deps. X-Git-Tag: 0.9.20~33^2~4^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b240bb00210587c63784b131add768be9a3ae495;p=pakfire.git Add a hack so you cannot append new strings in the same line for deps. We need to review that later. --- diff --git a/python/pakfire/packages/lexer.py b/python/pakfire/packages/lexer.py index ac68971f6..5fa235ce7 100644 --- a/python/pakfire/packages/lexer.py +++ b/python/pakfire/packages/lexer.py @@ -323,6 +323,8 @@ class Lexer(object): raise LexerUnhandledLine, "%d: %s" % (self.lineno, line) + DEP_DEFINITIONS = ("prerequires", "requires", "provides", "conflicts", "obsoletes",) + def parse_definition(self, pattern=LEXER_DEFINITION): line = self.get_line(self._lineno) @@ -338,7 +340,11 @@ class Lexer(object): if o == "+": prev = self.get_var(k, default=None, raw=True) if prev: - v = " ".join((prev or "", v)) + # Add a newline for all dependencies. + if k in self.DEP_DEFINITIONS: + prev += "\n" + + v = " ".join((prev or "", v.strip())) elif o == ":": # Expand the value immediately and save it.