summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-04-04 13:00:22 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-04-04 13:00:22 +0000
commit3ac0a8e0825aba542ea254ada47afa8b8a854b56 (patch)
tree093b76cef449cff35bf4fc8fa36552bb84b976e0
parent8f6f8763cf9e050967f78df354a6894c0bde87da (diff)
downloadabuild-3ac0a8e0825aba542ea254ada47afa8b8a854b56.tar.bz2
abuild-3ac0a8e0825aba542ea254ada47afa8b8a854b56.tar.xz
abuild: move abuildrepo to ~/.cache/abuild/$repo
We no require apk-tools-2.1
-rwxr-xr-xabuild.in38
1 files changed, 14 insertions, 24 deletions
diff --git a/abuild.in b/abuild.in
index f78329d..cd55865 100755
--- a/abuild.in
+++ b/abuild.in
@@ -10,7 +10,7 @@
abuild_ver=@VERSION@
sysconfdir=@sysconfdir@
-abuildrepo=@abuildrepo@
+abuildrepo_base=@abuildrepo@
datadir=@datadir@
program=${0##*/}
@@ -1009,31 +1009,20 @@ apk_up2date() {
abuildindex_up2date() {
local i
getpkgver || return 1
- for i in $pkgname $subpackages; do
- local found= dir=
- local apk="${i%:*}-$pkgver-r$pkgrel.apk"
-
- # look for file in all arch dirs
- for dir in "$abuildrepo"/*; do
- [ -d "$dir" ] || continue
- local file="$dir"/$apk
- local idx="$dir"/APKINDEX.tar.gz
-
- # check if index is missing
- [ -f "$idx" ] || return 1
+ local dir="$abuildrepo"/$CARCH
+ local apk="${pkgname%:*}-$pkgver-r$pkgrel.apk"
+ local idx="$dir"/APKINDEX.tar.gz
+ local file="$dir"/$apk
+
+ # 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
- done
+ # if link or file is missing, then we need update abuildrepo index
+ [ -f "$file" ] || return 1
+
+ # if file exists and is newer than index, then we need update index
+ [ "$file" -nt "$idx" ] && return 1
- # we are not up2date if file was not found in any arch dir
- [ -z "$found" ] && return 1
- done
return 0
}
@@ -1427,6 +1416,7 @@ pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
pkgrel=0
repo=${startdir%/*}
repo=${repo##*/}
+abuildrepo="$abuildrepo_base"/$repo
SRCDEST=${SRCDEST:-$startdir}
PKGDEST=${PKGDEST:-$startdir}