summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/remove-unused-hardware-packages
blob: eb7a126dcb130421a7a63e9f35db43563d64355e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

use lib qw(/usr/lib/libDrakX);
use common;
use pkgs;
use interactive;
use do_pkgs;
use run_program;
use standalone;

my $in = interactive->vnew;
my $wait = $in->wait_message(N("Hardware packages removal"),
			     N("Finding unused hardware packages..."));
my $do_pkgs = do_pkgs->do_pkgs($in);
my @unused_hardware_packages = pkgs::detect_unused_hardware_packages($do_pkgs);
undef $wait;

#- we should have some gurpme
if (@unused_hardware_packages &&
    $in->ask_yesorno(
	N("Hardware packages removal"),
	N("The following hardware packages do not seem to be useful for your system:") . "\n" .
	join("\n", map { "  " . $_ } sort(@unused_hardware_packages)) . "\n" .
	N("Do you want to remove these packages?"))) {
    my $_wait = $in->wait_message(N("Please wait"), N("Removing packages..."));
    run_program::run('urpme', '--auto', @unused_hardware_packages);
}