diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index 37a84a0c6fa9..bb64a2466bfc 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -123,6 +123,12 @@ set_reproducible_mirrors() expression2="/^#*deb.*$REPR_MIRROR_URL_PATTERN/! s/^#\s*(#*deb)/\1/" expression3="/#SET_REPR_MIRRORS/d" fi + if [[ "$1" != "-d" ]] && [ -f /etc/apt/sources.list.d/debian.sources ]; then + mv /etc/apt/sources.list.d/debian.sources /etc/apt/sources.list.d/debian.sources.back + fi + if [[ "$1" == "-d" ]] && [ -f /etc/apt/sources.list.d/debian.sources.back ]; then + mv /etc/apt/sources.list.d/debian.sources.back /etc/apt/sources.list.d/debian.sources + fi local mirrors="/etc/apt/sources.list $(find /etc/apt/sources.list.d/ -type f)" for mirror in $mirrors; do