The following commit has been merged in the master branch:
commit c8f636c510a882f89b9be18590556f963822e121
Author: Gerfried Fuchs <[email protected]>
Date:   Tue Jul 27 18:11:25 2010 +0200

    Fixed divert & alternative handling

diff --git a/debian/wesnoth-1.8-core.postinst b/debian/wesnoth-1.8-core.postinst
index d5df760..60490c7 100644
--- a/debian/wesnoth-1.8-core.postinst
+++ b/debian/wesnoth-1.8-core.postinst
@@ -5,6 +5,15 @@
 
 set -e
 
+divert_oldfiles()
+{
+       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
+       done
+}
+
 setup_alternatives()
 {
        # man 6 wesnoth
@@ -23,6 +32,7 @@ setup_alternatives()
 
 case "$1" in
        configure|reconfigure)
+               divert_oldfiles
                setup_alternatives
        ;;
 esac
diff --git a/debian/wesnoth-1.8-core.prerm b/debian/wesnoth-1.8-core.postrm
similarity index 92%
rename from debian/wesnoth-1.8-core.prerm
rename to debian/wesnoth-1.8-core.postrm
index d54b0b9..e140255 100644
--- a/debian/wesnoth-1.8-core.prerm
+++ b/debian/wesnoth-1.8-core.postrm
@@ -1,5 +1,5 @@
 #!/bin/sh
-# prerm script for wesnoth-1.8-core
+# postrm script for wesnoth-1.8-core
 # Copyright 2010 by Gerfried Fuchs <[email protected]>
 # Licensed under WTFPLv2
 
@@ -21,8 +21,8 @@ setup_alternatives()
 
 case "$1" in
        purge|remove)
-               divert_oldfiles
                setup_alternatives
+               divert_oldfiles
        ;;
 esac
 
diff --git a/debian/wesnoth-1.8-core.preinst b/debian/wesnoth-1.8-core.preinst
deleted file mode 100644
index 37eb1f4..0000000
--- a/debian/wesnoth-1.8-core.preinst
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-# preinst script for wesnoth-1.8-core
-# Copyright 2010 by Gerfried Fuchs <[email protected]>
-# Licensed under WTFPLv2
-
-set -e
-
-divert_oldfiles()
-{
-       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
-       done
-}
-
-case "$1" in
-       install|upgrade)
-               divert_oldfiles
-       ;;
-esac
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/wesnoth-BRANCH-core.postinst.in 
b/debian/wesnoth-BRANCH-core.postinst.in
index f09e151..2a1130c 100644
--- a/debian/wesnoth-BRANCH-core.postinst.in
+++ b/debian/wesnoth-BRANCH-core.postinst.in
@@ -5,6 +5,15 @@
 
 set -e
 
+divert_oldfiles()
+{
+       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
+       done
+}
+
 setup_alternatives()
 {
        # man 6 wesnoth
@@ -23,6 +32,7 @@ setup_alternatives()
 
 case "$1" in
        configure|reconfigure)
+               divert_oldfiles
                setup_alternatives
        ;;
 esac
diff --git a/debian/wesnoth-BRANCH-core.prerm.in 
b/debian/wesnoth-BRANCH-core.postrm.in
similarity index 92%
rename from debian/wesnoth-BRANCH-core.prerm.in
rename to debian/wesnoth-BRANCH-core.postrm.in
index 6f75472..b16e291 100644
--- a/debian/wesnoth-BRANCH-core.prerm.in
+++ b/debian/wesnoth-BRANCH-core.postrm.in
@@ -1,5 +1,5 @@
 #!/bin/sh
-# prerm script for wesnoth-BRANCH-core
+# postrm script for wesnoth-BRANCH-core
 # Copyright 2010 by Gerfried Fuchs <[email protected]>
 # Licensed under WTFPLv2
 
@@ -21,8 +21,8 @@ setup_alternatives()
 
 case "$1" in
        purge|remove)
-               divert_oldfiles
                setup_alternatives
+               divert_oldfiles
        ;;
 esac
 
diff --git a/debian/wesnoth-BRANCH-core.preinst.in 
b/debian/wesnoth-BRANCH-core.preinst.in
deleted file mode 100644
index 32ee0e7..0000000
--- a/debian/wesnoth-BRANCH-core.preinst.in
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-# preinst script for wesnoth-BRANCH-core
-# Copyright 2010 by Gerfried Fuchs <[email protected]>
-# Licensed under WTFPLv2
-
-set -e
-
-divert_oldfiles()
-{
-       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
-       done
-}
-
-case "$1" in
-       install|upgrade)
-               divert_oldfiles
-       ;;
-esac
-
-#DEBHELPER#
-
-exit 0

-- 
Debian packaging of wesnoth

_______________________________________________
Pkg-games-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

Reply via email to