summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/args.pm1
-rwxr-xr-xurpmi9
2 files changed, 6 insertions, 4 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index a1e9d9af..d81e28a1 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -113,6 +113,7 @@ my %options_spec = (
'excludepath|exclude-path=s' => sub { $urpm->{options}{excludepath} = $_[1] },
'excludedocs|exclude-docs' => sub { $urpm->{options}{excludedocs} = 1 },
'more-choices' => sub { $urpm->{options}{morechoices} = 1 },
+ 'expect-install!' => \$::expect_install,
a => \$::all,
q => sub { --$::verbose; $::rpm_opt = '' },
v => sub { ++$::verbose; $::rpm_opt = 'vh' },
diff --git a/urpmi b/urpmi
index 14c36b56..82dccd0c 100755
--- a/urpmi
+++ b/urpmi
@@ -215,7 +215,7 @@ if ($env) {
}
}
-unless ($bug || $install_src || $env || $urpm->{options}{'allow-force'}) {
+unless ($bug || $install_src || $env || $urpm->{options}{'allow-force'} || $root) {
require urpm::sys;
urpm::sys::check_fs_writable() or $urpm->{fatal}(1, N("Error: %s appears to be mounted read-only.
Use --allow-force to force operation.", $urpm::sys::mountpoint));
@@ -684,9 +684,10 @@ if ($nok) {
if ($test) {
message(N("Installation is possible"));
} elsif (@names || @src_names || @files || @src_files || $auto_select) {
- @{$state->{transaction} || []} == 0 && @ask_unselect == 0 && $verbose >= 0
- and message(N("The package(s) are already installed"));
- $exit_code = 15;
+ if (@{$state->{transaction} || []} == 0 && @ask_unselect == 0) {
+ message(N("The package(s) are already installed")) if $verbose >= 0;
+ $exit_code = 15 if our $expect_install;
+ }
}
}