Skip to content

Commit ff57447

Browse files
xumiamssonicbld
authored andcommitted
[Build] Change the default mirror version config file (#13786)
Why I did it Change the mirror config file Use the files/build/versions/default/versions-mirror only when reproducible build enabled. The config in files/build/versions is only for reproducible build, while snapshot mirror feature does not have the dependency on the reproducible build. How I did it Skip the mirror config in files/build/versions/default/versions-mirror if reproducible build not enabled. How to verify it
1 parent d70e8e1 commit ff57447

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Makefile.work

+1
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ endif
529529

530530
export MIRROR_URLS
531531
export MIRROR_SECURITY_URLS
532+
export SONIC_VERSION_CONTROL_COMPONENTS
532533

533534
%:: | sonic-build-hooks
534535
ifneq ($(filter y, $(MULTIARCH_QEMU_ENVIRON) $(CROSS_BUILD_ENVIRON)),)

scripts/build_mirror_config.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export ARCHITECTURE=$2
66
export DISTRIBUTION=$3
77

88
DEFAULT_MIRROR_URL_PREFIX=http://packages.trafficmanager.net
9-
MIRROR_VERSION_FILE=files/build/versions/default/versions-mirror
9+
MIRROR_VERSION_FILE=
10+
[[ "$SONIC_VERSION_CONTROL_COMPONENTS" == *deb* || $SONIC_VERSION_CONTROL_COMPONENTS == *all* ]] && MIRROR_VERSION_FILE=files/build/versions/default/versions-mirror
1011
[ -f target/versions/default/versions-mirror ] && MIRROR_VERSION_FILE=target/versions/default/versions-mirror
1112

1213
# The default mirror urls
@@ -21,7 +22,7 @@ if [ "$ARCHITECTURE" == "armhf" ]; then
2122
fi
2223

2324
if [ "$MIRROR_SNAPSHOT" == y ]; then
24-
if [ -f $MIRROR_VERSION_FILE ]; then
25+
if [ -f "$MIRROR_VERSION_FILE" ]; then
2526
DEBIAN_TIMESTAMP=$(grep "^debian==" $MIRROR_VERSION_FILE | tail -n 1 | sed 's/.*==//')
2627
DEBIAN_SECURITY_TIMESTAMP=$(grep "^debian-security==" $MIRROR_VERSION_FILE | tail -n 1 | sed 's/.*==//')
2728
elif [ -z "$DEBIAN_TIMESTAMP" ] || [ -z "$DEBIAN_SECURITY_TIMESTAMP" ]; then

0 commit comments

Comments
 (0)