#!/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)