Hallo,
Am Fri, 06 Jun 2014, Lentes, Bernd schrieb:
Gibt's eine Möglichkeit, per CPAN installierte Module komplett und
sauber vom System runterzukriegen ?
==== perluninstall.pl ====
#!/usr/bin/perl
### nope, no '-w', we 'use warnings' later.
#
### Copyright (c)2004-2014 David Haller
### This program is free software; you can redistribute it and/or
### modify it under the same terms as Perl itself.
use strict;
use ExtUtils::Installed;
# we don't want to die, if some module is not installed, we want to
# continue with the next module, therefore we redefine croak which
# ExtUtils::Installed calls in that case.
sub Carp::croak { print STDERR, @_, "\n"; return 1; }
use warnings;
use ExtUtils::Install;
use File::Basename;
my $verbose = 1;
my $test = 0;
my @MODULES;
my $USAGE ="Usage: " . basename($0)
. " [--test] [--quiet] [--help] MODULE ...\n";
die "$USAGE" if($#ARGV < 0);
foreach(@ARGV) {
if(/^--test$/) {
$test = 1;
} elsif(/^--quiet$/) {
$verbose = 0;
} elsif(/^--help$/) {
print "$USAGE";
exit(0);
} elsif(/^-/) {
die "Unknown option $_\n$USAGE";
} else {
push @MODULES, $_;
}
}
die "$USAGE" if $#MODULES < 0;
my $installed = new ExtUtils::Installed;
print "==== test mode ====\n" if $test;
foreach my $module (@MODULES) {
print "\n";
my $version = $installed->version($module) or next;
print "Found module $module, version $version\n";
print "do you want to uninstall this module? [y/N] ";
my $r = <STDIN>; chomp($r);
if($r && $r =~ /^y/i) {
my $pl = $installed->packlist($module)->packlist_file();
uninstall($pl, $verbose, $test);
}
}
1;
__END__
====
HTH,
-dnh
--
"Perl is the duct tape of the Internet."
-- Hassan Schroeder, Sun's first webmaster
--
Um die Liste abzubestellen, schicken Sie eine Mail an:
opensuse-de+unsubscribe@opensuse.org
Um den Listen Administrator zu erreichen, schicken
Sie eine Mail an: opensuse-de+owner@opensuse.org