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

Bug#546165: install-info should not complain when called with --remove in prerm



tags 546165 + patch
thanks

On 2009-09-11 12:38 +0200, Raphaël Hertzog wrote:

> Package: install-info
> Version: 4.13a.dfsg.1-4
>
> During upgrade this morning I saw:
> (Lecture de la base de données... 218733 fichiers et répertoires déjà installés.)
> Préparation du remplacement de coreutils 7.5-4 (en utilisant .../coreutils_7.5-5_i386.deb) ...
> Ignoring install-info called from maintainer script
> The package coreutils should be rebuild with new debhelper to get trigger support
> Dépaquetage de la mise à jour de coreutils ...
>
> In fact, 7.5-5 doesn't contain any call to install-info only the old 7.5-4 did
> and it was rightfully called with --remove in prerm. Please make install-info
> not complain when called with --remove in prerm otherwise we will have plenty
> of those messages during lenny->squeeze upgrades even if all packages have been
> properly updated.

It seems that dpkg does not export information about which maintainer
script it is running (CMIIW; I just looked at the "ENVIRONMENT VARIABLES"
section in dpkg.1), so the best approach appears to be silent whenever
install-info is called with "--remove" or "--remove-exactly" options, as
these are usually set in prerm scripts.

Here is a patch that does that:

--8<---------------cut here---------------start------------->8---
Index: install-info.sh
===================================================================
--- install-info.sh	(Revision 4190)
+++ install-info.sh	(Arbeitskopie)
@@ -17,6 +17,19 @@
   # we are running from a maintainer script, simply ignore the call
   # since we have trigger support and people should rebuild their
   # package with new debhelper which does not add calls to install-info
+  # Do not complain if called with "--remove" or "--remove-exactly",
+  # as these are used in old packages' prerm scripts (see #546165)
+  while [ -n "$1" ]; do
+      case "$1" in
+          --remove|--remove-exactly)
+              exit 0
+              ;;
+          *)
+              shift
+              ;;
+      esac
+        
+  done
   echo "Ignoring install-info called from maintainer script" >&2
   echo "The package $DPKG_MAINTSCRIPT_PACKAGE should be rebuilt with new debhelper to get trigger support" >&2
 fi
--8<---------------cut here---------------end--------------->8---

Cheers,
       Sven



Reply to: