From 6b4f8c5f46d17beb5eacb4a11f4aba7f5460ccd8 Mon Sep 17 00:00:00 2001
From: Erik Alexandre Pucci <eap08@c3sl.ufpr.br>
Date: Mon, 2 May 2011 17:02:47 -0300
Subject: [PATCH] build-wget: Improved some messages and comments

Signed-off-by: Erik Alexandre Pucci <eap08@c3sl.ufpr.br>
Acked-by: Danilo Kiyoshi Simizu Yorinori <danilok@c3sl.ufpr.br>
---
 build-wget | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/build-wget b/build-wget
index 2d27070..1d40a2b 100755
--- a/build-wget
+++ b/build-wget
@@ -24,12 +24,12 @@ PREFIX="$(dirname $0)"
 
 # Get the configuration
 if ! source "${PREFIX}/buildpackage.conf" 2> /dev/null; then
-    echo "error: failed to load buildpackage.conf"
+    printf "ERROR (1): Failed to load buildpackage.conf.\n"
     exit 1
 fi
 
-# Customizable variables, please refer to
-# buildpackage.conf to change these values
+# Customizable variables. Please refer to buildpackage.conf to change these
+# values
 : ${GITBASEDIR:="../"}
 : ${GITUSER:="git"}
 : ${GITSERVER:="git.c3sl.ufpr.br"}
@@ -38,34 +38,32 @@ fi
 : ${AGENTPACKAGEDIR:="SEED2-run"}
 
 
-printf "====================\n"
-printf "$0 v0.1\n"
-printf "\n"
+printf "====================\n$0 v0.1\n\n"
 printf "**** Make sure that you are connected to the internet!!!\n"
-printf "====================\n"
-printf "\n"
+printf "====================\n\n"
 
 # Remove old builds
 rm -Rf wget-*
 
 # Download the latest wget package
 wget http://gnu.c3sl.ufpr.br/ftp/wget/wget-latest.tar.gz -O wget.tar.gz || \
-  (printf "Error downloading the latest wget version... ABORTING!\n" && exit 1)
+  (printf "ERROR (2): Failed to download the latest wget version. %b" \
+          "Aborting...\n" && exit 2)
 
 # Unpack
 tar xvvf wget.tar.gz &> /dev/null || \
-  (printf "Error unpacking wget... ABORTING!\n" && exit 1)
+  (printf "ERROR (3): Failed to unpack wget. Aborting...\n" && exit 3)
 
 # Configure and compile
 cd wget-*
 ./configure --without-ssl --disable-opie --disable-digest --disable-ntlm \
             --disable-debug --disable-nls --disable-largefile \
             --disable-ipv6 --disable-rpath --disable-iri || \
-  (printf "Error configuring wget... ABORTING!\n" && exit 1)
+  (printf "ERROR (4): Failed to configure wget. Aborting...\n" && exit 4)
 
 make LDFLAGS=-static ||
-  (printf "Error compiling wget... ABORTING!\n" && exit 1)
+  (printf "ERROR (5): Failed to compile wget. Aborting...\n" && exit 5)
 
 cd - &> /dev/null
 
-printf "All done.\n"
+printf "\nAll done.\n\n"
-- 
GitLab