actions.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/copyleft/gpl.txt.
  6. from inary.actionsapi import autotools
  7. from inary.actionsapi import inarytools
  8. from inary.actionsapi import shelltools
  9. from inary.actionsapi import get
  10. WorkDir = "."
  11. ZoneDir = "/usr/share/zoneinfo"
  12. TargetDir = "%s%s" % (get.installDIR(), ZoneDir)
  13. RightDir = "%s/right" % TargetDir
  14. PosixDir = "%s/posix" % TargetDir
  15. timezones = ["etcetera", "southamerica", "northamerica", "europe", "africa", "antarctica", \
  16. "asia", "australasia", "factory", "backward", "pacificnew", \
  17. "systemv" ]
  18. def setup():
  19. inarytools.dodir (ZoneDir)
  20. inarytools.dodir (RightDir)
  21. inarytools.dodir (PosixDir)
  22. def install():
  23. inarytools.insinto ("/usr/share/zoneinfo", "iso3166.tab")
  24. inarytools.insinto ("/usr/share/zoneinfo", "zone.tab")
  25. inarytools.insinto ("/usr/share/zoneinfo", "zone1970.tab")
  26. for tzdata in timezones:
  27. cmd = "zic -L /dev/null -d %s -y \"%s/yearistype.sh\" %s" % (TargetDir, get.workDIR(), tzdata)
  28. shelltools.system (cmd)
  29. part2 = "zic -L /dev/null -d %s -y \"%s/yearistype.sh\" %s" % (PosixDir, get.workDIR(), tzdata)
  30. shelltools.system (part2)
  31. part3 = "zic -L leapseconds -d %s -y \"%s/yearistype.sh\" %s" % (RightDir, get.workDIR(), tzdata)
  32. shelltools.system (part3)
  33. #shelltools.system ("zic -d %s -y \"%s/yearistype.sh\" %s -p Europe/Istanbul" % (TargetDir, get.workDIR(), tzdata))
  34. shelltools.system ("zic -d %s -p Europe/Istanbul" % TargetDir)
  35. shelltools.system ("rm -rf {}/var/".format(get.installDIR()))