[25497] in Source-Commits
/svn/athena r25027 - trunk/debathena/config/from-config/debian
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Sat Mar 12 15:56:11 2011
Date: Sat, 12 Mar 2011 15:56:05 -0500
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201103122056.p2CKu5u7018975@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: jdreed
Date: 2011-03-12 15:56:05 -0500 (Sat, 12 Mar 2011)
New Revision: 25027
Removed:
trunk/debathena/config/from-config/debian/postinst
Modified:
trunk/debathena/config/from-config/debian/compat
trunk/debathena/config/from-config/debian/control.in
trunk/debathena/config/from-config/debian/prerm
trunk/debathena/config/from-config/debian/rules
Log:
Generate postinst in rules, generate Conflicts when appropriate, fix prerm
Modified: trunk/debathena/config/from-config/debian/compat
===================================================================
--- trunk/debathena/config/from-config/debian/compat 2011-03-12 06:27:56 UTC (rev 25026)
+++ trunk/debathena/config/from-config/debian/compat 2011-03-12 20:56:05 UTC (rev 25027)
@@ -1 +1 @@
-4
+5
Modified: trunk/debathena/config/from-config/debian/control.in
===================================================================
--- trunk/debathena/config/from-config/debian/control.in 2011-03-12 06:27:56 UTC (rev 25026)
+++ trunk/debathena/config/from-config/debian/control.in 2011-03-12 20:56:05 UTC (rev 25027)
@@ -9,6 +9,6 @@
Architecture: all
Depends: debathena-mitmailutils (>= 10.1.0), ${misc:Depends}
Provides: ${diverted-files}
-Conflicts: ${diverted-files}
+Conflicts: ${diverted-files}, ${debathena-from-config-conflicts}
Description: Set Athena from as default
This package makes /usr/bin/from point to the Debathena version.
Modified: trunk/debathena/config/from-config/debian/prerm
===================================================================
--- trunk/debathena/config/from-config/debian/prerm 2011-03-12 06:27:56 UTC (rev 25026)
+++ trunk/debathena/config/from-config/debian/prerm 2011-03-12 20:56:05 UTC (rev 25027)
@@ -19,7 +19,7 @@
case "$1" in
remove|deconfigure)
- if update-alteratives --list from | grep -q /usr/bin/from\.debathena; then
+ if update-alteratives --list from | grep -qFx '/usr/bin/from.debathena'; then
update-alternatives --remove from /usr/bin/from.debathena
fi
;;
Modified: trunk/debathena/config/from-config/debian/rules
===================================================================
--- trunk/debathena/config/from-config/debian/rules 2011-03-12 06:27:56 UTC (rev 25026)
+++ trunk/debathena/config/from-config/debian/rules 2011-03-12 20:56:05 UTC (rev 25027)
@@ -4,11 +4,30 @@
# From the changelog for bsdmainutils
USES_ALTERNATIVES = $(shell dpkg --compare-versions $(BSDMAINUTILS_VERSION) ge '8.0.6~' && echo y)
-ifeq ($(USES_ALTERNATIVES),y)
- DEB_DIVERT_EXTENSION = .debathena
+DEB_DIVERT_EXTENSION = .debathena
+ifneq ($(USES_ALTERNATIVES),y)
+ # Older packages, continue to divert
DEB_DIVERT_FILES_debathena-from-config += \
/usr/bin/from.debathena \
/usr/share/man/man1/from.debathena.1.gz
+else
+ # Newer packages: undivert, generate Conflicts, generate postinst
+ DEB_UNDIVERT_VERSION_/usr/bin/from.debathena = 1.5~
+ DEB_UNDIVERT_VERSION_/usr/share/man/man1/from.debathena.1.gz = 1.5~
+ DEB_UNDIVERT_FILES_debathena-from-config += \
+ /usr/bin/from.debathena \
+ /usr/share/man/man1/from.debathena.1.gz
+ binary-predeb/debathena-from-config::
+ echo "debathena-from-config-conflicts=bsdmainutils (<8.0.6~)" >> debian/debathena-from-config.substvars
+ common-build-indep::
+ (echo "#DEBHELPER#"; \
+ echo "if [ \"\$$1\" = configure ]; then"; \
+ echo " update-alteratives \\"; \
+ echo " --install /usr/bin/from from /usr/bin/from.debathena 100 \\"; \
+ echo " --slave /usr/share/man/man1/from.1.gz from.1.gz /usr/share/man/man1/from.debathena.1.gz"; \
+ echo "fi") > debian/postinst
+ clean::
+ rm -f debian/postinst
endif
include /usr/share/cdbs/1/rules/debhelper.mk