[SCM] Installer for game data files branch, quake, updated. ea4ca96eb7b2abe5aca780baea5a43c500f581c8

Stephen Kitt steve at sk2.org
Thu Apr 14 22:25:22 UTC 2011


The following commit has been merged in the quake branch:
commit ea4ca96eb7b2abe5aca780baea5a43c500f581c8
Author: Stephen Kitt <steve at sk2.org>
Date:   Fri Apr 15 00:23:35 2011 +0200

    Use common methods.
    Support version 1.06 registered data when importing a Quake installation.
    Mention alternate MD5 sums for SoA.

diff --git a/supported/quake b/supported/quake
index e2abf14..66ea3b2 100644
--- a/supported/quake
+++ b/supported/quake
@@ -132,6 +132,11 @@ cdrom_method() {
     
     pak0="$WORKDIR/id1/pak0.pak"
     pak1="$WORKDIR/id1/pak1.pak"
+    # This CD contains version 1.01
+    pak0sum=85fc9cee2035b66290da1e33be2ac86b
+    pak1sum=d76b3e5678f0b64ac74ce5e340e6a685
+    suffix=registered
+    folder=id1
     common_method
 }
 
@@ -139,6 +144,11 @@ dir_method() {
     # XXX: do clever things with case etc. here
     pak0="$mountpoint/id1/pak0.pak"
     pak1="$mountpoint/id1/pak1.pak"
+    # Presume the directory contains version 1.06
+    pak0sum=5906e5998fc3d896ddaf5e6a62e03abb
+    pak1sum=d76b3e5678f0b64ac74ce5e340e6a685
+    suffix=registered
+    folder=id1
     common_method
 }
 
@@ -154,55 +164,58 @@ swzip_method() {
     )
     pak0="$WORKDIR/id1/pak0.pak"
     pak1=""
-    # XXX: concerned that the pak0 in SW has a different sum
-    verify_file   "$pak0"
-    verify_md5sum "$pak0" 5906e5998fc3d896ddaf5e6a62e03abb
+
+    # Presume the shareware version is 1.06
+    pak0sum=5906e5998fc3d896ddaf5e6a62e03abb
+    suffix=shareware
+    folder=id1
     common_method
 }
 
 mp1_method() {
     pak0="$mountpoint/hipnotic/pak0.pak"
-    pak0sum=f05b7452ae725e060fb3d14f7731fb00
-    verify_md5sum "$pak0" "$pak0sum"
-
-    DEBBASE="quake-armagon_${GAME_PACKAGE_VERSION}_all.deb"
-    OUTFILE=`unravel "$OUTDIR"`"/$DEBBASE"
-    cp -p "$DATADIR/$DEBBASE" "$OUTFILE"
-
-    slipstream "$OUTFILE" "usr/share/games/quake/hipnotic/" "$pak0"
+# MD5 sum for original CD version
+    pak0sum=0ab83681aaf841c4320269e02941a14a
+# MD5 sum for glQuake-compatible version (see
+# http://speeddemosarchive.com/quake/qdq/movies/sds.html for more
+# info)
+#    pak0sum=f05b7452ae725e060fb3d14f7731fb00
+    pak1=""
+    suffix=armagon
+    folder=hipnotic
+    common_method
 }
 
 mp2_method() {
     pak0="$mountpoint/rogue/pak0.pak"
     pak0sum=f8898a483b131de21581656c94f3c1a4
-    verify_md5sum "$pak0" "$pak0sum"
-
-    DEBBASE="quake-dissolution_${GAME_PACKAGE_VERSION}_all.deb"
-    OUTFILE=`unravel "$OUTDIR"`"/$DEBBASE"
-    cp -p "$DATADIR/$DEBBASE" "$OUTFILE"
-
-    slipstream "$OUTFILE" "usr/share/games/quake/rogue/" "$pak0"
+    pak1=""
+    suffix=dissolution
+    folder=rogue
+    common_method
 }
 
+# Requires the following variables on entry:
+# pak0 - full path of the pak0.pak file to include
+# pak0sum - expected MD5 sum
+# pak1 - full path of the pak1.pak file to include (optional)
+# pak1sum - expected MD5 sum
+# suffix - package suffix to use
+# folder - base folder for the PAK files
 common_method() {
-    pak0sum=85fc9cee2035b66290da1e33be2ac86b
-    pak1sum=d76b3e5678f0b64ac74ce5e340e6a685
-    # XXX: can't verify sw pak0 with this sum, see above
-    [ "$method" = "swzip" ] || verify_md5sum "$pak0" "$pak0sum"
-    [ "$method" = "swzip" ] || verify_md5sum "$pak1" "$pak1sum"
+    verify_file "$pak0"
+    verify_md5sum "$pak0" "$pak0sum"
+    [ "$pak1" = "" ] || verify_file "$pak1"
+    [ "$pak1" = "" ] || verify_md5sum "$pak1" "$pak1sum"
 
-    DEBBASE="quake-registered_${GAME_PACKAGE_VERSION}_all.deb"
-    [ "$method" != "swzip" ] || \
-        DEBBASE="quake-shareware_${GAME_PACKAGE_VERSION}_all.deb"
+    DEBBASE="quake-${suffix}_${GAME_PACKAGE_VERSION}_all.deb"
     OUTFILE=`unravel "$OUTDIR"`"/$DEBBASE"
     cp -p "$DATADIR/$DEBBASE" "$OUTFILE"
 
-    if [ "$method" = "swzip" ]; then
-        slipstream "$OUTFILE" "usr/share/games/quake/id1/" "$pak0"
-        rm "$pak0"
+    if [ "$pak1" = "" ]; then
+        slipstream "$OUTFILE" "usr/share/games/quake/${folder}/" "$pak0"
     else
-        slipstream "$OUTFILE" "usr/share/games/quake/id1/" "$pak0" "$pak1"
-        rm "$pak0" "$pak1"
+        slipstream "$OUTFILE" "usr/share/games/quake/${folder}/" "$pak0" "$pak1"
     fi
-    rmdir "$WORKDIR/id1"
+    [ -d "$WORKDIR/${folder}" ] && rm -rf "$WORKDIR/${folder}"
 }

-- 
Installer for game data files



More information about the Pkg-games-commits mailing list