[cim PATCH 1/3] autogen: Better error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of making the execution of each command dependend on the
success of the previous one, check return values explicitly.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 autogen.sh | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index e4b7adc..5b2e4dc 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -2,20 +2,26 @@
 # ============================================================================
 # (C) Copyright IBM Corp. 2005
 
-echo "Running libtool ..." &&
-libtoolize --copy --force --automake &&
+die()
+{
+    test "$1" && echo "$1" >&2
+    exit 1
+}
 
-echo "Running aclocal ..." &&
-aclocal --force &&
+echo "Running libtool ..."
+libtoolize --copy --force --automake || die
 
-echo "Running autoheader ..." &&
-autoheader --force &&
+echo "Running aclocal ..."
+aclocal --force || die
 
-echo "Running automake ..." &&
-automake -i --add-missing --copy --foreign &&
+echo "Running autoheader ..."
+autoheader --force || die
 
-echo "Running autoconf ..." &&
-autoconf --force &&
+echo "Running automake ..."
+automake -i --add-missing --copy --foreign || die
+
+echo "Running autoconf ..."
+autoconf --force || die
 
 if test -x $(which git); then
     git rev-parse --short HEAD > .changeset
-- 
2.14.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux