Custom Search

Wednesday, December 28, 2005

Long Time No Blog

What an exciting time! :-) Not really. Started new job. Not usually fun, especially around the holidays. As usual, I've run into conflicts on one of my BSD boxes between perl modules and ports. I tried deleting some modules, went too far, and couldn't get back into the CPAN shell. Really buggered it up. I had done a full dump of /usr several days before, but had never done a restore before. After some experimenting, did the following: 1) Rebooted into single-user mode 2) Remounted / in rw mode, since it said it had to write some stuff there. Now I don't think so, but it's not important. It may have been referring to restoresymtable which gets written to the root of the directory you're doing a restore in, which, in this case, was /usr. This morning, after rebuilding the kernel and while rebuilding userland, I remembered to delete the file, which the man page says you should do. 3) Mounted the /usr slice rw in /mnt and ran newfs on it. 4) Mounted /data2 slice which held the dump backup. 5) Cd into /usr and ran restore rf /data2/backups/usr. Miracuously, everything worked out fine! Later, I ran a perl script that lists all installed modules and removed several, and then reinstalled them from /usr/ports. Still having some problems, though. Couldn't do a make install on SpamAssassin. It looked on a bunch of servers before finally finding the source code, but then it said the checksum was bad. I'll have to experiment with it some more later. Below is some of the perl stuff I found to help me out: http://www.cpan.org/misc/cpan-faq.html#How_delete_Perl_modules How do I remove installed Perl modules? By using the ExtUtils::Installed and ExtUtils::Packlist modules that come with Perl as in the example below. There is also a more elaborate example in the ExtUtils::Packlist man page. #!/usr/local/bin/perl -w use ExtUtils::Packlist; use ExtUtils::Installed; $ARGV[0] or die "Usage: $0 Module::Name\n"; my $mod = $ARGV[0]; my $inst = ExtUtils::Installed->new(); foreach my $item (sort($inst->files($mod))) { print "removing $item\n"; unlink $item; } my $packfile = $inst->packlist($mod)->packlist_file(); print "removing $packfile\n"; unlink $packfile; How do I find out what modules are already installed on my system? * perldoc perllocal Each time a module is installed on your system, it appends information like the following to a file called perllocal.pod which can be found in /usr/local/lib/perl5/version number/architecture/ or something akin to that. The path for your specific installation is in your @INC which you can divine with perl -V. =head2 Wed May 12 13:42:53 1999: C L =over 4 =item * C =item * C =item * C =item * C =back Each entry includes the Module name, date and time it was installed, where it was installed, linktype [ static or dynamic ], version and executables, if any, included with the module. * Use the ExtUtils::Installed module ExtUtils::Installed provides a standard way to find out what core and module files have been installed. It uses the information stored in .packlist files created during installation to provide this information. In addition it provides facilities to classify the installed files and to extract directory information from the .packlist files. #!/usr/local/bin/perl use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || "???"; print "$module -- $version\n"; } produces the following list of modules and their version Apache::DBI -- 0.87 Apache::DBILogConfig -- 0.01 Apache::DBILogger -- 0.93 AppConfig -- 1.52 Archive::Tar -- 0.22 BerkeleyDB -- 0.06 CGI -- 2.74 CPAN -- 1.59 CPAN::WAIT -- 0.27 Catalog -- 1.00 Compress::Zlib -- 1.11 Config::IniFiles -- 2.14 Convert::BER -- 1.26 Coy -- ??? Crypt::Rot13 -- 0.04 Crypt::SSLeay -- 0.16 DBI -- 1.14 [.....]

powered by performancing firefox

0 Comments:

Post a Comment

<< Home