Skip to content

Commit ad162ae

Browse files
authored
[Build] Optimize the version control for Debian packages (#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 d7d6445 commit ad162ae

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Makefile.work

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ PREPARE_DOCKER=BUILD_SLAVE=y \
224224
DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
225225
SONIC_VERSION_CACHE=$(SONIC_VERSION_CACHE) \
226226
DBGOPT='$(DBGOPT)' \
227+
MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \
227228
scripts/prepare_docker_buildinfo.sh \
228229
$(SLAVE_BASE_IMAGE) \
229230
$(SLAVE_DIR)/Dockerfile \

scripts/prepare_docker_buildinfo.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if [ -z "$DISTRO" ]; then
3838
fi
3939
fi
4040

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

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

+3
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ update_version_file()
382382
update_version_files()
383383
{
384384
local version_names="versions-deb versions-py2 versions-py3"
385+
if [ "$MIRROR_SNAPSHOT" == y ]; then
386+
version_names="versions-py2 versions-py3"
387+
fi
385388
for version_name in $version_names; do
386389
update_version_file $version_name
387390
done

0 commit comments

Comments
 (0)