mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-23 23:42:35 +00:00
only build if sources are newer than target
This commit is contained in:
parent
5a740569bc
commit
45e51ce190
22
abuild
22
abuild
@ -246,6 +246,22 @@ srcpkg() {
|
||||
(cd .. && tar -zcf $PKGDEST/$p.src.tar.gz $files)
|
||||
}
|
||||
|
||||
# check if package is up to date
|
||||
up2date() {
|
||||
local p="$pkgname-$pkgver"
|
||||
[ "$pkgrel" -ne 0 ] && p="$p-r$pkgrel"
|
||||
local pkg="$PKGDEST/$p.apk"
|
||||
local i s
|
||||
[ -f "$pkg" ] || return 1
|
||||
for i in $source APKBUILD; do
|
||||
local s="$SRCDEST/${i##*/}" # $(basename $i)
|
||||
if [ "$s" -nt "$pkg" ]; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "$(basename $0) $myver"
|
||||
echo "usage: $0 [options] [cmd] ..."
|
||||
@ -302,7 +318,11 @@ trap 'die "Aborted by user"' INT
|
||||
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
set $default_cmds
|
||||
if up2date; then
|
||||
vecho "Package is up to date"
|
||||
else
|
||||
set $default_cmds
|
||||
fi
|
||||
fi
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
|
Loading…
Reference in New Issue
Block a user