[SVN] r551 - in /trunk/cyrus-imapd-2.2.13/debian: changelog cyrus-common-2.2.postrm cyrus-common-2.2.preinst

Benjamin Seidenberg astronut at dlgeek.net
Tue Aug 8 23:00:33 UTC 2006


You got the 2nd part (revert the change if upgrade fails) but you didn't
put the upgrade part to move it in the first place.

debian at incase.de wrote:
> Author: sven
> Date: Wed Aug  9 00:50:11 2006
> New Revision: 551
>
> URL: https://mail.incase.de/viewcvs?rev=551&root=cyrus22&view=rev
> Log:
> Add logic in cyrus-common-2.2 preinst/postrm scripts to fix the cron.daily script name, supplements r545:550 by astronut
>
> Added:
>     trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.preinst
>       - copied, changed from r544, trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.postrm
> Modified:
>     trunk/cyrus-imapd-2.2.13/debian/changelog
>     trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.postrm
>
> Modified: trunk/cyrus-imapd-2.2.13/debian/changelog
> URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/debian/changelog?rev=551&root=cyrus22&r1=550&r2=551&view=diff
> ==============================================================================
> --- trunk/cyrus-imapd-2.2.13/debian/changelog (original)
> +++ trunk/cyrus-imapd-2.2.13/debian/changelog Wed Aug  9 00:50:11 2006
> @@ -35,8 +35,11 @@
>    * Add some more options to /etc/default/cyrus2.2 and use them in the init
>      script, including a generic OPTIONS variable to allow setting of any
>      commandline option for cyrmaster. (Closes: #382061)
> -
> - -- Benjamin Seidenberg <astronut at dlgeek.net>  Tue,  8 Aug 2006 12:47:07 -0400
> +  * Add logic in cyrus-common-2.2 preinst/postrm scripts to rename the
> +    cron.daily script. Supplements change by Benjamin Seidenberg, closing
> +    #382069.
> +
> + -- Sven Mueller <sven at debian.org>  Wed,  9 Aug 2006 00:46:11 +0200
>  
>  cyrus-imapd-2.2 (2.2.13-4) unstable; urgency=low
>  
>
> Modified: trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.postrm
> URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.postrm?rev=551&root=cyrus22&r1=550&r2=551&view=diff
> ==============================================================================
> --- trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.postrm (original)
> +++ trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.postrm Wed Aug  9 00:50:11 2006
> @@ -55,10 +55,27 @@
>  			update-rc.d cyrus2.2 remove >/dev/null
>          	;;
>  
> -		upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
> -
> +		upgrade|failed-upgrade|disappear)
>  			;;
> -
> +		abort-upgrade)
> +			# old version was in "configuration files only" state,
> +			# installation of new package failed before or after unpack
> +			if dpkg --compare-versions "$2" lt "2.2.13-4bpo1" ; then
> +				if [ -f /etc/cron.daily/cyrus22 ] \
> +				&& [ ! -f /etc/cron.daily/cyrus-common-2.2 ]; then
> +					mv -f /etc/cron.daily/cyrus22 /etc/cron.daily/cyrus-common-2.2
> +				fi
> +			fi
> +			;;
> +		abort-install)
> +			# old version was fully installed, but upgrade failed
> +			if dpkg --compare-versions "$2" lt "2.2.13-4bpo1" ; then
> +				if [ -f /etc/cron.daily/cyrus22 ] \
> +				&& [ ! -f /etc/cron.daily/cyrus-common-2.2 ]; then
> +					mv -f /etc/cron.daily/cyrus22 /etc/cron.daily/cyrus-common-2.2
> +				fi
> +			fi
> +			;;
>  		*)
>  			echo "postrm called with unknown argument \`$1'" >&2
>  			exit 0
>
> Copied: trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.preinst (from r544, trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.postrm)
> URL: https://mail.incase.de/viewcvs/trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.preinst?p2=trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.preinst&p1=trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.postrm&r1=544&r2=551&rev=551&root=cyrus22&view=diff
> ==============================================================================
> --- trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.postrm (original)
> +++ trunk/cyrus-imapd-2.2.13/debian/cyrus-common-2.2.preinst Wed Aug  9 00:50:11 2006
> @@ -12,53 +12,38 @@
>  . /usr/share/debconf/confmodule
>  
>  # summary of how this script can be called:
> -#        * <postrm> `remove'
> -#        * <postrm> `purge'
> -#        * <old-postrm> `upgrade' <new-version>
> -#        * <new-postrm> `failed-upgrade' <old-version>
> -#        * <new-postrm> `abort-install'
> -#        * <new-postrm> `abort-install' <old-version>
> -#        * <new-postrm> `abort-upgrade' <old-version>
> -#        * <disappearer's-postrm> `disappear' <overwriter> <new-version>
> +# <new-preinst> upgrade <old-version>
> +# <new-preinst> install <old-version>
> +# <old-preinst> abort-upgrade <new-version>
>  # for details, see /usr/doc/packaging-manual/
>  
>  case "$1" in
> -		remove)
> +		upgrade)
> +			# old version was fully installed
> +			if dpkg --compare-version "$2" lt "2.2.13-4bpo1"; then
> +				# Upgrading from a version which used a wrong
> +				# filename for the daily cronjob
> +				if [ -f /etc/cron.daily/cyrus-common-2.2 ] \
> +				&& [ ! -f /etc/cron.daily/cyrus22 ]; then
> +					mv -f /etc/cron.daily/cyrus-common-2.2 /etc/cron.daily/cyrus22
> +				fi
> +			fi
>  			;;
> -		purge)
> -			for i in /var/lib/cyrus /var/spool/sieve \
> -				 /var/spool/cyrus \
> -				 /var/run/cyrus /var/run/cyrus/socket ; do
> -				dpkg-statoverride --remove $i || true
> -			done
> -			rm -rf /var/run/cyrus || true
> -			rm  /usr/lib/cyrus/cyrus-db-types.active || true
> -			rm usr/lib/cyrus/cyrus-hardwired-config.active || true
> -
> -			# Should we remove our precious data?
> -			db_title "Cyrus IMAPd 2.2" || true
> -			db_fset cyrus-common-2.2/removespools seen false || true
> -			db_input high cyrus-common-2.2/removespools || true
> -			db_go || true
> -
> -			db_get cyrus-common-2.2/removespools
> -			[ "${RET}" = "true" ] && {
> -				for i in /var/spool/cyrus /var/lib/cyrus \
> -				         /var/spool/sieve /etc/sieve ; do
> -				        find "$i" -type f -exec rm -f '{}' \; || true
> -				        find "$i" -type d -depth -not -name 'lost+found' -exec rmdir '{}' \; || true
> -				done
> -				# Remove database type information
> -				rm -f /usr/lib/cyrus/cyrus-*.active
> -			}
> -
> -			update-rc.d cyrus2.2 remove >/dev/null
> -        	;;
> -
> -		upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
> -
> +		install)
> +			# old version was in "configuration files only" state
> +			if dpkg --compare-version "$2" lt "2.2.13-4bpo1"; then
> +				# Upgrading from a version which used a wrong
> +				# filename for the daily cronjob
> +				if [ -f /etc/cron.daily/cyrus-common-2.2 ] \
> +				&& [ ! -f /etc/cron.daily/cyrus22 ]; then
> +					mv -f /etc/cron.daily/cyrus-common-2.2 /etc/cron.daily/cyrus22
> +				fi
> +			fi
>  			;;
> -
> +		abort-upgrade)
> +			# upgrade failed after unpack - error unwind is tried
> +			# however, if it works, new-postrm is also called with abort-upgrade
> +			;;
>  		*)
>  			echo "postrm called with unknown argument \`$1'" >&2
>  			exit 0
>
> _______________________________________________
> Pkg-Cyrus-imapd-Debian-devel mailing list
> Pkg-Cyrus-imapd-Debian-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-cyrus-imapd-debian-devel
>   


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-cyrus-imapd-debian-devel/attachments/20060808/fde7fdb5/signature.pgp


More information about the Pkg-Cyrus-imapd-Debian-devel mailing list