This is an automated email from the ASF dual-hosted git repository.

tuhaihe pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 79423b6bcb343231e220c230dfac57180efe983c
Author: Dianjin Wang <[email protected]>
AuthorDate: Wed Jul 1 14:42:08 2026 +0800

    Fix RPM artifact checks for double-digit EL
    
    The RPM verify/copy steps in the build workflows broke on el10:
    
    - The OS major version was parsed with `[0-9]`, capturing only "1"
      from VERSION_ID="10" and looking for an el1 RPM. Use `[0-9]+`.
    - `rpm -qlp ... | grep -q` raced with pipefail: grep closed the pipe
      on the first match, rpm died with SIGPIPE, and the pipeline was
      reported as failed. Drop `-q` and redirect grep so the whole list
      is consumed.
    
    Applied to build-cloudberry.yml, build-cloudberry-rocky8.yml and
    build-dbg-cloudberry.yml.
    
    Assisted-by: Claude Code
---
 .github/workflows/build-cloudberry-rocky10.yml | 8 ++++----
 .github/workflows/build-cloudberry-rocky8.yml  | 8 ++++----
 .github/workflows/build-cloudberry.yml         | 8 ++++----
 .github/workflows/build-dbg-cloudberry.yml     | 8 ++++----
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/build-cloudberry-rocky10.yml 
b/.github/workflows/build-cloudberry-rocky10.yml
index 4f69479b6ab..15a9b6da2aa 100644
--- a/.github/workflows/build-cloudberry-rocky10.yml
+++ b/.github/workflows/build-cloudberry-rocky10.yml
@@ -661,7 +661,7 @@ jobs:
             "${SRC_DIR}"/devops/build/packaging/rpm/build-rpm.sh --version 
"${CBDB_VERSION}" --release "${BUILD_NUMBER}" "${DEBUG_RPMBUILD_OPT}"
 
             # Get OS version and move RPM
-            os_version=$(grep -oP '(?<=^VERSION_ID=")[0-9]' /etc/os-release)
+            os_version=$(grep -oP '(?<=^VERSION_ID=")[0-9]+' /etc/os-release)
             
RPM_FILE="${HOME}"/rpmbuild/RPMS/x86_64/apache-cloudberry-db-incubating-"${CBDB_VERSION}"-"${BUILD_NUMBER}""${DEBUG_IDENTIFIER}".el"${os_version}".x86_64.rpm
             cp "${RPM_FILE}" "${SRC_DIR}"
             
RPM_DEBUG="${HOME}"/rpmbuild/RPMS/x86_64/apache-cloudberry-db-incubating-debuginfo-"${CBDB_VERSION}"-"${BUILD_NUMBER}""${DEBUG_IDENTIFIER}".el"${os_version}".x86_64.rpm
@@ -674,7 +674,7 @@ jobs:
             # Verify critical files in RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
@@ -866,7 +866,7 @@ jobs:
             # Verify expected binaries are in the RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
@@ -1276,7 +1276,7 @@ jobs:
             # Verify expected binaries are in the RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
diff --git a/.github/workflows/build-cloudberry-rocky8.yml 
b/.github/workflows/build-cloudberry-rocky8.yml
index 8ad7bbe6f57..d48e436265b 100644
--- a/.github/workflows/build-cloudberry-rocky8.yml
+++ b/.github/workflows/build-cloudberry-rocky8.yml
@@ -660,7 +660,7 @@ jobs:
             "${SRC_DIR}"/devops/build/packaging/rpm/build-rpm.sh --version 
"${CBDB_VERSION}" --release "${BUILD_NUMBER}" "${DEBUG_RPMBUILD_OPT}"
 
             # Get OS version and move RPM
-            os_version=$(grep -oP '(?<=^VERSION_ID=")[0-9]' /etc/os-release)
+            os_version=$(grep -oP '(?<=^VERSION_ID=")[0-9]+' /etc/os-release)
             
RPM_FILE="${HOME}"/rpmbuild/RPMS/x86_64/apache-cloudberry-db-incubating-"${CBDB_VERSION}"-"${BUILD_NUMBER}""${DEBUG_IDENTIFIER}".el"${os_version}".x86_64.rpm
             cp "${RPM_FILE}" "${SRC_DIR}"
             
