From fc1bc72daad5696d3716b8fbe2dfedb914894d89 Mon Sep 17 00:00:00 2001 From: Julio Gonzalez Gil Date: Sat, 25 Apr 2015 17:52:51 +0200 Subject: [PATCH] Check and show errors at shell scripts --- clean | 7 +++++++ fuse-rpm | 13 +++++++++++-- s3fs-build-rpm | 13 +++++++++++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/clean b/clean index 9b68c82..ad5f9cf 100755 --- a/clean +++ b/clean @@ -1,2 +1,9 @@ #!/bin/bash rm -rf BUILD BUILDROOT RPMS SRPMS SOURCES/*.gz +if [ $? -eq 0 ]; then + echo "Directory cleaned up." + exit 0 +else + echo "There are errors. Check log!" + exit 1 +fi diff --git a/fuse-rpm b/fuse-rpm index 7afbc00..67cd8ae 100755 --- a/fuse-rpm +++ b/fuse-rpm @@ -2,7 +2,16 @@ VERSION='2.8.5' if [ ! -f "./SOURCES/fuse-${VERSION}.tar.gz" ]; then wget "http://downloads.sourceforge.net/fuse/fuse-${VERSION}.tar.gz" -O "./SOURCES/fuse-${VERSION}.tar.gz" + if [ $? -ne 0 ]; then + echo "Could not download fuse-${VERSION}.tar.gz! Check log!" + exit 1 + fi fi rpmbuild --define "_topdir `pwd`" -ba 'SPECS/fuse-vitki.spec' -echo Your packages are available at $PWD/RPMS - +if [ $? -eq 0 ]; then + echo "Your packages are available at $PWD/RPMS." + exit 0 +else + echo "There are errors. Check log!" + exit 1 +fi diff --git a/s3fs-build-rpm b/s3fs-build-rpm index 1efcf3d..28abce2 100755 --- a/s3fs-build-rpm +++ b/s3fs-build-rpm @@ -2,7 +2,16 @@ VERSION='1.78' if [ ! -f "./SOURCES/s3fs-fuse-${VERSION}.tar.gz" ]; then wget "https://github.com/s3fs-fuse/s3fs-fuse/archive/v${VERSION}.tar.gz" -O "./SOURCES/s3fs-fuse-${VERSION}.tar.gz" + if [ $? -ne 0 ]; then + echo "Could not download fuse-${VERSION}.tar.gz! Check log!" + exit 1 + fi fi rpmbuild --define "_topdir `pwd`" -ba 'SPECS/s3fs-fuse.spec' -echo Your packages are available at $PWD/RPMS - +if [ $? -eq 0 ]; then + echo "Your packages are available at $PWD/RPMS." + exit 0 +else + echo "There are errors. Check log!" + exit 1 +fi