Commit b2d6b47b authored by Dubiousjim's avatar Dubiousjim Committed by Natanael Copa

various: s/echo/msg/, s/echo/error/, tweak error messages

parent f15c630c
......@@ -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
......
......@@ -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
}
......
......@@ -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/" \
......
......@@ -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
......
......@@ -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"
......
......@@ -71,7 +71,7 @@ abuild)
}
error() {
echo "$@" >&2
echo "$prog: $@" >&2
}
;;
esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment