summaryrefslogtreecommitdiffstats
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-06-03 21:29:58 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-06-03 21:29:58 +0000
commit44247711a40c057685c144d2ff71318684cacdee (patch)
tree49a81992bdee671a8675ce02cd261cc585c1ae69 /abuild.in
parent2c907ddc341822fe4bc64ea7fb12501184e059be (diff)
downloadabuild-44247711a40c057685c144d2ff71318684cacdee.tar.bz2
abuild-44247711a40c057685c144d2ff71318684cacdee.tar.xz
abuild: up2date handle apkcache properly
abuild will not consider package up2date unless apk cache is up2date
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in34
1 files changed, 26 insertions, 8 deletions
diff --git a/abuild.in b/abuild.in
index d0b61a3..6fffc2c 100755
--- a/abuild.in
+++ b/abuild.in
@@ -467,10 +467,11 @@ update_apkcache_index() {
}
apkcache() {
- if ! up2date; then
+ if ! apk_up2date || [ -n "$force" ]; then
sanitycheck && builddeps && clean && fetch && unpack && rootpkg || return 1
fi
local apk
+ mkdir -p "$apkcache" || return 1
set --
for apk in $(listpkg); do
ln -sf "$PKGDEST"/$apk "$apkcache"/$apk
@@ -572,7 +573,7 @@ srcpkg() {
}
# check if package is up to date
-up2date() {
+apk_up2date() {
local pkg="$PKGDEST/$pkgname-$pkgver-r$pkgrel.apk"
local i s
cd "$startdir"
@@ -595,6 +596,19 @@ up2date() {
return 0
}
+cache_up2date() {
+ local i apk
+ for i in $pkgname $subpackages; do
+ apk="${i%:*}-$pkgver-r$pkgrel.apk"
+ [ "$apkcache"/APK_INDEX.gz -nt "$apkcache"/$apk ] || return 1
+ done
+ return 0
+}
+
+up2date() {
+ apk_up2date && cache_up2date
+}
+
# source all APKBUILDs and output:
# 1) origin of package
# 2) all dependencies
@@ -854,7 +868,15 @@ installdeps() {
uninstalldeps (){
sudo apk del .makedepends-$pkgname
}
-
+
+all() {
+ if up2date && [ -z "$force" ]; then
+ msg "Package is up to date"
+ else
+ apkcache
+ fi
+}
+
usage() {
echo "$(basename $0) $abuild_ver"
echo "usage: ${0##*/} [options] [-i PKG] [-P REPODEST] [-p PKGDEST]"
@@ -947,11 +969,7 @@ if [ -z "$1" ] && [ -n "$newname" ]; then
fi
if [ -z "$1" ]; then
- if up2date && [ -z "$force" ]; then
- msg "Package is up to date"
- else
- set $default_cmds
- fi
+ set all
fi
while [ $# -gt 0 ]; do