Mercurial > hgrepos > FreeBSD > ports > PyPy
view lang/pypy2/misc/augment_plist.py @ 152:dcc9136b3305
FIX: Remove bogus subdir py-sqlite3 from pypy2-sqlite3
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 14 Jan 2024 22:25:24 +0100 |
| parents | 1c224aaef1af |
| children |
line wrap: on
line source
# -*- coding: utf-8 -*- r"""Augment the current pkg-plist with entries for byte-compiled files. The result is written to stdout. Usage: augment_plist.py INPUT Python """ from __future__ import print_function, absolute_import import io import os import re import sys def main(): infile = sys.argv[1] outlines = [] for line_orig in io.open(infile, encoding="us-ascii"): outlines.append(line_orig) line = line_orig.rstrip() if not line: continue # # NOTE: Sync with the "compileall" installation step in the Makefile # if re.search("/tests?/|tools/make_ssl_data.py", line): continue if line.endswith(".py"): for compiled_suffix in ('c', 'o'): outlines.append( "%%BYTECOMPILE%%{line}{compiled_suffix}\n" .format(line=line, compiled_suffix=compiled_suffix)) for line in outlines: sys.stdout.write(line) if __name__ == "__main__": main()
