Re: Removing Modules
by Fastolfe (Vicar) on Feb 02, 2001 at 08:08 UTC
|
Are you talking about deleting a module from your system? I don't know that I've ever heard anyone ask that.
Since most modules tend to follow filename/path conventions that match their given name, something like this should turn up all files/directories used by the module (including sub-modules):
find /usr/lib/perl5 -name 'ModuleName*'
If that looks kosher, appending an -exec rm -rf {} \; to that should do the trick, provided you understand what it does and trust the 'find' output.
May I ask why you need to do this? | [reply] [d/l] [select] |
|
|
| [reply] |
|
|
| [reply] |
|
|
Why do I want to do it? I have three systems running here:
- a production (external) web server, with Apache, mod_perl, EmbPerl and similar stuff.
- A production (internal) system, with a number of Perl applications and our intranet server
- My development box
The development box now has a number of modules on it that I put on, kicked around with, and decided not to make use of. However, we try to keep all three systems in sync as far as versions, software installed and so on. I want to make sure that the development server can have stuff removed that I don't wish to run in production.
| [reply] |
|
|
It might be easier/safer to start from a minimal installation with the stuff you want, and then pack up and distribute that filesystem to your other machines, nuking the older copies. So long as the architectures and Perl versions are the same across systems, the /usr/lib/perl5 hierarchy should be reasonably portable. That would also greatly assist your "in sync" needs.
| [reply] |
|
|
(crazyinsomniac) Re: Removing Modules
by crazyinsomniac (Prior) on Feb 02, 2001 at 08:27 UTC
|
I run IndigoPerl which comes with a binary version of Apache. Anyway, it comes with a nifty little perlscript embedded in a bat file that goes something like: @rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S "%0" %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
goto endofperl
@rem ';
#!perl
# dpm.pl V0.04 Dynamic Package Manager
# Copyright (c) 2000 Indy Singh/IndigoSTAR Software all rights reserve
+d
BEGIN {
$| = 1;
open (STDERR, ">&STDOUT");
}
use strict;
use ExtUtils::Install ();
use Config;
use File::Path; # mkpath, rmtree
Anyway, that nifty little perlscript is much like Win32 ActivePerls ppm(Perl Package Manager) and takes the hassle out of managing your perl modules/packages. You should be able to adapt it to whatever environment you're using since alls it needs is write permission ;)
<SHAMELESSPLUG>
You can check out my review here to get an idea how it(dpm) works. They even included a 'GUI'(browser) front end for it.
</SHAMELESSPLUG>
Update: on Fastolfe point, why don't you just build the exact replica of your 'production' machine, develop 'your film' and then just switch the cable's.
"cRaZy is co01, but sometimes cRaZy is cRaZy".
- crazyinsomniac | [reply] [d/l] |
|
|
Interesting. I've been using IndigoPerl lately too, as I've got WinNT running more often than Linux (both on the same box).
Anyway, though I haven't read the docs *thoroughly* yet (shame on me), but it appears that CPAN.pm doesn't have this ability (to remove/uninstall modules). Does anybody know why not?<?p>
| [reply] |
Re: Removing Modules
by the_slycer (Chaplain) on Feb 02, 2001 at 11:41 UTC
|
Hmm, just poking around a bit on my system, it appears that
every module that I have installed has created a file in
/usr/lib/perl5/site_perl/i386-linux/auto/module_name/optionial_extras
called ".packlist" which gives me the list of files that have
been installed (including man pages etc). It should be possible
to parse that and unlink as you do so.
Note though that as a quick test I installed ASP *shudder* and after
make install immediately tried a make uninstall. This failed
saying that uninstall was depreceated, to check the .packlist
carefully as there may be errors.
Quite possibly this is why no-one has suggested this yet. :-) | [reply] |