#!/usr/bin/env python3 """Poprawki: cups (useradd -u lp -> -g lpadmin), sbc (--disable-tester). Pliki LF.""" def patch(path, old, new): with open(path, encoding='utf-8', newline='') as f: content = f.read() if old not in content: print("NIE ZNALEZIONO w %s" % path) return False content = content.replace(old, new, 1) with open(path, 'w', encoding='utf-8', newline='') as f: f.write(content) print("OK:", path) return True patch('recipes/gui/cups/PAGBUILD.yaml', ' useradd -c "Printer Service User" -d /var/spool/cups \\\n -u $IDN -g $UN -s /bin/false -u $UN', ' useradd -c "Printer Service User" -d /var/spool/cups \\\n -u $IDN -g $SN -s /bin/false') patch('recipes/utils/sbc/PAGBUILD.yaml', ' ./configure --prefix=/usr \\\n --disable-static', ' ./configure --prefix=/usr \\\n --disable-static \\\n --disable-tester')