diff options
author | Junichi Uekawa <dancer@netfort.gr.jp> | 2009-02-26 12:53:15 +0900 |
---|---|---|
committer | Junichi Uekawa <dancer@netfort.gr.jp> | 2009-02-26 14:33:11 +0900 |
commit | 06a64a8ce3cbe0e9b7079114f821083ca3c3a8da (patch) | |
tree | 516660a2366b18b40d1a823ba1ec188a39a59634 /pbuilder-checkparams | |
parent | 37597b2cb6439cce9571de83218586b0a99e6ea9 (diff) | |
download | pbuilder-06a64a8ce3cbe0e9b7079114f821083ca3c3a8da.tar pbuilder-06a64a8ce3cbe0e9b7079114f821083ca3c3a8da.tar.gz |
refactor to use 'log' function rather than using 'echo' directly.
First cut into doing this, hopefully we're not breaking anything.
Diffstat (limited to 'pbuilder-checkparams')
-rwxr-xr-x | pbuilder-checkparams | 18 |
1 files changed, 9 insertions, 9 deletions
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; ;; *) |