Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonic_debian_extension] fix packages.json generation and make the bu… #39

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion files/build_templates/packages.json.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
{% for docker_installation_target in installer_images.strip().split() -%}
{% set pkgname, docker_build_path, image = docker_installation_target.split('|') -%}
{% set pkgname, docker_build_path, _, image = docker_installation_target.split('|') -%}
{% set imagefilepath = image.split(':')|first -%}
{% set imageversion = image.split(':')|last -%}
{% set imagefilename = imagefilepath.split('/')|last -%}
Expand Down
4 changes: 4 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,10 @@ fi
SONIC_PACKAGE_MANAGER_FOLDER="/var/lib/sonic-package-manager/"
sudo mkdir -p $FILESYSTEM_ROOT/$SONIC_PACKAGE_MANAGER_FOLDER
j2 $BUILD_TEMPLATES/packages.json.j2 | sudo tee $FILESYSTEM_ROOT/$SONIC_PACKAGE_MANAGER_FOLDER/packages.json
if [ "${PIPESTATUS[0]}" != "0" ]; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stepanblyschak have you considered shopt -s pipefail as general solution?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually no, I think it might break other things that do want to hide error?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stepanblyschak ok. Then no need to change.

echo "Failed to generate packages.json" >&2
exit 1
fi

# Copy docker_image_ctl.j2 for SONiC Package Manager
sudo cp $BUILD_TEMPLATES/docker_image_ctl.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/docker_image_ctl.j2
Expand Down