diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-08-18 15:59:06 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-08-18 15:59:06 +0000 |
commit | e9ca401d4091b43245096a088043ef7e4ff50196 (patch) | |
tree | 3a49f2ca520fba445a58c5477b35c1eeedf39a57 | |
parent | aa6d841812e6e3ee6ac01b610db844cb0f6139b6 (diff) | |
download | drakx-e9ca401d4091b43245096a088043ef7e4ff50196.tar drakx-e9ca401d4091b43245096a088043ef7e4ff50196.tar.gz drakx-e9ca401d4091b43245096a088043ef7e4ff50196.tar.bz2 drakx-e9ca401d4091b43245096a088043ef7e4ff50196.tar.xz drakx-e9ca401d4091b43245096a088043ef7e4ff50196.zip |
move hardware packages detection code in pkgs
-rw-r--r-- | perl-install/install/steps.pm | 21 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 23 |
2 files changed, 24 insertions, 20 deletions
diff --git a/perl-install/install/steps.pm b/perl-install/install/steps.pm index 07c9063ed..812ff7776 100644 --- a/perl-install/install/steps.pm +++ b/perl-install/install/steps.pm @@ -573,26 +573,7 @@ sub install_urpmi { sub install_hardware_packages { my ($o) = @_; if ($o->{match_all_hardware}) { - my @l; - - require Xconfig::card; - require Xconfig::proprietary; - my $cards = Xconfig::card::readCardsDB("$ENV{SHARE_PATH}/ldetect-lst/Cards+"); - my @drivers = grep { $_ } uniq(map { $_->{Driver2} } values %$cards); - push @l, map { Xconfig::proprietary::pkgs_for_Driver2($_, $o->do_pkgs) } @drivers; - - require network::connection; - require network::thirdparty; - foreach my $type (network::connection->get_types) { - $type->can('get_thirdparty_settings') or next; - foreach my $settings (@{$type->get_thirdparty_settings || []}) { - foreach (@network::thirdparty::thirdparty_types) { - my @packages = network::thirdparty::get_required_packages($_, $settings); - push @l, network::thirdparty::get_available_packages($_, $o->do_pkgs, @packages); - } - } - } - + my @l = pkgs::detect_hardware_packages($o->do_pkgs, $o->{match_all_hardware}); $o->do_pkgs->install(@l) if @l; } } diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 3d5ccecef..6d795f4e5 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -152,4 +152,27 @@ sub list_hardware_packages { grep { !/openoffice/ } simple_read_rpmsrate($o_match_all_hardware); } +sub detect_hardware_packages { + my ($do_pkgs, $o_match_all_hardware) = @_; + my @l; + require Xconfig::card; + require Xconfig::proprietary; + my $cards = Xconfig::card::readCardsDB("$ENV{SHARE_PATH}/ldetect-lst/Cards+"); + my @drivers = grep { $_ } uniq(map { $_->{Driver2} } values %$cards); + push @l, map { Xconfig::proprietary::pkgs_for_Driver2($_, $do_pkgs) } @drivers; + + require network::connection; + require network::thirdparty; + foreach my $type (network::connection->get_types) { + $type->can('get_thirdparty_settings') or next; + foreach my $settings (@{$type->get_thirdparty_settings || []}) { + foreach (@network::thirdparty::thirdparty_types) { + my @packages = network::thirdparty::get_required_packages($_, $settings); + push @l, network::thirdparty::get_available_packages($_, $do_pkgs, @packages); + } + } + } + @l; +} + 1; |