[monitoring-plugins] Fix RPM build tests

Lorenz Kästle git at monitoring-plugins.org
Fri Nov 8 14:00:12 CET 2024


 Module: monitoring-plugins
 Branch: master
 Commit: e5a825de740ce78d99a1f47118c76b756bf32554
 Author: Lorenz Kästle <12514511+RincewindsHat at users.noreply.github.com>
   Date: Fri Nov  8 13:46:35 2024 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=e5a825d

Fix RPM build tests

---

 .github/mock.sh | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/.github/mock.sh b/.github/mock.sh
index 87543ce..ea4f7f3 100755
--- a/.github/mock.sh
+++ b/.github/mock.sh
@@ -52,13 +52,16 @@ if command -v git > /dev/null 2>&1; then
 fi
 
 mkdir -p "${SRCRPM_DIR}" "${RPM_DIR}"
-#rpmbuild --undefine=_disable_source_fetch --define "_sourcedir ${SOURCE_DIR}" -ba ${SPEC_FILE}
+
+# Run mock below
+# No idea what happens here to be honest
+# mock seems to run more containers to build the package
 dnf -y --setopt="tsflags=nodocs" install rpmdevtools && \
   spectool -g -C ${SOURCE_DIR} ${SPEC_FILE} && \
-  { mock --dnf --clean --spec ${SPEC_FILE} --sources=${SOURCE_DIR} --result=${SRCRPM_DIR} --build || \
-  { cat ${SRCRPM_DIR}/{root,build}.log; exit 1; } }
-
-mock --dnf --clean --sources=${SOURCE_DIR} --result=${RPM_DIR} --rebuild "${SRCRPM_DIR}"/${SRC_RPM} || \
-  { cat ${RPM_DIR}/{root,build}.log; exit 1; }
+  mock --init && \
+  { mock --no-clean --spec ${SPEC_FILE} --sources=${SOURCE_DIR} --result=${SRCRPM_DIR} --build || \
+  { cat ${SRCRPM_DIR}/{root,build}.log; exit 1; } } && \
+  { mock --no-clean --sources=${SOURCE_DIR} --result=${RPM_DIR} --rebuild "${SRCRPM_DIR}"/${SRC_RPM} || \
+  { cat ${RPM_DIR}/{root,build}.log; exit 1; } }
 
 ls -la ${SOURCE_DIR} ${SRCRPM_DIR} ${RPM_DIR}



More information about the Commits mailing list