Abort early so that the real error message can be noticed easily.
==========================
$ ./rpmbuild.sh
Found CMake: /usr/bin/cmake (3.18.4)
Run-time dependency libtraceevent found: NO (tried pkgconfig and cmake)

../meson.build:147:2: ERROR: Dependency "libtraceevent" not found, tried 
pkgconfig and cmake

A full log can be found at /path/to/ndctl/build/meson-logs/meson-log.txt
FAILED: build.ninja
...

Signed-off-by: Li Zhijian <[email protected]>
---
 rpmbuild.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rpmbuild.sh b/rpmbuild.sh
index d9823e5eda61..d952f96aa8c1 100755
--- a/rpmbuild.sh
+++ b/rpmbuild.sh
@@ -10,7 +10,7 @@ if ./git-version | grep -q dirty; then
        exit 1
 fi
 if [ ! -f $spec ]; then
-       meson compile -C build rhel/ndctl.spec
+       meson compile -C build rhel/ndctl.spec || exit
        spec=$(dirname $0)/build/rhel/ndctl.spec
 fi
 ./make-git-snapshot.sh
-- 
2.29.2


Reply via email to