avahi-daemon-package.py 556 B

1234567891011121314151617181920
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import shutil
  5. ownerships = {
  6. "/run/avahi-daemon" : "avahi:avahi",
  7. }
  8. def postInstall(fromVersion, fromRelease, toVersion, toRelease):
  9. for directory,owners in ownerships.items():
  10. if os.path.exists(directory):
  11. os.system("/bin/chown %s %s" % (owners, directory))
  12. if os.path.exists("/etc/localtime"):
  13. if not os.path.isdir("/etc/avahi/etc"):
  14. os.makedirs("/etc/avahi/etc")
  15. shutil.copy("/etc/localtime", "/etc/avahi/etc/localtime")