| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
import sys |
| 9 |
from glob import glob |
| 10 |
from os import listdir |
| 11 |
from os.path import basename |
| 12 |
|
| 13 |
|
| 14 |
def installed_headers(binpkg): |
| 15 |
path = f'debian/{binpkg}.install' |
| 16 |
with open(path, encoding='utf-8') as f: |
| 17 |
for line in f: |
| 18 |
if line.startswith('#'): |
| 19 |
continue |
| 20 |
parts = line.split() |
| 21 |
if len(parts) == 2: |
| 22 |
pattern, dest = parts |
| 23 |
elif len(parts) == 3 and parts[1] == '=>': |
| 24 |
pattern, _, dest = parts |
| 25 |
else: |
| 26 |
print(f'Failure to parse {path}: {line}') |
| 27 |
sys.exit(1) |
| 28 |
if dest.rstrip('/') == '/usr/include/pypy3.11': |
| 29 |
for fn in glob(pattern): |
| 30 |
yield basename(fn) |
| 31 |
|
| 32 |
|
| 33 |
installed = ( |
| 34 |
set(installed_headers('pypy3-dev')) |
| 35 |
| set(installed_headers('pypy3'))) |
| 36 |
built_headers = set( |
| 37 |
basename(fn) for fn in listdir('include/pypy3.11') |
| 38 |
if fn.endswith('.h')) |
| 39 |
|
| 40 |
if installed != built_headers: |
| 41 |
if built_headers - installed: |
| 42 |
print("Missing headers:", built_headers - installed) |
| 43 |
if installed - built_headers: |
| 44 |
print("Extra headers:", installed - built_headers) |
| 45 |
sys.exit(1) |