uninstalling modules 
Author Message
 uninstalling modules

I am trying to set up a web page that provides the following
functionality:

List currently installed CPAN modules
Install a CPAN module
Upgrade a CPAN module
Uninstall a CPAN module

CPAN.pm is of great help in doing most of this. Except, I can't figure
out how to uninstall a perl module (either using CPAN.pm or by some
other means).

Any suggestions?

Thanks,
aravind



Wed, 18 Apr 2001 03:00:00 GMT  
 uninstalling modules
[ cc to poster ]

I have a script that reads the .packlist for a module, figures out what
files are part of it and deletes them. It is at work and it is Saturday
now. I'll mail to you Monday, post Monday night.

Quote:

> I am trying to set up a web page that provides the following
> functionality:

> List currently installed CPAN modules
> Install a CPAN module
> Upgrade a CPAN module
> Uninstall a CPAN module

> CPAN.pm is of great help in doing most of this. Except, I can't figure
> out how to uninstall a perl module (either using CPAN.pm or by some
> other means).

> Any suggestions?

> Thanks,
> aravind

--
Matthew O. Persico
Nothing even remotely clever at the moment.


Wed, 18 Apr 2001 03:00:00 GMT  
 uninstalling modules
[Courtesy cc to poster]

Just a reminder to ask if you could kindly post the script.

Thanks,

aravind

Quote:

> [ cc to poster ]

> I have a script that reads the .packlist for a module, figures out what
> files are part of it and deletes them. It is at work and it is Saturday
> now. I'll mail to you Monday, post Monday night.


> > I am trying to set up a web page that provides the following
> > functionality:

> > List currently installed CPAN modules
> > Install a CPAN module
> > Upgrade a CPAN module
> > Uninstall a CPAN module

> > CPAN.pm is of great help in doing most of this. Except, I can't figure
> > out how to uninstall a perl module (either using CPAN.pm or by some
> > other means).

> > Any suggestions?

> > Thanks,
> > aravind

> --
> Matthew O. Persico
> Nothing even remotely clever at the moment.



Sat, 21 Apr 2001 03:00:00 GMT  
 uninstalling modules

[cc'd to others]

One {*filter*}y weeny shell scrip to find .packlist files.
One unInstall.pl script to uninstall a module.

Flame away. If it's any good, I'll send it to p5p.

--
Matthew O. Persico
Nothing even remotely clever at the moment.

  find_packlist.sh
< 1K Download

  unInstall.pl
3K Download


Sat, 21 Apr 2001 03:00:00 GMT  
 uninstalling modules

Quote:

> One {*filter*}y weeny shell scrip to find .packlist files.
> One unInstall.pl script to uninstall a module.

> Flame away. If it's any good, I'll send it to p5p.

With recent Perls (5.005+) all the stuff needed to do this is provided
already - check out the documentation ExtUtils::Packlist and
ExtUtils::Installed.  The following even {*filter*}ier script does the job
for me:

use strict;
use IO::Dir;
use ExtUtils::Packlist;
use ExtUtils::Installed;

sub emptydir($)
{

my $dh = IO::Dir->new($dir) || return(0);

$dh->close();

Quote:
}

# Find all the installed packages
print("Finding all installed modules...\n");
my $installed = ExtUtils::Installed->new();

foreach my $module (grep(!/^Perl$/, $installed->modules()))
   {
   my $version = $installed->version($module) || "???";
   print("Found module $module Version $version\n");
   print("Do you want to delete $module? [n] ");
   my $r = <STDIN>; chomp($r);
   if ($r && $r =~ /^y/i)
      {
      # Remove all the files
      foreach my $file (sort($installed->files($module)))
         {
         print("rm $file\n");
         unlink($file);
         }
      my $pf = $installed->packlist($module)->packlist_file();
      print("rm $pf\n");
      unlink($pf);
      foreach my $dir (reverse(sort($installed->directory_tree($module))))
         {
         if (emptydir($dir))
            {
            print("rmdir $dir\n");
            rmdir($dir);
            }
         }
      }
   }



Sun, 22 Apr 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Uninstalling modules????

2. Uninstalling modules????

3. uninstalling modules

4. Uninstalling modules????

5. Uninstalling certain modules....with out CPAN shell...

6. Uninstalling CPAN modules

7. uninstalling perl on unix

8. uninstalling perl (linux)

9. Uninstalling PerlEx 1.1

10. DBD-Mysql Perl module vs DBI Perl module module vs DBM module ?

11. module needs to be installed in, *and* depends on modules in, a nonstandard directory

 

 
Powered by phpBB® Forum Software