summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-13 16:58:53 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-13 16:58:53 +0000
commit4d5a1da07d318b058a25f5bc38174fcdc456b50f (patch)
tree97defa8c9aa5c53c59277d5e379b21c9fedfcd9c
parent326c67b442cd98164f7b74d7b0a1ac99873215c7 (diff)
downloadurpmi-4d5a1da07d318b058a25f5bc38174fcdc456b50f.tar
urpmi-4d5a1da07d318b058a25f5bc38174fcdc456b50f.tar.gz
urpmi-4d5a1da07d318b058a25f5bc38174fcdc456b50f.tar.bz2
urpmi-4d5a1da07d318b058a25f5bc38174fcdc456b50f.tar.xz
urpmi-4d5a1da07d318b058a25f5bc38174fcdc456b50f.zip
- urpmi
o --urpmi-root: if <root>/etc/urpmi/*.list are available, use them. otherwise defaults to /etc/urpmi/*.list
-rw-r--r--NEWS4
-rw-r--r--urpm.pm13
2 files changed, 13 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 2517904f..5d8207a6 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+- urpmi
+ o --urpmi-root: if <root>/etc/urpmi/*.list are available, use them.
+ otherwise defaults to /etc/urpmi/*.list
+
Version 4.10.3 - 13 August 2007, by Thierry Vignaud
- urpmi
diff --git a/urpm.pm b/urpm.pm
index 6927f61f..3767d28a 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -51,15 +51,20 @@ sub new {
$self;
}
+sub prefer_rooted {
+ my ($root, $file) = @_;
+ -e "$root$file" ? "$root$file" : $file;
+}
+
sub set_files {
my ($urpm, $urpmi_root) = @_;
my %h = (
config => "$urpmi_root/etc/urpmi/urpmi.cfg",
- skiplist => "$urpmi_root/etc/urpmi/skip.list",
- instlist => "$urpmi_root/etc/urpmi/inst.list",
- prefer_list => "$urpmi_root/etc/urpmi/prefer.list",
+ skiplist => prefer_rooted($urpmi_root, '/etc/urpmi/skip.list'),
+ instlist => prefer_rooted($urpmi_root, '/etc/urpmi/inst.list'),
+ prefer_list => prefer_rooted($urpmi_root, '/etc/urpmi/prefer.list'),
prefer_vendor_list =>
- "$urpmi_root/etc/urpmi/prefer.vendor.list",
+ prefer_rooted($urpmi_root, '/etc/urpmi/prefer.vendor.list'),
private_netrc => "$urpmi_root/etc/urpmi/netrc",
statedir => "$urpmi_root/var/lib/urpmi",
cachedir => "$urpmi_root/var/cache/urpmi",