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

Bug#483418: debian-policy: Not limit dpkg-divert to install but valid also for upgrade in app. G



Package: debian-policy
Version: 3.7.3.0
Severity: minor

In "Appendix G - Diversions - overriding a package's version of a file (from old Packaging Manual)", there's some misleading explanations on dpkg-divert preferred use in presint scriptsi (as I understand it, this is not related to policy itself, as it lies in the appendix, so this issue should be easily fixed ?).

The following example is provided with a sentence which seems erronous to me ATM :

       if [ install = "$1"  ]; then
                 dpkg-divert --package smailwrapper --add --rename \
	              --divert /usr/sbin/smail.real /usr/sbin/smail
       fi

     Testing $1 is necessary so that the script doesn't try to add the diversion again when smailwrapper is upgraded.

IMHO, whenever a package introduces a diversion for the first time, whereas previous versions of the package may have been installed, there's a need to add the diversion on upgrade too.
Running dpkg-divert twice in a row with the same arguments doesn't harm, at the moment from the tests I've done on a "testing" system.

Maybe this used to be different in ancient times and diverting several times would lead to chaos ?

So I suggest that the example is changed to something like :

	case "$1" in
    		install|upgrade)
			dpkg-divert --package smailwrapper --add --rename \
	                      --divert /usr/sbin/smail.real /usr/sbin/smail
	        ;;

without further explanations by removing the sentence in question.

Hope this helps.

Best regards,

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-openvz-24-004.1d1-686 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- no debconf information



Reply to: