Received: by mail.netbsd.org (Postfix, from userid 605) id 2326084D7F; Thu, 12 Sep 2019 02:49:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 9FE9784D3E for ; Thu, 12 Sep 2019 02:49:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id rIcFKDyNqU37 for ; Thu, 12 Sep 2019 02:49:34 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 1E93884CEF for ; Thu, 12 Sep 2019 02:49:34 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 18B64FBF4; Thu, 12 Sep 2019 02:49:34 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_156825657452310" MIME-Version: 1.0 Date: Thu, 12 Sep 2019 02:49:34 +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: <20190912024934.18B64FBF4@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. --_----------=_156825657452310 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Thu Sep 12 02:49:34 UTC 2019 Modified Files: pkgsrc/pkgtools/url2pkg/files: url2pkg.pl Log Message: pkgtools/url2pkg: split Perl package code into separate subs To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 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. --_----------=_156825657452310 Content-Disposition: inline Content-Length: 2997 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.65 pkgsrc/pkgtools/url2pkg/files/url2pkg.pl:1.66 --- pkgsrc/pkgtools/url2pkg/files/url2pkg.pl:1.65 Wed Sep 11 05:25:55 2019 +++ pkgsrc/pkgtools/url2pkg/files/url2pkg.pl Thu Sep 12 02:49:33 2019 @@ -1,5 +1,5 @@ #! @PERL5@ -# $NetBSD: url2pkg.pl,v 1.65 2019/09/11 05:25:55 rillig Exp $ +# $NetBSD: url2pkg.pl,v 1.66 2019/09/12 02:49:33 rillig Exp $ # # Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -350,40 +350,42 @@ sub adjust_libtool() { } } -sub adjust_perl_module() { - - if (-f "$abs_wrksrc/Build.PL") { - # Example packages: - # devel/p5-Algorithm-CheckDigits +# Example packages: +# devel/p5-Algorithm-CheckDigits +sub adjust_perl_module_Build_PL() { - # It's a Module::Build module. Dependencies cannot yet be - # extracted automatically. - # - # TODO: Implement this similarly to the Makefile.PL mock below. + # TODO: Implement this similarly to the Makefile.PL mock below. - push(@todos, "Look for the dependencies in Build.PL."); + push(@todos, "Look for the dependencies in Build.PL."); - push(@build_vars, var("PERL5_MODULE_TYPE", "=", "Module::Build")); + push(@build_vars, var("PERL5_MODULE_TYPE", "=", "Module::Build")); +} - } elsif (-f "$abs_wrksrc/Makefile.PL") { - # Example packages: - # devel/p5-Algorithm-Diff (no dependencies) - # devel/p5-Carp-Assert-More (dependencies without version numbers) - # www/p5-HTML-Quoted (dependency with version number) - - # To avoid fix_up_makefile error for p5-HTML-Quoted, generate Makefile first. - system("cd '$abs_wrksrc' && perl -I. Makefile.PL < /dev/null") or do {}; - - open(DEPS, "cd '$abs_wrksrc' && perl -I$libdir -I. Makefile.PL |") or die; - while (defined(my $dep = )) { - chomp($dep); +# Example packages: +# devel/p5-Algorithm-Diff (no dependencies) +# devel/p5-Carp-Assert-More (dependencies without version numbers) +# www/p5-HTML-Quoted (dependency with version number) +sub adjust_perl_module_Makefile_PL() { + + # To avoid fix_up_makefile error for p5-HTML-Quoted, generate Makefile first. + system("cd '$abs_wrksrc' && perl -I. Makefile.PL < /dev/null") or do {}; + + open(DEPS, "cd '$abs_wrksrc' && perl -I$libdir -I. Makefile.PL |") or die; + while (defined(my $dep = )) { + chomp($dep); - if ($dep =~ qr"^(\w+)\t(\S+)(>\S+|):(\.\./\.\./\S+)$") { - add_dependency($1, $2, $3, $4); - } + if ($dep =~ qr"^(\w+)\t(\S+)(>\S+|):(\.\./\.\./\S+)$") { + add_dependency($1, $2, $3, $4); } - close(DEPS) or die; + } + close(DEPS) or die; +} +sub adjust_perl_module() { + if (-f "$abs_wrksrc/Build.PL") { + adjust_perl_module_Build_PL(); + } elsif (-f "$abs_wrksrc/Makefile.PL") { + adjust_perl_module_Makefile_PL(); } else { return; } @@ -393,6 +395,7 @@ sub adjust_perl_module() { push(@includes, "../../lang/perl5/module.mk"); $pkgname = "p5-\${DISTNAME}"; push(@categories, "perl5"); + unlink("PLIST") or do {}; } --_----------=_156825657452310--