Modify script to return error if the file doesn't exist.

Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/5b60e4f4
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/5b60e4f4
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/5b60e4f4

Branch: refs/heads/trunk
Commit: 5b60e4f490baec3ee4931275da5a722974203527
Parents: fa1f4d5
Author: Tomaz Muraus <[email protected]>
Authored: Tue Dec 31 14:45:50 2013 +0100
Committer: Tomaz Muraus <[email protected]>
Committed: Tue Dec 31 14:45:50 2013 +0100

----------------------------------------------------------------------
 dist/verify_checksums.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/5b60e4f4/dist/verify_checksums.sh
----------------------------------------------------------------------
diff --git a/dist/verify_checksums.sh b/dist/verify_checksums.sh
index d75fb56..52cb9a2 100755
--- a/dist/verify_checksums.sh
+++ b/dist/verify_checksums.sh
@@ -57,9 +57,19 @@ do
     echo "Downloading file from Apache mirror..."
     wget --quiet "${apache_url}" -O "${file_path_apache}"
 
+    if [ $? -ne 0 ]; then
+        echo "[ERR] Failed to download file: ${apache_url}"
+        exit 2
+    fi
+
     echo "Downloading file from PyPi mirror..."
     wget --quiet "${pypi_url}" -O "${file_path_pypi}"
 
+    if [ $? -ne 0 ]; then
+        echo "[ERR] Failed to download file: ${pypi_url}"
+        exit 2
+    fi
+
     md5sum_apache=$(md5sum "${file_path_apache}" | awk '{ print $1 }')
     md5sum_pypi=$(md5sum "${file_path_pypi}"| awk '{ print $1 }')
 

Reply via email to