From 0855b97baffd5de3a6cf30af6f2c6021d1e0e641 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 6 Oct 2011 11:40:23 +0200 Subject: [PATCH] Support := operator for variables. Works exactly like := in GNU make. --- python/pakfire/packages/lexer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.39.5