~alpine/devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[alpine-devel] [PATCH] delete remote source files that fail the md5 checksum test

Jeremy Thomerson <jeremy@thomersonfamily.com>
Details
Message ID
<1289046306-8854-1-git-send-email-jeremy@thomersonfamily.com>
Sender timestamp
1289046306
DKIM signature
missing
Download raw message
Patch: +21 -2
Currently, if the build server downloads a file that fails the md5sum check
for some reason (perhaps interrupted download, etc), the file is never deleted
so the build can not succeed until someone manually deletes the bad file.  This
change deletes any file that is a remote source file / package that fails the
md5sum check.  The subsequent rebuild will then be forced to download the file
again.
---
 abuild.in |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/abuild.in b/abuild.in
index ff18c6b..11811ba 100755
--- a/abuild.in
+++ b/abuild.in
@@ -155,7 +155,7 @@ sanitycheck() {
}

md5check() {
	local dummy f
	local dummy f endreturnval originalparams origin file
	if [ -z "$source" ]; then
		return 0
	fi
@@ -167,7 +167,26 @@ md5check() {
	fi
	fetch || return 1
	msg "Checking md5sums..."
	cd "$srcdir" && echo "$md5sums" | md5sum -c 
	IFS=$'\n'
	endreturnval=0
	originalparams=$@
	set -- $source
	for src in $md5sums; do
		origin=$1; shift
		echo "$src" | md5sum -c
		if [ $? -ne 0 ]; then
			is_remote $origin || continue
			echo "Because the remote file above failed the md5sum check it will be deleted."
			echo "Rebuilding will cause it to re-download which in some cases may fix the problem."
			file=`echo "$src" | sed 's/.*[ \t\n]\(.*\)/\1/'`
			echo "Deleting: $file"
			rm $file
			endreturnval=1
		fi
	done
	unset IFS
	set -- $originalparams
	return $endreturnval
}

# verify upstream sources
-- 
1.7.4.1



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20110329080648.5055499a@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<1289046306-8854-1-git-send-email-jeremy@thomersonfamily.com> (view parent)
Sender timestamp
1301378808
DKIM signature
missing
Download raw message
On Sat,  6 Nov 2010 12:25:06 +0000
Jeremy Thomerson <jeremy@thomersonfamily.com> wrote:

> Currently, if the build server downloads a file that fails the md5sum
> check for some reason (perhaps interrupted download, etc), the file
> is never deleted so the build can not succeed until someone manually
> deletes the bad file.  This change deletes any file that is a remote
> source file / package that fails the md5sum check.  The subsequent
> rebuild will then be forced to download the file again.
> ---
>  abuild.in |   23 +++++++++++++++++++++--
>  1 files changed, 21 insertions(+), 2 deletions(-)

Looks good.
Applied. Thanks!

(There is actually no need to save and restore originalparams since
md5check() function does not take any parameters.)

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)