Skip to content

Commit c154289

Browse files
committed
[Build] Optimize the version control for Debian packages (sonic-net#14557)
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
1 parent cde1574 commit c154289

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

Makefile.work

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \
203203

204204
PREPARE_DOCKER=BUILD_SLAVE=y \
205205
DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
206+
MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \
206207
scripts/prepare_docker_buildinfo.sh \
207208
$(SLAVE_BASE_IMAGE) \
208209
$(SLAVE_DIR)/Dockerfile \

scripts/prepare_docker_buildinfo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if [ -z "$DISTRO" ]; then
2323
[ -z "$DISTRO" ] && DISTRO=jessie
2424
fi
2525

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

src/sonic-build-hooks/scripts/buildinfo_base.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ update_version_file()
351351
update_version_files()
352352
{
353353
local version_names="versions-deb versions-py2 versions-py3"
354+
if [ "$MIRROR_SNAPSHOT" == y ]; then
355+
version_names="versions-py2 versions-py3"
356+
fi
354357
for version_name in $version_names; do
355358
update_version_file $version_name
356359
done

0 commit comments

Comments
 (0)