[SCM] Classic first person shooter branch, master, updated. fa8e1495fa25557672c8dfc65345b5b9b500fe43

David Banks amoebae at gmail.com
Tue Jun 14 15:36:29 UTC 2011


The following commit has been merged in the master branch:
commit fa8e1495fa25557672c8dfc65345b5b9b500fe43
Author: David Banks <amoebae at gmail.com>
Date:   Tue Jun 14 16:28:24 2011 +0100

    add check for missing data

diff --git a/debian/copyright b/debian/copyright
index 94634ec..ba41bc1 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -9,3 +9,17 @@ Files: quake.png
 Copyright: 2007 Rodney Dawes 
 License: GPL-2
  Please refer to the file '/usr/share/common-licenses/GPL-2' on Debian systems.
+
+Files: need-data.sh
+Copyright:
+  © 2006 Damien Laniel
+  © 2008 Jack Coulter
+  © 2008 Peter Eisentraut
+  © 2010 Simon McVittie
+License: GPL-2+
+  Permission is granted to copy, distribute and/or modify this work under the
+  terms of the GNU General Public License, Version 2, or any later version
+  published by the Free Software Foundation.
+  .
+  On Debian systems, the complete text of the GNU General Public License can
+  be found in /usr/share/common-licenses/GPL-2.
diff --git a/debian/quake.install b/debian/quake.install
index 370fb4d..0ccd393 100644
--- a/debian/quake.install
+++ b/debian/quake.install
@@ -1,3 +1,4 @@
 quake          /usr/games
+need-data.sh   /usr/share/games/quake
 quake.desktop  /usr/share/applications
 quake.xpm      /usr/share/pixmaps
diff --git a/need-data.sh b/need-data.sh
new file mode 100755
index 0000000..69412ae
--- /dev/null
+++ b/need-data.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+TITLE="Quake"
+TEXT="$1"
+
+try_zenity () {
+  if command -v zenity >/dev/null; then
+    zenity --error --text="$TEXT" --title="$TITLE"
+    return 0
+  else
+    return 1
+  fi
+}
+
+try_kdialog () {
+  if command -v kdialog >/dev/null; then
+    kdialog --error --text="$TEXT" --title="$TITLE"
+    return 0
+  else
+    return 1
+  fi
+}
+
+try_xmessage () {
+  if command -v xmessage >/dev/null; then
+    xmessage -center -buttons OK "$TEXT"
+    return 0
+  else
+    return 1
+  fi
+}
+
+case $(echo "$DESKTOP_SESSION" | tr A-Z a-z) in
+  (kde)
+    pref=try_kdialog
+    ;;
+  (gnome)
+    pref=try_zenity
+    ;;
+  (*)
+    pref=false
+    ;;
+esac
+
+$pref || try_zenity || try_kdialog || try_xmessage
+
+printf "%s\n" "$TEXT"
+exit 72         # EX_OSFILE
diff --git a/quake.sh b/quake.sh
index e059cec..22fe0f1 100644
--- a/quake.sh
+++ b/quake.sh
@@ -5,4 +5,10 @@
 data_location=/usr/share/games/quake
 engine_path=/usr/games/quakespasm
 
+no_data_msg="Missing data; see /usr/share/doc/quake/README.Debian"
+
+if ! [ -f "${data_location}/id1/pak0.pak" ]; then
+    exec "$data_location"/need-data.sh "$no_data_msg"
+fi
+
 exec ${engine_path} -basedir ${data_location}

-- 
Classic first person shooter



More information about the Pkg-games-commits mailing list