summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-05-06 08:20:59 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-05-06 08:20:59 +0000
commit18c1dde2def1fe2b928a69c00ff0d6616fb0be45 (patch)
tree841a153b866dba47562c8c78c9a75da6c8935d3c
parented0613addae202ec9988a66f3bf27b13947685a8 (diff)
downloadabuild-18c1dde2def1fe2b928a69c00ff0d6616fb0be45.tar.bz2
abuild-18c1dde2def1fe2b928a69c00ff0d6616fb0be45.tar.xz
abuild: only update abuildrepo index if needed
speeds up abuild -R a bit
-rwxr-xr-xabuild.in16
1 files changed, 11 insertions, 5 deletions
diff --git a/abuild.in b/abuild.in
index ec3b9d4..5e345f9 100755
--- a/abuild.in
+++ b/abuild.in
@@ -535,7 +535,7 @@ create_apks() {
done
}
-abuildrepo() {
+update_abuildrepo() {
if ! apk_up2date || [ -n "$force" ]; then
sanitycheck && builddeps && clean && fetch && unpack \
&& prepare && mkusers && rootpkg || return 1
@@ -707,7 +707,7 @@ apk_up2date() {
return 0
}
-cache_up2date() {
+abuildindex_up2date() {
local i apk
getpkgver || return 1
for i in $pkgname $subpackages; do
@@ -718,7 +718,13 @@ cache_up2date() {
}
up2date() {
- apk_up2date && cache_up2date
+ apk_up2date && abuildindex_up2date
+}
+
+# rebuild package and abuildrepo index if needed
+abuildindex() {
+ up2date && return 0
+ update_abuildrepo
}
# source all APKBUILDs and output:
@@ -854,7 +860,7 @@ builddeps() {
local pkg=${i%:*}
if [ -d "$dir" ]; then
msg "Entering $dir"
- cd "$dir" && $0 -k -r abuildrepo || return 1
+ cd "$dir" && $0 -k -r abuildindex || return 1
fi
done
$SUDO $APK add -u --repository "$abuildrepo" \
@@ -988,7 +994,7 @@ all() {
if up2date && [ -z "$force" ]; then
msg "Package is up to date"
else
- abuildrepo
+ update_abuildrepo
fi
}