Commit 8f6f8763 authored by Natanael Copa's avatar Natanael Copa

abuild: fix check if abuildindex is up 2 date

parent 62a87c97
...@@ -1007,17 +1007,32 @@ apk_up2date() { ...@@ -1007,17 +1007,32 @@ apk_up2date() {
} }
abuildindex_up2date() { abuildindex_up2date() {
local i j apk local i
getpkgver || return 1 getpkgver || return 1
for i in $pkgname $subpackages; do for i in $pkgname $subpackages; do
apk="${i%:*}-$pkgver-r$pkgrel.apk" local found= dir=
for j in "$abuildrepo"/*/$apk; do local apk="${i%:*}-$pkgver-r$pkgrel.apk"
[ -r "$j" ] || continue # ignore missing files
local idx="${j%/*}"/APKINDEX.tar.gz # look for file in all arch dirs
if ! [ "$idx" -nt "$j" ]; then for dir in "$abuildrepo"/*; do
return 1 [ -d "$dir" ] || continue
local file="$dir"/$apk
local idx="$dir"/APKINDEX.tar.gz
# check if index is missing
[ -f "$idx" ] || return 1
# check if file is there but is newer than index
if [ -f "$file" ]; then
found=1
if [ "$file" -nt "$idx" ]; then
return 1
fi
fi fi
done done
# we are not up2date if file was not found in any arch dir
[ -z "$found" ] && return 1
done done
return 0 return 0
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment