Le 09/11/2012 22:27, Guillaume Rousse a écrit :
So, do we really need this option, or could we assume than packages
downloaded without root privileges will aways end in
/tmp/.urpmi-<uid>/rpms ?
Answer to myself: yes, we want it, because it will easier to create a
new download directory and parse its content after urpmi usage, than
parsing urpmi output.
Thierry, here is a patch fixing the usage of the value given through
--download-dir option.
Feel free to commit, alongside your own patches.
--
BOFH excuse #356:
the daemons! the daemons! the terrible daemons!
Index: urpm.pm
===================================================================
--- urpm.pm (révision 6367)
+++ urpm.pm (copie de travail)
@@ -165,7 +165,9 @@
my ($urpm) = @_;
$< or return;
- my $dir = ($urpm->{urpmi_root} || '') . userdir_prefix($urpm) . $< . "/lib";
+ my $dir = $urpm->{options}{cachedir} ?
+ $urpm->{options}{cachedir} . "/lib":
+ ($urpm->{urpmi_root} || '') . userdir_prefix($urpm) . $< . "/lib";
init_dir($urpm, $dir);
}
@@ -174,7 +176,9 @@
my ($urpm) = @_;
$< or return;
- my $dir = ($urpm->{urpmi_root} || '') . userdir_prefix($urpm) . $<;
+ my $dir = $urpm->{options}{cachedir} ?
+ $urpm->{options}{cachedir} :
+ ($urpm->{urpmi_root} || '') . userdir_prefix($urpm) . $<;
init_dir($urpm, $dir);
}