summaryrefslogtreecommitdiffstats
path: root/urpmi
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-01-10 08:37:18 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-01-10 08:37:18 +0000
commit38503ac49864e6de1c90a9fd7c5ddad40076baa7 (patch)
tree5d1007667cb0123de5d56e83bd6e7f8e76181df9 /urpmi
parent46307104b892d733ff7d83b5aabcb61f02991904 (diff)
downloadurpmi-38503ac49864e6de1c90a9fd7c5ddad40076baa7.tar
urpmi-38503ac49864e6de1c90a9fd7c5ddad40076baa7.tar.gz
urpmi-38503ac49864e6de1c90a9fd7c5ddad40076baa7.tar.bz2
urpmi-38503ac49864e6de1c90a9fd7c5ddad40076baa7.tar.xz
urpmi-38503ac49864e6de1c90a9fd7c5ddad40076baa7.zip
Add an option to urpmi, --expect-install, that tells urpmi to return with
an exit status of 15 if it installed nothing.
Diffstat (limited to 'urpmi')
-rwxr-xr-xurpmi9
1 files changed, 5 insertions, 4 deletions
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;
+ }
}
}