summaryrefslogtreecommitdiffstats
path: root/checkapk.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 /checkapk.in
parent144ee3f113ffc73188c6cdc1682b908f6e28cba6 (diff)
downloadabuild-db1314ac55df59e1fbecdae280cf2b4c1784dd5a.tar.bz2
abuild-db1314ac55df59e1fbecdae280cf2b4c1784dd5a.tar.xz
various: move conf-loading and i/o to functions
Diffstat (limited to 'checkapk.in')
-rw-r--r--checkapk.in24
1 files changed, 11 insertions, 13 deletions
diff --git a/checkapk.in b/checkapk.in
index 9c1d9fd..e95249e 100644
--- a/checkapk.in
+++ b/checkapk.in
@@ -6,24 +6,22 @@
# Distributed under GPL-2
#
-die() {
- echo "$@" >&2
+abuild_ver=@VERSION@
+datadir=@datadir@
+
+if ! [ -f "$datadir/functions.sh" ]; then
+ echo "$datadir/functions.sh: not found" >&2
exit 1
-}
+fi
+. "$datadir/functions.sh"
+
-msg() {
- echo "$@"
-}
-have_abuild_conf=
-for conf in /etc/abuild.conf ~/.abuild/abuild.conf; do
- if [ -f "$conf" ]; then
- . $conf && have_abuild_conf=yes
- fi
-done
-[ -z "$have_abuild_conf" ] && die "no abuild.conf found"
+if ! [ -f "$abuild_conf" ] && ! [ -f "$abuild_userconf" ]; then
+ die "no abuild.conf found"
+fi
if ! [ -f APKBUILD ]; then
die 'This must be run in the directory of a built package.'