From 8e509b4874284be95d54af7db7d596c56d1b52ad Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 16 Oct 2015 04:04:37 -0400 Subject: sbosrcarch: rewrite parse_info --- sbosrcarch | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'sbosrcarch') diff --git a/sbosrcarch b/sbosrcarch index 49ca980..c1b3276 100755 --- a/sbosrcarch +++ b/sbosrcarch @@ -400,19 +400,10 @@ sub parse_info { $got =~ s/\\\s*\n//gs; # join \ continuation lines $got =~ s/[ \t]+/ /g; # condense whitespace - my @urls = (); - while($got =~ /DOWNLOAD(?:_x86_64)?="((?:htt|ft)[^"]+)"/gc) { - push @urls, split " ", $1; - } - - my @md5s = (); - while($got =~ /MD5SUM(?:_x86_64)?="([^"]+)"/gc) { - push @md5s, split " ", $1; - } - - for(@md5s) { - print "bad md5sum in $file\n", return undef unless /^[0-9a-f]{32}$/; - } + my @urllines = ($got =~ /DOWNLOAD(?:_x86_64)?="\s*((?:htt|ft)[^"]+)"/g); + my @md5lines = ($got =~ /MD5SUM(?:_x86_64)?="\s*([0-9a-f][^"]+)"/g); + my @urls = split " ", join " ", @urllines; + my @md5s = split " ", join " ", @md5lines; my %ret; for(@urls) { -- cgit v1.2.3