pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/games/nethack-lib Further improve the nethack launch s...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f54a30051654
branches:  trunk
changeset: 534608:f54a30051654
user:      pooka <pooka%pkgsrc.org@localhost>
date:      Sat Oct 27 18:26:34 2007 +0000

description:
Further improve the nethack launch script to autodetect which UIs
are installed and run an installed one instead of insisting that
nethack-tty must always be installed.  nethack-tty is still naturally
preferred as the default instead of cheap plastic imitations such
as nethack-x11.

diffstat:

 games/nethack-lib/distinfo         |   4 ++--
 games/nethack-lib/patches/patch-ad |  26 +++++++++++++++++++++-----
 2 files changed, 23 insertions(+), 7 deletions(-)

diffs (61 lines):

diff -r 9c653da95626 -r f54a30051654 games/nethack-lib/distinfo
--- a/games/nethack-lib/distinfo        Sat Oct 27 18:07:54 2007 +0000
+++ b/games/nethack-lib/distinfo        Sat Oct 27 18:26:34 2007 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.14 2007/10/27 18:07:54 pooka Exp $
+$NetBSD: distinfo,v 1.15 2007/10/27 18:26:34 pooka Exp $
 
 SHA1 (nethack-343-src.tgz) = c26537093c38152bc0fbcec20468d975b35f59fd
 RMD160 (nethack-343-src.tgz) = 42f600d24715a0b7e631b357c135761410b3ca95
@@ -6,7 +6,7 @@
 SHA1 (patch-aa) = ed5c55651acf81c459867c99026e13a6c5ed34a0
 SHA1 (patch-ab) = 73a1ac287ded70f371bb38c82cdbcd36182ce3a5
 SHA1 (patch-ac) = e447b4c60ef7db7cfcd35a9be8b8d2f86fc0c27b
-SHA1 (patch-ad) = bee0bd8263bac8cffa0bed84e199d0d2c2a80e9a
+SHA1 (patch-ad) = 05bb391eb0e4382c906251bc8b8627124873a7a0
 SHA1 (patch-ae) = a72da6e6bd1af3a8eaed97ecc1fdd1ed4198a5db
 SHA1 (patch-af) = e4723716f326df242279953b6091e528eb7e0007
 SHA1 (patch-ag) = 6aeae6bde079b9c9081f6e32523687010c9bc674
diff -r 9c653da95626 -r f54a30051654 games/nethack-lib/patches/patch-ad
--- a/games/nethack-lib/patches/patch-ad        Sat Oct 27 18:07:54 2007 +0000
+++ b/games/nethack-lib/patches/patch-ad        Sat Oct 27 18:26:34 2007 +0000
@@ -1,18 +1,34 @@
-$NetBSD: patch-ad,v 1.6 2007/10/27 18:07:54 pooka Exp $
+$NetBSD: patch-ad,v 1.7 2007/10/27 18:26:34 pooka Exp $
 
---- sys/unix/nethack.sh.orig   2003-08-30 03:08:04.000000000 +0300
-+++ sys/unix/nethack.sh        2003-09-02 02:52:31.000000000 +0300
-@@ -1,9 +1,15 @@
+--- sys/unix/nethack.sh.orig   2003-12-08 00:39:13.000000000 +0100
++++ sys/unix/nethack.sh        2007-10-27 20:18:37.000000000 +0200
+@@ -1,9 +1,31 @@
  #!/bin/sh
  #     SCCS Id: @(#)nethack.sh 3.4     1990/02/26
  
 -HACKDIR=/usr/games/lib/nethackdir
++UILIST="tty x11 qt" 
++findbin ()
++{
++      for x in $UILIST; do
++              if [ -x XXXPREFIXXXX/bin/nethack-$x ]; then
++                      echo $x
++                      return
++              fi
++      done
++}
++
 +if [ -z "$1" -o -z "${1%%-*}" ]; then
-+      TTY=tty
++      TTY=`findbin`
 +else
 +      TTY=$1
 +fi
 +
++if [ -z "$TTY" ]; then
++      echo "No UI ($UILIST) found"
++      exit 1
++fi
++
 +HACKDIR=XXXPREFIXXXX/share/nethackdir340
  export HACKDIR
 -HACK=$HACKDIR/nethack



Home | Main Index | Thread Index | Old Index