diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-02-05 18:11:41 +0100 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-02-05 18:11:41 +0100 |
commit | 8a036bc73353300ab84eb1d72807d9376cc7b4f5 (patch) | |
tree | 35370c809c89798074d0e746f9f8b881187da849 /src/hydrilla_builder/build.py | |
parent | 34072d8dafb7a71fe49ce56fa4f3dc2746b7c741 (diff) | |
download | hydrilla-builder-8a036bc73353300ab84eb1d72807d9376cc7b4f5.tar.gz hydrilla-builder-8a036bc73353300ab84eb1d72807d9376cc7b4f5.zip |
add test case with modified index.json from the example
Diffstat (limited to 'src/hydrilla_builder/build.py')
-rw-r--r-- | src/hydrilla_builder/build.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/hydrilla_builder/build.py b/src/hydrilla_builder/build.py index dcd7e01..e7c6962 100644 --- a/src/hydrilla_builder/build.py +++ b/src/hydrilla_builder/build.py @@ -223,8 +223,8 @@ class Build: index_obj = json.loads(strip_json_comments(index_json_text)) - self.files_by_path[self.index_json_path] = \ - FileRef(self.index_json_path, index_json_text.encode()) + self.files_by_path[self.srcdir / 'index.json'] = \ + FileRef(self.srcdir / 'index.json', index_json_text.encode()) self._process_index_json(index_obj) @@ -302,7 +302,7 @@ class Build: """ copy_props = ['type', 'identifier', 'long_name', 'uuid', 'description'] if 'comment' in item_def: - copy_props.append(copy_props) + copy_props.append('comment') if item_def['type'] == 'resource': item_list = self.resource_list @@ -319,8 +319,9 @@ class Build: else: item_list = self.mapping_list - payloads = dict([(pat, {'identifier': res_ref['identifier']}) - for pat, res_ref in item_def['payloads'].items()]) + payloads = {} + for pat, res_ref in item_def.get('payloads', {}).items(): + payloads[pat] = {'identifier': res_ref['identifier']} new_item_obj = { 'payloads': payloads @@ -386,6 +387,9 @@ class Build: 'source_archives': source_archives_obj } + if 'comment' in index_obj: + self.source_description['comment'] = index_obj['comment'] + def write_source_package_zip(self, dstpath: Path): """ Create a .zip archive containing files needed to build this source |