[SCM] Debian packaging of wesnoth branch, devel, updated. debian/1.8.5-1-8-g5ee0a15

Gerfried Fuchs rhonda at debian.at
Fri Oct 22 14:13:07 UTC 2010


The following commit has been merged in the devel branch:
commit 5ee0a15268d43d07364f02446dc320af87d38766
Author: Gerfried Fuchs <rhonda at debian.at>
Date:   Sun Oct 17 22:19:33 2010 +0200

    Fix dpkg-divert handling

diff --git a/debian/changelog b/debian/changelog
index 72bc5a8..0d66d6e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ wesnoth-1.9 (1:1.9.1-1) unstable; urgency=low
   * New campaign "Dead Water" (-dw).
   * Call ./configure explicitly again, autogen.sh doesn't do it anymore.
   * New Build-Depends on libboost-system-dev and libboost-thread-dev.
+  * 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.9-core.postinst b/debian/wesnoth-1.9-core.postinst
index 503ebbf..248c396 100644
--- a/debian/wesnoth-1.9-core.postinst
+++ b/debian/wesnoth-1.9-core.postinst
@@ -9,17 +9,23 @@ divert_oldfiles()
 {
 	# programs
 	for i in wesnoth wesnoth-nolog wesnoth-smallgui wesnoth-editor; do
-		dpkg-divert --package wesnoth-1.9-core \
-			--divert /usr/games/$i-old \
-			--rename /usr/games/$i
+		dpkg-divert --list /usr/games/$i | grep -q /usr/games/$i
+		if [ $? != 0 ]; then
+			dpkg-divert --package wesnoth-1.9-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.9-core \
-			--divert /usr/share/man/$i/man6/wesnoth-old.6.gz \
-			--rename /usr/share/man/$i/man6/wesnoth.6.gz
+		dpkg-divert --list /usr/share/man/$i/man6/wesnoth.6.gz | grep -q /usr/share/man/$i/man6/wesnoth.6.gz
+		if [ $? != 0 ]; then
+			dpkg-divert --package wesnoth-1.9-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.9-core.postrm b/debian/wesnoth-1.9-core.postrm
index 42cac8c..25015b7 100644
--- a/debian/wesnoth-1.9-core.postrm
+++ b/debian/wesnoth-1.9-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.9-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.9-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..f648798 100644
--- a/debian/wesnoth-BRANCH-core.postinst.in
+++ b/debian/wesnoth-BRANCH-core.postinst.in
@@ -9,17 +9,23 @@ 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
+		dpkg-divert --list /usr/games/$i | grep -q /usr/games/$i
+		if [ $? != 0 ]; 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
+		dpkg-divert --list /usr/share/man/$i/man6/wesnoth.6.gz | grep -q /usr/share/man/$i/man6/wesnoth.6.gz
+		if [ $? != 0 ]; 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