CPAN upgrade for perl5.10.0

CPANは、便利だ。依存関係にあるモジュールどもまで導入してくれる。

この存在を知らなかった時、1つのモジュールを導入している途中で、必要なモジュールがない、と、警告され、その必要なモジュールをまず導入して、いる途中で、必要なモジュールがない、と、警告され、その必要なモジュールをまず導入して、いる途中で、…やめたっ!
と、いうことになってしまっていた。

依存関係にあるモジュールどもを一気に導入してくれる、安心・便利・優れもの!
と、思っていた。
そこはそれ、モジュールを作成しているのはヒトだし、READMEあるいはINSTALLファイルを読んで、依存関係にあるモジュールを手作業で導入しなければならないことも有ったりする。

upgradeコマンドを使って、最新のモジュールにしようとしているのだが、何度も何度も同じモジュールを導入している。
こいつ、アホか、と、思ってみたりしたが、思うだけでは埒があかない。

確かに、最新モジュールは導入されてはいるようなのだが、何故、古いモジュールが存在していると認知しているのか、わからなかった。
古いモジュールが存在しているから、毎回、upgradeするのだよ、きっと。
で、最新モジュールは、別の場所に導入され、upgradeすると、古いモジュールを探し出して改めupgradeして、その古いモジュールが残ったままになっているに違いない。
さて、どこだ。

この時点で問題になっているのは、
Compress::Zlib
Time::Piece
URI
の3つ。

これらのうち、Compress::Zlibは、IO::Compress::Baseが古いと主張している。

cd /usr/local/lib/perl5/
find . -name Base.pm -ls -exec grep “VERSION = ” {} \;

と、実行してみると、IO::Compress::Base、は、どうやら、

/usr/local/lib/perl5/5.10.0/darwin-2level/IO/
/usr/local/lib/perl5/5.10.0/IO/

の2ヶ所にあるようだ。perl -Vで表示されるパスと睨めっこして、バージョンの古いモジュールを削除してしまえっ

当該ファイルを探し、古ければ削除っ、えいっ!
…面倒なので、まとめて、やっ!

rm -rf /usr/local/lib/perl5/5.10.0/darwin-2level/IO/Compress/Base*
rm -rf /usr/local/lib/perl5/5.10.0/darwin-2level/IO/Uncompress/Base*
rm -rf /usr/local/lib/perl5/5.10.0/darwin-2level/IO/Compress/*
rm -rf /usr/local/lib/perl5/5.10.0/darwin-2level/IO/Uncompress/*
rm -rf /usr/local/lib/perl5/5.10.0/darwin-2level/Compress/*
rm -rf /usr/local/lib/perl5/5.10.0/darwin-2level/Uncompress/*
rm -rf /usr/local/lib/perl5/5.10.0/darwin-2level/File/GlobMapper*

かなり、乱暴!

改めて、CPANにて、

install IO::Compress::Base
install IO::Uncompress::Base

を実行して、最新モジュールであることを確認し、おもむろに、

install IO::Compress::Gzip
install Compress::Zlib

ただし、だ。
どうも、perl5.8.8、のモジュールと衝突(5.8.8のモジュールが最新で、5.10.0のモジュールが1世代前、あるいは逆)しているように見える。
つまり、findコマンドで見つけた、先の削除対象ファイルに、perl5.8.8、のモジュールが含まれている場合も有った。必ずしもそうではない、だから、困る。

perl -V、で表示されるパスが5.8.8のモジュールにも通っているということは、
/usr/local/bin/perl5.8.8、で、CPANのシェルを動かして、

/usr/localbin/perl5.8.8 -MCPAN -e shell

5.8.8のモジュールをupgradeしてやる方が、もしかすると、速い、かも…
部分的に削除してしまえば、パッケージリストの内容と矛盾が生じてしまう、し、な。
もっとも、5.8.8のモジュールにもパスが通っているのだから、そちらを利用できるのだし、とりあえず、1世代前のモジュールを削除しちまってもいいはず、理屈では。

ま、休みだし、のんびり作業することにしょっ、と。
サーバどもは9台有るし、取っ換え引っ換え、試してみたりして…1日、つぶれるな。


5.8.8のモジュールもupgradeしてみたけど、結局、えいっ、やっ、で、削除するはめになったのだな。
念のため、CPANでCompress関連のモジュールを再導入。一応、最新になったようだった。
さらに、念のため、upgradeしておく。
後は、様子見。

install Compress::Zlib
install Compress::Raw::Zlib
install Compress::Bzip2
install Compress::Raw::Bzip2

install IO::Compress::Adapter::Bzip2
install IO::Compress::Adapter::Deflate
install IO::Compress::Adapter::Identity
install IO::Compress::Base
install IO::Compress::Base::Common
install IO::Compress::Bzip2
install IO::Compress::Deflate
install IO::Compress::Gzip
install IO::Compress::Gzip::Constants
install IO::Compress::RawDeflate
install IO::Compress::Zip
install IO::Compress::Zip::Constants
install IO::Compress::Zlib::Constants
install IO::Compress::Zlib::Extra
install IO::Uncompress::Adapter::Bunzip2
install IO::Uncompress::Adapter::Identity
install IO::Uncompress::Adapter::Inflate
install IO::Uncompress::AnyInflate
install IO::Uncompress::AnyUncompress
install IO::Uncompress::Base
install IO::Uncompress::Bunzip2
install IO::Uncompress::Gunzip
install IO::Uncompress::Inflate
install IO::Uncompress::RawInflate

Author: Kumecchi

コメントを残す