#!/usr/bin/env python3 """Apply ordinary data/script permissions in the private installation prefix.""" from pathlib import Path for p in Path('debian/tmp').rglob('*'): if p.is_symlink() or not p.is_file():continue if p.suffix=='.desktop':p.chmod(0o644) elif p.suffix in ('.py','.sh'): with p.open('rb') as f:head=f.read(128) if head.startswith(b'#!'):p.chmod(0o755) # startplasma invokes this interpreter-less helper through /bin/sh. p=Path('debian/tmp/opt/plasma/libexec/plasma-sourceenv.sh') if p.is_file() and not p.is_symlink():p.chmod(0o644)