[Bug][Build]: fix the file not found issue caused by the relative pat… (#9443)

Fix the nodesource.list cannot read issue, it is cased by the full path not used.

```
2021-12-03T06:59:26.0019306Z Removing intermediate container 77cfe980cd36
2021-12-03T06:59:26.0020872Z  ---> 528fd40e60f6
2021-12-03T06:59:26.0021457Z Step 81/81 : RUN post_run_buildinfo
2021-12-03T06:59:26.0841136Z  ---> Running in d804bd7e1b06
2021-12-03T06:59:29.1626594Z DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
2021-12-03T06:59:34.2960105Z /usr/bin/sed: can't read nodesource.list: No such file or directory
2021-12-03T06:59:34.5094880Z The command '/bin/sh -c post_run_buildinfo' returned a non-zero code: 2
```

Co-authored-by: Ubuntu <xumia@xumia-vm1.jqzc3g5pdlluxln0vevsg3s20h.xx.internal.cloudapp.net>
This commit is contained in:
xumia 2021-12-04 13:23:09 +08:00
parent 72fea76ef7
commit 6b88f4b33d
2 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ pr:
- sonic-slave-jessie
- sonic-slave-stretch
- sonic-slave-buster
- src/sonic-build-hooks
parameters:
- name: 'arches'

View File

@ -71,7 +71,7 @@ set_reproducible_mirrors()
expression="s/^deb.*$REPR_MIRROR_URL_PATTERN/#\0/"
fi
local mirrors="/etc/apt/sources.list $(ls /etc/apt/sources.list.d/)"
local mirrors="/etc/apt/sources.list $(find /etc/apt/sources.list.d/ -type f)"
for mirror in $mirrors; do
sed -i "$expression" "$mirror"
done