From: Michael Tremer Date: Thu, 6 Oct 2011 09:40:23 +0000 (+0200) Subject: Support := operator for variables. X-Git-Tag: 0.9.13~9^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0855b97baffd5de3a6cf30af6f2c6021d1e0e641;p=pakfire.git Support := operator for variables. Works exactly like := in GNU make. --- diff --git a/python/pakfire/packages/lexer.py b/python/pakfire/packages/lexer.py index 80d976735..99a71ae7d 100644 --- a/python/pakfire/packages/lexer.py +++ b/python/pakfire/packages/lexer.py @@ -32,7 +32,7 @@ LEXER_COMMENT = re.compile(r"^\s*#") LEXER_QUOTES = "\"'" LEXER_EMPTY_LINE = re.compile(r"^\s*$") -LEXER_DEFINITION = re.compile(r"^([A-Za-z0-9_\-]+)\s*(\+)?=\s*(.+)?$") +LEXER_DEFINITION = re.compile(r"^([A-Za-z0-9_\-]+)\s*([\+\:])?=\s*(.+)?$") LEXER_BLOCK_LINE_INDENT = "\t" LEXER_BLOCK_LINE = re.compile(r"^\t(.*)$") @@ -334,6 +334,10 @@ class Lexer(object): if prev: v = " ".join((prev or "", v)) + elif o == ":": + # Expand the value immediately and save it. + v = self.expand_string(v) + # Handle backslash. while v and v.endswith("\\"): line = self.get_line(self._lineno)