Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CPAN-Mini CPAN distribution.

Report information
The Basics
Id: 16696
Status: rejected
Priority: 0/
Queue: CPAN-Mini

People
Owner: Nobody in particular
Requestors: sthoenna [...] efn.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Date: Fri, 23 Dec 2005 00:47:10 -0800
From: Yitzchak Scott-Thoennes <sthoenna [...] efn.org>
To: bug-CPAN-Mini [...] rt.cpan.org
Subject: [PATCH] add bundle option, allow skip_cleanup in rc file
This adds a -b|bundle option to specify a bundle file and only mirror the bundle's contents. I'd hope this would prevent the proliferation of modules like CPAN::Mini::Phalanx100. Also allow skip_cleanup in the .minicpanrc file. --- CPAN-Mini-0.40/bin/minicpan.orig 2005-09-05 21:24:38.000000000 -0700 +++ CPAN-Mini-0.40/bin/minicpan 2005-12-23 00:31:47.681542400 -0800 @@ -18,15 +18,13 @@ -p - mirror perl, ponie, and parrot distributions -q - run in quiet mode (don't print status) -qq - run in silent mode (don't even print warnings) + -b FILE - only modules listed in the given bundle file =head1 DESCRIPTION This simple shell script just updates (or creates) a miniature CPAN mirror as described in CPAN::Mini. -The local and remote mirror locations are (for now) hardcoded and should be -updated before running this script for the first time. - =cut use CPAN::Mini; @@ -84,6 +82,7 @@ "l|local=s" => \$config{local}, "r|remote=s" => \$config{remote}, "d|dirmode=s" => \$config{dirmode}, + "b|bundle=s" => \$config{bundle}, "qq" => sub { $config{quiet} = 2; $config{errors} = 0; }, "q+" => \$config{quiet}, "f+" => \$config{force}, @@ -91,6 +90,21 @@ "x+" => \$config{exact_mirror}, ) or pod2usage(2); +# make a suitable module filter if just doing a bundle +if ($config{bundle}) { + my $file = delete $config{bundle}; + open my $fh, "<", $file or die "Couldn't open bundle file $file: $!\n"; + my %contents; + while (<$fh>) { + next unless /^=head1\s+CONTENTS/ .. /^=(?!head1\s+CONTENTS)/; + next if /^=/; + s/\#.*//; + next if /^\s+$/; + $contents{(split " ", $_, 2)[0]} = 1; + } + push @{$config{module_filters}}, sub { !exists $contents{$_[0]} }; +} + eval "require $class"; die $@ if $@; @@ -106,6 +120,7 @@ trace => (not $config{quiet}), force => $config{force}, dirmode => $config{dirmode}, + skip_cleanup => $config{skip_cleanup}, skip_perl => (not $config{perl}), exact_mirror => ($config{exact_mirror}), module_filters => ($config{module_filters}),
Download (untitled) / with headers
text/plain 178b
I have fixed the skip_cleanup omission. I am unsure about the code that reads in a bundle. I'd like to see if I can use CPAN.pm to get that information more reliably. -- rjbs
Subject: Re: [rt.cpan.org #16696] [PATCH] add bundle option, allow skip_cleanup in rc file
Date: Thu, 1 May 2008 21:16:11 -0700 (PDT)
To: bug-CPAN-Mini [...] rt.cpan.org
From: "Yitzchak Scott-Thoennes" <sthoenna [...] efn.org>
Download (untitled) / with headers
text/plain 652b
On Thu, May 1, 2008 8:17 pm, Ricardo SIGNES via RT wrote: Show quoted text
>
Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=16696 > > > > I have fixed the skip_cleanup omission. > > > I am unsure about the code that reads in a bundle. I'd like to see if I > can use CPAN.pm to get that information more reliably.
Thanks for looking at my patch :) I believe I copied that code from CPAN.pm, so it should certainly work for existing bundles, and any new bundles that need to be compatible with older CPAN.pm versions. The only advantage to somehow going through CPAN would be if new formats of bundles become supported at some point; is the extra work worth it?
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #16696] [PATCH] add bundle option, allow skip_cleanup in rc file
Date: Fri, 2 May 2008 07:24:59 -0400
To: Yitzchak Scott-Thoennes via RT <bug-CPAN-Mini [...] rt.cpan.org>
From: Ricardo SIGNES <rjbs [...] cpan.org>
Download (untitled) / with headers
text/plain 564b
* Yitzchak Scott-Thoennes via RT <bug-CPAN-Mini@rt.cpan.org> [2008-05-02T00:20:01] Show quoted text
> I believe I copied that code from CPAN.pm, so it should certainly work > for existing bundles, and any new bundles that need to be compatible > with older CPAN.pm versions. The only advantage to somehow going through > CPAN would be if new formats of bundles become supported at some point; > is the extra work worth it?
The other advantage is if bugs are found in CPAN.pm, or if the code is changed in any other way that later makes future bugfixes harder to apply. -- rjbs
Download (untitled) / with headers
text/plain 366b
Please consider submitting a patch to CPAN to break the bundle expansion code into a reusable component (CPAN::BundleExpander or something) which we can then rely on. Until then, I think this is not appropriate for CPAN::Mini to re-implement. Thanks for your contributions. I look forward to this feature finding its way in differently in the future. -- rjbs


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.