[Pkg-nethack-devel] nethack/debian/patches 15_recover_errormsg.dpatch,NONE,1.1 16_pixmapdir.dpatch,NONE,1.1 00list,1.8,1.9 14_common_config.dpatch,1.1,1.2

Joshua Kwan joshk-guest@quantz.debian.org
Thu, 23 Oct 2003 05:23:36 +0000


Update of /cvsroot/pkg-nethack/nethack/debian/patches
In directory quantz:/tmp/cvs-serv19981/debian/patches

Modified Files:
	00list 14_common_config.dpatch 
Added Files:
	15_recover_errormsg.dpatch 16_pixmapdir.dpatch 
Log Message:
Oof, too much stuff landing at once, please test! See debian/changelog
for all the details.


--- NEW FILE: 16_pixmapdir.dpatch ---
#! /bin/sh -e
## 16_pixmapdir.dpatch by Joshua Kwan <joshk@triplehelix.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Use /usr/share/pixmaps/nethack/ for pretty pictures.

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1;;
esac

exit 0

--- nethack/win/Qt/qt_win.cpp~	2003-10-22 21:25:09.000000000 -0700
+++ nethack/win/Qt/qt_win.cpp	2003-10-22 21:29:31.000000000 -0700
@@ -3177,7 +3177,7 @@
 {
     if (!pixmap) {
 	pixmap=new QPixmap;
-	tryload(*pixmap, "rip.xpm");
+	tryload(*pixmap, PIXMAPDIR "rip.xpm");
     }
     riplines=0;
     resize(pixmap->width(),pixmap->height());
@@ -4286,7 +4286,7 @@
 	tile_file = iflags.wc_tile_file;
 
     if (!img.load(tile_file)) {
-	tile_file = "x11tiles";
+	tile_file = PIXMAPDIR "x11tiles";
 	if (!img.load(tile_file)) {
 	    QString msg;
 	    msg.sprintf("Cannot load x11tiles or nhtiles.bmp");
--- nethack/win/X11/winX.c~	2003-10-22 21:15:53.000000000 -0700
+++ nethack/win/X11/winX.c	2003-10-22 21:16:08.000000000 -0700
@@ -919,12 +919,12 @@
     { "message_lines", "Message_lines", XtRInt, sizeof(int),
       XtOffset(AppResources *,message_lines), XtRString, "12" },
     { "pet_mark_bitmap", "Pet_mark_bitmap", XtRString, sizeof(String),
-      XtOffset(AppResources *,pet_mark_bitmap), XtRString, "pet_mark.xbm" },
+      XtOffset(AppResources *,pet_mark_bitmap), XtRString, PIXMAPDIR "pet_mark.xbm" },
     { "pet_mark_color", "Pet_mark_color", XtRPixel, sizeof(XtRPixel),
       XtOffset(AppResources *,pet_mark_color), XtRString, "Red" },
 #ifdef GRAPHIC_TOMBSTONE
     { "tombstone", "Tombstone", XtRString, sizeof(String),
-      XtOffset(AppResources *,tombstone), XtRString, "rip.xpm" },
+      XtOffset(AppResources *,tombstone), XtRString, PIXMAPDIR "rip.xpm" },
     { "tombtext_x", "Tombtext_x", XtRInt, sizeof(int),
       XtOffset(AppResources *,tombtext_x), XtRString, "155" },
     { "tombtext_y", "Tombtext_y", XtRInt, sizeof(int),
--- nethack/win/gnome/gnbind.c~	2003-10-22 21:20:43.000000000 -0700
+++ nethack/win/gnome/gnbind.c	2003-10-22 21:20:49.000000000 -0700
@@ -7,6 +7,8 @@
  * code in the Gnome port and the rest of the nethack game engine. 
 */
 
+#include "config.h"
+
 #include "gnbind.h"
 #include "gnmain.h"
 #include "gnaskstr.h"
@@ -97,7 +97,7 @@
 
 #ifdef HACKDIR
     //if (ghack_init_glyphs(HACKDIR "/t32-1024.xpm"))
-    if (ghack_init_glyphs(HACKDIR "/x11tiles"))
+    if (ghack_init_glyphs(PIXMAPDIR "/x11tiles"))
       g_error ("ERROR:  Could not initialize glyphs.\n");
 #else
 #   error HACKDIR is not defined!
--- nethack/win/gnome/gnopts.c~	2003-10-22 21:21:01.000000000 -0700
+++ nethack/win/gnome/gnopts.c	2003-10-22 21:21:20.000000000 -0700
@@ -97,13 +97,13 @@
 	case 0:
 	    /* They selected traditional */
 	    ghack_free_glyphs();
-	    if (ghack_init_glyphs(HACKDIR "/x11tiles"))
+	    if (ghack_init_glyphs(PIXMAPDIR "/x11tiles"))
 		      g_error ("ERROR:  Could not initialize glyphs.\n");
 	    ghack_reinit_map_window();
 	    break;
 	case 1:
 	    ghack_free_glyphs();
-	    if (ghack_init_glyphs(HACKDIR "/t32-1024.xpm"))
+	    if (ghack_init_glyphs(PIXMAPDIR "/t32-1024.xpm"))
 		      g_error ("ERROR:  Could not initialize glyphs.\n");
 	    ghack_reinit_map_window();
 
--- nethack/win/gnome/gnmap.c~	2003-10-22 21:57:08.000000000 -0700
+++ nethack/win/gnome/gnmap.c	2003-10-22 21:57:20.000000000 -0700
@@ -179,7 +179,7 @@
 		    NULL) );
 
   /* Tile the map background with a pretty image */ 
