diff options
Diffstat (limited to 'sbolint')
| -rwxr-xr-x | sbolint | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -1249,6 +1249,7 @@ sub check_dl_and_md5 { } check_github_url($file, $u); + check_pypi_url($file, $u); if($url_head) { curl_head_request($file, $u) || do { @@ -1389,6 +1390,34 @@ sub check_github_url { } } +sub check_pypi_url { + my $file = shift; + my $url = shift; + my $filename; + my $initial; + my $newurl; + my $srcnam; + + return unless $url =~ m{^(https?)://files.pythonhosted.org}; + + # don't mess with URLs that don't have the 60-digit hex hash. + return unless $url =~ m{/[0-9a-f]{60}/}; + + if($1 ne 'https') { + log_error("$file: pypi URL must be https://"); + } + + ($filename = $url) =~ s,.*/,,; + $initial = substr($filename, 0, 1); + # FIXME: assumes no - in the version number. So far that's true... + ($srcnam = $filename) =~ s,-\d[^-]*\.tar\.gz$,,; + + $newurl = "https://files.pythonhosted.org/packages/source/$initial/$srcnam/$filename"; + if($url ne $newurl) { + log_warning("$file: canonical pypi URL should be $newurl"); + } +} + sub script_exists { my $file = $buildname . ".SlackBuild"; unless(-e $file) { |
