diff options
author | Dubiousjim <dubiousjim@gmail.com> | 2013-07-05 00:21:16 -0400 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-09 06:44:01 +0000 |
commit | db1314ac55df59e1fbecdae280cf2b4c1784dd5a (patch) | |
tree | f94dc44cf791559b3291a45d8470bba3f2423610 /newapkbuild.in | |
parent | 144ee3f113ffc73188c6cdc1682b908f6e28cba6 (diff) | |
download | abuild-db1314ac55df59e1fbecdae280cf2b4c1784dd5a.tar.gz abuild-db1314ac55df59e1fbecdae280cf2b4c1784dd5a.tar.bz2 abuild-db1314ac55df59e1fbecdae280cf2b4c1784dd5a.tar.xz abuild-db1314ac55df59e1fbecdae280cf2b4c1784dd5a.zip |
various: move conf-loading and i/o to functions
Diffstat (limited to 'newapkbuild.in')
-rwxr-xr-x | newapkbuild.in | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/newapkbuild.in b/newapkbuild.in index 1a41ae9..0f95f19 100755 --- a/newapkbuild.in +++ b/newapkbuild.in @@ -6,22 +6,15 @@ # Distributed under GPL-2 # -version=@VERSION@ -sysconfdir=@sysconfdir@ +abuild_ver=@VERSION@ datadir=@datadir@ -prog=${0##*/} +if ! [ -f "$datadir/functions.sh" ]; then + echo "$datadir/functions.sh: not found" >&2 + exit 1 +fi +. "$datadir/functions.sh" -# Source $PACKAGER -for i in $sysconfdir/abuild.conf $HOME/.abuild/abuild.conf; do - if [ -f "$i" ]; then - . $i - fi -done - -error() { - echo "$@" >&2 -} is_url() { case "$1" in @@ -260,7 +253,7 @@ __EOF__ } usage() { - echo "$prog $version" + echo "$prog $abuild_ver" echo "usage: $prog [-cfh] [-d DESC] [-l LICENSE] [-n NAME] [-u URL] PKGNAME[-PKGVER]|SRCURL" echo "Options:" echo " -a Create autotools (use ./configure ...)" |