Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 239217
Collapse All | Expand All

(-)g-cpan-0.15.0.orig/ChangeLog (+11 lines)
Lines 1-6 Link Here
1
# ChangeLog for g-cpan
1
# ChangeLog for g-cpan
2
# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
2
# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
3
# $Header: $
3
# $Header: $
4
  
5
  30 Sep 2008; Robin H. Johnson <robbat2@gentoo.org> bin/g-cpan,
6
  lib/Gentoo/CPAN.pm, lib/Gentoo/Portage.pm:
7
  If there is no DESCRIPTION set by the CPAN data, extract it from the POD
8
  manpage after unpacking. Use MODULE_AUTHOR and optionally MODULE_SECTION to
9
  generate slimmer ebuilds. This will allow the eclass to populate HOMEPAGE and
10
  SRC_URI easily.
11
12
  30 Sep 2008; Robin H. Johnson <robbat2@gentoo.org> lib/Gentoo/CPAN.pm:
13
  Generate MyConfig.pm without extra quotes in urllist, as this breaks newer
14
  libwww-perl.
4
15
5
  05 Apr 2007; Michael Cummings <mcummings@gentoo.org> ChangeLog:
16
  05 Apr 2007; Michael Cummings <mcummings@gentoo.org> ChangeLog:
6
  Quick fix for search results of 0
17
  Quick fix for search results of 0
(-)g-cpan-0.15.0.orig/bin/g-cpan (-7 / +17 lines)
Lines 28-34 Link Here
28
use Log::Agent::Driver::File;
28
use Log::Agent::Driver::File;
29
use Log::Agent::Driver::Silent;
29
use Log::Agent::Driver::Silent;
30
30
31
our $VERSION = "0.15.0";
31
our $VERSION = "0.16.0";
32
my $prog = basename($0);
32
my $prog = basename($0);
33
33
34
##### Establish our tmpdir
34
##### Establish our tmpdir
Lines 598-603 Link Here
598
            # Let's unpack it and get all the deps out of it.
598
            # Let's unpack it and get all the deps out of it.
599
            spinner_start();
599
            spinner_start();
600
            $gcpan_run->unpackModule($gcpan_run->{cpan}{lc($original_ebuild)}{name});
600
            $gcpan_run->unpackModule($gcpan_run->{cpan}{lc($original_ebuild)}{name});
601
            # Force re-compute of the information, as MANPAGE is now valid.
602
            $gcpan_run->getCPANInfo($original_ebuild);
601
            spinner_stop();
603
            spinner_stop();
602
604
603
            foreach my $dep (keys %{$gcpan_run->{cpan}{lc($original_ebuild)}{depends}})
605
            foreach my $dep (keys %{$gcpan_run->{cpan}{lc($original_ebuild)}{depends}})
Lines 664-682 Link Here
664
                        print_info('Generating ebuild for ' . $gcpan_run->{cpan}{lc($original_ebuild)}{name});
666
                        print_info('Generating ebuild for ' . $gcpan_run->{cpan}{lc($original_ebuild)}{name});
665
                        my $EBUILD = IO::File->new($ebuild, '>')
667
                        my $EBUILD = IO::File->new($ebuild, '>')
666
                          or fatal(print_err("Couldn't open(write) file $ebuild: $!"));
668
                          or fatal(print_err("Couldn't open(write) file $ebuild: $!"));
669
                        my $module_author = $gcpan_run->{'cpan'}{lc($original_ebuild)}{'src_uri'};
670
                        $module_author =~ s/.\/..\/(.*)\/[^\/]+$/$1/g;
671
                        my $module_section = '';
672
                        if($module_author =~ /\//) {
673
                            $module_section = $module_author;
674
                            my @module_bits = split /\//, $module_author, 2;
675
                            $module_author = $module_bits[0];
676
                            $module_section = sprintf "MODULE_SECTION=\"%s\"\n", $module_bits[1];
677
                        }
678
                        my $description = $gcpan_run->{'cpan'}{lc($original_ebuild)}{'description'};
679
667
                        print $EBUILD <<"HERE";
680
                        print $EBUILD <<"HERE";
