diff options
| -rw-r--r-- | bitbake/lib/bb/tinfoil.py | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/bitbake/lib/bb/tinfoil.py b/bitbake/lib/bb/tinfoil.py index 56ce54f6b9..c05e1465f1 100644 --- a/bitbake/lib/bb/tinfoil.py +++ b/bitbake/lib/bb/tinfoil.py | |||
| @@ -25,7 +25,8 @@ import bb.cache | |||
| 25 | import bb.cooker | 25 | import bb.cooker |
| 26 | import bb.providers | 26 | import bb.providers |
| 27 | import bb.utils | 27 | import bb.utils |
| 28 | from bb.cooker import state | 28 | from bb.cooker import state, BBCooker |
| 29 | from bb.cookerdata import CookerConfiguration, ConfigParameters | ||
| 29 | import bb.fetch2 | 30 | import bb.fetch2 |
| 30 | 31 | ||
| 31 | class Tinfoil: | 32 | class Tinfoil: |
| @@ -43,12 +44,11 @@ class Tinfoil: | |||
| 43 | console.setFormatter(format) | 44 | console.setFormatter(format) |
| 44 | self.logger.addHandler(console) | 45 | self.logger.addHandler(console) |
| 45 | 46 | ||
| 46 | initialenv = os.environ.copy() | 47 | self.config = CookerConfiguration() |
| 47 | bb.utils.clean_environment() | 48 | configparams = TinfoilConfigParameters(parse_only=True) |
| 48 | self.config = TinfoilConfig(parse_only=True) | 49 | self.config.setConfigParameters(configparams) |
| 49 | self.cooker = bb.cooker.BBCooker(self.config, | 50 | self.config.setServerRegIdleCallback(self.register_idle_function) |
| 50 | self.register_idle_function, | 51 | self.cooker = BBCooker(self.config) |
| 51 | initialenv) | ||
| 52 | self.config_data = self.cooker.configuration.data | 52 | self.config_data = self.cooker.configuration.data |
| 53 | bb.providers.logger.setLevel(logging.ERROR) | 53 | bb.providers.logger.setLevel(logging.ERROR) |
| 54 | self.cooker_data = None | 54 | self.cooker_data = None |
| @@ -81,20 +81,21 @@ class Tinfoil: | |||
| 81 | else: | 81 | else: |
| 82 | self.parseRecipes() | 82 | self.parseRecipes() |
| 83 | 83 | ||
| 84 | class TinfoilConfigParameters(ConfigParameters): | ||
| 84 | 85 | ||
| 85 | class TinfoilConfig(object): | ||
| 86 | def __init__(self, **options): | 86 | def __init__(self, **options): |
| 87 | self.pkgs_to_build = [] | 87 | self.initial_options = options |
| 88 | self.debug_domains = [] | 88 | super(TinfoilConfigParameters, self).__init__() |
| 89 | self.extra_assume_provided = [] | ||
| 90 | self.prefile = [] | ||
| 91 | self.postfile = [] | ||
| 92 | self.debug = 0 | ||
| 93 | self.__dict__.update(options) | ||
| 94 | 89 | ||
| 95 | def __getattr__(self, attribute): | 90 | def parseCommandLine(self): |
| 96 | try: | 91 | class DummyOptions: |
| 97 | return super(TinfoilConfig, self).__getattribute__(attribute) | 92 | def __init__(self, initial_options): |
| 98 | except AttributeError: | 93 | self.show_environment = False |
| 99 | return None | 94 | self.pkgs_to_build = [] |
| 95 | self.prefile = [] | ||
| 96 | self.postfile = [] | ||
| 97 | self.tracking = False | ||
| 98 | for key, val in initial_options.items(): | ||
| 99 | setattr(self, key, val) | ||
| 100 | 100 | ||
| 101 | return DummyOptions(self.initial_options), None | ||
