summaryrefslogtreecommitdiffstats
path: root/abump.in
diff options
context:
space:
mode:
authorDubiousjim <dubiousjim@gmail.com>2013-07-05 00:21:16 -0400
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-09 06:44:01 +0000
commitdb1314ac55df59e1fbecdae280cf2b4c1784dd5a (patch)
treef94dc44cf791559b3291a45d8470bba3f2423610 /abump.in
parent144ee3f113ffc73188c6cdc1682b908f6e28cba6 (diff)
downloadabuild-db1314ac55df59e1fbecdae280cf2b4c1784dd5a.tar.bz2
abuild-db1314ac55df59e1fbecdae280cf2b4c1784dd5a.tar.xz
various: move conf-loading and i/o to functions
Diffstat (limited to 'abump.in')
-rwxr-xr-xabump.in23
1 files changed, 13 insertions, 10 deletions
diff --git a/abump.in b/abump.in
index 897b50e..32ff4af 100755
--- a/abump.in
+++ b/abump.in
@@ -6,12 +6,15 @@
# Distributed under GPL-2
#
-program=${0##*/}
+abuild_ver=@VERSION@
+datadir=@datadir@
-die() {
- echo "$@" >&2
+if ! [ -f "$datadir/functions.sh" ]; then
+ echo "$datadir/functions.sh: not found" >&2
exit 1
-}
+fi
+. "$datadir/functions.sh"
+
# version bump a pkg
@@ -31,14 +34,14 @@ do_bump() {
cve=" ($cvelist)"
fi
- msg="$section/$pkgname: $upgrade to ${pkgver}${cve}"
+ message="$section/$pkgname: $upgrade to ${pkgver}${cve}"
if [ -n "$fixes" ]; then
- msg="$msg
+ message="$message
fixes #${fixes#\#}
"
fi
- echo "$msg"
+ echo "$message"
( . ./APKBUILD; type package | grep -q function ) || die "package() missing"
@@ -49,12 +52,12 @@ fixes #${fixes#\#}
abuild $abuild_opts checksum all || exit 1
git add APKBUILD
- git commit -m"$msg"
+ git commit -m"$message"
}
usage() {
- echo "$program - utility to bump pkgver in APKBUILDs"
- echo "usage: $program [-hR] [-s CVE-1,CVE-2,...] [-f ISSUE]"
+ echo "$prog - utility to bump pkgver in APKBUILDs"
+ echo "usage: $prog [-hR] [-s CVE-1,CVE-2,...] [-f ISSUE]"
echo ""
echo " -h show this help"
echo " -R run abuild with -R for recursive building"