actions.py 701 B

123456789101112131415161718192021
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file https://www.gnu.org/licenses/gpl-3.0.txt
  6. from pisi.actionsapi import shelltools, pisitools
  7. def setup():
  8. shelltools.cd("dictionaries")
  9. shelltools.system("rename -v - _ *")
  10. for t in shelltools.ls("*"):
  11. shelltools.system("find %s -type f -iname 'index*' | sed -e 'p;s:index:%s:' | xargs -n2 mv" % (t, t))
  12. shelltools.system("find %s -type f -exec chmod 0644 {} \;" % t)
  13. def install():
  14. shelltools.cd("dictionaries")
  15. for t in shelltools.ls("*"):
  16. pisitools.insinto("/usr/share/hunspell", "%s/%s.dic" % (t, t))
  17. pisitools.insinto("/usr/share/hunspell", "%s/%s.aff" % (t, t))