Files

22 lines
1.0 KiB
Python

#!/usr/bin/env python3
"""Assign each private Frameworks/provider file to one runtime or dev package."""
import json
from pathlib import Path
def development(path,policy):
return False
if __name__=='__main__':
policy=json.loads(Path('debian/package-policy.json').read_text());root=Path('debian/tmp')
groups={name:[] for name in policy['packages']};base='plasma-next-'+policy['module']
for p in sorted(root.rglob('*')):
if not p.is_symlink() and not p.is_file():continue
path=str(p.relative_to(root));key=base+'-dev' if development(path,policy) else base
if key not in groups:raise ValueError('Unexpected package category: '+path)
groups[key].append(path)
for key,files in groups.items():
if not files:raise ValueError('Empty package: '+key)
# Compat 13 substitutes these after splitting fields on whitespace.
escaped=[p.replace('$','${Dollar}').replace(' ','${Space}').replace('\t','${Tab}') for p in files]
Path('debian/'+key+'.install').write_text('\n'.join(escaped)+'\n')