diff options
author | B. Watson <yalhcru@gmail.com> | 2015-10-16 04:04:37 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2015-10-16 04:04:37 -0400 |
commit | 8e509b4874284be95d54af7db7d596c56d1b52ad (patch) | |
tree | aeaea05daad0fb5b62c1fc711bdc1986670684cb /sbosrcarch | |
parent | 61d03d928698925593e5efaf48fe8229036a6db8 (diff) | |
download | sbostuff-8e509b4874284be95d54af7db7d596c56d1b52ad.tar.gz |
sbosrcarch: rewrite parse_info
Diffstat (limited to 'sbosrcarch')
-rwxr-xr-x | sbosrcarch | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -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) { |