From: "Kent Fredric" <kentfredric@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/perl-overlay:master commit in: scripts/
Date: Mon, 14 Nov 2011 02:57:32 +0000 (UTC) [thread overview]
Message-ID: <ab4f94737364e5a82928459a5e96c6416448dcb1.kent@gentoo> (raw)
commit: ab4f94737364e5a82928459a5e96c6416448dcb1
Author: Kent Fredric <kentfredric <AT> gmail <DOT> com>
AuthorDate: Mon Nov 14 02:52:24 2011 +0000
Commit: Kent Fredric <kentfredric <AT> gmail <DOT> com>
CommitDate: Mon Nov 14 02:52:24 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/perl-overlay.git;a=commit;h=ab4f9473
Add support for --debug to gen_ebuild
---
scripts/gen_ebuild.pl | 100 +++++++++++++++++++++++++------------------------
1 files changed, 51 insertions(+), 49 deletions(-)
diff --git a/scripts/gen_ebuild.pl b/scripts/gen_ebuild.pl
index ef9c4c7..a230110 100755
--- a/scripts/gen_ebuild.pl
+++ b/scripts/gen_ebuild.pl
@@ -47,16 +47,14 @@ EOF
}
my ($release) = shift(@ARGV);
-
-
*STDOUT->binmode(':utf8');
*STDERR->binmode(':utf8');
require deptools;
-my ( $release_info ) = deptools::get_deps( $release );
+my ($release_info) = deptools::get_deps($release);
-if ( not $release_info ){
+if ( not $release_info ) {
die "Cannot find $release on MetaCPAN";
}
my $dep_phases = deptools::get_dep_phases($release);
@@ -71,119 +69,123 @@ for my $module ( keys %{ $dep_phases->{modules} } ) {
my @squeue =
sort { $a->[1]->[2] cmp $b->[1]->[2] or $a->[1]->[3] cmp $b->[1]->[3] or $a->[0] cmp $b->[0] } @queue;
-
require dep::handler::stdout;
require dep::handler::bashcode;
my $handler = dep::handler::stdout->new();
-my $handler2 = dep::handler::bashcode->new();
-
+my $handler2 = dep::handler::bashcode->new( ( $flags->{debug} ? ( debug => 1 ) : () ), debug_handler => $handler, );
for my $qi (@squeue) {
deptools::dispatch_dependency_handler( $release, @{$qi}, $handler2 );
}
-my $depends = [];
+my $depends = [];
my $rdepends = [];
require POSIX;
-my $year = POSIX::strftime('%Y', gmtime);
+my $year = POSIX::strftime( '%Y', gmtime );
-my $path = deptools::gentooize_pkg($release_info->{distribution} );
+my $path = deptools::gentooize_pkg( $release_info->{distribution} );
require Gentoo::PerlMod::Version;
-my $version = Gentoo::PerlMod::Version::gentooize_version( $release_info->{version} , { lax => 1 } );
+my $version = Gentoo::PerlMod::Version::gentooize_version( $release_info->{version}, { lax => 1 } );
$env->root->subdir($path)->mkpath;
-my $file = $env->root->subdir($path)->file($release_info->{distribution} . '-' . $version . '.ebuild' );
+my $file = $env->root->subdir($path)->file( $release_info->{distribution} . '-' . $version . '.ebuild' );
-my ( $fh ) = $file->openw;
+my ($fh) = $file->openw;
say "Writing $file";
$fh->say("# Copyright 1999-$year Gentoo Foundation");
$fh->say("# Distributed under the terms of the GNU General Public License v2");
$fh->say("# \$Header: \$");
$fh->say("EAPI=4");
-$fh->say("MODULE_AUTHOR=" . $release_info->{author});
-$fh->say("MODULE_VERSION=" . $release_info->{version});
+$fh->say( "MODULE_AUTHOR=" . $release_info->{author} );
+$fh->say( "MODULE_VERSION=" . $release_info->{version} );
$fh->say('inherit perl-module');
$fh->say('');
-if ( not defined $release_info->{abstract} ) {
- $fh->say('DESCRIPTION=\'' . $release_info->{distribution} . '\'');
+
+if ( not defined $release_info->{abstract} ) {
+ $fh->say( 'DESCRIPTION=\'' . $release_info->{distribution} . '\'' );
warn "Missing an ABSTRACT";
-} else {
- $fh->say('DESCRIPTION=\'' . $release_info->{abstract} . '\'');
+}
+else {
+ $fh->say( 'DESCRIPTION=\'' . $release_info->{abstract} . '\'' );
}
-my $lics = [];
+my $lics = [];
my $licmap = {
- perl_5 => [qw( Artistic GPL-2 )],
+ perl_5 => [qw( Artistic GPL-2 )],
apache_2_0 => [qw( Apache-2.0 )],
- mit => [qw( MIT )],
- lgpl_2_1 => [qw( LGPL-2.1 )]
+ mit => [qw( MIT )],
+ lgpl_2_1 => [qw( LGPL-2.1 )]
};
-for my $lic ( @{ $release_info->{license} } ){
- if ( exists $licmap->{$lic} ){
- push @$lics, @{ $licmap->{$lic}};
- } else {
+for my $lic ( @{ $release_info->{license} } ) {
+ if ( exists $licmap->{$lic} ) {
+ push @$lics, @{ $licmap->{$lic} };
+ }
+ else {
warn "No Gentoo maping listed for $lic license type";
}
}
-if( scalar @$lics == 1 ){
- $fh->say('LICENSE=" ' . $lics->[0] . '"');
-} elsif ( scalar @$lics > 1 ){
- $fh->say('LICENSE=" || ( ' . (join q{ } , @$lics) . ' )"');
-} else {
+if ( scalar @$lics == 1 ) {
+ $fh->say( 'LICENSE=" ' . $lics->[0] . '"' );
+}
+elsif ( scalar @$lics > 1 ) {
+ $fh->say( 'LICENSE=" || ( ' . ( join q{ }, @$lics ) . ' )"' );
+}
+else {
$fh->say('LICENSE=""');
}
$fh->say('SLOT="0"');
$fh->say('KEYWORDS="~amd64 ~x86"');
-if( $handler2->has_tdeps ) {
+if ( $handler2->has_tdeps ) {
$fh->say('IUSE="test"');
-} else {
+}
+else {
$fh->say('IUSE=""');
}
if ( $handler2->has_cdeps ) {
$fh->say('perl_meta_configure() {');
for my $dep ( @{ $handler2->cdeps } ) {
- $fh->say("\t# " . $dep->{dep});
- $fh->say("\techo " . $dep->{install});
+ $fh->say( "\t# " . $dep->{dep} );
+ $fh->say( "\techo " . $dep->{install} );
}
$fh->say('}');
- push @{ $depends }, '$(perl_meta_configure)';
+ push @{$depends}, '$(perl_meta_configure)';
}
if ( $handler2->has_bdeps ) {
$fh->say('perl_meta_build() {');
for my $dep ( @{ $handler2->bdeps } ) {
- $fh->say("\t# " . $dep->{dep});
- $fh->say("\techo " . $dep->{install});
+ $fh->say( "\t# " . $dep->{dep} );
+ $fh->say( "\techo " . $dep->{install} );
}
$fh->say('}');
- push @{ $depends }, '$(perl_meta_build)';
+ push @{$depends}, '$(perl_meta_build)';
}
if ( $handler2->has_rdeps ) {
$fh->say('perl_meta_runtime() {');
for my $dep ( @{ $handler2->rdeps } ) {
- $fh->say("\t# " . $dep->{dep});
- $fh->say("\techo " . $dep->{install});
+ $fh->say( "\t# " . $dep->{dep} );
+ $fh->say( "\techo " . $dep->{install} );
}
$fh->say('}');
- push @{ $depends }, '$(perl_meta_runtime)';
- push @{ $rdepends }, '$(perl_meta_runtime)';
+ push @{$depends}, '$(perl_meta_runtime)';
+ push @{$rdepends}, '$(perl_meta_runtime)';
}
if ( $handler2->has_tdeps ) {
$fh->say('perl_meta_test() {');
for my $dep ( @{ $handler2->tdeps } ) {
- $fh->say("\t# " . $dep->{dep});
- $fh->say("\techo " . $dep->{install});
+ $fh->say( "\t# " . $dep->{dep} );
+ $fh->say( "\techo " . $dep->{install} );
}
$fh->say('}');
- push @{ $depends }, 'test? ( $(perl_meta_test) )';
+ push @{$depends}, 'test? ( $(perl_meta_test) )';
}
-$fh->say("DEPEND=\"\n" . ( join qq{\n}, map { "\t$_" } @{$depends} ) . "\n\"");
-$fh->say("RDEPEND=\"\n" . ( join qq{\n}, map { "\t$_" } @{$rdepends} ) . "\n\"");
+$fh->say( "DEPEND=\"\n" . ( join qq{\n}, map { "\t$_" } @{$depends} ) . "\n\"" );
+$fh->say( "RDEPEND=\"\n" . ( join qq{\n}, map { "\t$_" } @{$rdepends} ) . "\n\"" );
$fh->say("SRC_TEST=\"do\"");
#say pp( \%modules,);# { pretty => 1 } );
next reply other threads:[~2011-11-14 2:58 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 2:57 Kent Fredric [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-09-16 22:36 [gentoo-commits] proj/perl-overlay:master commit in: scripts/ Kent Fredric
2015-02-28 23:17 Kent Fredric
2015-02-28 23:17 Kent Fredric
2013-12-23 15:28 Kent Fredric
2013-05-01 23:03 Kent Fredric
2013-05-01 23:03 Kent Fredric
2012-10-24 15:49 Kent Fredric
2012-09-15 23:19 Kent Fredric
2012-08-02 11:46 Kent Fredric
2012-08-02 11:46 Kent Fredric
2012-07-31 3:04 Kent Fredric
2012-07-12 19:23 Torsten Veller
2012-06-22 7:34 Kent Fredric
2012-06-08 17:14 Kent Fredric
2012-05-27 2:30 Kent Fredric
2012-04-28 10:40 Kent Fredric
2012-04-18 3:32 Kent Fredric
2012-04-18 3:32 Kent Fredric
2012-04-18 3:32 Kent Fredric
2012-04-12 19:46 Kent Fredric
2012-04-09 16:05 Kent Fredric
2012-04-08 13:20 Kent Fredric
2012-04-08 13:20 Kent Fredric
2012-04-05 10:02 Kent Fredric
2012-03-27 1:26 Kent Fredric
2012-03-27 1:26 Kent Fredric
2012-03-27 1:26 Kent Fredric
2012-03-01 11:38 Kent Fredric
2012-02-29 12:22 Kent Fredric
2012-02-29 12:22 Kent Fredric
2012-02-29 12:06 Kent Fredric
2012-02-28 21:55 Kent Fredric
2012-02-28 21:55 Kent Fredric
2012-02-28 21:55 Kent Fredric
2012-02-24 7:13 Kent Fredric
2012-02-24 7:13 Kent Fredric
2012-02-12 7:22 Kent Fredric
2012-02-12 7:22 Kent Fredric
2011-12-05 21:45 Kent Fredric
2011-11-14 2:57 Kent Fredric
2011-11-11 14:38 Kent Fredric
2011-10-31 18:05 Kent Fredric
2011-10-31 18:05 Kent Fredric
2011-10-31 8:46 Kent Fredric
2011-10-31 7:10 Kent Fredric
2011-10-31 4:52 Kent Fredric
2011-10-31 2:48 Kent Fredric
2011-10-31 2:48 Kent Fredric
2011-10-31 2:48 Kent Fredric
2011-10-31 2:48 Kent Fredric
2011-10-31 2:48 Kent Fredric
2011-10-31 2:48 Kent Fredric
2011-10-31 2:48 Kent Fredric
2011-10-31 2:48 Kent Fredric
2011-10-25 19:46 Kent Fredric
2011-10-25 19:46 Kent Fredric
2011-10-25 19:46 Kent Fredric
2011-10-24 21:17 Kent Fredric
2011-10-24 18:26 Kent Fredric
2011-10-24 9:09 Kent Fredric
2011-09-23 6:17 Kent Fredric
2011-08-29 5:44 Kent Fredric
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ab4f94737364e5a82928459a5e96c6416448dcb1.kent@gentoo \
--to=kentfredric@gmail.com \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox