pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/url2pkg/files pkgtools/url2pkg: fix parsing o...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/614375ba7780
branches:  trunk
changeset: 399810:614375ba7780
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Aug 17 11:57:36 2019 +0000

description:
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:

 pkgtools/url2pkg/files/url2pkg.pl |  19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diffs (49 lines):

diff -r 9a6c56691da5 -r 614375ba7780 pkgtools/url2pkg/files/url2pkg.pl
--- a/pkgtools/url2pkg/files/url2pkg.pl Sat Aug 17 11:06:11 2019 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.pl Sat Aug 17 11:57:36 2019 +0000
@@ -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 @@
                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 @@
                        }
                }
        }
+       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 @@
                }
        }
 
-       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/}";



Home | Main Index | Thread Index | Old Index