X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 6EBBFDC7C09 for ; Fri, 5 Jul 2013 04:21:56 +0000 (UTC) Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 793872095F for ; Fri, 5 Jul 2013 00:21:54 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 05 Jul 2013 00:21:54 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :in-reply-to:references; s=smtpout; bh=W+LZzmzmtil4uAP3ku6c+6e7C z8=; b=j61AK3t8/dXduackIuROIliOkPCIB4l6gX72Nkzq46clRMnwkmOCNJHPO uZvQKgyWyeTiVDu9R2zD8dtxXo2NwsNG+iQLc04FT78wMCvsLY62hbPM5hTRraNW 8Ury5x7TCZxI42FWoQx9QoEX0vIOvgRtFUcps+saKdZ6mB0yCg= X-Sasl-enc: 9JDBVroVj+U5N/vPbatjFDQEU3xU3dpYBSpzrzh4+dX7 1372998114 Received: from localhost (unknown [69.86.161.244]) by mail.messagingengine.com (Postfix) with ESMTPA id 39E98680204 for ; Fri, 5 Jul 2013 00:21:54 -0400 (EDT) From: Dubiousjim To: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] [PATCH 28/31] various: s/echo/msg/, s/echo/error/, tweak error messages Date: Fri, 5 Jul 2013 00:21:37 -0400 Message-Id: <78c1c0d2d8ce8f3c2bba5d69cfba17ccfd048f30.1372997335.git.dubiousjim@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- abuild-keygen.in | 2 +- abuild-sign.in | 6 ++---- abump.in | 10 +++++----- apkgrel.in | 4 ++-- checkapk.in | 10 +++++----- functions.sh.in | 2 +- 6 files changed, 16 insertions(+), 18 deletions(-) diff --git a/abuild-keygen.in b/abuild-keygen.in index bf9d105..dbedad1 100644 --- a/abuild-keygen.in +++ b/abuild-keygen.in @@ -32,7 +32,7 @@ get_privkey_file() { privkey="$abuild_home/$default_name.rsa" [ -n "$non_interactive" ] && return 0 - echo "Generating public/private rsa key pair for abuild" + msg "Generating public/private rsa key pair for abuild" echo -n "Enter file in which to save the key [$privkey]: " read line diff --git a/abuild-sign.in b/abuild-sign.in index 96a1826..c1a0c77 100644 --- a/abuild-sign.in +++ b/abuild-sign.in @@ -37,10 +37,8 @@ do_sign() { rm -f "$tmptargz" "$sig" chmod 644 "$tmpsigned" mv "$tmpsigned" "$i" - if [ -z "$quiet" ]; then - echo "Signed $i" - fi - ) || die "Failed to sign $i" + msg "Signed $i" + ) || die "failed to sign $i" done } diff --git a/abump.in b/abump.in index d846e9a..203df8e 100755 --- a/abump.in +++ b/abump.in @@ -35,11 +35,11 @@ do_bump() { # verify APKBUILD ( . "$a" || exit 1 - [ "$pkgname" = "$name" ] || die "$name: APKBUILD has different \$pkgname" - type package | grep -q function || die "$name: missing package()" + [ "$pkgname" = "$name" ] || die "APKBUILD has different \$pkgname for $name" + type package | grep -q function || die "missing package() for $name" case $(apk version --test "$pkgver" "$ver") in - '=') die "$pkgname: already at version $pkgver";; - '>') die "$pkgname: already at newer version $pkgver";; + '=') die "$pkgname is already at version $pkgver";; + '>') die "$pkgname is already at newer version $pkgver";; '<') exit 0;; *) exit 1;; esac @@ -59,7 +59,7 @@ do_bump() { fixes #${fixes#\#} " fi - echo "$message" + msg "$message" sed -i -e "s/^pkgver=.*/pkgver=$ver/" \ -e "s/^pkgrel=.*/pkgrel=0/" \ diff --git a/apkgrel.in b/apkgrel.in index 7e33e34..1d178aa 100644 --- a/apkgrel.in +++ b/apkgrel.in @@ -25,7 +25,7 @@ show_plain() { show_pretty() { ( . "$1" || exit 1 - [ -n "$pkgname" ] || die "$1: no pkgname" + [ -n "$pkgname" ] || die "no \$pkgname for $1" printf '%s: r%s\n' "$pkgname" "${pkgrel:-?}" ) } @@ -63,7 +63,7 @@ do_verify() { for f; do [ -d "$f" ] && f="$f/APKBUILD" if ! grep -q '^pkgrel=[0-9]' "$f"; then - echo "$f: Has no proper pkgrel" >&2 + error "no proper \$pkgrel for $f" rc=1 fi done diff --git a/checkapk.in b/checkapk.in index 2953b8b..d3e2988 100644 --- a/checkapk.in +++ b/checkapk.in @@ -36,14 +36,14 @@ if ! [ -f "$abuild_conf" ] && ! [ -f "$abuild_userconf" ]; then fi if ! [ -f APKBUILD ]; then - die 'This must be run in the directory of a built package.' + die 'must be run in the directory of a built package' fi . ./APKBUILD startdir="$PWD" tmpdir=$(mktemp -d -t checkpkg-script.XXXXXX) -cd "$tmpdir" || die "Failed to create temp dir" +cd "$tmpdir" || die "failed to create temp dir" for i in $pkgname $subpackages; do _pkgname=${i%:*} @@ -57,19 +57,19 @@ for i in $pkgname $subpackages; do break fi done - [ -f "$filepath" ] || die "could not find $pkgfile" + [ -f "$filepath" ] || die "can't find $pkgfile" # generate a temp repositories file with only the http repos grep ^http: /etc/apk/repositories > $tmpdir/repositories oldpkg=$(apk fetch --repositories-file $tmpdir/repositories --simulate 2>&1 | sed 's/^Downloading //') if [ "${oldpkg}" = "${pkg}" ]; then - die "The built package ($_pkgname) is the one in the repo right now!" + die "the built package ($_pkgname) is already in the repo" fi apk fetch --repositories-file $tmpdir/repositories --stdout $_pkgname \ | tar -zt | grep -v '^\.SIGN\.' | sort > filelist-$_pkgname-old \ - || die "Failed to download old pkg. Maybe run 'apk update'?" + || die "failed to download old pkg, maybe run 'apk update'?" tar -ztf "$filepath" | grep -v '^\.SIGN\.' | sort > "filelist-$_pkgname" diff --git a/functions.sh.in b/functions.sh.in index 96b0586..a25c39a 100644 --- a/functions.sh.in +++ b/functions.sh.in @@ -71,7 +71,7 @@ abuild) } error() { - echo "$@" >&2 + echo "$prog: $@" >&2 } ;; esac -- 1.8.3.1 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---