summaryrefslogtreecommitdiffstats
path: root/perl-install/install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-18 07:25:57 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-18 07:25:57 +0000
commit5f247d4e86f322ed5e99116c243147c24a564661 (patch)
treea99291b426213e6d81e7b49c1ba9ed184be36ccd /perl-install/install
parente0b9985719de4fc72dbec1fa869c551320657199 (diff)
downloaddrakx-5f247d4e86f322ed5e99116c243147c24a564661.tar
drakx-5f247d4e86f322ed5e99116c243147c24a564661.tar.gz
drakx-5f247d4e86f322ed5e99116c243147c24a564661.tar.bz2
drakx-5f247d4e86f322ed5e99116c243147c24a564661.tar.xz
drakx-5f247d4e86f322ed5e99116c243147c24a564661.zip
- when basesystem can't be selected, display the reason
Diffstat (limited to 'perl-install/install')
-rw-r--r--perl-install/install/NEWS1
-rw-r--r--perl-install/install/pkgs.pm27
2 files changed, 19 insertions, 9 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 4153e8529..c49c44b8e 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,4 @@
+- when basesystem can't be selected, display the reason
- also load dm-zero for dmraid
Version 10.4.201 - 17 September 2007, by Pascal "Pixel" Rigaux
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index c71312b4d..f84a2a2b4 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -241,7 +241,8 @@ sub select_by_package_names_or_die {
foreach (@$names) {
my $p = packageByName($packages, $_) or die "package $_ not found";
!$p->flag_installed && !$p->flag_selected or next;
- selectPackage($packages, $p, $b_base) or die "package $_ can't be selected";
+ 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);
}
}
@@ -251,27 +252,35 @@ sub resolve_requested_and_check {
my @l = $packages->resolve_requested($packages->{rpmdb}, $state, $requested,
callback_choices => \&packageCallbackChoices);
+ my $error;
if (find { !exists $state->{selected}{$_} } keys %$requested) {
my @rejected = urpm::select::unselected_packages($packages, $state);
- log::l("ERROR: selection failed: " . urpm::select::translate_why_unselected($packages, $state, @rejected));
+ $error = urpm::select::translate_why_unselected($packages, $state, @rejected);
+ log::l("ERROR: selection failed: $error");
}
- @l;
+ \@l, $error;
}
sub selectPackage {
my ($packages, $pkg, $b_base) = @_;
+ my ($pkgs, $_error) = selectPackage_with_error($packages, $pkg, $b_base);
+ @$pkgs;
+}
+
+sub selectPackage_with_error {
+ my ($packages, $pkg, $b_base) = @_;
my $state = $packages->{state} ||= {};
$packages->{rpmdb} ||= rpmDbOpen();
- my @l = resolve_requested_and_check($packages, $state, packageRequest($packages, $pkg) || {});
+ my ($pkgs, $error) = resolve_requested_and_check($packages, $state, packageRequest($packages, $pkg) || {});
if ($b_base) {
- $_->set_flag_base foreach @l;
+ $_->set_flag_base foreach @$pkgs;
}
- @l;
+ ($pkgs, $error);
}
sub unselectPackage {
@@ -370,17 +379,17 @@ sub setSelectedFromCompssList {
#- selecting $p. the packages are not selected.
my $state = $packages->{state} ||= {};
- my @l = resolve_requested_and_check($packages, $state, packageRequest($packages, $p) || {});
+ my ($l, $_error) = resolve_requested_and_check($packages, $state, packageRequest($packages, $p) || {});
#- this enable an incremental total size.
my $old_nb = $nb;
- foreach (@l) {
+ foreach (@$l) {
$nb += $_->size;
}
if ($max_size && $nb > $max_size) {
$nb = $old_nb;
$min_level = $p->rate;
- $packages->disable_selected($packages->{rpmdb}, $state, @l);
+ $packages->disable_selected($packages->{rpmdb}, $state, @$l);
last;
}
}