Skip to content

Commit c92fda1

Browse files
committed
[Build] Change the default mirror version config file (sonic-net#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 fa9b3d1 commit c92fda1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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)