Gentoo Archives: gentoo-perl

From: Yuval Yaari <yyuval@××××××××××.com>
To: gentoo-perl@l.g.o
Subject: Re: [gentoo-perl] g-cpan -u
Date: Mon, 14 Nov 2005 23:30:49
Message-Id: 43791E1A.6060009@checkpoint.com
In Reply to: Re: [gentoo-perl] g-cpan -u by Michael Cummings
1 Michael Cummings wrote:
2
3 > I could try the old developer trick of "in the next version..." - but
4 > the short of it is, you're right, we cheat here. Instead of expending
5 > time on checking module versions (which seem to change numbering
6 > schemes between releases sometimes), we just check to see if we need
7 > to make an ebuild for it or if one already exists (after making sure
8 > we are in $OVERLAY/perl-gcpan of course, and not upgrading your 'real'
9 > tree) - then we just rely on portage to handle the -u for anything
10 > that has an ebuild greater than what's installed. Cheap, tawdry - sure
11 > beat writing version checkers (or adding deps for one)(or stealing
12 > more code from how cpan handles it, which I will show off in the next
13 > version with some new fangled dep checking).
14 >
15 Stealing & hacking code from CPAN:
16
17 #!/usr/bin/perl -w
18 use strict;
19 use CPAN;
20
21 my ($module) = CPAN::Shell->expand("Module", 'DBD::mysql');
22 my $latest = $module->cpan_version;
23 my $have = $module->inst_version;
24
25 # Skipping version_zeros part (which can also be easily stolen from CPAN.pm)
26
27 if (CPAN::Version->vgt($latest, $have)) {
28 print "There's a newer version on CPAN\n";
29 print "CPAN version: $latest\n";
30 print "You have: $have\n";
31 } else {
32 print "No newer version!\n";
33 }
34 __END__
35
36 Can't we rely on that if the CPAN shell relies on that?
37
38 --Yuval
39 --
40 gentoo-perl@g.o mailing list

Replies

Subject Author
Re: [gentoo-perl] g-cpan -u Michael Cummings <mcummings@g.o>