blob: bafd96518a5058bdcf626e26ccd745d5742696e1 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
2
3# Determine the staged version of perl from the perl configuration file
4# Assign vardepvalue, because otherwise signature is changed before and after
5# perl is built (from None to real version in config.sh).
6get_perl_version[vardepvalue] = "${PERL_OWN_DIR}"
7def get_perl_version(d):
8 import re
9 cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh')
10 try:
11 f = open(cfg, 'r')
12 except IOError:
13 return None
14 l = f.readlines();
15 f.close();
Brad Bishop977dc1a2019-02-06 16:01:43 -050016 r = re.compile(r"^version='(\d*\.\d*\.\d*)'")
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017 for s in l:
18 m = r.match(s)
19 if m:
20 return m.group(1)
21 return None
22
23PERLVERSION := "${@get_perl_version(d)}"
24PERLVERSION[vardepvalue] = ""