Fix generating terminfo on NetBSD

This commit is contained in:
pagedown 2022-03-16 09:15:31 +08:00
parent 576ab24609
commit d3472966d3
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB

View File

@ -137,7 +137,13 @@ def compile_terminfo(base):
if not tic: if not tic:
return return
tname = '.terminfo' tname = '.terminfo'
q = os.path.join(base, tname, '78', 'xterm-kitty')
if not os.path.exists(q):
os.makedirs(os.path.dirname(q), exist_ok=True)
os.symlink('../x/xterm-kitty', q)
if os.path.exists('/usr/share/misc/terminfo.cdb'): if os.path.exists('/usr/share/misc/terminfo.cdb'):
# NetBSD requires this
os.symlink('../../.terminfo.cdb', os.path.join(base, tname, 'x', 'xterm-kitty'))
tname += '.cdb' tname += '.cdb'
os.environ['TERMINFO'] = os.path.join(HOME, tname) os.environ['TERMINFO'] = os.path.join(HOME, tname)
p = subprocess.Popen( p = subprocess.Popen(
@ -148,10 +154,6 @@ def compile_terminfo(base):
if rc != 0: if rc != 0:
getattr(sys.stderr, 'buffer', sys.stderr).write(p.stdout) getattr(sys.stderr, 'buffer', sys.stderr).write(p.stdout)
raise SystemExit('Failed to compile the terminfo database') raise SystemExit('Failed to compile the terminfo database')
q = os.path.join(base, tname, '78', 'xterm-kitty')
if not os.path.exists(q):
os.makedirs(os.path.dirname(q), exist_ok=True)
os.symlink('../x/xterm-kitty', q)
def iter_base64_data(f): def iter_base64_data(f):