Skip to content

Commit

Permalink
[Build] Optimize the version control for Debian packages (#14557) (#1…
Browse files Browse the repository at this point in the history
…4610)

Why I did it
Optimize the version control for Debian packages.
Fix sonic-slave-buster/sources.list.amd64 not found display issue, need to generate the file before running the shell command to evaluate the sonic image tag.
When using the snapshot mirror, it is not necessary to update the version file based on the base image. It will reduce the version dependency issue, when an image is not run when freezing the version.

How I did it
Not to update the version file when snapshot mirror enabled.

How to verify it
  • Loading branch information
xumia committed Apr 12, 2023
1 parent 73766c2 commit 4ce33aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \

PREPARE_DOCKER=BUILD_SLAVE=y \
DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \
scripts/prepare_docker_buildinfo.sh \
$(SLAVE_BASE_IMAGE) \
$(SLAVE_DIR)/Dockerfile \
Expand Down
2 changes: 1 addition & 1 deletion scripts/prepare_docker_buildinfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ -z "$DISTRO" ]; then
[ -z "$DISTRO" ] && DISTRO=jessie
fi

if [[ "$IMAGENAME" == docker-base-* ]] || [[ "$IMAGENAME" == docker-ptf ]]; then
if [[ "$IMAGENAME" == sonic-slave-* ]] || [[ "$IMAGENAME" == docker-base-* ]] || [[ "$IMAGENAME" == docker-ptf ]]; then
scripts/build_mirror_config.sh ${DOCKERFILE_PATH} $ARCH $DISTRO
fi

Expand Down
3 changes: 3 additions & 0 deletions src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ update_version_file()
update_version_files()
{
local version_names="versions-deb versions-py2 versions-py3"
if [ "$MIRROR_SNAPSHOT" == y ]; then
version_names="versions-py2 versions-py3"
fi
for version_name in $version_names; do
update_version_file $version_name
done
Expand Down

0 comments on commit 4ce33aa

Please sign in to comment.