Bug 97407

Summary: /usr/share/misc/termcap overwritten by installworld
Product: Base System Reporter: Stephen Hurd <shurd>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 6.1-RELEASE   
Hardware: Any   
OS: Any   

Description Stephen Hurd freebsd_committer freebsd_triage 2006-05-17 18:40:19 UTC
After a source upgrade from 6.0 to 6.1, my custom termcap entries were lost.  It didn't occur to me that termcap wasn't *really* in /etc, so mergemaster doesn't handle it.  Definatly violated POLA for me.

Fix: 

Modify mergemaster to handle /usr/share/misc/termcap
How-To-Repeat: Modify your termcap... install world.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2006-05-24 19:01:26 UTC
Responsible Changed
From-To: freebsd-bugs->dougb

Over to maintainer.
Comment 2 Doug Barton freebsd_committer freebsd_triage 2006-05-24 23:37:08 UTC
State Changed
From-To: open->feedback


As I understand it, the canonical way to solve this problem is 
to copy the file to /etc, and make your changes there. Since 
the file in usr/share is installed by installworld, even if 
mergemaster dealt with your changes on a one time basis, 
the next installworld would cause the same problem you saw. 

Does editing a copy of the file in /etc meet your needs?
Comment 3 Stephen Hurd freebsd_committer freebsd_triage 2006-05-25 04:48:08 UTC
> Does editing a copy of the file in /etc meet your needs?
>   
Not unless /usr/share/misc/termcap.db is generated from the symlink in 
/etc in an installworld which (iirc) it isn't.  Editing a copy in /etc 
would be no different from editing a copy in ~root or anywhere else.  
The basic problem is that you need to manually fiddle around after any 
upgrade to get your (for example) Link MC/5 terminals running at 132x43 
working properly again.  They're configured correctly in /etc (gettytab, 
ttys) but every time you do an installworld, you need to manually 
regenerate /usr/share/misc/termcap.db from some other file (which you 
*should* merge with the stock /usr/share/misc/termcap) because every 
single installworld will break any terminal using a non-stock termcap entry.

OTOH, if installworld *does* build termcap.db from /etc, why is the one 
in /usr/share/misc not a symlink to the one in /etc?  I've always 
wondered about that one, but thought that complaining would just be 
bikeshedding... but I have lost at least one painstakingly generated 
termcap entry on my home system from editing via the /etc symlink and 
(much) later upgrading... backing up that directory is even more 
non-obvious than backing up /usr/X11R6/lib/X11/xdm (another one that bit 
me at home, but at least there I *knew* that I edited files in that dir)

But yeah, ideally termcap should live in /etc and if there's some reason 
for it to exist in /usr/share/misc too (one I'm utterly unaware of) then 
the one in /usr/share/misc should be the symlink.  That way, mergemaster 
would Just Work and even us freaks with dumb terminals that have custom 
settings would stay happy.  However, having my terminals keep working 
without needing to have a sticky note somewhere reminding me to restore 
the correct termcap on any installworld is the goal.  I really don't 
care how it's accomplished.  :-)

My opinion is very much that having all your terminals stop working on 
every upgrade unless you perform a manual merging/restoring separate 
from the automated merge is a gross violation of POLA.
  I do, however, understand that I'm the last person in the world using 
dumb terminals with non-standard termcap entries... my settings are odd 
enough that I don't believe that having them included in the stock 
termcap actually makes any sense.
Comment 4 Doug Barton freebsd_committer freebsd_triage 2006-05-25 19:52:24 UTC
State Changed
From-To: feedback->open


What you're asking for is well beyond the scope of what mergemaster 
is really designed to handle. You might want to post something 
on freebsd-questions@freebsd.org about this issue and ask how others 
tackle these problems.  


Comment 5 Doug Barton freebsd_committer freebsd_triage 2006-05-25 19:52:24 UTC
Responsible Changed
From-To: dougb->freebsd-bugs


Not in my area, and I don't have time to tackle this.
Comment 6 ru freebsd_committer freebsd_triage 2007-04-16 22:09:57 UTC
State Changed
From-To: open->closed

This is by design; to make your termcap changes permanent, 
please edit src/share/termcap/termcap.src.  For example, 
I have the following diff locally: 

Index: share/termcap/termcap.src 
=================================================================== 
RCS file: /home/ncvs/src/share/termcap/termcap.src,v 
retrieving revision 1.144 
diff -u -p -r1.144 termcap.src 
--- share/termcap/termcap.src   5 Jun 2004 15:35:14 -0000       1.144 
+++ share/termcap/termcap.src   11 Aug 2006 08:27:27 -0000 
@@ -2805,8 +2805,8 @@ xterm-xfree86|XFree86 xterm: 
:k1=EOP:k2=EOQ:k3=EOR:k4=EOS: 
:k5=E[15~:k6=E[17~:k7=E[18~:k8=E[19~: 
:k9=E[20~:k;=E[21~:F1=E[23~:F2=E[24~: 
-       :kH=EOF:@7=EOF:kI=E[2~: 
-       :kh=EOH:*6=EOF:kP=E[5~:kN=E[6~: 
+       :@7=EOF:kI=E[2~: 
+       :kh=EOH:kP=E[5~:kN=E[6~: 
:ku=EOA:kd=EOB:kr=EOC:kl=EOD:Km=E[M:tc=xterm-basic: 
# 
# This chunk is used for building the VT220/Sun/PC keyboard variants.