perl-version.bbclass 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. PERL_OWN_DIR = ""
  2. # Determine the staged version of perl from the perl configuration file
  3. # Assign vardepvalue, because otherwise signature is changed before and after
  4. # perl is built (from None to real version in config.sh).
  5. get_perl_version[vardepvalue] = "${PERL_OWN_DIR}"
  6. def get_perl_version(d):
  7. import re
  8. cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/config.sh')
  9. try:
  10. f = open(cfg, 'r')
  11. except IOError:
  12. return None
  13. l = f.readlines();
  14. f.close();
  15. r = re.compile(r"^version='(\d*\.\d*\.\d*)'")
  16. for s in l:
  17. m = r.match(s)
  18. if m:
  19. return m.group(1)
  20. return None
  21. PERLVERSION := "${@get_perl_version(d)}"
  22. PERLVERSION[vardepvalue] = ""
  23. # Determine the staged arch of perl from the perl configuration file
  24. # Assign vardepvalue, because otherwise signature is changed before and after
  25. # perl is built (from None to real version in config.sh).
  26. def get_perl_arch(d):
  27. import re
  28. cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl5/config.sh')
  29. try:
  30. f = open(cfg, 'r')
  31. except IOError:
  32. return None
  33. l = f.readlines();
  34. f.close();
  35. r = re.compile("^archname='([^']*)'")
  36. for s in l:
  37. m = r.match(s)
  38. if m:
  39. return m.group(1)
  40. return None
  41. PERLARCH := "${@get_perl_arch(d)}"
  42. PERLARCH[vardepvalue] = ""
  43. # Determine the staged arch of perl-native from the perl configuration file
  44. # Assign vardepvalue, because otherwise signature is changed before and after
  45. # perl is built (from None to real version in config.sh).
  46. def get_perl_hostarch(d):
  47. import re
  48. cfg = d.expand('${STAGING_LIBDIR_NATIVE}/perl5/config.sh')
  49. try:
  50. f = open(cfg, 'r')
  51. except IOError:
  52. return None
  53. l = f.readlines();
  54. f.close();
  55. r = re.compile("^archname='([^']*)'")
  56. for s in l:
  57. m = r.match(s)
  58. if m:
  59. return m.group(1)
  60. return None