Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[action] [PR:13786] [Build] Change the default mirror version config file #13903

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ SONIC_BUILD_INSTRUCTION := make \

export MIRROR_URLS
export MIRROR_SECURITY_URLS
export SONIC_VERSION_CONTROL_COMPONENTS

%::
ifeq ($(MULTIARCH_QEMU_ENVIRON), y)
Expand Down
5 changes: 3 additions & 2 deletions scripts/build_mirror_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export ARCHITECTURE=$2
export DISTRIBUTION=$3

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

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

if [ "$MIRROR_SNAPSHOT" == y ]; then
if [ -f $MIRROR_VERSION_FILE ]; then
if [ -f "$MIRROR_VERSION_FILE" ]; then
DEBIAN_TIMESTAMP=$(grep "^debian==" $MIRROR_VERSION_FILE | tail -n 1 | sed 's/.*==//')
DEBIAN_SECURITY_TIMESTAMP=$(grep "^debian-security==" $MIRROR_VERSION_FILE | tail -n 1 | sed 's/.*==//')
elif [ -z "$DEBIAN_TIMESTAMP" ] || [ -z "$DEBIAN_SECURITY_TIMESTAMP" ]; then
Expand Down