summaryrefslogtreecommitdiff
path: root/functions.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'functions.sh.in')
-rw-r--r--functions.sh.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/functions.sh.in b/functions.sh.in
index a25c39a..ab4dff5 100644
--- a/functions.sh.in
+++ b/functions.sh.in
@@ -30,6 +30,19 @@ aports_buildscript() {
fi
}
+# expects $1 to be a file, or a directory containing an APKBUILD, or a package directory in the aports tree
+# outputs APKBUILD's path if successful (doesn't verify that it's a valid APKBUILD)
+any_buildscript() {
+ if [ -f "$1" ]; then
+ echo "$1"
+ elif [ -d "$1" ]; then
+ [ -f "$1/APKBUILD" ] || return 1
+ echo "$1/APKBUILD"
+ else
+ aports_buildscript "$1" || return 1
+ fi
+}
+
# output functions
case $prog in