]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
makefiles: Let packages inherit environment from build block.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 16 Dec 2011 18:59:48 +0000 (19:59 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 16 Dec 2011 18:59:48 +0000 (19:59 +0100)
A lot of variables are often reused there and we should not
pollute the root with that.

python/pakfire/packages/lexer.py

index 1bfcaacd6427cdcc4e52ef5dbd6209d6cad23842..105065539ed5b7f6a8e0120d5be13d846b759fc7 100644 (file)
@@ -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)