diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-06-30 23:02:53 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-07-01 17:17:36 +0100 |
commit | f3be8e9a7df13cc11ffc8fc667efaf2db96a7c38 (patch) | |
tree | 879e825269f5d1f6523259a92f883e5f22278116 /bitbake | |
parent | 22d8fb1fc3be67ef01a7bbe161d9b303fcad4e53 (diff) | |
download | poky-f3be8e9a7df13cc11ffc8fc667efaf2db96a7c38.tar.gz |
bitbake: add -R option for loading configuration files after bitbake.conf
Useful if you want to load a configuration file that sets values which may
also be set in bitbake.conf or one of the files it includes.
(Bitbake rev: a8246ae5400c23df0d3ee29c36f4d9f257d1e6d1)
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/bin/bitbake | 5 | ||||
-rw-r--r-- | bitbake/lib/bb/cooker.py | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 29e9acd97a..2564e97123 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
@@ -118,7 +118,10 @@ Default BBFILES are the .bb files in the current directory.""") | |||
118 | action = "store", dest = "cmd") | 118 | action = "store", dest = "cmd") |
119 | 119 | ||
120 | parser.add_option("-r", "--read", help = "read the specified file before bitbake.conf", | 120 | parser.add_option("-r", "--read", help = "read the specified file before bitbake.conf", |
121 | action = "append", dest = "file", default = []) | 121 | action = "append", dest = "prefile", default = []) |
122 | |||
123 | parser.add_option("-R", "--postread", help = "read the specified file after bitbake.conf", | ||
124 | action = "append", dest = "postfile", default = []) | ||
122 | 125 | ||
123 | parser.add_option("-v", "--verbose", help = "output more chit-chat to the terminal", | 126 | parser.add_option("-v", "--verbose", help = "output more chit-chat to the terminal", |
124 | action = "store_true", dest = "verbose", default = False) | 127 | action = "store_true", dest = "verbose", default = False) |
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index aceb084b75..6d59660794 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -129,7 +129,8 @@ class BBCooker: | |||
129 | bb.data.inheritFromOS(self.configuration.data) | 129 | bb.data.inheritFromOS(self.configuration.data) |
130 | 130 | ||
131 | try: | 131 | try: |
132 | self.parseConfigurationFiles(self.configuration.file) | 132 | self.parseConfigurationFiles(self.configuration.prefile, |
133 | self.configuration.postfile) | ||
133 | except SyntaxError: | 134 | except SyntaxError: |
134 | sys.exit(1) | 135 | sys.exit(1) |
135 | except Exception: | 136 | except Exception: |
@@ -653,10 +654,12 @@ class BBCooker: | |||
653 | def _findLayerConf(self): | 654 | def _findLayerConf(self): |
654 | return self._findConfigFile("bblayers.conf") | 655 | return self._findConfigFile("bblayers.conf") |
655 | 656 | ||
656 | def parseConfigurationFiles(self, files): | 657 | def parseConfigurationFiles(self, prefiles, postfiles): |
657 | data = self.configuration.data | 658 | data = self.configuration.data |
658 | bb.parse.init_parser(data) | 659 | bb.parse.init_parser(data) |
659 | for f in files: | 660 | |
661 | # Parse files for loading *before* bitbake.conf and any includes | ||
662 | for f in prefiles: | ||
660 | data = _parse(f, data) | 663 | data = _parse(f, data) |
661 | 664 | ||
662 | layerconf = self._findLayerConf() | 665 | layerconf = self._findLayerConf() |
@@ -680,6 +683,10 @@ class BBCooker: | |||
680 | 683 | ||
681 | data = _parse(os.path.join("conf", "bitbake.conf"), data) | 684 | data = _parse(os.path.join("conf", "bitbake.conf"), data) |
682 | 685 | ||
686 | # Parse files for loading *after* bitbake.conf and any includes | ||
687 | for p in postfiles: | ||
688 | data = _parse(p, data) | ||
689 | |||
683 | # Handle any INHERITs and inherit the base class | 690 | # Handle any INHERITs and inherit the base class |
684 | bbclasses = ["base"] + (data.getVar('INHERIT', True) or "").split() | 691 | bbclasses = ["base"] + (data.getVar('INHERIT', True) or "").split() |
685 | for bbclass in bbclasses: | 692 | for bbclass in bbclasses: |