package install::pkgs; use strict; use feature 'state'; BEGIN { # needed before "use URPM" mkdir '/etc/rpm'; symlink "/tmp/stage2/etc/rpm/$_", "/etc/rpm/$_" foreach 'macros.d'; } use URPM; use URPM::Resolve; use URPM::Signature; use urpm; use urpm::args; use urpm::main_loop; use urpm::select; use common; use install::any; use install::media qw(getFile_ getAndSaveFile_ packageMedium); use run_program; use detect_devices; use log; use fs; use fs::any; use fs::loopback; use c; #- lower bound on the left ( aka 90 means [90-100[ ) our %compssListDesc = ( 5 => N_("must have"), 4 => N_("important"), 3 => N_("very nice"), 2 => N_("nice"), 1 => N_("maybe"), ); #- TODO BEFORE TODO #- size and correction size functions for packages. my $B = 1.20873; my $C = 4.98663; #- does not take hdlist's into account as getAvailableSpace will do it. sub correctSize { $B * $_[0] + $C } sub invCorrectSize { ($_[0] - $C) / $B } sub selectedSize { my ($packages) = @_; my $size = 0; my %skip; #- take care of packages selected... foreach (@{$packages->{depslist}}) { if ($_->flag_selected) { $size += $_->size; #- if a package is obsoleted with the same name it should #- have been selected, so a selected new package obsoletes #- all the old package. exists $skip{$_->name} and next; $skip{$_->name} = undef; $size -= $packages->{sizes}{$_->name}; } } #- but remove size of package being obsoleted or removed. foreach (keys %{$packages->{state}{rejected}}) { my ($name) = /(.*)-[^\-]*-[^\-]*$/ or next; exists $skip{$name} and next; $skip{$name} = undef; $size -= $packages->{sizes}{$name}; } $size; } sub size2time { my ($x, $max) = @_; my $A = 7e-07; my $limit = min($max * 3 / 4, 9e8); if ($x < $limit) { $A * $x; } else { $x -= $limit; my $B = 6e-16; my $C = 15e-07; $B * $x ** 2 + $C * $x + $A * $limit; } } # Based on Rpmdrake::pkg::extract_header(): sub get_pkg_info { my ($p) = @_; my $urpm = $::o->{packages}; my $name = $p->fullname; my $medium = URPM::pkg2media($urpm->{media}, $p); my ($local_source, %xml_info_pkgs, $description); my $dir = urpm::file_from_local_url($medium->{url}); $local_source = "$dir/" . $p->filename if $dir; if (-s $local_source) { log::l("getting information from $dir..."); $p->update_header($local_source) and $description = $p->description; log::l("Warning, could not extract header for $name from $medium!") if !$description; } if (!$description) { my $_w = $::o->wait_message(undef, N("Getting package information from XML meta-data...")); if (my $xml_info_file = eval { urpm::media::any_xml_info($urpm, $medium, 'info', undef, urpm::download::sync_logger) }) { require urpm::xml_info; require urpm::xml_info_pkg; log::l("getting information from $xml_info_file"); my %nodes = eval { urpm::xml_info::get_nodes('info', $xml_info_file, [ $name ]) }; goto header_non_available if $@; put_in_hash($xml_info_pkgs{$name} ||= {}, $nodes{$name}); } else { $urpm->{info}(N("No xml info for medium \"%s\", only partial result for package %s", $medium->{name}, $name)); } } if (!$description && $xml_info_pkgs{$name}) { $description = $xml_info_pkgs{$name}{description}; } header_non_available: $description || N("No description"); } sub packagesProviding { my ($packages, $name) = @_; grep { $_->is_arch_compat } URPM::packages_providing($packages, $name); } #- search package with given name and compatible with current architecture. #- take the best one found (most up-to-date). sub packageByName { my ($packages, $name) = @_; my @l = grep { $_->name eq $name } packagesProviding($packages, $name); my $best; foreach (@l) { if ($best && $best != $_) { if ($best->fullname eq $_->fullname) { $best = $_ if $_->flag_installed; } else { $_->compare_pkg($best) > 0 and $best = $_; } } else { $best = $_; } } $best or log::l("unknown package `$name'"); $best; } sub _is_kernelServer_needed() { # forbid selecting kernel-server if not having PAE since PAE support is mandatory for kernel-server: return if !detect_devices::has_cpu_flag('pae'); arch() =~ /i.86/ && detect_devices::dmi_detect_memory() > 3.8 * 1024 || detect_devices::isServer(); } sub _bestKernel_extensions { my ($o_match_all_hardware) = @_; $::o->{kernel_extension} ? $::o->{kernel_extension} : $o_match_all_hardware ? (arch() =~ /i.86/ ? '-desktop586' : '-desktop') : detect_devices::is_i586() ? '-desktop586' : _is_kernelServer_needed() ? '-server' : '-desktop'; } sub bestKernelPackage { my ($packages, $o_match_all_hardware) = @_; my @preferred_exts = _bestKernel_extensions($o_match_all_hardware); my @kernels = grep { $_ } map { packageByName($packages, "kernel$_-latest") } @preferred_exts; if (!@kernels) { #- fallback on most generic kernel if the suitable one is not available #- (only kernel-desktop586-latest is available on Dual ISO for i586) my @fallback_exts = _bestKernel_extensions('force'); @kernels = grep { $_ } map { packageByName($packages, "kernel$_-latest") } @fallback_exts; } log::l("bestKernelPackage (" . join(':', @preferred_exts) . "): " . join(' ', map { $_->name } @kernels) . (@kernels > 1 ? ' (choosing the first)' : '')); $kernels[0]; } sub packagesToInstall { my ($packages) = @_; my @packages; foreach (@{$packages->{media}}) { !$_->{ignore} or next; log::l("examining packagesToInstall of medium $_->{name}"); push @packages, grep { $_->flag_selected } install::media::packagesOfMedium($packages, $_); } log::l("found " . scalar(@packages) . " packages to install: " . formatList(5, map { scalar $_->fullname } @packages)); @packages; } sub _packageRequest { my ($packages, $pkg) = @_; #- check if the same or better version is installed, #- do not select in such case. $pkg && ($pkg->flag_upgrade || !$pkg->flag_installed) or return; #- check for medium selection, if the medium has not been #- selected, the package cannot be selected. my $medium = packageMedium($packages, $pkg); $medium && !$medium->{ignore} or return; +{ $pkg->id => 1 }; } sub packageCallbackChoices { my ($urpm, $_db, $_state, $choices, $virtual_pkg_name, $prefered) = @_; if ($prefered && @$prefered) { @$prefered; } elsif (my @l = _packageCallbackChoices_($urpm, $choices, $virtual_pkg_name)) { @l; } else { log::l("packageCallbackChoices: default choice ('" . $choices->[0]->name . "') from " . join(",", map { $_->name } @$choices) . " for $virtual_pkg_name"); $choices->[0]; } } sub _packageCallbackChoices_ { my ($urpm, $choices, $virtual_pkg_name) = @_; my ($prefer, $_other) = urpm::select::get_preferred($urpm, $choices, $::o->{preferred_packages}); if (@$prefer) { @$prefer; } elsif ($virtual_pkg_name eq 'kernel') { my $re = join('|', map { "kernel\Q$_-2" } _bestKernel_extensions()); my @l = grep { $_->name =~ $re } @$choices; log::l("packageCallbackChoices: kernel chosen ", join(",", map { $_->name } @l), " in ", join(",", map { $_->name } @$choices)); @l; } elsif ($choices->[0]->name =~ /^kernel-(.*source-|.*-devel-)/) { my @l = grep { if ($_->name =~ /^kernel-.*source-stripped-(.*)/) { my $version = quotemeta($1); find { $_->name =~ /-$version$/ && ($_->flag_installed || $_->flag_selected); } $urpm->packages_providing('kernel'); } elsif ($_->name =~ /(kernel-.*)-devel-(.*)/) { my $kernel = "$1-$2"; my $p = packageByName($urpm, $kernel); $p && ($p->flag_installed || $p->flag_selected); } elsif ($_->name =~ /^kernel-.*source-/) { #- hopefully we don't have a media with kernel-source but not kernel-source-stripped nor kernel-.*-devel 0; } else { log::l("unknown kernel-source package " . $_->fullname); 0; } } @$choices; log::l("packageCallbackChoices: kernel source chosen ", join(",", map { $_->name } @l), " in ", join(",", map { $_->name } @$choices)); @l; } else { (); } } sub skip_packages { my ($packages, $skipped_packages) = @_; $packages->compute_flags($skipped_packages, skip => 1); } sub select_by_package_names { my ($packages, $names, $b_base) = @_; my @l; foreach (@$names) { my $p = packageByName($packages, $_) or next; push @l, selectPackage($packages, $p, $b_base); } @l; } sub select_by_package_names_or_die { my ($packages, $names, $b_base) = @_; foreach (@$names) { my $p = packageByName($packages, $_) or die "package $_ not found"; !$p->flag_installed && !$p->flag_selected or next; my ($_pkgs, $error) = _selectPackage_with_error($packages, $p, $b_base); $error and die N("Some packages requested by %s cannot be installed:\n%s", $_, $error); } } my @recommended_package_ids; sub _resolve_requested_and_check { my ($packages, $state, $requested) = @_; my @l = $packages->resolve_requested($packages->{rpmdb}, $state, $requested, callback_choices => \&packageCallbackChoices, no_recommends => $::o->{no_recommends}); #- keep track of recommended packages so that theys could be unselected if the "no recommends" option is choosen later: if (!is_empty_hash_ref($state->{selected})) { my @new_ids = map { $packages->{depslist}[$_]->id } grep { $state->{selected}{$_}{recommended} } keys %{$state->{selected}}; @recommended_package_ids = uniq(@recommended_package_ids, @new_ids); } my $error; if (find { !exists $state->{selected}{$_} } keys %$requested) { my @rejected = urpm::select::unselected_packages($state); $error = urpm::select::translate_why_unselected($packages, $state, @rejected); log::l("ERROR: selection failed: $error"); } \@l, $error; } sub s
-rw-r--r-- | perl-install/share/po/eo.po | 6 |
diff --git a/perl-install/share/po/eo.po b/perl-install/share/po/eo.po index 5420f1283..a1ca1fc10 100644 --- a/perl-install/share/po/eo.po +++ b/perl-install/share/po/eo.po @@ -5625,7 +5625,7 @@ msgstr "Eniras paŝon `%s'\n" #, c-format msgid "" "Your system is low on resources. You may have some problem installing\n" -"Mandrivalinux. If that occurs, you can try a text install instead. For " +"Mandriva Linux. If that occurs, you can try a text install instead. For " "this,\n" "press `F1' when booting on CDROM, then enter `text'." msgstr "" @@ -6162,7 +6162,7 @@ msgstr "" #: install_steps_interactive.pm:821 #, c-format msgid "" -"Contacting Mandrivalinux web site to get the list of available mirrors..." +"Contacting Mandriva Linux web site to get the list of available mirrors..." msgstr "" #: install_steps_interactive.pm:840 @@ -6376,7 +6376,7 @@ msgstr "" #: install_steps_newt.pm:20 #, c-format -msgid "Mandrivalinux Installation %s" +msgid "Mandriva Linux Installation %s" msgstr "" #. -PO: This string must fit in a 80-char wide text screen |