[Bug][Build]: fix the file not found issue caused by the relative path (#9450)

#### Why I did it
Merged from master branch: https://github.com/Azure/sonic-buildimage/pull/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
```
This commit is contained in:
xumia 2021-12-08 15:42:33 +08:00 committed by GitHub
parent f93d1f64a2
commit 6a6512246d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -70,7 +70,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