[SCM] Debian package of greed branch, master, updated. upstream/3.6-77-g118875e

Josue Abarca jmaslibre at debian.org.gt
Thu Nov 17 16:01:01 UTC 2011


The following commit has been merged in the master branch:
commit 118875ec6f667d9b5ff57c17dddcd0198ca6f26d
Author: Josue Abarca <jmaslibre at debian.org.gt>
Date:   Thu Nov 17 09:58:30 2011 -0600

    * debian/NEWS.Debian and debian/postrm downgrade was not well supported so it is droped now.
    * debian/postinst Fix /var/games/greed directory owner and permissions.

diff --git a/debian/NEWS.Debian b/debian/NEWS.Debian
index e2e0964..3403d3f 100644
--- a/debian/NEWS.Debian
+++ b/debian/NEWS.Debian
@@ -5,12 +5,13 @@ greed (3.7-1) unstable; urgency=low
   * If you upgrade to greed 3.7-1 from a version lesser than 3.7, and you
     have an score file then it will be moved to
     /var/games/greed/greed.hs.dpkg-old in order to preserve your scores.
-  * If you downgrade to a version lesser than 3.7 your score file will be
-    moved to /var/games/greed/greed.hs.dpkg-new. If greed (>=3.7) was
-    removed, but not purged, then you should purge it before installing any
-    version lesser than 3.7.
-  * Please be aware that any existing file greed.hs.dpkg-{old,new} in the
-    greed directory will be overwritten during the upgrade/downgrade.
+  * Please be aware that in the above case any file with name
+    greed.hs.dpkg-old in the greed directory will be overwritten during
+    the upgrade.
+  * Downgrade: If greed (>=3.7) is installed or was removed, but not
+    purged, then you must purge the package before installing any version
+    lesser than 3.7.
+
   * As expected if you purge the greed 3.7-1 package all the score files
     will be deleted including greed.hs.dpkg-{old,new}.
 
diff --git a/debian/postinst b/debian/postinst
index 0417305..9c14267 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -5,9 +5,15 @@ set -e
 
 case "$1" in
     configure)
+        GREEDVARDIR="/var/games/greed"
         SCOREFILE="/var/games/greed/greed.hs"
         # Old score files are now incompatible
+        # and the permissions and owner of the directory must be updated
 	if dpkg --compare-versions "$2" lt "3.7-1"; then
+            if [ -d $GREEDVARDIR ]; then
+                chown root:root $GREEDVARDIR
+                chmod 755 $GREEDVARDIR
+            fi
 	    if [ -f $SCOREFILE ]; then
 		echo -n "Preserving user scores to $SCOREFILE.dpkg-old..."
 		mv -f "$SCOREFILE" "$SCOREFILE".dpkg-old
diff --git a/debian/postrm b/debian/postrm
index 036eeef..08f1132 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -7,33 +7,15 @@ case "$1" in
     purge)
         SCOREFILE="/var/games/greed/greed.hs"
         OLDSCOREFILE="/var/games/greed/greed.hs.dpkg-old"
-        NEWSCOREFILE="/var/games/greed/greed.hs.dpkg-new"
         if [ -f $SCOREFILE ]; then
             rm -rf $SCOREFILE
         fi
         if [ -f $OLDSCOREFILE ]; then
             rm -rf $OLDSCOREFILE
         fi
-        if [ -f $NEWSCOREFILE ]; then
-            rm -rf $NEWSCOREFILE
-        fi
     ;;
-    upgrade)
-        SCOREFILE="/var/games/greed/greed.hs"
-        if [ "$2" != "" ]; then
-            # Old score files are now incompatible
-            if dpkg --compare-versions "$2" lt "3.7-1"; then
-		if [ -f $SCOREFILE ]; then
-		    echo -n "Preserving user scores to $SCOREFILE.dpkg-new..."
-		    mv -f "$SCOREFILE" "$SCOREFILE".dpkg-new
-                    chown root:games "$SCOREFILE".dpkg-new
-                    chmod 664 "$SCOREFILE".dpkg-new
-		    echo "done."
-		fi
-	    fi
-        fi
-    ;;
-    remove|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
     ;;
 
     *)

-- 
Debian package of greed



More information about the Pkg-games-commits mailing list