When command line is too short :-)

| No Comments | No TrackBacks

perl -MDebian::Apt::PM -MList::MoreUtils=uniq -MYAML -MApp::Cache -MCPAN -le '$a=shift @ARGV or die; $p=Debian::Apt::PM->new(); $c=App::Cache->new(); do { local *STDOUT; $r = join "\n", grep { not $p->find($_) } grep { CPAN::Shell->expand("Module", $_) } uniq map { s/-/::/g; $_ } map { $_->{"name"} } map { eval { Load($_) } || {} } map { $c->get_url("http://archive.cpan.cz/authors/id/".substr($a,0,1)."/".substr($a,0,2)."/$a/$_") } map { map { $_ =~ /\.meta$/ ? $_ : () } @{$_} } CPAN::Shell->expand("Author", $a)->ls;}; print $r;' GAAS

A little more readable version:

use Debian::Apt::PM;
use List::MoreUtils 'uniq';
use YAML;
use App::Cache;
use CPAN;

$a=shift @ARGV or die;
$p=Debian::Apt::PM->new();
$c=App::Cache->new();

do {
	local *STDOUT;
	$r =
		join "\n",
		grep { not $p->find($_) }
		grep { CPAN::Shell->expand("Module", $_) }
		uniq
		map { s/-/::/g; $_ }
		map { $_->{"name"} }
		map { eval { Load($_) } || {} }
		map { $c->get_url("http://archive.cpan.cz/authors/id/".substr($a,0,1)."/".substr($a,0,2)."/$a/$_") }
		map { map { $_ =~ /\.meta$/ ? $_ : ()  } @{$_} }
		CPAN::Shell->expand("Author", $a)->ls
	;
};

print $r;

It prints out CPAN modules from author id that are not packaged in Debian. Will work for 99% of cases. Only problem are the distributions that have "custom" names, like libwww-perl, as the package name is created from the distribution name that is read from .meta files.

No TrackBacks

TrackBack URL: http://blog.meon.eu/admin/tb/105

Leave a comment

Updates

Subscribe to the blog updates with an email:

If you like it, share it.

Pages

About this Entry

This page contains a single entry by Jozef Kutej published on February 19, 2010 8:37 PM.

Compare Search Engines 20100117 was the previous entry in this blog.

commit diff to the file with patch... is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.