summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2008-10-22 21:13:56 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2008-10-22 21:13:56 +0000
commit45e51ce1908aafc611b62c98ffaca12b7200b166 (patch)
tree510ef911b02d9171581f5e721060fc0f305dcb05
parent5a740569bc42ab6a36d848144d03af0862a063f6 (diff)
downloadabuild-45e51ce1908aafc611b62c98ffaca12b7200b166.tar.gz
abuild-45e51ce1908aafc611b62c98ffaca12b7200b166.tar.bz2
abuild-45e51ce1908aafc611b62c98ffaca12b7200b166.tar.xz
abuild-45e51ce1908aafc611b62c98ffaca12b7200b166.zip
only build if sources are newer than target
-rwxr-xr-xabuild22
1 files changed, 21 insertions, 1 deletions
diff --git a/abuild b/abuild
index bfb2653..9ccbe3e 100755
--- a/abuild
+++ b/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