RPM_DEBUG="${HOME}"/rpmbuild/RPMS/x86_64/apache-cloudberry-db-incubating-debuginfo-"${CBDB_VERSION}"-"${BUILD_NUMBER}""${DEBUG_IDENTIFIER}".el"${os_version}".x86_64.rpm
@@ -673,7 +673,7 @@ jobs:
             # Verify critical files in RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
@@ -865,7 +865,7 @@ jobs:
             # Verify expected binaries are in the RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
@@ -1275,7 +1275,7 @@ jobs:
             # Verify expected binaries are in the RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
diff --git a/.github/workflows/build-cloudberry.yml 
b/.github/workflows/build-cloudberry.yml
index 242a89a746b..6289785bb14 100644
--- a/.github/workflows/build-cloudberry.yml
+++ b/.github/workflows/build-cloudberry.yml
@@ -659,7 +659,7 @@ jobs:
             "${SRC_DIR}"/devops/build/packaging/rpm/build-rpm.sh --version 
"${CBDB_VERSION}" --release "${BUILD_NUMBER}" "${DEBUG_RPMBUILD_OPT}"
 
             # Get OS version and move RPM
-            os_version=$(grep -oP '(?<=^VERSION_ID=")[0-9]' /etc/os-release)
+            os_version=$(grep -oP '(?<=^VERSION_ID=")[0-9]+' /etc/os-release)
             
RPM_FILE="${HOME}"/rpmbuild/RPMS/x86_64/apache-cloudberry-db-incubating-"${CBDB_VERSION}"-"${BUILD_NUMBER}""${DEBUG_IDENTIFIER}".el"${os_version}".x86_64.rpm
             cp "${RPM_FILE}" "${SRC_DIR}"
             
RPM_DEBUG="${HOME}"/rpmbuild/RPMS/x86_64/apache-cloudberry-db-incubating-debuginfo-"${CBDB_VERSION}"-"${BUILD_NUMBER}""${DEBUG_IDENTIFIER}".el"${os_version}".x86_64.rpm
@@ -672,7 +672,7 @@ jobs:
             # Verify critical files in RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
@@ -864,7 +864,7 @@ jobs:
             # Verify expected binaries are in the RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
@@ -1274,7 +1274,7 @@ jobs:
             # Verify expected binaries are in the RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
diff --git a/.github/workflows/build-dbg-cloudberry.yml 
b/.github/workflows/build-dbg-cloudberry.yml
index 967fc259f0b..d79bd78c77c 100644
--- a/.github/workflows/build-dbg-cloudberry.yml
+++ b/.github/workflows/build-dbg-cloudberry.yml
@@ -503,7 +503,7 @@ jobs:
             "${SRC_DIR}"/devops/build/packaging/rpm/build-rpm.sh --version 
"${CBDB_VERSION}" --release "${BUILD_NUMBER}" "${DEBUG_RPMBUILD_OPT}"
 
             # Get OS version and move RPM
-            os_version=$(grep -oP '(?<=^VERSION_ID=")[0-9]' /etc/os-release)
+            os_version=$(grep -oP '(?<=^VERSION_ID=")[0-9]+' /etc/os-release)
             
RPM_FILE="${HOME}"/rpmbuild/RPMS/x86_64/apache-cloudberry-db-incubating-"${CBDB_VERSION}"-"${BUILD_NUMBER}""${DEBUG_IDENTIFIER}".el"${os_version}".x86_64.rpm
             cp "${RPM_FILE}" "${SRC_DIR}"
 
@@ -514,7 +514,7 @@ jobs:
             # Verify critical files in RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
@@ -675,7 +675,7 @@ jobs:
             # Verify expected binaries are in the RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi
@@ -1047,7 +1047,7 @@ jobs:
             # Verify expected binaries are in the RPM
             echo "Verifying critical files in RPM..."
             for binary in "bin/postgres" "bin/psql"; do
-              if ! rpm -qlp "${RPM_FILE}" | grep -q "${binary}$"; then
+              if ! rpm -qlp "${RPM_FILE}" | grep "${binary}$" >/dev/null 2>&1; 
then
                 echo "::error::Critical binary '${binary}' not found in RPM"
                 exit 1
               fi


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to