summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-04 15:55:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-04 15:55:21 +0000
commit561b6b1eaf2cf64d7c33b69d57ae679a8cf874c3 (patch)
tree67bbec6f779928bcbc3075a99007a7a95fc8f7ed
parent44cd0817b8110e82a98db443a4319feffd0202ff (diff)
downloadurpmi-561b6b1eaf2cf64d7c33b69d57ae679a8cf874c3.tar
urpmi-561b6b1eaf2cf64d7c33b69d57ae679a8cf874c3.tar.gz
urpmi-561b6b1eaf2cf64d7c33b69d57ae679a8cf874c3.tar.bz2
urpmi-561b6b1eaf2cf64d7c33b69d57ae679a8cf874c3.tar.xz
urpmi-561b6b1eaf2cf64d7c33b69d57ae679a8cf874c3.zip
add new urpmi option, only for debugging purpose: --debug__do_not_install
-rw-r--r--urpm/args.pm1
-rw-r--r--urpm/main_loop.pm2
-rwxr-xr-xurpmi4
3 files changed, 5 insertions, 2 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index 47dbb1e2..69a8dd51 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -137,6 +137,7 @@ my %options_spec = (
'strict-arch!' => sub { $urpm->{options}{'strict-arch'} = $_[1] },
'norebuild!' => sub { $urpm->{options}{'build-hdlist-on-error'} = !$_[1] },
'test!' => \$::test,
+ 'debug__do_not_install' => \$options{debug__do_not_install},
'skip=s' => \$options{skip},
'prefer=s' => \$options{prefer},
'root=s' => sub { set_root($urpm, $_[1]) },
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm
index c0d7e25c..f746f9b0 100644
--- a/urpm/main_loop.pm
+++ b/urpm/main_loop.pm
@@ -63,6 +63,8 @@ urpm::install::build_transaction_set_($urpm, $state,
split_level => $urpm->{options}{'split-level'},
split_length => !$test && $urpm->{options}{'split-length'});
+$options{debug__do_not_install} and exit 0;
+
my ($ok, $nok) = (0, 0);
my @errors;
diff --git a/urpmi b/urpmi
index 998d351f..478fa932 100755
--- a/urpmi
+++ b/urpmi
@@ -263,7 +263,7 @@ if ($env) {
$urpm->{prefer_vendor_list} = "$env/prefer.vendor.list";
$urpm->{statedir} = $env;
} else {
- if ($< != 0) {
+ if ($< != 0 && !$options{debug__do_not_install}) {
#- need to be root if binary rpms are to be installed
$auto_select || @names || @files and $urpm->{fatal}(1, N("Only superuser is allowed to install packages"));
}
@@ -595,7 +595,7 @@ foreach my $pkg (sort { $a->name cmp $b->name } @{$urpm->{depslist}}[keys %{$sta
}
}
$urpm->{nb_install} = @to_install;
-if ($env) {
+if ($env && !$options{debug__do_not_install}) {
my $msg = $urpm->{nb_install} == 1 ? N("To satisfy dependencies, the following package is going to be installed:")
: N("To satisfy dependencies, the following packages are going to be installed:");
my $msg2 = P("(%d package, %d MB)", "(%d packages, %d MB)", $urpm->{nb_install}, $urpm->{nb_install}, toMb($sum));