668
# Copyright 1999-2006 Gentoo Foundation
681
# Copyright 1999-2006 Gentoo Foundation
669
# Distributed under the terms of the GNU General Public License v2
682
# Distributed under the terms of the GNU General Public License v2
670
# This ebuild generated by $prog $VERSION
683
# This ebuild generated by $prog $VERSION
671
684
685
MODULE_AUTHOR="$module_author"
686
$module_section
672
inherit perl-module
687
inherit perl-module
673
688
674
S=\${WORKDIR}/$gcpan_run->{'cpan'}{lc($original_ebuild)}{'portage_sdir'}
689
DESCRIPTION="$description"
675
676
DESCRIPTION="$gcpan_run->{'cpan'}{lc($original_ebuild)}{'description'}"
677
HOMEPAGE="http://search.cpan.org/search?query=$gcpan_run->{cpan}{lc($original_ebuild)}{portage_name}\&mode=dist"
678
SRC_URI="mirror://cpan/authors/id/$gcpan_run->{'cpan'}{lc($original_ebuild)}{'src_uri'}"
679
680
690
681
IUSE=""
691
IUSE=""
682
692
(-)g-cpan-0.15.0.orig/lib/Gentoo/CPAN.pm (-3 / +18 lines)
Lines 133-140 Link Here
133
#   missing a lot of our ebuilds/packages >
133
#   missing a lot of our ebuilds/packages >
134
# Addendum. Appears we are missing items both ways - have to test both the name in cpan_file and the mod->id. :/
134
# Addendum. Appears we are missing items both ways - have to test both the name in cpan_file and the mod->id. :/
135
    next unless ( $mod->id );
135
    next unless ( $mod->id );
136
    # manpage_headline spews a bunch of warnings, and is not always valid.
137
    # If this is a # CPAN::Bundle, manual work is needed anyway.
138
    sub manpage_title {
139
        my $mod = shift;
140
		# Force the calculation of contents.
141
		$mod->as_string();
142
        my $module_name = shift;
143
        my $desc = $mod->{MANPAGE};
144
		return $desc unless $desc;
145
		return $desc unless $module_name;
146
        $desc =~ s/^$module_name - //g;
147
        return $desc;
148
    }
136
    $self->{'cpan'}{ lc($find_module) }{'description'} =
149
    $self->{'cpan'}{ lc($find_module) }{'description'} =
137
      $mod->{RO}{'description'} || "No description available";
150
      $mod->{RO}{'description'} || manpage_title($mod, $find_module) || "No description available";
138
    $self->{'cpan'}{ lc($find_module) }{'src_uri'} = $mod->{RO}{'CPAN_FILE'};
151
    $self->{'cpan'}{ lc($find_module) }{'src_uri'} = $mod->{RO}{'CPAN_FILE'};
139
    $self->{'cpan'}{ lc($find_module) }{'name'}    = $mod->id;
152
    $self->{'cpan'}{ lc($find_module) }{'name'}    = $mod->id;
140
    $self->{'cpan'}{ lc($find_module) }{'version'} = $mod->{RO}{'CPAN_VERSION'}
153
    $self->{'cpan'}{ lc($find_module) }{'version'} = $mod->{RO}{'CPAN_VERSION'}
Lines 169-175 Link Here
169
    }
182
    }
170
183
171
    # Grab the tarball and unpack it
184
    # Grab the tarball and unpack it
172
    $pack->get or die "Insufficient permissions!";
185
    unless (defined($pack->{build_dir})) {
186
        $pack->get or die "Insufficient permissions!";
187
    }
173
    my $tmp_dir = $pack->{build_dir};
188
    my $tmp_dir = $pack->{build_dir};
174
189
175
    # Set our starting point
190
    # Set our starting point
Lines 553-559 Link Here
553
  'tar' => q[$tar_prog],
568
  'tar' => q[$tar_prog],
554
  'term_is_latin' => q[1],
569
  'term_is_latin' => q[1],
555
  'unzip' => q[$unzip_prog],
570
  'unzip' => q[$unzip_prog],
556
  'urllist' => [qw["http://search.cpan.org/CPAN" "http://www.cpan.org/pub/CPAN" ],],
571
  'urllist' => [qw[http://search.cpan.org/CPAN http://www.cpan.org/pub/CPAN ],],
557
  'wget' => q[$wget_prog],
572
  'wget' => q[$wget_prog],
558
};
573
};
559
1;
574
1;
(-)g-cpan-0.15.0.orig/lib/Gentoo/Portage.pm (+1 lines)
Lines 69-74 Link Here
69
69
70
sub strip_env {
70
sub strip_env {
71
    my $key = shift;
71
    my $key = shift;
72
    return $key unless defined($key);
72
    if (defined($ENV{$key})) {
73
    if (defined($ENV{$key})) {
73
        $ENV{$key} =~ s{\\n}{ }gxms;
74
        $ENV{$key} =~ s{\\n}{ }gxms;
74
        $ENV{$key} =~ s{\\|\'|\\'|\$|\s*$}{}gmxs;
75
        $ENV{$key} =~ s{\\|\'|\\'|\$|\s*$}{}gmxs;

Return to bug 239217