Skip to content

Commit

Permalink
manifest: correctly handle unspecified stage packages (#3828)
Browse files Browse the repository at this point in the history
Stage packages in manifest used the values from the state assets and
was populated with null when no stage packages were defined in the
part. Fixed to use empty list in this case.

Signed-off-by: Claudio Matsuoka <[email protected]>
  • Loading branch information
cmatsuoka authored Jul 6, 2022
1 parent 426beb5 commit cd72857
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion snapcraft/parts/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def _generate_manifest(
for name, part in parts.items():
assets = lifecycle.get_part_pull_assets(part_name=name)
if assets:
part["stage-packages"] = assets.get("stage-packages", [])
part["stage-packages"] = assets.get("stage-packages", []) or []
for key in ("stage", "prime", "stage-packages", "build-packages"):
part.setdefault(key, [])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ parts:
plugin: nil
stage-packages:
- hello
other-part:
plugin: nil

0 comments on commit cd72857

Please sign in to comment.