Skip to content

Commit

Permalink
[build] Fix bookworm reproducible build issue. (sonic-net#18789)
Browse files Browse the repository at this point in the history
Why I did it
Bookworm involved new file /etc/apt/sources.list.d/debian.sources to setup debian mirror repo.
Reproducible build need to support this scenario.

Work item tracking
Microsoft ADO (number only): 27792318
How I did it
How to verify it
  • Loading branch information
liushilongbuaa committed Apr 25, 2024
1 parent d25c943 commit c3899ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sonic-build-hooks/scripts/buildinfo_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3899ef

Please sign in to comment.