ports/116690: Update port: devel/rlwarp fix broken pty search on devfs
Martin Kammerhofer
dada at pluto.tugraz.at
Thu Sep 27 13:20:07 UTC 2007
>Number: 116690
>Category: ports
>Synopsis: Update port: devel/rlwarp fix broken pty search on devfs
>Confidential: no
>Severity: non-critical
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Sep 27 13:20:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Martin Kammerhofer
>Release: FreeBSD 6.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD Martin.liebt.Susi 6.2-STABLE FreeBSD 6.2-STABLE #0: Sun Aug 19 14:22:22 CEST 2007 toor at Martin.liebt.Susi:/usr/obj/usr/src/sys/P2B-S i386
>Description:
The configure script of the devel/rlwrap port searches for the names
of pseudo terminals. Found /dev/pty?? files are then hard-coded into
the $PREFIX/bin/rlwrap executable.
This does not work well with FreeBSD where /dev/* nodes are
dynamic. The resulting behaviour is highly undesirable: Only pseudo
terminals in use at configure time are considered. If none of those is
free at run time then pseudo tty allocation fails with a fatal error!
The fix is of course to let the binary know about valid pseudo tty
names on FreeBSD, i.e. /dev/[pt]ty[p-sP-S][0-9a-v].
While at it also s/PREFIX/LOCALBASE/ where appropriate.
>How-To-Repeat:
>Fix:
diff -ruN /usr/ports/devel/rlwrap/Makefile devel/rlwrap/Makefile
--- /usr/ports/devel/rlwrap/Makefile 2007-07-23 11:35:45.000000000 +0200
+++ devel/rlwrap/Makefile 2007-09-27 14:23:12.000000000 +0200
@@ -8,6 +8,7 @@
PORTNAME= rlwrap
PORTVERSION= 0.28
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://utopia.knoware.nl/~hlub/uck/rlwrap/
@@ -26,11 +27,11 @@
.if ${OSVERSION} < 500018
# This port requires readline 4.2 or newer, which is only available
# in the base system in FreeBSD 5.x.
-BUILD_DEPENDS+= ${PREFIX}/lib/libreadline.so.5:${PORTSDIR}/devel/readline
+BUILD_DEPENDS+= ${LOCALBASE}/lib/libreadline.so.5:${PORTSDIR}/devel/readline
RUN_DEPENDS+= ${BUILD_DEPENDS}
# Make sure the dynamic linker does not pick up
# the older libreadline library from the base system.
-LDFLAGS+= -rpath ${PREFIX}/lib
+LDFLAGS+= -rpath ${LOCALBASE}/lib
.endif
.include <bsd.port.post.mk>
diff -ruN /usr/ports/devel/rlwrap/files/patch-src::ptytty.c devel/rlwrap/files/patch-src::ptytty.c
--- /usr/ports/devel/rlwrap/files/patch-src::ptytty.c 2005-11-01 11:03:23.000000000 +0100
+++ devel/rlwrap/files/patch-src::ptytty.c 2007-09-27 14:23:12.000000000 +0200
@@ -1,5 +1,5 @@
---- src/ptytty.c.orig Mon Oct 31 16:01:11 2005
-+++ src/ptytty.c Mon Oct 31 16:01:57 2005
+--- src/ptytty.c.orig 2005-10-17 09:36:46.000000000 +0200
++++ src/ptytty.c 2007-09-27 14:12:26.000000000 +0200
@@ -41,7 +41,7 @@
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
@@ -9,3 +9,28 @@
# include <sys/stropts.h> /* for I_PUSH */
#endif
+@@ -159,11 +159,19 @@
+ char pty_name[] = "/dev/pty??";
+ char tty_name[] = "/dev/tty??";
+
+-# ifndef PTYCHAR1
+-# define PTYCHAR1 "pqrstuvwxyz"
+-# endif
+-# ifndef PTYCHAR2
+-# define PTYCHAR2 "0123456789abcdef"
++# ifdef __FreeBSD__
++/* Auto-detected pty names do not work well with devfs! */
++# undef PTYCHAR1
++# define PTYCHAR1 "pqrsPQRS"
++# undef PTYCHAR2
++# define PTYCHAR2 "0123456789abcdefghijklmnopqrstuv"
++# else
++# ifndef PTYCHAR1
++# define PTYCHAR1 "pqrstuvwxyz"
++# endif
++# ifndef PTYCHAR2
++# define PTYCHAR2 "0123456789abcdef"
++# endif
+ # endif
+ for (c1 = PTYCHAR1; *c1; c1++) {
+ pty_name[(sizeof(pty_name) - 3)] =
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list