summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2019-08-17 11:57:36 +0000
committerrillig <rillig@pkgsrc.org>2019-08-17 11:57:36 +0000
commit11186334a7b15538e061460655791b8a2f623d1d (patch)
tree33861c34ca3f5328e6eba39a66e9326abe2065e9 /pkgtools
parent0b5df70a90df33252b5e20b357ebab01298ab4e5 (diff)
downloadpkgsrc-11186334a7b15538e061460655791b8a2f623d1d.tar.gz
pkgtools/url2pkg: fix parsing of mk/fetch/sites.mk
Before, the final line of each MASTER_SITE_* definition had been skipped because it didn't end with a backslash. That part of the regular expression had always been intended to be optional. That bug lasted almost 13 years, which is remarkably long but not the record. The mk/fetch/sites.mk is now closed properly, which has gone unnoticed for almost 13 years as well. Google Code doesn't exist anymore, therefore there's no point in keeping it.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/url2pkg/files/url2pkg.pl19
1 files changed, 5 insertions, 14 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg.pl b/pkgtools/url2pkg/files/url2pkg.pl
index b7a8afe8e43..ef06a3b435c 100644
--- a/pkgtools/url2pkg/files/url2pkg.pl
+++ b/pkgtools/url2pkg/files/url2pkg.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: url2pkg.pl,v 1.39 2019/05/25 03:58:50 maya Exp $
+# $NetBSD: url2pkg.pl,v 1.40 2019/08/17 11:57:36 rillig Exp $
#
# Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -273,7 +273,7 @@ sub generate_initial_package($) {
if ($line =~ qr"^(MASTER_SITE_.*)\+=") {
$master_site = $1;
- } elsif ($line =~ qr"^\t(.*?)(?:\s+\\)$") {
+ } elsif ($line =~ qr"^\t(.*?)(?:\s+\\)?$") {
my ($site) = ($1);
if (index($url, $site) == 0) {
@@ -297,8 +297,9 @@ sub generate_initial_package($) {
}
}
}
+ close(SITES) or die;
- if (!$found) {
+ if (true) {
if ($url =~ qr"^http://(?:pr)?downloads\.sourceforge\.net/([^/]*)/([^/?]+)(?:\?(?:download|use_mirror=.*))?$") {
my $pkgbase = $1;
$distfile = $2;
@@ -309,17 +310,7 @@ sub generate_initial_package($) {
}
}
- if (!$found) {
- if ($url =~ qr"^http://([^.]*).googlecode\.com/files/(.*$)") {
- my $pkgbase = $1;
- $distfile = $2;
- $master_sites = "http://${pkgbase}.googlecode.com/files/";
- $homepage = "http://code.google.com/p/${pkgbase}/";
- $found = true;
- }
- }
-
- if (!$found) {
+ if (true) {
if ($url =~ qr"^https?://github\.com/") {
if ($url =~ qr"^https?://github\.com/(.*)/(.*)/archive/(.*)(\.tar\.gz|\.zip)$") {
$master_sites = "\${MASTER_SITE_GITHUB:=$1/}";