summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm25
-rw-r--r--urpm/parallel_ka_run.pm14
-rw-r--r--urpm/parallel_ssh.pm20
-rwxr-xr-xurpmi22
-rw-r--r--urpmi.spec13
5 files changed, 56 insertions, 38 deletions
diff --git a/urpm.pm b/urpm.pm
index 3e2b10a1..e3f39ed0 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1858,8 +1858,6 @@ sub get_source_packages {
my %sources;
unless ($medium->{ignore}) {
- print STDERR ">>$medium->{$_}\n" foreach qw(name list url start end);
- print STDERR "\n";
#- always prefer a list file is available.
if ($medium->{list} && -r "$urpm->{statedir}/$medium->{list}") {
open F, "$urpm->{statedir}/$medium->{list}";
@@ -2135,23 +2133,22 @@ sub install {
my ($urpm, $remove, $install, $upgrade, %options) = @_;
my $db = URPM::DB::open($urpm->{root}, !$options{test}); #- open in read/write mode unless testing installation.
my $trans = $db->create_transaction($urpm->{root});
- my (@l, %file2pkg);
+ my ($update, @l, %file2pkg) = (0);
local *F;
foreach (@$remove) {
$trans->remove($_) or $urpm->{error}(_("unable to remove package %s", $_));
}
- foreach (keys %$install) {
- my $pkg = $urpm->{depslist}[$_];
- $file2pkg{$install->{$_}} = $pkg;
- $pkg->update_header($install->{$_});
- $trans->add($pkg, 0) or $urpm->{error}(_("unable to install package %s", $install->{$_}));
- }
- foreach (keys %$upgrade) {
- my $pkg = $urpm->{depslist}[$_];
- $file2pkg{$upgrade->{$_}} = $pkg;
- $pkg->update_header($upgrade->{$_});
- $trans->add($pkg, 1) or $urpm->{error}(_("unable to install package %s", $upgrade->{$_}));
+ foreach my $mode ($install, $upgrade) {
+ foreach (keys %$mode) {
+ my $pkg = $urpm->{depslist}[$_];
+ $file2pkg{$mode->{$_}} = $pkg;
+ $pkg->update_header($mode->{$_});
+ $trans->add($pkg,
+ update => $update, $options{excludepath} ? (excludepath => [ split ',', $options{excludepath} ]) : ())
+ or $urpm->{error}(_("unable to install package %s", $install->{$_}));
+ }
+ ++$update;
}
if (!$options{nodeps} and @l = $trans->check) {
if ($options{translate_message}) {
diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm
index 4d44e2ac..10f29d66 100644
--- a/urpm/parallel_ka_run.pm
+++ b/urpm/parallel_ka_run.pm
@@ -91,7 +91,7 @@ sub parallel_resolve_dependencies {
#- parallel install.
sub parallel_install {
- my ($parallel, $urpm, $remove, $install, $upgrade) = @_;
+ my ($parallel, $urpm, $remove, $install, $upgrade, %options) = @_;
$urpm->{log}("parallel_ka_run: mput $parallel->{options} -- ".join(' ', values %$install, values %$upgrade)." $urpm->{cachedir}/rpms/");
system "mput", split(' ', $parallel->{options}), '--', values %$install, values %$upgrade, "$urpm->{cachedir}/rpms/";
@@ -116,9 +116,15 @@ sub parallel_install {
}
%bad_nodes and return;
- #- continue installation.
- $urpm->{log}("parallel_ka_run: rshp $parallel->{options} -- urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}");
- system("rshp $parallel->{options} -- urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}") == 0;
+ if ($options{test}) {
+ $urpm->{error}(_("Installation is possible"));
+ 1;
+ } else {
+ my $line = $parallel->{line} . ($options{excludepath} && " --excludepath '$options{excludepath}'");
+ #- continue installation.
+ $urpm->{log}("parallel_ka_run: rshp $parallel->{options} -- urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $line");
+ system("rshp $parallel->{options} -- urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $line") == 0;
+ }
}
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index 22c3570e..9cc0198a 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -21,8 +21,7 @@ sub parallel_resolve_dependencies {
my ($best_requested, $best);
foreach (@$_) {
exists $state->{selected}{$_->id} and $best_requested = $_, last;
- exists $avoided{$_->name} and next;
- if ($best_requested || exists $requested{$_->id}) {
+ if ($best_requested) {
if ($best_requested && $best_requested != $_) {
$_->compare_pkg($best_requested) > 0 and $best_requested = $_;
} else {
@@ -93,7 +92,7 @@ sub parallel_resolve_dependencies {
#- parallel install.
sub parallel_install {
- my ($parallel, $urpm, $remove, $install, $upgrade) = @_;
+ my ($parallel, $urpm, $remove, $install, $upgrade, %options) = @_;
foreach (keys %{$parallel->{nodes}}) {
my $sources = join ' ', map { "'$_'" } values %$install, values %$upgrade;
@@ -119,12 +118,17 @@ sub parallel_install {
}
%bad_nodes and return;
- #- continue installation on each nodes.
- foreach my $node (keys %{$parallel->{nodes}}) {
- $urpm->{log}("parallel_ssh: ssh $node urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}");
- system "ssh $node urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $parallel->{line}";
+ if ($options{test}) {
+ $urpm->{error}(_("Installation is possible"));
+ 1;
+ } else {
+ my $line = $parallel->{line} . ($options{excludepath} && " --excludepath '$options{excludepath}'");
+ #- continue installation on each nodes.
+ foreach my $node (keys %{$parallel->{nodes}}) {
+ $urpm->{log}("parallel_ssh: ssh $node urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $line");
+ system "ssh $node urpmi --no-locales --no-verify-rpm --auto --synthesis $parallel->{synthesis} $line" == 0;
+ }
}
- 1;
}
diff --git a/urpmi b/urpmi
index 18996a1c..1ee528b0 100755
--- a/urpmi
+++ b/urpmi
@@ -52,6 +52,7 @@ my $env = '';
my $log = '';
my $verify_rpm = 1;
my $test = 0;
+my $excludepath = 0;
my $uid;
my @files;
@@ -103,6 +104,7 @@ usage:
") . _(" --verify-rpm - verify rpm signature before installation
(--no-verify-rpm disable it, default is enabled).
") . _(" --test - verify if the installation can be achieved correctly.
+") . _(" --excludepath - exclude path separated by comma.
") . _(" -a - select all matches on command line.
") . _(" -p - allow search in provides to find package.
") . _(" -P - do not search in provides to find package.
@@ -168,6 +170,7 @@ while (defined($_ = shift @ARGV)) {
/^--(no-)?test$/ and do { $test = !$1; next };
/^--comment$/ and do { push @nextargv, undef; next };
/^--root$/ and do { push @nextargv, \$root; next };
+ /^--excludepath$/ and do { push @nextargv, \$excludepath; next };
/^-(.*)$/ and do { foreach (split //, $1) {
/[\?h]/ and do { usage; next };
/a/ and do { $all = 1; next };
@@ -492,18 +495,18 @@ if (%sources_install || %sources) {
}
#- check for local files.
- foreach (values %sources_install, values %sources) {
- m|^/| && ! -e $_ or next;
- message(_("Installation failed, some files are missing.\nYou may want to update your urpmi database"));
+ if (my @missing = grep { m|^/| && ! -e $_ } values %sources_install, values %sources) {
+ message(_("Installation failed, some files are missing:\n%s\nYou may want to update your urpmi database",
+ join "\n", map { " $_" } @missing));
exit 2;
}
-
+
if ($parallel) {
message(_("distributing %s\n", join(' ', values %sources_install, values %sources)), 'noX');
#- no remove are handle here, automatically done by each distant node.
$urpm->{log}("starting distributed install");
$urpm->parallel_install([ keys %{$state->{ask_remove} || {}} ], \%sources_install, \%sources,
- test => $test);
+ test => $test, excludepath => $excludepath);
} else {
message(_("installing %s\n", join(' ', values %sources_install, values %sources)), 'noX');
log_it(scalar localtime, " ", join(' ', values %sources_install, values %sources), "\n");
@@ -527,7 +530,8 @@ if (%sources_install || %sources) {
} else {
my @l = $urpm->install([ keys %{$state->{ask_remove} || {}} ], \%sources_install, \%sources,
translate_message => 1,
- test => $test, oldpackage => $state->{oldpackage}, post_clean_cache => $post_clean_cache);
+ oldpackage => $state->{oldpackage}, post_clean_cache => $post_clean_cache,
+ test => $test, excludepath => $excludepath);
if (@l) {
message(_("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
@@ -541,7 +545,8 @@ if (%sources_install || %sources) {
$urpm->{log}("starting installing packages without deps");
@l = $urpm->install([ keys %{$state->{ask_remove} || {}} ], \%sources_install, \%sources,
translate_message => 1, nodeps => 1,
- test => $test, oldpackage => $state->{oldpackage}, post_clean_cache => $post_clean_cache);
+ oldpackage => $state->{oldpackage}, post_clean_cache => $post_clean_cache,
+ test => $test, excludepath => $excludepath);
if (@l) {
message(_("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
!$allow_force and exit 1;
@@ -550,7 +555,8 @@ if (%sources_install || %sources) {
$urpm->{log}("starting force installing packages without deps");
@l = $urpm->install([ keys %{$state->{ask_remove} || {}} ], \%sources_install, \%sources,
translate_message => 1, nodeps => 1, force => 1,
- test => $test, oldpackage => $state->{oldpackage}, post_clean_cache => $post_clean_cache);
+ oldpackage => $state->{oldpackage}, post_clean_cache => $post_clean_cache,
+ test => $test, excludepath => $excludepath);
@l and $urpm->fatal(2, _("Installation failed") . ":\n" . join("\n", map { "\t$_" } @l));
}
} else {
diff --git a/urpmi.spec b/urpmi.spec
index 1bf3b740..0cfca845 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,14 +2,14 @@
Name: urpmi
Version: 4.1
-Release: 7mdk
+Release: 8mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
Summary: User mode rpm install
URL: http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/urpmi
Requires: eject webfetch perl-DateManip >= 5.40
-PreReq: perl-Locale-gettext rpmtools >= 4.3-6mdk perl-URPM >= 0.70-9mdk
+PreReq: perl-Locale-gettext rpmtools >= 4.3-6mdk perl-URPM >= 0.71-1mdk
BuildRequires: bzip2-devel gettext rpm-devel >= 4.0.3
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildArch: noarch
@@ -37,7 +37,7 @@ gurpmi is a graphical front-end to urpmi
%package -n urpmi-parallel-ka-run
Summary: Parallel extensions to urpmi using ka-run
-Requires: urpmi >= 4.0 ka-run >= 2.0-15mdk
+Requires: urpmi >= 4.1-8mdk ka-run >= 2.0-15mdk
Group: %{group}
%description -n urpmi-parallel-ka-run
urpmi-parallel-ka-run is an extensions module to urpmi for handling
@@ -45,7 +45,7 @@ distributed installation using ka-run tools.
%package -n urpmi-parallel-ssh
Summary: Parallel extensions to urpmi using ssh and scp
-Requires: urpmi >= 4.0 openssh-clients
+Requires: urpmi >= 4.1-8mdk openssh-clients
Group: %{group}
%description -n urpmi-parallel-ssh
urpmi-parallel-ssh is an extensions module to urpmi for handling
@@ -204,6 +204,11 @@ fi
%changelog
+* Tue Dec 3 2002 François Pons <fpons@mandrakesoft.com> 4.1-8mdk
+- added --excludepath option (fix bug 577).
+- fixed missing options given to parallel plugins.
+- fixed missing files not given to user.
+
* Mon Dec 2 2002 François Pons <fpons@mandrakesoft.com> 4.1-7mdk
- fixed rsync:// protocol, now it really works, tested.