use vars qw( @EXPORT @ISA $VERSION );
@EXPORT = qw( shell fetch get install );
@ISA = qw( Exporter );
- $VERSION = "0.80"; #have to hardcode or cpan.org gets unhappy
+ $VERSION = "0.81_01"; #have to hardcode or cpan.org gets unhappy
}
### purely for backward compatibility, so we can call it from the commandline:
=cut
$Conf->{'conf'}->{'signature'} = do {
- (can_run('gpg') || check_install(module => 'Crypt::OpenPGP')) ?1:0 };
+ check_install( module => 'Module::Signature', version => '0.06' )
+ and ( can_run('gpg') ||
+ check_install(module => 'Crypt::OpenPGP')
+ );
+ } ? 1 : 0;
=item skiptest
? ($name.$ver, $name)
: ($name, $name.$ver);
};
-
+
+ ### patch from Steve Hay Fri 29 Jun 2007 14:26:02 GMT+02:00
+ ### Msg-Id: <4684FA5A.7030506@uk.radan.com>
+ ### look for files with a ".bat" extension as well on Win32
+ @bins = map { $_, "$_.bat" } @bins if $^O eq 'MSWin32';
+
my $path;
BIN: for my $bin (@bins) {
### pass '-P' to perl: "run program through C
### preprocessor before compilation"
error(loc(
- "Could not find the '%1' in your path".
+ "Could not find the '%1' binary in your path".
"--this may be a problem.\n".
"Please locate this program and set ".
- "your '%2' config entry to its path.\n",
- $name, 'perlwrapper'
+ "your '%2' config entry to its path.\n".
+ "From the default shell, you can do this by typing:\n\n".
+ " %3\n".
+ " %4\n",
+ $name, 'perlwrapper',
+ 's program perlwrapper FULL_PATH_TO_CPANP_RUN_PERL',
+ 's save'
));
return '';
}->();
needed to make a distinction between program name and options to that
program. For Win32 machines, you can use the short name for a path,
like '%1'.
-
- ", 'c:\Progra~1\prog.exe' );
+", 'c:\Progra~1\prog.exe' );
for my $prog ( sort $conf->options( type => 'program') ) {
PROGRAM: {
- print loc("Where can I find your '%1' utility? ".
- "(Enter a single space to disable)", $prog );
+ print "\n", loc("Where can I find your '%1' utility? ".
+ "(Enter a single space to disable)", $prog ), "\n";
my $loc = $term->get_reply(
prompt => "Path to your '$prog'",
$conf->set_program( $prog => $cmd );
print $cmd
- ? loc( "Your '%1' utility has been set to '%2'",
+ ? loc( "Your '%1' utility has been set to '%2'.",
$prog, $cmd )
- : loc( "Your '%1' has been disabled", $prog );
+ : loc( "Your '%1' has been disabled.", $prog );
print "\n";
}
}
CPANPLUS::Internals::Report
];
-$VERSION = "0.80";
+$VERSION = "0.81_01";
=pod
filter_prereqs => sub { return $_[1] },
# continue if 'make test' fails?
proceed_on_test_failure => sub { return 0 },
+ munge_dist_metafile => sub { return $_[1] },
};
my $status = Object::Accessor->new;
a boolean indicating whether the install should continue even if
the test failed.
+=item munge_dist_metafile
+
+Is called when the C<CPANPLUS::Dist::*> metafile is created, like
+C<control> for C<CPANPLUS::Dist::Deb>, giving the user a chance to
+programatically alter it. Should return the (munged) text to be
+written to the metafile.
+
=back
=cut
signature => [
sub {
my $cb = shift;
- return if can_run('gpg');
- ### leave this out -- Crypt::OpenPGP is fairly
- ### painful to install, and broken on some platforms
- ### so we'll just always fall back to gpg. It may
- ### issue a warning or 2, but that's about it.
- ### this change due to this ticket: #26914
- # and $cb->configure_object->get_conf('prefer_bin');
- return { 'Crypt::OpenPGP' => '0.0' };
+ return {
+ 'Module::Signature' => '0.06',
+ } if can_run('gpg');
+ ### leave this out -- Crypt::OpenPGP is fairly
+ ### painful to install, and broken on some platforms
+ ### so we'll just always fall back to gpg. It may
+ ### issue a warning or 2, but that's about it.
+ ### this change due to this ticket: #26914
+ # and $cb->configure_object->get_conf('prefer_bin');
+
+ return {
+ 'Crypt::OpenPGP' => '0.0',
+ 'Module::Signature' => '0.06',
+ };
},
sub {
my $cb = shift;
BEGIN {
use vars qw[ $VERSION @ISA ];
@ISA = qw[ CPANPLUS::Shell::_Base::ReadLine ];
- $VERSION = "0.80";
+ $VERSION = "0.81_01";
}
load CPANPLUS::Shell;
$SIG{$sig} = $entry->{handler} if exists($entry->{handler});
}
- print "\n";
+ print "\n";
last if $self->dispatch_on_input( input => $input );
### flush the lib cache ###
### print out the help message ###
### perhaps, '?' should be a slightly different version ###
-my @Help;
-sub _help {
- my $self = shift;
- my %hash = @_;
-
- my $input;
- { local $Params::Check::ALLOW_UNKNOWN = 1;
-
- my $tmpl = {
- input => { required => 0, store => \$input }
- };
-
- my $args = check( $tmpl, \%hash ) or return;
- }
-
- @Help = (
+{ my @help;
+ sub _help {
+ my $self = shift;
+ my %hash = @_;
+
+ my $input;
+ { local $Params::Check::ALLOW_UNKNOWN = 1;
+
+ my $tmpl = {
+ input => { required => 0, store => \$input }
+ };
+
+ my $args = check( $tmpl, \%hash ) or return;
+ }
+
+ @help = (
loc('[General]' ),
loc(' h | ? # display help' ),
loc(' q # exit' ),
loc(' ! EXPR # evaluate a perl statement' ),
loc(' p [FILE] # print the error stack (optionally to a file)' ),
loc(' x # reload CPAN indices (purges cache)' ),
-loc(' x --update_source # reload CPAN indices, get fresh source files' ),
+loc(' x --update_source # reload CPAN indices, get fresh source files' ),
+loc('[Common Options]' ),
+loc(' i ... --skiptest # skip tests' ),
+loc(' i ... --force # force all operations' ),
+loc(' i ... --verbose # run in verbose mode' ),
loc('[Plugins]' ),
loc(' /plugins # list available plugins' ),
loc(' /? [PLUGIN NAME] # show usage for (a particular) plugin(s)' ),
- ) unless @Help;
-
- $self->_pager_open if (@Help >= $self->_term_rowcount);
- ### XXX: functional placeholder for actual 'detailed' help.
- print "Detailed help for the command '$input' is not available.\n\n"
- if length $input;
- print map {"$_\n"} @Help;
- print $/;
- $self->_pager_close;
+ ) unless @help;
+
+ $self->_pager_open if (@help >= $self->_term_rowcount);
+ ### XXX: functional placeholder for actual 'detailed' help.
+ print "Detailed help for the command '$input' is not available.\n\n"
+ if length $input;
+ print map {"$_\n"} @help;
+ print $/;
+ $self->_pager_close;
+ }
}
### eval some code ###
loc( "You can use plugins. Type '%1' to list available plugins",
'/plugins' ),
loc( "You can show all your out of date modules using '%1'", 'o' ),
- loc( "Many operations take options, like '%1' or '%2'",
- '--verbose', '--skiptest' ),
+ loc( "Many operations take options, like '%1', '%2' or '%3'",
+ '--verbose', '--force', '--skiptest' ),
loc( "The documentation in %1 and %2 is very useful",
"CPANPLUS::Module", "CPANPLUS::Backend" ),
loc( "You can type '%1' for help and '%2' to exit", 'h', 'q' ),
use Data::Dumper;
use Getopt::Long;
use File::Spec;
+use File::Temp qw|tempfile|;
use File::Basename;
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
'logfile=s', 'timeout=s',
'dist-opts=s%', 'set-config=s%',
'default-banlist!', 'set-program=s%',
- 'default-ignorelist!',
+ 'default-ignorelist!', 'edit-metafile!'
);
die usage() if exists $opts->{'help'};
die usage() unless @modules;
+### set up munge callback if requested
+{ if( $opts->{'edit-metafile'} ) {
+ my $editor = $conf->get_program('editor');
+
+ if( $editor ) {
+
+ ### register install callback ###
+ $cb->_register_callback(
+ name => 'munge_dist_metafile',
+ code => sub {
+ my $self = shift;
+ my $text = shift or return;
+
+ my($fh,$file) = tempfile( UNLINK => 1 );
+
+ unless( print $fh $text ) {
+ warn "Could not print metafile information: $!";
+ return;
+ }
+
+ close $fh;
+
+ system( $editor => $file );
+
+ my $cont = $cb->_get_file_contents( file => $file );
+
+ return $cont;
+ },
+ );
+
+ } else {
+ warn "No editor configured. Can not edit metafiles!\n";
+ }
+ }
+}
my $fh;
LOGFILE: {
Options:
### take no argument:
- --help Show this help message
- --skiptest Skip tests. Can be negated using --noskiptest
- --force Force operation. Can be negated using --noforce
- --verbose Be verbose. Can be negated using --noverbose
- --keepsource Keep sources after building distribution. Can be
- negated by --nokeepsource. May not be supported
- by all formats
- --makefile Prefer Makefile.PL over Build.PL. Can be negated
- using --nomakefile. Defaults to your config setting
- --buildprereq Build packages of any prerequisites, even if they are
- already uptodate on the local system. Can be negated
- using --nobuildprereq. Defaults to false.
- --archive Indicate that all modules listed are actually archives
- --flushcache Update CPANPLUS' cache before commencing any operation
- --defaults Instruct ExtUtils::MakeMaker and Module::Build to use
- default answers during 'perl Makefile.PL' or 'perl
- Build.PL' calls where possible
+ --help Show this help message
+ --skiptest Skip tests. Can be negated using --noskiptest
+ --force Force operation. Can be negated using --noforce
+ --verbose Be verbose. Can be negated using --noverbose
+ --keepsource Keep sources after building distribution. Can be
+ negated by --nokeepsource. May not be supported
+ by all formats
+ --makefile Prefer Makefile.PL over Build.PL. Can be negated
+ using --nomakefile. Defaults to your config setting
+ --buildprereq Build packages of any prerequisites, even if they are
+ already uptodate on the local system. Can be negated
+ using --nobuildprereq. Defaults to false.
+ --archive Indicate that all modules listed are actually archives
+ --flushcache Update CPANPLUS' cache before commencing any operation
+ --defaults Instruct ExtUtils::MakeMaker and Module::Build to use
+ default answers during 'perl Makefile.PL' or 'perl
+ Build.PL' calls where possible
+ --edit-metafile Edit the distributions metafile(s) before the distribution
+ is built. Requires a configured editor.
### take argument:
--format Installer format to use (defaults to config setting)
munge_test_report => $$, # munge the test report
filter_prereqs => $$, # limit prereqs
proceed_on_test_failure => 0, # continue on failed 'make test'?
+ munge_dist_metafile => $$, # munge the metailfe
};
for my $callback ( keys %$callback_map ) {
uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz lib/CPANPLUS/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
-Created at Sun Jun 17 14:15:09 2007
+Created at Sat Jul 7 11:15:17 2007
#########################################################################
__UU__
M'XL("%_EO$4``S`Q;6%I;')C+G1X=`!+S,E,+%9P#8T(5@`#)=>*DM"2S)QB
uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/E/EU/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/E/EU/EUNOXS/Bundle-Foo-Bar-0.01.tar.gz.packed
-Created at Sun Jun 17 14:15:09 2007
+Created at Sat Jul 7 11:15:17 2007
#########################################################################
__UU__
M'XL("!1%OT4"`T)U;F1L92U&;V\M0F%R+3`N,#$N=&%R`.V7:V_:,!2&^8I_
uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/E/EU/EUNOXS/Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/E/EU/EUNOXS/Foo-Bar-0.01.tar.gz.packed
-Created at Sun Jun 17 14:15:09 2007
+Created at Sat Jul 7 11:15:17 2007
#########################################################################
__UU__
M'XL("/8X34("`T9O;RU"87(M,"XP,2YT87(`[9KQ;]I&%,?Y^?Z*1YE$(A5C
uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/E/EU/EUNOXS/perl5.005_03.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/E/EU/EUNOXS/perl5.005_03.tar.gz.packed
-Created at Sun Jun 17 14:15:09 2007
+Created at Sat Jul 7 11:15:17 2007
#########################################################################
__UU__
M'XL(`'3DO44``^W/,0J`,`Q`T1RE)Y"T-O4XXN"DB%2]OR(*NNC4[;_E#\F0
uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/E/EU/EUXS/Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/E/EU/EUXS/Foo-Bar-0.01.tar.gz.packed
-Created at Sun Jun 17 14:15:09 2007
+Created at Sat Jul 7 11:15:17 2007
#########################################################################
__UU__
M'XL("`DY34("`T9O;RU"87(M,"XP,2YT87(`[5IK3]M(%,U7YE=<H%5``A.;
uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/M/MB/MBNOXS/Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/M/MB/MBNOXS/Foo-Bar-0.01.tar.gz.packed
-Created at Sun Jun 17 14:15:09 2007
+Created at Sat Jul 7 11:15:17 2007
#########################################################################
__UU__
M'XL("-<X34(``T9O;RU"87(M,"XP,2YT87(`[9E;;]HP%,=Y]J<X+9722@-R
uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/authors/id/M/MB/MBXS/Foo-Bar-0.01.tar.gz lib/CPANPLUS/t/dummy-CPAN/authors/id/M/MB/MBXS/Foo-Bar-0.01.tar.gz.packed
-Created at Sun Jun 17 14:15:10 2007
+Created at Sat Jul 7 11:15:17 2007
#########################################################################
__UU__
M'XL("-\X34(``T9O;RU"87(M,"XP,2YT87(`[5K_3QI)%/=7YZ]XU39H(BN[
uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz lib/CPANPLUS/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
-Created at Sun Jun 17 14:15:10 2007
+Created at Sat Jul 7 11:15:17 2007
#########################################################################
__UU__
M'XL("-%#OT4``S`R<&%C:V%G97,N9&5T86EL<RYT>'0`E=-1:]LP$`#@=_^*
uupacktool.pl -p lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz lib/CPANPLUS/t/dummy-CPAN/modules/03modlist.data.gz.packed
-Created at Sun Jun 17 14:15:10 2007
+Created at Sat Jul 7 11:15:18 2007
#########################################################################
__UU__
M'XL("#'FO$4``S`S;6]D;&ES="YD871A`%U3_6O;,!#].?HKCBXC"20A=<@&