summaryrefslogtreecommitdiff
path: root/apkgrel.in
diff options
context:
space:
mode:
Diffstat (limited to 'apkgrel.in')
-rw-r--r--apkgrel.in13
1 files changed, 10 insertions, 3 deletions
diff --git a/apkgrel.in b/apkgrel.in
index 1d178aa..94acd55 100644
--- a/apkgrel.in
+++ b/apkgrel.in
@@ -45,9 +45,8 @@ do_add () {
local f= old=
for f; do
[ -n "$only_clean_git" ] \
- && [ -n "$(git diff --name-only "$f")" ] \
+ && [ -n "$(git diff --name-only "${f%/*}")" ] \
&& continue
- [ -d "$f" ] && f="$f/APKBUILD"
old=$(show_plain "$f")
case $old in
[0-9]*) setto=$((old + 1));;
@@ -61,7 +60,6 @@ do_verify() {
[ -n "$force" ] && return 0
local f= rc=0
for f; do
- [ -d "$f" ] && f="$f/APKBUILD"
if ! grep -q '^pkgrel=[0-9]' "$f"; then
error "no proper \$pkgrel for $f"
rc=1
@@ -124,6 +122,15 @@ if [ $# -eq 0 ]; then
exit 2
fi
+# normalize $@ into paths to APKBUILDs
+[ "$(echo "$@" | wc -l)" -eq 1 ] || die "can't handle paths with embedded newlines"
+args=$(for a; do p=$(any_buildscript "$a") || die "can't find APKBUILD for $a"; echo "$p"; done)
+[ $? -eq 0 ] || exit 1
+oldifs=$IFS
+IFS=$'\n'
+set -- $args
+IFS=$oldifs
+
do_verify "$@" || exit 1
$cmd "$@"