summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-07-09 18:31:23 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-07-09 18:31:23 +0000
commitbb8676359506223e1510e845685957e9a0754cde (patch)
treeb7ac442a674370b6245544c52c9d81f6e1769d94
parentb526f1673aa4ba42eaa7c7e38ed16c66a21b4436 (diff)
downloadurpmi-bb8676359506223e1510e845685957e9a0754cde.tar
urpmi-bb8676359506223e1510e845685957e9a0754cde.tar.gz
urpmi-bb8676359506223e1510e845685957e9a0754cde.tar.bz2
urpmi-bb8676359506223e1510e845685957e9a0754cde.tar.xz
urpmi-bb8676359506223e1510e845685957e9a0754cde.zip
factorize
-rw-r--r--urpm/parallel.pm10
-rw-r--r--urpm/parallel_ka_run.pm6
-rw-r--r--urpm/parallel_ssh.pm6
3 files changed, 12 insertions, 10 deletions
diff --git a/urpm/parallel.pm b/urpm/parallel.pm
index 442dd29d..441da68a 100644
--- a/urpm/parallel.pm
+++ b/urpm/parallel.pm
@@ -66,4 +66,14 @@ sub remove {
);
}
+sub post_register_rpms {
+ my ($parallel, $urpm, @files) = @_;
+
+ #- keep trace of direct files.
+ $parallel->{line} .=
+ join(' ',
+ map { "'$_'" }
+ map { "$urpm->{cachedir}/rpms/" . basename($_) } @files);
+}
+
1;
diff --git a/urpm/parallel_ka_run.pm b/urpm/parallel_ka_run.pm
index 1d02cdbc..3a0c79f5 100644
--- a/urpm/parallel_ka_run.pm
+++ b/urpm/parallel_ka_run.pm
@@ -32,11 +32,7 @@ sub parallel_register_rpms {
system $mput_command, split(' ', $parallel->{options}), '--', @files, "$urpm->{cachedir}/rpms/";
$? == 0 || $? == 256 or $urpm->{fatal}(1, N("mput failed, maybe a node is unreacheable"));
- #- keep trace of direct files.
- $parallel->{line} .=
- join(' ',
- map { "'$_'" }
- map { "$urpm->{cachedir}/rpms/" . basename($_) } @files);
+ urpm::parallel::post_register_rpms($parallel, $urpm, @files);
}
#- parallel find_packages_to_remove
diff --git a/urpm/parallel_ssh.pm b/urpm/parallel_ssh.pm
index d17bb061..722112eb 100644
--- a/urpm/parallel_ssh.pm
+++ b/urpm/parallel_ssh.pm
@@ -34,11 +34,7 @@ sub parallel_register_rpms {
$? == 0 or $urpm->{fatal}(1, N("scp failed on host %s (%d)", $host, $? >> 8));
}
- #- keep trace of direct files.
- $parallel->{line} .=
- join(' ',
- map { "'$_'" }
- map { "$urpm->{cachedir}/rpms/" . basename($_) } @files);
+ urpm::parallel::post_register_rpms($parallel, $urpm, @files);
}
#- parallel find_packages_to_remove