From db1314ac55df59e1fbecdae280cf2b4c1784dd5a Mon Sep 17 00:00:00 2001 From: Dubiousjim Date: Fri, 5 Jul 2013 00:21:16 -0400 Subject: various: move conf-loading and i/o to functions --- apkgrel.in | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'apkgrel.in') diff --git a/apkgrel.in b/apkgrel.in index 0934847..46e189f 100644 --- a/apkgrel.in +++ b/apkgrel.in @@ -6,7 +6,15 @@ # Distributed under GPL-2 # -program=${0##*/} +abuild_ver=@VERSION@ +datadir=@datadir@ + +if ! [ -f "$datadir/functions.sh" ]; then + echo "$datadir/functions.sh: not found" >&2 + exit 1 +fi +. "$datadir/functions.sh" + do_show() { awk -F= '$1 == "pkgrel" { print $2 }' "$@" @@ -49,7 +57,7 @@ do_nothing() { do_usage() { cat <<__EOF__ -Usage: $program -a|-h|-s NUM|-t|-z [-f] FILE... +Usage: $prog -a|-h|-s NUM|-t|-z [-f] FILE... Commands: -a Add 1 to current pkgrel -g Only do the change on files that have clean git status -- cgit v1.2.3-70-g09d2