From 2b086eb4294731e64faa89774d06eb0a96693c42 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 11 Jul 2022 19:22:46 +0800 Subject: [PATCH] [Bug]: fix the version file name issue (#11072) (#11415) Why I did it Cherry pick PR: #11072 [Bug]: fix the version file name issue Why I did it [Bug]: fix the version file name issue Fix the build failure: https://dev.azure.com/mssonic/build/_build/results?buildId=107211&view=results + scripts/build_debian_base_system.sh amd64 bullseye ./fsroot-centec sed: can't read /tmp/tmp.glTzJefV24/version-deb: No such file or directory Not found host-base-image packages, please check the version files in files/build/versions/host-base-image How I did it Change the version-deb, to versions-deb And add an improvement for host base image build, if the version path not exist, skipped the version control for base image. How to verify it https://dev.azure.com/mssonic/build/_build/results?buildId=107587&view=results --- scripts/build_debian_base_system.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build_debian_base_system.sh b/scripts/build_debian_base_system.sh index 0e00eeeac5..a403791e52 100755 --- a/scripts/build_debian_base_system.sh +++ b/scripts/build_debian_base_system.sh @@ -21,7 +21,7 @@ generate_version_file() sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "dpkg-query -W -f '\${Package}==\${Version}\n'" > $TARGET_BASEIMAGE_PATH/versions-deb-${IMAGE_DISTRO}-${CONFIGURED_ARCH} } -if [ "$ENABLE_VERSION_CONTROL_DEB" != "y" ]; then +if [ "$ENABLE_VERSION_CONTROL_DEB" != "y" ] || [ ! -d files/build/versions/host-base-image ]; then if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then if [ $MULTIARCH_QEMU_ENVIRON == "y" ]; then # qemu arm bin executable for cross-building @@ -55,7 +55,7 @@ fi # Generate the version files for the host base image TEMP_DIR=$(mktemp -d) ./scripts/versions_manager.py generate -t $TEMP_DIR -n host-base-image -d $IMAGE_DISTRO -a $CONFIGURED_ARCH -PACKAGES=$(sed -E 's/=(=[^=]*)$/\1/' $TEMP_DIR/version-deb) +PACKAGES=$(sed -E 's/=(=[^=]*)$/\1/' $TEMP_DIR/versions-deb) if [ -z "$PACKAGES" ]; then echo "Not found host-base-image packages, please check the version files in files/build/versions/host-base-image" 2>&1 exit 1