summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-06-17 11:13:40 +0000
committerFrancois Pons <fpons@mandriva.com>2003-06-17 11:13:40 +0000
commitd3864b76594c22507114055a7838a1018add0846 (patch)
treee288777c0b1bfc328c0774a54c79121377d47270
parent07f01970048de8314c51781c6a577191b258bbf7 (diff)
downloadurpmi-d3864b76594c22507114055a7838a1018add0846.tar
urpmi-d3864b76594c22507114055a7838a1018add0846.tar.gz
urpmi-d3864b76594c22507114055a7838a1018add0846.tar.bz2
urpmi-d3864b76594c22507114055a7838a1018add0846.tar.xz
urpmi-d3864b76594c22507114055a7838a1018add0846.zip
4.4-2mdk
-rw-r--r--urpm.pm5
-rw-r--r--urpm/parallel_ka_run.pm16
-rw-r--r--urpm/parallel_ssh.pm16
-rwxr-xr-xurpmi34
-rw-r--r--urpmi.spec10
5 files changed, 51 insertions, 30 deletions
diff --git a/urpm.pm b/urpm.pm
index bddda161..61a90075 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2137,6 +2137,9 @@ sub resolve_dependencies {
}
#- let each node determine what is requested, according to handler given.
$urpm->{parallel_handler}->parallel_resolve_dependencies($file, @_);
+
+ #- build simplest transaction (no split).
+ $urpm->build_transaction_set(undef, $state, split_level => 0);
} else {
my $db;
@@ -2157,7 +2160,7 @@ sub resolve_dependencies {
$urpm->resolve_requested($db, $state, $requested, %options);
- #- build transaction set now...
+ #- build transaction set...
$urpm->build_transaction_set($db, $state, %options);
}
}
diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm
index d80e292e..68e5c80b 100644
--- a/urpm/parallel_ka_run.pm
+++ b/urpm/parallel_ka_run.pm
@@ -24,13 +24,13 @@ sub parallel_find_remove {
#- keep in mind if the previous selection is still active, it avoid
#- to re-start urpme --test on each node.
if ($options{find_packages_to_remove}) {
- delete $state->{ask_remove};
+ delete $state->{rejected};
delete $urpm->{error_remove};
$test = '--test ';
} else {
@{$urpm->{error_remove} || []} and return @{$urpm->{error_remove}};
#- no need to restart what has been started before.
- $options{test} and return keys %{$state->{ask_remove}};
+ $options{test} and return keys %{$state->{rejected}};
$test = '';
}
@@ -46,10 +46,10 @@ sub parallel_find_remove {
and $urpm->{fatal}(1, ("node %s has bad version of urpme, please upgrade", $node));
if (/unknown packages?:? (.*)/) {
$options{callback_notfound} and $options{callback_notfound}->($urpm, split ", ", $1)
- or delete $state->{ask_remove}, last;
+ or delete $state->{rejected}, last;
} elsif (/The following packages contain ([^:]*): (.*)/) {
$options{callback_fuzzy} and $options{callback_fuzzy}->($urpm, $1, split " ", $2)
- or delete $state->{ask_remove}, last;
+ or delete $state->{rejected}, last;
} elsif (/removing package (.*) will break your system/) {
$base_to_remove{$1} = undef;
} elsif (/Removing failed/) {
@@ -58,7 +58,8 @@ sub parallel_find_remove {
if (exists $bad_nodes{$node}) {
/^\s+(.*)/ and push @{$bad_nodes{$node}}, $1;
} else {
- $state->{ask_remove}{$_}{$node} = undef;
+ $state->{rejected}{$_}{removed} = 1;
+ $state->{rejected}{$_}{nodes}{$node} = undef;
}
}
}
@@ -77,7 +78,7 @@ sub parallel_find_remove {
}
}
- keys %{$state->{ask_remove}};
+ keys %{$state->{rejected}};
}
#- parallel resolve_dependencies
@@ -139,7 +140,8 @@ sub parallel_resolve_dependencies {
chomp;
s/<([^>]*)>.*:->:(.*)/$2/ and $node = $1;
if (/^\@removing\@(.*)/) {
- $state->{ask_remove}{$1}{$node} = undef;
+ $state->{rejected}{$1}{removed} = 1;
+ $state->{rejected}{$1}{nodes}{$node} = undef;
} elsif (/\|/) {
#- distant urpmq returned a choices, check if it has already been chosen
#- or continue iteration to make sure no more choices are left.
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index e92380a7..a0831c14 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -27,13 +27,13 @@ sub parallel_find_remove {
#- keep in mind if the previous selection is still active, it avoid
#- to re-start urpme --test on each node.
if ($options{find_packages_to_remove}) {
- delete $state->{ask_remove};
+ delete $state->{rejected};
delete $urpm->{error_remove};
$test = '--test ';
} else {
@{$urpm->{error_remove} || []} and return @{$urpm->{error_remove}};
#- no need to restart what has been started before.
- $options{test} and return keys %{$state->{ask_remove}};
+ $options{test} and return keys %{$state->{rejected}};
$test = '';
}
@@ -49,10 +49,10 @@ sub parallel_find_remove {
and $urpm->{fatal}(1, ("node %s has bad version of urpme, please upgrade", $node));
if (/unknown packages?:? (.*)/) {
$options{callback_notfound} and $options{callback_notfound}->($urpm, split ", ", $1)
- or delete $state->{ask_remove}, last;
+ or delete $state->{rejected}, last;
} elsif (/The following packages contain ([^:]*): (.*)/) {
$options{callback_fuzzy} and $options{callback_fuzzy}->($urpm, $1, split " ", $2)
- or delete $state->{ask_remove}, last;
+ or delete $state->{rejected}, last;
} elsif (/removing package (.*) will break your system/) {
$base_to_remove{$1} = undef;
} elsif (/Removing failed/) {
@@ -61,7 +61,8 @@ sub parallel_find_remove {
if (exists $bad_nodes{$node}) {
/^\s+(.*)/ and push @{$bad_nodes{$node}}, $1;
} else {
- $state->{ask_remove}{$_}{$node} = undef;
+ $state->{rejected}{$_}{removed} = 1;
+ $state->{rejected}{$_}{nodes}{$node} = undef;
}
}
}
@@ -81,7 +82,7 @@ sub parallel_find_remove {
}
}
- keys %{$state->{ask_remove}};
+ keys %{$state->{rejected}};
}
#- parallel resolve_dependencies
@@ -143,7 +144,8 @@ sub parallel_resolve_dependencies {
while (defined ($_ = <F>)) {
chomp;
if (/^\@removing\@(.*)/) {
- $state->{ask_remove}{$1}{$node} = undef;
+ $state->{rejected}{$1}{removed} = 1;
+ $state->{rejected}{$1}{nodes}{$node} = undef;
} elsif (/\|/) {
#- distant urpmq returned a choices, check if it has already been chosen
#- or continue iteration to make sure no more choices are left.
diff --git a/urpmi b/urpmi
index 3c646583..b58dd869 100755
--- a/urpmi
+++ b/urpmi
@@ -32,6 +32,7 @@ my $auto = 0;
my $allow_medium_change = 0;
my $auto_select = 0;
my $no_remove = 0;
+my $split_level = 1;
my $force = 0;
my $parallel = '';
my $sync;
@@ -79,6 +80,7 @@ usage:
") . N(" --auto - automatically select a package in choices.
") . N(" --auto-select - automatically select packages to upgrade the system.
") . N(" --no-uninstall - never ask to uninstall a package, abort the installation.
+") . N(" --split-level - build small transaction of minimal given length.
") . N(" --fuzzy - impose fuzzy search (same as -y).
") . N(" --src - next package is a source package (same as -s).
") . N(" --install-src - install only source package (no binaries).
@@ -147,6 +149,7 @@ while (defined($_ = shift @ARGV)) {
/^--allow-medium-change$/ and do { $allow_medium_change = 1; next };
/^--auto-select$/ and do { $auto_select = 1; next };
/^--no-(remove|uninstall)$/ and do { $no_remove = 1; next };
+ /^--split-level$/ and do { $urpm->{options}{'split-level'} = undef; push @nextargv, \$urpm->{options}{'split-level'}; next };
/^--(no-)?fuzzy$/ and do { $urpm->{options}{fuzzy} = !$1; next };
/^--src$/ and do { $src = 1; next };
/^--install-src$/ and do { $install_src = 1; next };
@@ -322,7 +325,7 @@ $urpm->configure(nocheck_access => $env || $uid > 0,
parallel => $parallel,
);
#- get back activated default values of boolean options.
-foreach (qw(post-clean use-provides verify-rpm)) {
+foreach (qw(post-clean use-provides verify-rpm split-level)) {
exists $urpm->{options}{$_} or $urpm->{options}{$_} = 1;
}
@@ -386,7 +389,7 @@ $urpm->resolve_dependencies($state, \%requested,
callback_choices => \&ask_choice,
install_src => $install_src,
nodeps => $urpm->{options}{'allow-nodeps'} || $urpm->{options}{'allow-force'},
- split_level => 1,
+ split_level => $urpm->{parallel_handler} ? 0 : $urpm->{options}{'split-level'},
);
my @ask_unselect = $urpm->unselected_packages($state);
@@ -506,6 +509,8 @@ $urpm->copy_packages_of_removable_media($list, \%sources,
}
});
+my $nok;
+
foreach my $set (@{$state->{transaction} || []}) {
my (@transaction_list, %transaction_sources);
@@ -513,7 +518,7 @@ foreach my $set (@{$state->{transaction} || []}) {
$urpm->prepare_transaction($set, $list, \%sources, \@transaction_list, \%transaction_sources);
#- first, filter out what is really needed to download for this small transaction.
- $urpm->download_packages_of_distant_media($list, \%transaction_sources, \%error_sources,
+ $urpm->download_packages_of_distant_media(\@transaction_list, \%transaction_sources, \%error_sources,
verbose => $verbose > 0,
limit_rate => $urpm->{options}{'limit-rate'},
force_local => 1,
@@ -613,16 +618,16 @@ foreach my $set (@{$state->{transaction} || []}) {
if (my @missing = grep { m|^/| && ! -e $_ } values %transaction_sources_install, values %transaction_sources) {
message(N("Installation failed, some files are missing:\n%s\nYou may want to update your urpmi database",
join "\n", map { " $_" } @missing));
- exit 2;
+ ++$nok;
}
#- install source package only (whatever the user is root or not, but use rpm for that).
if ($install_src) {
if (my @l = grep { /\.src\.rpm$/ } values %transaction_sources_install, values %transaction_sources) {
system("rpm", "-i$rpm_opt", @l, ($root ? ("--root", $root) : @{[]}));
- $? and message(N("Installation failed")), exit 1;
+ $? and message(N("Installation failed")), ++$nok;
}
- exit 0;
+ next;
}
#- clean to remove any src package now.
@@ -667,12 +672,10 @@ foreach my $set (@{$state->{transaction} || []}) {
test => $test,
excludepath => $urpm->{options}{excludepath}, excludedocs => $urpm->{options}{excludedocs},
callback_inst => $callback_inst, callback_trans => $callback_inst);
- $X and gurpm::end();
if (@l) {
message(N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
- m|^/| && !-e $_ and exit 2 foreach values %transaction_sources_install, values %transaction_sources; #- missing local file
- $auto || !$urpm->{options}{'allow-nodeps'} && !$urpm->{options}{'allow-force'} and exit 1;
+ $auto || !$urpm->{options}{'allow-nodeps'} && !$urpm->{options}{'allow-force'} and ++$nok;
$noexpr = N("Nn");
$yesexpr = N("Yy");
@@ -696,18 +699,21 @@ foreach my $set (@{$state->{transaction} || []}) {
test => $test,
excludepath => $urpm->{options}{excludepath},
excludedocs => $urpm->{options}{excludedocs});
- @l and $urpm->fatal(2, N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
+ @l and $urpm->error(N("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l)), ++$nok;
}
- } else {
- $test and message(N("Installation is possible"));
}
}
- } elsif ($test) {
+ }
+}
+$X and gurpm::end();
+if (!$nok) {
+ if ($test) {
message(N("Installation is possible"));
} else {
- $verbose >= 0 and message(N("Everything already installed"), $auto);
+ @{$state->{transaction} || []} == 0 && $verbose >= 0 and message(N("Everything already installed"), $auto);
}
}
+
$urpm->unlock_urpmi_db;
#- try to umount removable device which may have been mounted.
diff --git a/urpmi.spec b/urpmi.spec
index b8d4ac85..17f2739d 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 4.4
-Release: 1mdk
+Release: 2mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -202,6 +202,14 @@ $urpm->update_media;
%changelog
+* Tue Jun 17 2003 François Pons <fpons@mandrakesoft.com> 4.4-2mdk
+- fixed parallel handler with removing.
+- build transaction set just before starting downloading and
+ installing packages.
+- fixed glitches with gurpmi.
+- fixed bad test report.
+- fixed bad transaction ordering and splitting on some cases.
+
* Mon Jun 16 2003 François Pons <fpons@mandrakesoft.com> 4.4-1mdk
- added preliminary support for small transaction set.
- internal library changes (compabilility should have been kept).