From owner-freebsd-bugs@FreeBSD.ORG Sun Apr 24 01:50:27 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EAB216A4CE for ; Sun, 24 Apr 2005 01:50:27 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36C6843D31 for ; Sun, 24 Apr 2005 01:50:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3O1oQKl044510 for ; Sun, 24 Apr 2005 01:50:26 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3O1oQ0c044507; Sun, 24 Apr 2005 01:50:26 GMT (envelope-from gnats) Date: Sun, 24 Apr 2005 01:50:26 GMT Message-Id: <200504240150.j3O1oQ0c044507@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Evans Subject: Re: bin/80256: /rescue/vi doesn't work without terminal database in /usr X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bruce Evans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2005 01:50:27 -0000 The following reply was made to PR bin/80256; it has been noted by GNATS. From: Bruce Evans To: "Simon L. Nielsen" Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/80256: /rescue/vi doesn't work without terminal database in /usr Date: Sun, 24 Apr 2005 11:40:39 +1000 (EST) On Sat, 23 Apr 2005, Simon L. Nielsen wrote: > On 2005.04.23 17:19:17 +0200, Brian Candler wrote: > > I do note however from ncurses(3X): > >=20 > > If the ncurses library has been configured with termcap sup= > port, > > ncurses will check for a terminal's description in termcap fo= > rm if > > it is not available in the terminfo database. > >=20 > > This suggests a very simple solution (untested): > >=20 > > --- lib/libncurses/pathnames.h.orig Sat Apr 23 17:17:01 2005 > > +++ lib/libncurses/pathnames.h Sat Apr 23 17:17:13 2005 > > @@ -34,5 +34,5 @@ > > * $FreeBSD: src/lib/libncurses/pathnames.h,v 1.1 1999/08/30 07:57:50 pe= > ter Exp $ > > */ > > =20 > > -#define _PATH_DEF ".termcap /usr/share/misc/termcap" > > +#define _PATH_DEF ".termcap /usr/share/misc/termcap /rescue/termcap" > > #define _PATH_DEF_SEC "/usr/share/misc/termcap" > >=20 > > and then bundle a few termcap entries in /rescue/termcap. Is there any > > reason why that couldn't be done? > > Without knowing how the code in question works, that does sounds like > a simple way to get working vi in a rescue environment. Why not use the normal mechanism? Environment variables exist so that you don't have to hard-code paths into utilities. From environ(7): %%% TERMCAP The string describing the terminal in TERM, or, if it begins with a '/', the name of the termcap file. See TERMPATH below, and termcap(5). TERMPATH A sequence of pathnames of termcap files, separated by colons or spaces, which are searched for terminal descrip- tions in the order listed. Having no TERMPATH is equivalent to a TERMPATH of ``$HOME/.termcap:/etc/termcap''. TERMPATH is ignored if TERMCAP contains a full pathname. %%% Or you can use ".termcap" (maybe using a special $HOME for rescue) without changing ther defaults. There is also some documentation of TERMCAP and TERMPATH in termcap(5). This gives a few less details than the above, and points to termcap(3). termcap(3) used to have a few more details than the above, but has rotted and now doesn't say anything about the environment variables. The details are still in the Attic (libterm/Attic/termcap.3,v). Bruce