Skip to content

Commit

Permalink
cargo: Merge workspace features with crate features
Browse files Browse the repository at this point in the history
Those features are additive so the workspace should not overwrite
the ones declared on the crate
  • Loading branch information
zecakeh authored and hfiguiere committed Apr 6, 2024
1 parent bb7d86b commit fc7b6e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cargo/flatpak-cargo-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ def update_workspace_keys(pkg, workspace):
if 'workspace' in item:
if isinstance(workspace_item, dict):
del item['workspace']
item.update(workspace_item)

for dep_key, workspace_value in workspace_item.items():
# features are additive
if dep_key == 'features' and 'features' in item:
item['features'] += workspace_value
else:
item[dep_key] = workspace_value
elif len(item) > 1:
del item['workspace']
item.update({ 'version': workspace_item })
Expand Down

0 comments on commit fc7b6e1

Please sign in to comment.