r6126 - /scripts/qa/versioncheck.pl
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Mon Jul 30 14:50:15 UTC 2007
Author: dmn
Date: Mon Jul 30 14:50:15 2007
New Revision: 6126
URL: http://svn.debian.org/wsvn/?sc=1&rev=6126
Log:
Remove obsolete latest_upstream_from_cpan_legacy; update TODO
Modified:
scripts/qa/versioncheck.pl
Modified: scripts/qa/versioncheck.pl
URL: http://svn.debian.org/wsvn/scripts/qa/versioncheck.pl?rev=6126&op=diff
==============================================================================
--- scripts/qa/versioncheck.pl (original)
+++ scripts/qa/versioncheck.pl Mon Jul 30 14:50:15 2007
@@ -13,13 +13,8 @@
# Would be very nice if version-mangling options of debian/watch are supported
# so 0.2200 (cpan) gets equal to 0.22 (debian) when this is described
#
-# Instead of using CPAN.pm, parse ls-lR.gz from the CPAN mirror. The file is
-# ~3MB large, but expands to 68M!
-# Parsing should make it easy to quickly check for available versions using the
-# watch stanza. Perkaps keyed on dir name, separate for by-module and
-# by-author. Perhaps the parsed tree could be stored on disk with Storable to
-# avoid re-parsing if the data is still fresh. This would make running uscan on
-# CPAN-hosted packages pointless.
+# Make "CPAN: x.xx" link to the upstream site (the path component of the watch
+# file)
our $THIS_REVISION = '$Id$';
@@ -365,95 +360,6 @@
return $vers[-1] || '';
}
-sub latest_upstream_from_cpan_legacy($$)
-{
- my ($watch, $pkg) = @_;
-
- my @cpan = grep( m{^(?:http|ftp)://.*cpan}i, @$watch );
-
- return undef unless @cpan;
-
- my @vers;
-
- foreach(@cpan)
- {
- s{^(?:http|ftp)://.+/\s*}{};
- s{(?:-v?)?\(.+$}{};
- s/-/::/g;
-
- debugmsg( sprintf( " cpan search %s\n", $_ ) );
- my $cpan_mod = $cpan->expand('Module', $_);
-
- if( $cpan_mod )
- {
- push @vers, $cpan_mod->cpan_version;
- }
-
- do {
- # Try with capital first letters
- s/^(.)/\U$1/;
- s/::(.)/::\U$1/g;
-
- debugmsg( sprintf( " cpan search %s\n", $_ ) );
- my $cpan_mod = $cpan->expand('Module', $_);
-
- if( $cpan_mod )
- {
- push @vers, $cpan_mod->cpan_version;
- }
- };
-
- do {
- # Try to gyess real module name given the distribution file
- # name (without version) and the perl package name
- my $tmp = $pkg;
- $tmp =~ s/^lib//; $tmp =~ s/-perl$//;
- my @pkg_parts = split(/-/, $tmp);
-
- my $watch_mod = $_;
- $watch_mod = 'Net'.$watch_mod if $pkg_parts[0] eq 'net';
-
- my @mod_parts;
- while( @pkg_parts and $watch_mod =~ s/^($pkg_parts[0])-?//xi )
- {
- push @mod_parts, $1;
- shift @pkg_parts;
- }
-
- unless( @pkg_parts )
- {
- my $mod_name = join( '::', @mod_parts );
- debugmsg( sprintf( " cpan search %s\n", $mod_name ) );
- $cpan_mod = $cpan->expand( 'Module', $mod_name );
- push @vers, $cpan_mod->cpan_version if $cpan_mod;
- }
- };
-
- do {
- # Last try - blindly convert package name to perl module
- my $tmp = $pkg;
- $tmp =~ s/^lib//; $tmp =~ s/-perl$//;
- my @pkg_parts = split(/-/, $tmp);
- s/^(.)/\U$1/ foreach @pkg_parts;
-
- my $mod_name = join( '::', @pkg_parts );
- debugmsg( sprintf( " cpan search %s\n", $mod_name ) );
- $cpan_mod = $cpan->expand( 'Module', $mod_name );
- push @vers, $cpan_mod->cpan_version if $cpan_mod;
-
- #unless( @vers )
- #{
- # # This is slow - last resort
- # $cpan_mod = $cpan->expand( 'Module', "/$mod_name/");
- # push @vers, $cpan_mod->cpan_version if $cpan_mod;
- #}
- };
- }
-
- @vers = sort { cmp_ver($a,$b) } @vers;
-
- return $vers[-1] || '';
-}
print <<_EOF;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
More information about the Pkg-perl-cvs-commits
mailing list