summaryrefslogtreecommitdiffstats
path: root/abuild
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-23 08:28:58 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-23 08:28:58 +0000
commit1cff62daed4e7fffee83416be85798f96b9378f9 (patch)
treecdff1bf983680dd00faf7b595da2d78966390588 /abuild
parent71854c3fae75cd4e4e83ffea4533b67142a0deaa (diff)
downloadabuild-1cff62daed4e7fffee83416be85798f96b9378f9.tar.bz2
abuild-1cff62daed4e7fffee83416be85798f96b9378f9.tar.xz
abuild: checksum modifies the APKBUILD directly
Diffstat (limited to 'abuild')
-rwxr-xr-xabuild7
1 files changed, 5 insertions, 2 deletions
diff --git a/abuild b/abuild
index ebb8086..5e86c25 100755
--- a/abuild
+++ b/abuild
@@ -94,7 +94,7 @@ md5check() {
return 0
fi
if [ -z "$md5sums" ]; then
- die "Use 'abuild checksum >>$APKBUILD' to generate a checksum"
+ die "Use 'abuild checksum' to generate/update the checksum(s)"
fi
if [ "$(echo $source | wc -l)" -ne "$(echo $md5sums | wc -l)" ]; then
@@ -494,14 +494,17 @@ builddeps() {
done
}
+# replace the md5sums in the APKBUILD
checksum() {
local s files
fetch
+ msg "Updating the md5sums in APKBUILD..."
for s in $source; do
files="$files ${s##*/}"
done
md5sums="$(cd "$srcdir" && md5sum $files)" || die "md5sum failed"
- echo "md5sums=\"$md5sums\""
+ sed -i -e '/^md5sums="/,/"\$/d; /^md5sums=''/,/''\$/d' "$APKBUILD"
+ echo "md5sums=\"$md5sums\"" >>"$APKBUILD"
}
stripbin() {