[SCM] Debian packaging of wesnoth branch, master, updated. debian/1.8.5-1-4-g36fc5ca

Gerfried Fuchs rhonda at debian.org
Thu May 12 14:24:01 UTC 2011


The following commit has been merged in the master branch:
commit 36fc5caa69b56bf5da5ead8d65d1602349106a7f
Author: Gerfried Fuchs <rhonda at debian.org>
Date:   Thu May 12 16:20:19 2011 +0200

    Fix dpkg-divert handling

diff --git a/debian/changelog b/debian/changelog
index 819bc39..466d46a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ wesnoth-1.8 (1:1.8.6-1) unstable; urgency=low
   * New upstream stable release.
   * Bump Standards-Version to 3.9.2.
   * Fix patch wesnothd-name to really find the proper binary (closes: #617945)
+  * Fix dpkg-divert handling to not fail when wesnoth-1.8-core and
+    wesnoth-1.9-core are installed.
 
  -- 
 
diff --git a/debian/wesnoth-1.8-core.postinst b/debian/wesnoth-1.8-core.postinst
index c6909ec..65a965f 100644
--- a/debian/wesnoth-1.8-core.postinst
+++ b/debian/wesnoth-1.8-core.postinst
@@ -9,17 +9,21 @@ divert_oldfiles()
 {
 	# programs
 	for i in wesnoth wesnoth-nolog wesnoth-smallgui wesnoth-editor; do
-		dpkg-divert --package wesnoth-1.8-core \
-			--divert /usr/games/$i-old \
-			--rename /usr/games/$i
+		if ! dpkg-divert --list /usr/games/$i | grep -q /usr/games/$i; then
+			dpkg-divert --package wesnoth-1.8-core \
+				--divert /usr/games/$i-old \
+				--rename /usr/games/$i
+		fi
 	done
 
 	# manpages
 	for i in ca_ES at valencia cs da de en_GB es et fi fr gl hu it ja \
 		lt nl pl sk sr sr at latin sv tr zh_CN zh_TW; do
-		dpkg-divert --package wesnoth-1.8-core \
-			--divert /usr/share/man/$i/man6/wesnoth-old.6.gz \
-			--rename /usr/share/man/$i/man6/wesnoth.6.gz
+		if ! dpkg-divert --list /usr/share/man/$i/man6/wesnoth.6.gz | grep -q /usr/share/man/$i/man6/wesnoth.6.gz; then
+			dpkg-divert --package wesnoth-1.8-core \
+				--divert /usr/share/man/$i/man6/wesnoth-old.6.gz \
+				--rename /usr/share/man/$i/man6/wesnoth.6.gz
+		fi
 	done
 }
 
diff --git a/debian/wesnoth-1.8-core.postrm b/debian/wesnoth-1.8-core.postrm
index 4f02733..fc4d4e2 100644
--- a/debian/wesnoth-1.8-core.postrm
+++ b/debian/wesnoth-1.8-core.postrm
@@ -10,14 +10,14 @@ divert_oldfiles()
 	# programs
 	for i in wesnoth wesnoth-nolog wesnoth-smallgui wesnoth-editor; do 
 		dpkg-divert --remove --package wesnoth-1.8-core \
-			--rename /usr/games/$i
+			--rename /usr/games/$i 2>/dev/null || true
 	done
 
 	# manpages
 	for i in ca_ES at valencia cs da de en_GB es et fi fr gl hu it ja \
 		lt nl pl sk sr sr at latin sv tr zh_CN zh_TW; do
 		dpkg-divert --remove --package wesnoth-1.8-core \
-			--rename /usr/share/man/$i/man6/wesnoth.6.gz
+			--rename /usr/share/man/$i/man6/wesnoth.6.gz 2>/dev/null || true
 	done
 }
 
diff --git a/debian/wesnoth-BRANCH-core.postinst.in b/debian/wesnoth-BRANCH-core.postinst.in
index 11d977a..339a547 100644
--- a/debian/wesnoth-BRANCH-core.postinst.in
+++ b/debian/wesnoth-BRANCH-core.postinst.in
@@ -9,17 +9,21 @@ divert_oldfiles()
 {
 	# programs
 	for i in wesnoth wesnoth-nolog wesnoth-smallgui wesnoth-editor; do
-		dpkg-divert --package wesnoth-BRANCH-core \
-			--divert /usr/games/$i-old \
-			--rename /usr/games/$i
+		if ! dpkg-divert --list /usr/games/$i | grep -q /usr/games/$i; then
+			dpkg-divert --package wesnoth-BRANCH-core \
+				--divert /usr/games/$i-old \
+				--rename /usr/games/$i
+		fi
 	done
 
 	# manpages
 	for i in ca_ES at valencia cs da de en_GB es et fi fr gl hu it ja \
 		lt nl pl sk sr sr at latin sv tr zh_CN zh_TW; do
-		dpkg-divert --package wesnoth-BRANCH-core \
-			--divert /usr/share/man/$i/man6/wesnoth-old.6.gz \
-			--rename /usr/share/man/$i/man6/wesnoth.6.gz
+		if ! dpkg-divert --list /usr/share/man/$i/man6/wesnoth.6.gz | grep -q /usr/share/man/$i/man6/wesnoth.6.gz; then
+			dpkg-divert --package wesnoth-BRANCH-core \
+				--divert /usr/share/man/$i/man6/wesnoth-old.6.gz \
+				--rename /usr/share/man/$i/man6/wesnoth.6.gz
+		fi
 	done
 }
 
diff --git a/debian/wesnoth-BRANCH-core.postrm.in b/debian/wesnoth-BRANCH-core.postrm.in
index 9afdef4..cc14b3a 100644
--- a/debian/wesnoth-BRANCH-core.postrm.in
+++ b/debian/wesnoth-BRANCH-core.postrm.in
@@ -10,14 +10,14 @@ divert_oldfiles()
 	# programs
 	for i in wesnoth wesnoth-nolog wesnoth-smallgui wesnoth-editor; do 
 		dpkg-divert --remove --package wesnoth-BRANCH-core \
-			--rename /usr/games/$i
+			--rename /usr/games/$i 2>/dev/null || true
 	done
 
 	# manpages
 	for i in ca_ES at valencia cs da de en_GB es et fi fr gl hu it ja \
 		lt nl pl sk sr sr at latin sv tr zh_CN zh_TW; do
 		dpkg-divert --remove --package wesnoth-BRANCH-core \
-			--rename /usr/share/man/$i/man6/wesnoth.6.gz
+			--rename /usr/share/man/$i/man6/wesnoth.6.gz 2>/dev/null || true
 	done
 }
 

-- 
Debian packaging of wesnoth



More information about the Pkg-games-commits mailing list