Skip to content
Snippets Groups Projects
Commit 1cff62da authored by Natanael Copa's avatar Natanael Copa
Browse files

abuild: checksum modifies the APKBUILD directly

parent 71854c3f
No related branches found
No related tags found
No related merge requests found
...@@ -94,7 +94,7 @@ md5check() { ...@@ -94,7 +94,7 @@ md5check() {
return 0 return 0
fi fi
if [ -z "$md5sums" ]; then if [ -z "$md5sums" ]; then
die "Use 'abuild checksum >>$APKBUILD' to generate a checksum" die "Use 'abuild checksum' to generate/update the checksum(s)"
fi fi
if [ "$(echo $source | wc -l)" -ne "$(echo $md5sums | wc -l)" ]; then if [ "$(echo $source | wc -l)" -ne "$(echo $md5sums | wc -l)" ]; then
...@@ -494,14 +494,17 @@ builddeps() { ...@@ -494,14 +494,17 @@ builddeps() {
done done
} }
# replace the md5sums in the APKBUILD
checksum() { checksum() {
local s files local s files
fetch fetch
msg "Updating the md5sums in APKBUILD..."
for s in $source; do for s in $source; do
files="$files ${s##*/}" files="$files ${s##*/}"
done done
md5sums="$(cd "$srcdir" && md5sum $files)" || die "md5sum failed" md5sums="$(cd "$srcdir" && md5sum $files)" || die "md5sum failed"
echo "md5sums=\"$md5sums\"" sed -i -e '/^md5sums="/,/"\$/d; /^md5sums=''/,/''\$/d' "$APKBUILD"
echo "md5sums=\"$md5sums\"" >>"$APKBUILD"
} }
stripbin() { stripbin() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment