mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00

Updates Debian and RPM packages so that /opt/saltstack/salt and the python packages don't have to be owned by salt user. It shouldn't be necessary for salt user, used to run salt-master to be able to write/modify files in that directory hierarchy. Add postinst scripts to call the python compileall module to create byte-compiled python modules. This should preserve performance whilst not requiring write access for salt user. Also cleans up .pyc files and __pycache__ dirs on removal.
5 lines
237 B
Bash
5 lines
237 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
dpkg -L salt-common | perl -ne 's,/([^/]*)\.py$,/__pycache__/\1.*, or next; unlink $_ or die $! foreach glob($_)'
|
|
find /opt/saltstack/salt -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
|