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

pmake: diff for NMU version 1.111-1.1



tags 493839 + patch
tags 547459 + patch
thanks

Dear Sam,

I have prepared a patch to a four-year untouched package which would
probably not have built cleanly these days anyway. The main new feature
is support for hurd-i386 (although this is done as a kludge; I’d do it
properly if we were to re-base onto a current version of nbmake, or even
(I know quite a lot of NetBSD® developers) push that upstream), but I’ve
also fixed a few other problems and another bug during that.

My intention is to ask a DD (as I’m only a DM myself) for an NMU if there
is no reply within “a while” (I’m leaving this unspecified but have CC’d
the hurd port maintainers to this), because e.g. makefs cannot be built on
hurd-i386 currently only for the lack of pmake.

I’ve verified it builds on a sid (i386) schroot, as well as some unknown
hurd-i386 version on gnubber.bddebian.org (luckily it’s up right now),
but not whether makefs can indeed be built with it, because I cannot in-
stall packages on gnubber.

diff -u pmake-1.111/mk/sys.mk pmake-1.111/mk/sys.mk
--- pmake-1.111/mk/sys.mk
+++ pmake-1.111/mk/sys.mk
@@ -1,7 +1,7 @@
 #	$NetBSD: sys.mk,v 1.54 1999/03/10 14:06:14 mycroft Exp $
 #	@(#)sys.mk	8.2 (Berkeley) 3/21/94
 
-unix?=		We run NetBSD.
+unix?=		We run Debian GNU.
 
 .SUFFIXES: .out .a .ln .o .s .S .c .cc .C .F .f .r .y .l .cl .p .h .sh .m4
 
diff -u pmake-1.111/main.c pmake-1.111/main.c
--- pmake-1.111/main.c
+++ pmake-1.111/main.c
@@ -636,6 +636,17 @@
 	char found_path[MAXPATHLEN + 1];	/* for searching for sys.mk */
 	struct timeval rightnow;		/* to initialize random seed */
 
+#ifdef MAXPATHLEN_UNDEFINED
+	if (sysconf(_PC_PATH_MAX) > MAXPATHLEN) {
+		fprintf(stderr, "This operating system runs with "
+		    "sysconf(_PC_PATH_MAX) > MAXPATHLEN\n(%ld > %ld). "
+		    "Please change the guesstimated value at the bottom\n"
+		    "of 'make.h' and recompile, or reduce the actual "
+		    "value.\n", sysconf(_PC_PATH_MAX), (long)MAXPATHLEN);
+		return (255);
+	}
+#endif
+
 	/*
 	 * Set the seed to produce a different random sequences
 	 * on each program execution.
diff -u pmake-1.111/debian/changelog pmake-1.111/debian/changelog
--- pmake-1.111/debian/changelog
+++ pmake-1.111/debian/changelog
@@ -1,3 +1,20 @@
+pmake (1.111-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Port to hurd-i386 (Closes: #547459)
+    - make.h: define MAXPATHLEN if not defined (XXX kludge)
+    - main.c: check sysconf(_PC_PATH_MAX) and bail out if larger than
+      the defined kludge value; inform the user appropriately
+    I’m doing it this way because this codebase is ancient, and to
+    really fix this issue is not worth the effort. No activity in
+    more than four years speaks for itself.
+  * mk/sys.mk: We do not run NetBSD® but Debian. (Closes: #493839)
+  * debian/rules: Replace 「dpkg --print-gnu-build-architecture」 with
+    「dpkg-architecture -qDEB_BUILD_ARCH_CPU」 to unbreak build.
+  * debian/rules: Use -Wno-unused to clean up build messages.
+
+ -- Thorsten Glaser <tg@mirbsd.de>  Sat, 24 Oct 2009 21:01:40 +0000
+
 pmake (1.111-1) unstable; urgency=low
 
   * New upstream snapshot.
diff -u pmake-1.111/debian/rules pmake-1.111/debian/rules
--- pmake-1.111/debian/rules
+++ pmake-1.111/debian/rules
@@ -2,12 +2,12 @@
 
 #export DH_VERBOSE=1
 
-ARCH=$(shell dpkg --print-gnu-build-architecture)
+ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
 CFLAGS="-O2  -g -Wall -D__COPYRIGHT\(x\)= -D__RCSID\(x\)= \
 	-I. -DMACHINE=\\\"debian\\\" -DMACHINE_ARCH=\\\"${ARCH}\\\" \
 	-DHAVE_SETENV -DHAVE_STRERROR -DHAVE_STRDUP -DHAVE_STRFTIME \
 	-DHAVE_VSNPRINTF \
-	-D_GNU_SOURCE"
+	-D_GNU_SOURCE -Wno-unused"
 
 build: build-stamp
 build-stamp:
only in patch2:
unchanged:
--- pmake-1.111.orig/make.h
+++ pmake-1.111/make.h
@@ -476,4 +476,10 @@
 #define MAX(a, b) ((a > b) ? a : b)
 #endif
 
+/* maybe Debian GNU/HURD */
+#ifndef MAXPATHLEN
+#define MAXPATHLEN	4096	/* some sensible value */
+#define MAXPATHLEN_UNDEFINED	/* triggers check in main.c */
+#endif
+
 #endif /* _MAKE_H_ */


Reply to: