From 6a6512246dea0a047eee9eafdda613522db87d60 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Wed, 8 Dec 2021 15:42:33 +0800 Subject: [PATCH] [Bug][Build]: fix the file not found issue caused by the relative path (#9450) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### 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 ``` --- .azure-pipelines/docker-sonic-slave.yml | 1 + src/sonic-build-hooks/scripts/buildinfo_base.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 6b4fcafda9..c8209c5163 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -21,6 +21,7 @@ pr: - sonic-slave-jessie - sonic-slave-stretch - sonic-slave-buster + - src/sonic-build-hooks parameters: - name: 'arches' diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index d20d685815..f156930bf0 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -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