pakhandler.py 498 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. import piksemel
  3. import subprocess
  4. def updateCache(filepath):
  5. doc = piksemel.parse(filepath)
  6. for item in doc.tags("File"):
  7. path = item.getTagData("Path")
  8. if path.startswith("usr/share/fonts"):
  9. subprocess.call(["/usr/bin/fc-cache"])
  10. return
  11. def setupPackage(metapath, filepath):
  12. updateCache(filepath)
  13. def cleanupPackage(metapath, filepath):
  14. pass
  15. def postCleanupPackage(metapath, filepath):
  16. updateCache(filepath)