]> git.ipfire.org Git - pakfire.git/commitdiff
Add a hack so you cannot append new strings in the same line for deps.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 22 Dec 2011 10:25:01 +0000 (11:25 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 22 Dec 2011 15:02:33 +0000 (16:02 +0100)
We need to review that later.

python/pakfire/packages/lexer.py

index ac68971f6aec3c8621073c8cf5c86c4dffe80965..5fa235ce72e69e7e03e12b474b0f2a7124cc6c70 100644 (file)
@@ -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.