From: Michael Tremer Date: Fri, 16 Dec 2011 18:59:48 +0000 (+0100) Subject: makefiles: Let packages inherit environment from build block. X-Git-Tag: 0.9.20~36^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db2d5e27b5295adce1b4bcf54a374e54a7100a1c;p=pakfire.git makefiles: Let packages inherit environment from build block. A lot of variables are often reused there and we should not pollute the root with that. --- diff --git a/python/pakfire/packages/lexer.py b/python/pakfire/packages/lexer.py index 1bfcaacd6..105065539 100644 --- a/python/pakfire/packages/lexer.py +++ b/python/pakfire/packages/lexer.py @@ -803,9 +803,6 @@ class RootLexer(ExportLexer): def init(self, environ): ExportLexer.init(self, environ) - # A place to store all packages and templates. - self.packages = PackagesLexer([], parent=self) - # Import all environment variables. if environ: for k, v in environ.items(): @@ -816,6 +813,12 @@ class RootLexer(ExportLexer): # Place for build instructions self.build = BuildLexer([], parent=self) + # A place to store all packages and templates. + # The parent of this is the build block because a lot + # of relevant variables are set there and need to be used + # later. That keeps us the root lexer a bit more clean. + self.packages = PackagesLexer([], parent=self.build) + # Place for quality-agent exceptions self.quality_agent = QualityAgentLexer([], parent=self)