From 06a64a8ce3cbe0e9b7079114f821083ca3c3a8da Mon Sep 17 00:00:00 2001 From: Junichi Uekawa Date: Thu, 26 Feb 2009 12:53:15 +0900 Subject: refactor to use 'log' function rather than using 'echo' directly. First cut into doing this, hopefully we're not breaking anything. --- pbuilder-checkparams | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'pbuilder-checkparams') diff --git a/pbuilder-checkparams b/pbuilder-checkparams index 47e4613..523e21e 100755 --- a/pbuilder-checkparams +++ b/pbuilder-checkparams @@ -47,7 +47,7 @@ while [ -n "$1" ]; do touch "$2";; esac if [ ! -f "$2" ]; then - echo "E: File $2 does not exist" >&2 + log "E: File $2 does not exist" exit 1 fi BASETGZ=$(readlink -f "$2"); @@ -55,7 +55,7 @@ while [ -n "$1" ]; do ;; --buildplace) if [ ! -d "$2" ] ; then - echo "E: Directory $2 does not exist" >&2 + log "E: Directory $2 does not exist" exit 1 fi BUILDPLACE=$(readlink -f "$2"); @@ -91,7 +91,7 @@ while [ -n "$1" ]; do BUILDRESULT=$(readlink -f "$2"); else BUILDRESULT="$2" - echo "W: Build-result Directory $2 does not exist" >&2 + log "W: Build-result Directory $2 does not exist" # warn, but make it progress. fi else @@ -104,7 +104,7 @@ while [ -n "$1" ]; do if [ -d "$2" ]; then APTCACHE=$(readlink -f "$2"); else - echo "E: Directory $2 does not exist" >&2 + log "E: Directory $2 does not exist" exit 1 fi else @@ -122,7 +122,7 @@ while [ -n "$1" ]; do ;; --configfile) if [ ! -f "$2" ]; then - echo "E: Config file $2 does not exist" >&2 + log "E: Config file $2 does not exist" exit 1 fi . "$2"; @@ -146,7 +146,7 @@ while [ -n "$1" ]; do shift; shift; ;; --logfile) - echo " -> Logging to $2" + log "I: Logging to $2" exec > >(tee "$2"); exec 2>&1 PBUILDER_BUILD_LOGFILE=$(readlink -f "$2") @@ -211,13 +211,13 @@ while [ -n "$1" ]; do ;; --no-targz) # specify this option if I am running in no-targz mode - echo " -> Running in no-targz mode" + log "I: Running in no-targz mode" INTERNAL_BUILD_UML="yes" shift; ;; --internal-build-uml) # specify this option if I am running inside UML. - echo " -> Running in pbuilder-user-mode-linux mode" + log "I: Running in pbuilder-user-mode-linux mode" INTERNAL_BUILD_UML="yes" IGNORE_UMOUNT="no" shift; @@ -227,7 +227,7 @@ while [ -n "$1" ]; do break; ;; --*) - echo "Error: Unknown option [$1] was specified " >&2 + log "E: Unknown option [$1] was specified " exit 1; ;; *) -- cgit v1.2.3