From c9326cc1edc9e84e950cdec7f0cecd4a520570ac Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Mon, 17 Jul 2017 22:38:07 +0200 Subject: [PATCH] Write deterministic local.conf and bblayers.conf Sort the header sections by their keys and the layers by their names. This will re-enable writing deterministic config files, and bitbake can use its cache again, accelerating rebuild startup times a lot. While at it, indent the layers in bblayers.conf nicely. Signed-off-by: Jan Kiszka --- kas/config.py | 2 +- kas/libcmds.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kas/config.py b/kas/config.py index 88beb44..03285ff 100644 --- a/kas/config.py +++ b/kas/config.py @@ -154,7 +154,7 @@ class Config: Returns the local.conf header """ header = '' - for key, value in self._config.get(header_name, {}).items(): + for key, value in sorted(self._config.get(header_name, {}).items()): header += '# {}\n{}\n'.format(key, value) return header diff --git a/kas/libcmds.py b/kas/libcmds.py index 4279ad2..052425e 100644 --- a/kas/libcmds.py +++ b/kas/libcmds.py @@ -184,9 +184,10 @@ class WriteConfig(Command): filename = config.build_dir + '/conf/bblayers.conf' with open(filename, 'w') as fds: fds.write(config.get_bblayers_conf_header()) - fds.write('BBLAYERS ?= " \\\n') - for repo in config.get_repos(): - fds.write(' \\\n'.join(repo.layers + [''])) + fds.write('BBLAYERS ?= " \\\n ') + fds.write(' \\\n '.join( + sorted(layer for repo in config.get_repos() + for layer in repo.layers))) fds.write('"\n') def _write_local_conf(config):