pakhandler.py 552 B

1234567891011121314151617181920212223
  1. # -*- coding: utf-8 -*-
  2. import piksemel
  3. import subprocess
  4. def domodules(filepath):
  5. doc = piksemel.parse(filepath)
  6. for item in doc.tags("File"):
  7. path = item.getTagData("Path")
  8. if path.startswith("lib/modules/"):
  9. kernelVersion = path.split("/")[2]
  10. subprocess.call(["/sbin/depmod", "-a", kernelVersion])
  11. return
  12. def setupPackage(metapath, filepath):
  13. domodules(filepath)
  14. def cleanupPackage(metapath, filepath):
  15. pass
  16. def postCleanupPackage(metapath, filepath):
  17. domodules(filepath)