diff options
author | Dubiousjim <dubiousjim@gmail.com> | 2013-07-05 00:21:29 -0400 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-09 07:09:05 +0000 |
commit | 78b22a0f78f72cc9890add81f49a15e8390c2e05 (patch) | |
tree | ed875e65fe7d2d192ede917470924788975f8dc9 /functions.sh.in | |
parent | ecde203930001b0db3e05e7582cd10d437187f27 (diff) | |
download | abuild-78b22a0f78f72cc9890add81f49a15e8390c2e05.tar.gz abuild-78b22a0f78f72cc9890add81f49a15e8390c2e05.tar.bz2 abuild-78b22a0f78f72cc9890add81f49a15e8390c2e05.tar.xz abuild-78b22a0f78f72cc9890add81f49a15e8390c2e05.zip |
abump, functions: refactor (and verify) calculation of APKBUILD path
Diffstat (limited to 'functions.sh.in')
-rw-r--r-- | functions.sh.in | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/functions.sh.in b/functions.sh.in index d71ef38..96b0586 100644 --- a/functions.sh.in +++ b/functions.sh.in @@ -19,6 +19,18 @@ if [ -f "$abuild_userconf" ]; then fi +# expects $1 to be a package directory in the aports tree ('foo' or 'main/foo') +# outputs APKBUILD's path if successful +aports_buildscript() { + [ -n "$APORTSDIR" ] || return 1 + if [ "${1#*/}" != "$1" ]; then + ( cd "$APORTSDIR/$1" && [ -f APKBUILD ] && echo "$PWD/APKBUILD" ) + else + ( cd "$APORTSDIR"/*/"$1" && [ -f APKBUILD ] && echo "$PWD/APKBUILD" ) + fi +} + + # output functions case $prog in abuild) |