aboutsummaryrefslogtreecommitdiff
path: root/sbosrcarch
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2015-10-16 04:04:37 -0400
committerB. Watson <yalhcru@gmail.com>2015-10-16 04:04:37 -0400
commit8e509b4874284be95d54af7db7d596c56d1b52ad (patch)
treeaeaea05daad0fb5b62c1fc711bdc1986670684cb /sbosrcarch
parent61d03d928698925593e5efaf48fe8229036a6db8 (diff)
downloadsbostuff-8e509b4874284be95d54af7db7d596c56d1b52ad.tar.gz
sbosrcarch: rewrite parse_info
Diffstat (limited to 'sbosrcarch')
-rwxr-xr-xsbosrcarch17
1 files changed, 4 insertions, 13 deletions
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) {