Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you read CPAN changelogs?

Tags:

perl

cpan

Since discovering perlbrew, I'm a happy CPAN user. But what I have never figured out is how to read changelogs of modules. For example, when looking at the outdated ones with "r" in the CPAN shell, I'd like to easily inspect the changelog to decide whether to upgrade or not.

Of course I can download the module, unpack it, and hunt around for a changelog. But I hope there is an easier way. How do you do it?

I'm using the old CPAN shell. If CPANPLUS or cpanminus support this, I'd consider switching.

like image 639
Thomas Kappler Avatar asked Sep 24 '10 06:09

Thomas Kappler


2 Answers

I just look on CPAN Search. The main page for each distribution links to the main files, and you can also browse the entire distribution. You don't have to download or unpack the distribution.

You can also use the cpan command's -C switch so you don't have to enter the CPAN.pm shell:

 $ cpan -C Some::Module

I don't know of anything that will show you the Changes file at once for all of the outdated modules though. That would probably be a bit of a mess in the terminal. You might be able to rig up something with the -O switch:

 $ cpan -O | perl -anle 'print $F[0] if $. > 9' | xargs cpan -C

That's $. > 9 bit is there to skip the CPAN.pm output and the table header. It's ugly for sure.

If you wanted to do something more fancy, you could make that last part of the pipe some script to run cpan -C individually and save the result to a file. Put all the files in a directory of Changes and Bob's your uncle. That's a lot more work than I care to do. I just update things and look at the Changes later if something breaks.

like image 90
brian d foy Avatar answered Oct 29 '22 12:10

brian d foy


cpan-outdated nearly does what you need out of the box:

$ cpan-outdated --compare-changes

Above produces a diff between all your Changes files and latest from CPAN for each out dated module you have. However this can be a bit long & messy to trawl through if you have a lot of out dated modules!

Fortunately it only took a few changes to add these options:

$ cpan-outdated --pkg Catalyst::View::TT --compare-changes

$ cpan-outdated --filter-pkg Catalyst --compare-changes

My update can be found on Github here: http://github.com/draegtun/cpan-outdated. Here is the diff of my changes to tokuhirom cpan-outdated

/I3az/

like image 34
draegtun Avatar answered Oct 29 '22 12:10

draegtun