-  background = gdk_imlib_load_image((char *) "mapbg.xpm");
+  background = gdk_imlib_load_image((char *) PIXMAPDIR "mapbg.xpm");
   if (background == NULL) {
       g_warning("Bummer! Failed to load the map background image (mapbg.xpm)!");
   }

Index: 00list
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/debian/patches/00list,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- 00list	16 Oct 2003 06:26:34 -0000	1.8
+++ 00list	23 Oct 2003 05:23:33 -0000	1.9
@@ -11,6 +11,8 @@
 12_lisp_windowing
 13_qt_warning_fixes
 14_common_config
+15_recover_errormsg
+16_pixmapdir
 90_enh_hpmon
 91_enh_menucolors
 92_enh_paranoid_hit

--- NEW FILE: 15_recover_errormsg.dpatch ---
#! /bin/sh -e
## 15_recover_errormsg.dpatch by Joshua Kwan <joshk@triplehelix.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Be a little bit more useful with recover's error messages

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1;;
esac

exit 0

--- nethack/util/recover.c~	2003-10-18 16:08:36.000000000 -0700
+++ nethack/util/recover.c	2003-10-18 16:18:46.000000000 -0700
@@ -39,7 +39,7 @@
 #define Fprintf	(void)nhce_message
 static void nhce_message(FILE*, const char*, ...);
 #endif
-
+#define Perror  (void)perror
 #define Close	(void)close
 
 #ifdef UNIX
@@ -65,6 +65,7 @@
 #endif
 char savename[SAVESIZE]; /* holds relative path of save file from playground */
 
+const char *dir = (char*)0;
 
 int
 main(argc, argv)
@@ -72,7 +73,6 @@
 char *argv[];
 {
 	int argno;
-	const char *dir = (char *)0;
 #ifdef AMIGA
 	char *startdir = (char *)0;
 #endif
@@ -138,7 +138,8 @@
 	startdir = getcwd(0,255);
 #endif
 	if (dir && chdir((char *) dir) < 0) {
-		Fprintf(stderr, "%s: cannot chdir to %s.\n", argv[0], dir);
+		Fprintf(stderr, "%s: cannot chdir:", argv[0]);
+                Perror(dir);
 		exit(EXIT_FAILURE);
 	}
 
@@ -275,7 +276,9 @@
 	  	Fprintf(stderr,
 			"\nTrouble accessing level 0 (errno = %d).\n", errno);
 #endif
-	    Fprintf(stderr, "Cannot open level 0 for %s.\n", basename);
+	    Fprintf(stderr, "Cannot open level 0 for %s in directory %s: ",
+                basename, dir);
+            Perror(lock);
 	    return(-1);
 	}
 	if (read(gfd, (genericptr_t) &hpid, sizeof hpid) != sizeof hpid) {
@@ -297,7 +300,8 @@
 		!= sizeof savename) ||
 	    (read(gfd, (genericptr_t) &version_data, sizeof version_data)
 		!= sizeof version_data)) {
-	    Fprintf(stderr, "Error reading %s -- can't recover.\n", lock);
+	    Fprintf(stderr, "Error reading, can't recover: ");
+            Perror(lock);
 	    Close(gfd);
 	    return(-1);
 	}
@@ -310,14 +314,16 @@
 	 */
 	sfd = create_savefile();
 	if (sfd < 0) {
-	    Fprintf(stderr, "Cannot create savefile %s.\n", savename);
+	    Fprintf(stderr, "Cannot create savefile in %s: ", dir);
+            Perror(savename);
 	    Close(gfd);
 	    return(-1);
 	}
 
 	lfd = open_levelfile(savelev);
 	if (lfd < 0) {
-	    Fprintf(stderr, "Cannot open level of save for %s.\n", basename);
+	    Fprintf(stderr, "Cannot open level of save for %s: ", basename);
+            Perror(lock);
 	    Close(gfd);
 	    Close(sfd);
 	    return(-1);
@@ -325,7 +331,8 @@
 
 	if (write(sfd, (genericptr_t) &version_data, sizeof version_data)
 		!= sizeof version_data) {
-	    Fprintf(stderr, "Error writing %s; recovery failed.\n", savename);
+	    Fprintf(stderr, "Error writing, recovery failed: ");
+            Perror(savename);
 	    Close(gfd);
 	    Close(sfd);
 	    return(-1);

Index: 14_common_config.dpatch
===================================================================
RCS file: /cvsroot/pkg-nethack/nethack/debian/patches/14_common_config.dpatch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- 14_common_config.dpatch	12 Oct 2003 06:41:17 -0000	1.1
+++ 14_common_config.dpatch	23 Oct 2003 05:23:33 -0000	1.2
@@ -57,7 +57,7 @@
  # define USE_XPM		/* Use XPM format for images (required) */
  # define GRAPHIC_TOMBSTONE	/* Use graphical tombstone (rip.ppm) */
  # ifndef DEFAULT_WINDOW_SYS
-@@ -124,7 +130,7 @@
+@@ -124,7 +131,7 @@
   * would allow:
   *  xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
   */
@@ -130,12 +130,13 @@
  #  endif
  # endif
  
-@@ -216,7 +220,7 @@
+@@ -216,7 +220,8 @@
   * since the user might create files in a directory of his choice.
   * Of course SECURE is meaningful only if HACKDIR is defined.
   */
 -/* #define SECURE */	/* do setuid(getuid()) after chdir() */
 +#define SECURE	/* do setuid(getuid()) after chdir() */
++#define PIXMAPDIR "/usr/share/pixmaps/nethack/"
  
  /*
   * If it is desirable to limit the number of people that can play Hack