Received: by mail.netbsd.org (Postfix, from userid 605) id D64EF84D4B; Sun, 18 Aug 2019 07:51:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 5E86184D33 for ; Sun, 18 Aug 2019 07:51:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 7Jii83t9N0W4 for ; Sun, 18 Aug 2019 07:51:40 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id D601A84CE3 for ; Sun, 18 Aug 2019 07:51:40 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id CFD18FBF4; Sun, 18 Aug 2019 07:51:40 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1566114700278650" MIME-Version: 1.0 Date: Sun, 18 Aug 2019 07:51:40 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/pkgtools/url2pkg/files To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20190818075140.CFD18FBF4@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1566114700278650 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Sun Aug 18 07:51:40 UTC 2019 Modified Files: pkgsrc/pkgtools/url2pkg/files: url2pkg.pl Log Message: pkgtools/url2pkg: remove unnecessary local variable To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 pkgsrc/pkgtools/url2pkg/files/url2pkg.pl Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1566114700278650 Content-Disposition: inline Content-Length: 2519 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/pkgtools/url2pkg/files/url2pkg.pl diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg.pl:1.54 pkgsrc/pkgtools/url2pkg/files/url2pkg.pl:1.55 --- pkgsrc/pkgtools/url2pkg/files/url2pkg.pl:1.54 Sun Aug 18 07:47:58 2019 +++ pkgsrc/pkgtools/url2pkg/files/url2pkg.pl Sun Aug 18 07:51:40 2019 @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: url2pkg.pl,v 1.54 2019/08/18 07:47:58 rillig Exp $ +# $NetBSD: url2pkg.pl,v 1.55 2019/08/18 07:51:40 rillig Exp $ # # Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -306,7 +306,6 @@ sub generate_initial_package_Makefile_li my $github_release = ""; my $dist_subdir = ""; - my $found = false; open(SITES, "<", "../../mk/fetch/sites.mk") or die; while (defined(my $line = )) { chomp($line); @@ -318,8 +317,6 @@ sub generate_initial_package_Makefile_li my ($site) = ($1); if (index($url, $site) == 0) { - $found = true; - if ($url =~ qr"^\Q${site}\E(.+)/([^/]+)$") { my $subdir = $1; $distfile = $2; @@ -346,7 +343,6 @@ sub generate_initial_package_Makefile_li $master_sites = "\${MASTER_SITE_SOURCEFORGE:=${project}/}"; $homepage = "https://${project}.sourceforge.net/"; $distfile = $filename; - $found = true; } if ($url =~ qr"^https://github\.com/") { @@ -361,7 +357,6 @@ sub generate_initial_package_Makefile_li $dist_subdir = '${GITHUB_PROJECT}'; } $distfile = "$tag$ext"; - $found = true; } elsif ($url =~ qr"^https://github\.com/(.*)/(.*)/releases/download/(.*)/(.*)(\.tar\.gz|\.zip)$") { my ($org, $proj, $tag, $base, $ext) = ($1, $2, $3, $4, $5); @@ -374,15 +369,16 @@ sub generate_initial_package_Makefile_li } $github_release = $tag eq $base ? '${DISTNAME}' : $tag; $distfile = "$base$ext"; - $found = true; + } else { print("$0: ERROR: Invalid GitHub URL: ${url}, handling as normal URL\n"); } } - if (!$found) { + if ($master_sites eq "") { if ($url =~ qr"^(.*/)(.*)$") { - ($master_sites, $distfile) = ($1, $2); + $master_sites = $1; + $distfile = $2; $homepage = $master_sites; } else { die("$0: ERROR: Invalid URL: ${url}\n"); @@ -390,9 +386,11 @@ sub generate_initial_package_Makefile_li } if ($distfile =~ qr"^(.*?)((?:\.tar)?\.\w+)$") { - ($distname, $extract_sufx) = ($1, $2); + $distname = $1; + $extract_sufx = $2; } else { - ($distname, $extract_sufx) = ($distfile, "# none"); + $distname = $distfile; + $extract_sufx = "# none"; } rename("Makefile", "Makefile-url2pkg.bak") or do {}; --_----------=_1566114700278650--