[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#133446: dpkg: update-alternatives exits with 1

Package: dpkg
Version: 1.9.19
Severity: normal

Basicly the manpage for update-alternatives states 0 and 2 as possible exit
codes. How ever it's possible that update-alternatives returns 1.
for instance when asking for information about a non existing alternative

update-alternatives --display someone-completely-unrelated

At the moment it seems this is an inconsistency between the man page and
the program. But certain programs seems to rely on update-alternatives not
returning anything else then 0 (post install scripts of various packages)

There is one related bug report being:
#133033: post installation exits with status 1
about the exuberant-ctags package exiting because of the 1 exit code in
combination with set -e.

I quick grep of postinst scripts lists quite some more packages that might
suffer from this problem (vim being one of them).

I think the correct solution is to exit with a 0 exit code at the moment
that the alternative doesn't exist.  (a patch for this solution is attached)

-- System Information
Debian Release: 3.0
Kernel Version: Linux oi 2.2.20 #2 Sun Feb 10 14:49:53 CET 2002 i686 unknown

Versions of the packages dpkg depends on:
ii  libc6          2.2.5-3        GNU C Library: Shared libraries and Timezone
ii  libncurses5    5.2.20020112a- Shared libraries for terminal handling
ii  libstdc++2.10- 2.95.4-2       The GNU stdc++ library

------------- Patch
--- update-alternatives.orig	Mon Feb 11 15:56:56 2002
+++ update-alternatives	Mon Feb 11 15:57:04 2002
@@ -165,7 +165,7 @@
 if ($mode eq 'display') {
     if (!$dataread) {
         &pr("No alternatives for $name.");
-	exit 1;
+	exit 0;
     } else {
         &pr("$name - status is $manual.");
         if (defined($linkname= readlink("$altdir/$name"))) {

Reply to: