summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-17 15:26:01 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-17 15:26:01 +0000
commit435d92f61744e346fe549006f39aef606333c7e7 (patch)
treef1eb230a4062d13a1d3f4bddf54f77aada86e6e7
parent18aac0fd6bb8d73f1219304af48c8e52ec998cde (diff)
downloadurpmi-435d92f61744e346fe549006f39aef606333c7e7.tar
urpmi-435d92f61744e346fe549006f39aef606333c7e7.tar.gz
urpmi-435d92f61744e346fe549006f39aef606333c7e7.tar.bz2
urpmi-435d92f61744e346fe549006f39aef606333c7e7.tar.xz
urpmi-435d92f61744e346fe549006f39aef606333c7e7.zip
fix using urpmi --env where the media are virtual (by removing "virtual" from urpmi.cfg)
-rwxr-xr-xurpmi6
1 files changed, 5 insertions, 1 deletions
diff --git a/urpmi b/urpmi
index b3ecf84c..12c9647d 100755
--- a/urpmi
+++ b/urpmi
@@ -25,7 +25,7 @@ use urpm::args;
use urpm::msg;
use urpm::media;
use urpm::select;
-use urpm::util qw(untaint difference2 member partition);
+use urpm::util qw(untaint difference2 member partition cat_);
use urpm::main_loop;
#URPM::setVerbosity(7);
@@ -249,6 +249,10 @@ if ($env) {
print N("using specific environment on %s\n", $env);
#- setting new environment.
$urpm->{config} = "$env/urpmi.cfg";
+ if (cat_($urpm->{config}) =~ /^\s*virtual\s*$/m) {
+ print "dropping virtual from $urpm->{config}\n";
+ system(q(perl -pi -e 's/^\s*virtual\s*$//' ) . $urpm->{config});
+ }
$urpm->{skiplist} = "$env/skip.list";
$urpm->{instlist} = "$env/inst.list";
$urpm->{prefer_list} = "$env/prefer.list";