Filter tic output to remove "older tic versions may treat the description field as an alias"

This commit is contained in:
Luflosi 2018-10-15 17:17:03 +02:00
parent 093c05e16a
commit f08f0f9dbd
No known key found for this signature in database
GPG Key ID: 14140F703B7D8362

View File

@ -599,7 +599,11 @@ def package(args, for_bundle=False, sh_launcher=False):
for x in (libdir, os.path.join(ddir, 'share')):
odir = os.path.join(x, 'terminfo')
safe_makedirs(odir)
subprocess.check_call(['tic', '-x', '-o' + odir, 'terminfo/kitty.terminfo'])
proc = subprocess.run(['tic', '-x', '-o' + odir, 'terminfo/kitty.terminfo'], check=True, text=True, stderr=subprocess.PIPE)
regex = '^"terminfo/kitty.terminfo", line [0-9]+, col [0-9]+, terminal \'xterm-kitty\': older tic versions may treat the description field as an alias$'
err_msg = proc.stderr.rstrip()
if not re.match(regex, err_msg):
print(err_msg, file=sys.stderr)
if not glob.glob(os.path.join(odir, '*/xterm-kitty')):
raise SystemExit('tic failed to output the compiled kitty terminfo file')
shutil.copy2('__main__.py', libdir)