Skip to content

Instantly share code, notes, and snippets.

@neilb
neilb / cpan-version-formats
Last active December 19, 2015 21:09
Displays the distribution of different version numbers used for CPAN distributions, by parsing 02packages.details.txt
#!/usr/local/bin/perl
use strict;
use warnings;
my %seen;
my %count;
my $dist_count = 0;
my $inheader = 1;
my @patterns =
@neilb
neilb / fix-changes-dates
Created August 21, 2013 09:14
The script I use to fix up the date format in Changes files.
#!/usr/local/bin/perl
#
# fix-changes-dates
#
# This is the script I use to fix up dates in Changes files
#
use strict;
use warnings;
my %month =
@neilb
neilb / find-cpan-adoptions
Last active August 29, 2015 13:56
Find CPAN distributions that look like they've been adopted at some point in their history
#!/usr/local/bin/perl
#
# Iterate over CPAN release history, looking for dists that appear to have been adopted one or more times.
# An adoption is guessed at if we saw one or more releases from PERSONA, then a gap of at least 180 days,
# then one or more releases from PERSONB and we never see PERSONA again.
#
use strict;
use warnings;
use CPAN::ReleaseHistory 0.02;
#!/usr/local/bin/perl
#
# cpan-user-release-history - take a PAUSE id and generate an ascii graph of their # releases by year
#
use strict;
use warnings;
use CPAN::ReleaseHistory 0.02;
my $MAX_BAR_SIZE = 50;
my $iterator = CPAN::ReleaseHistory->new()->release_iterator();
@neilb
neilb / compare-weeks
Created March 7, 2014 09:19
Show dates where Date::WeekOfYear gets the week number wrong
#!/usr/local/bin/perl
#
# Compares the week numbers from DateTime and Date::WeekOfYear
# This shows the places where WeekOfYear gets it wrong.
#
use strict;
use warnings;
use DateTime;
use Date::WeekOfYear;
my $DAY_IN_SECONDS = 24 * 60 * 60;
@neilb
neilb / bad-case-packages.txt
Last active August 4, 2017 07:41
A list of packages which appear to be different, with different user permissions, where the package names are equivalent case insensitively
# Where the package still exists on CPAN, the path is given. If you see no path for a package,
# there are still permissions in PAUSE, but the dist is no longer on CPAN
about
package : About
users : RKIES:f
package : about
users : SHERWOOD:f
S/SH/SHERWOOD/xisofs-1.3.tar.gz
@neilb
neilb / module-abstract
Created March 17, 2014 23:55
Script which gets the pod source for a module from MetaCPAN then tries to extract the abstract for it, following the spec for an abstract
#!/usr/bin/env perl
#
# module-abstract - get the abstract for a module, using MetaCPAN
#
# Usage: module-abstract <module-name>
#
use strict;
use warnings;
use HTTP::Tiny;
use JSON;
@neilb
neilb / recent-developer-releases.txt
Created March 19, 2014 09:28
A list of dists where the most recent release is a developer release (as of 2014-03-18)
2013-01-04T20:42:32 Alien-Archive-Npk A/AM/AMORETTE/Alien-Archive-Npk-0.000001_001.tar.gz
2013-01-08T16:24:25 MarpaX-Lex-Easy A/AR/ARODLAND/MarpaX-Lex-Easy-0.0000001-TRIAL.tar.gz
2013-01-10T00:26:20 Net-Amazon-R53 R/RS/RSRCHBOY/Net-Amazon-R53-0.002-TRIAL.tar.gz
2013-01-12T04:48:01 Marpa-R3 J/JK/JKEGL/Marpa-R3-3.001_001.tar.gz
2013-01-16T00:04:30 Marpa-Guide J/JK/JKEGL/Marpa-Guide-0.000_000.tar.gz
2013-01-20T22:52:11 Alien-Wenity T/TO/TOBYINK/Alien-Wenity-0.000_01.tar.gz
2013-01-22T15:55:19 TSQL-AST D/DE/DEDMEDVED/TSQL-AST-0.03_007.tar.gz
2013-01-30T21:31:27 Net-StackExchange G/GI/GIDEON/Net-StackExchange-0.01_1.tar.gz
2013-02-11T04:34:59 Bundle-Music G/GE/GENE/Bundle-Music-0.0104_1.tar.gz
2013-02-13T23:34:19 PDL-Parallel-threads D/DC/DCMERTENS/PDL-Parallel-threads-0.03_01.tar.gz

CPAN Index for latest releases

02packages.details.txt doesn't contain developer releases, essentially by definition.

For the CPAN Dashboard I want to display the latest release of a dist, developer release or not. If the latest release is a developer release, then I'm currently thinking it should display the latest developer release and the latest non-developer release. This would result in some duplication of information (eg bug count), but there there is some useful information that would be good to see for these two releases, such as CPAN Testers results.

I've been talking to (he might say 'harassing' :-) Paul Johnson; CPAN Cover may evolve to provide coverage testing of the same thing: the latest stable release, and the latest developer release if that is the most recent release. At the moment it doesn't do developer releases, partly because there's no handy index that includes developer releases.

There's no easy way to get a list of all the releases outlined above, so I'm wondering if this wo

@neilb
neilb / build-latest-cpan-index.pl
Last active August 29, 2015 13:58
Use the MetaCPAN API to build an index of the latest version of each dist on CPAN, including developer releases
#!/usr/local/bin/perl
#
# This builds a text index for all the dists on CPAN. Each line has: path time size
# If the latest release is a developer release,
# it will have the most recent stable release (if there is one) first,
# followed by the developer release
#
use strict;
use warnings;
use MetaCPAN::Client;