mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-03-11 06:37:31 +00:00
abuild: move abuildrepo to ~/.cache/abuild/$repo
We no require apk-tools-2.1
This commit is contained in:
parent
8f6f8763cf
commit
3ac0a8e082
34
abuild.in
34
abuild.in
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
abuild_ver=@VERSION@
|
abuild_ver=@VERSION@
|
||||||
sysconfdir=@sysconfdir@
|
sysconfdir=@sysconfdir@
|
||||||
abuildrepo=@abuildrepo@
|
abuildrepo_base=@abuildrepo@
|
||||||
datadir=@datadir@
|
datadir=@datadir@
|
||||||
|
|
||||||
program=${0##*/}
|
program=${0##*/}
|
||||||
@ -1009,31 +1009,20 @@ apk_up2date() {
|
|||||||
abuildindex_up2date() {
|
abuildindex_up2date() {
|
||||||
local i
|
local i
|
||||||
getpkgver || return 1
|
getpkgver || return 1
|
||||||
for i in $pkgname $subpackages; do
|
local dir="$abuildrepo"/$CARCH
|
||||||
local found= dir=
|
local apk="${pkgname%:*}-$pkgver-r$pkgrel.apk"
|
||||||
local apk="${i%:*}-$pkgver-r$pkgrel.apk"
|
local idx="$dir"/APKINDEX.tar.gz
|
||||||
|
local file="$dir"/$apk
|
||||||
|
|
||||||
# look for file in all arch dirs
|
# check if index is missing
|
||||||
for dir in "$abuildrepo"/*; do
|
[ -f "$idx" ] || return 1
|
||||||
[ -d "$dir" ] || continue
|
|
||||||
local file="$dir"/$apk
|
|
||||||
local idx="$dir"/APKINDEX.tar.gz
|
|
||||||
|
|
||||||
# check if index is missing
|
# if link or file is missing, then we need update abuildrepo index
|
||||||
[ -f "$idx" ] || return 1
|
[ -f "$file" ] || return 1
|
||||||
|
|
||||||
# check if file is there but is newer than index
|
# if file exists and is newer than index, then we need update index
|
||||||
if [ -f "$file" ]; then
|
[ "$file" -nt "$idx" ] && return 1
|
||||||
found=1
|
|
||||||
if [ "$file" -nt "$idx" ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# we are not up2date if file was not found in any arch dir
|
|
||||||
[ -z "$found" ] && return 1
|
|
||||||
done
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1427,6 +1416,7 @@ pkgbasedir=${pkgbasedir:-"$startdir/pkg"}
|
|||||||
pkgrel=0
|
pkgrel=0
|
||||||
repo=${startdir%/*}
|
repo=${startdir%/*}
|
||||||
repo=${repo##*/}
|
repo=${repo##*/}
|
||||||
|
abuildrepo="$abuildrepo_base"/$repo
|
||||||
|
|
||||||
SRCDEST=${SRCDEST:-$startdir}
|
SRCDEST=${SRCDEST:-$startdir}
|
||||||
PKGDEST=${PKGDEST:-$startdir}
|
PKGDEST=${PKGDEST:-$startdir}
|
||||||
|
Loading…
Reference in New Issue
Block a user