summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Müller-Klieser <S.Mueller-Klieser@phytec.de>2019-05-21 14:32:09 +0200
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2019-05-28 14:29:51 +0200
commita323c38ada9bfa41edc453dc79ace19c283ba70a (patch)
treeb55708d103d211074a556ed24980197cb0804c68
parent0b78ef6b465e9ba03321cadb28f1d5a78c290490 (diff)
downloadmeta-phytec-2.5.3-phy6.tar.bz2
meta-phytec-2.5.3-phy6.zip
phylib: add poky version meta info2.5.3-phy6
We are parsing the version info from the git tags of poky. Having this meta data available makes some build and deploy scripts much easier. Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rw-r--r--scripts/phylib.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/phylib.py b/scripts/phylib.py
index 2ab44cc..002061e 100644
--- a/scripts/phylib.py
+++ b/scripts/phylib.py
@@ -84,6 +84,7 @@ class Sourcecode(object):
# Interface
self.machines = Vividict()
self.bsp_dir = ""
+ self._poky_version = None
try:
#v2 Implementation
@@ -94,6 +95,28 @@ class Sourcecode(object):
print("Could not find necessary file: ", e)
raise SystemExit
+ @property
+ def poky_version(self):
+ if self._poky_version:
+ return self._poky_version
+ p = subprocess.Popen(["git", "tag", "-l", "yocto-*", "--merged", "HEAD"],
+ cwd=os.path.join(self.bsp_dir, "sources", "poky"),
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ (out, error) = p.communicate()
+ if p.returncode != 0:
+ raise Exception("ERROR in git: %d '%s'" % (p.returncode, error))
+ taglist = out.decode('utf-8').split('\n')
+ taglist_sorted = []
+ for t in taglist:
+ t = t.lstrip('yocto-')
+ t = [e.split('_') for e in t.split('.')]
+ # flatten list
+ t = [item for sublist in t for item in sublist]
+ taglist_sorted.append(tuple(t))
+ taglist_sorted.sort()
+ self._poky_version = taglist_sorted[-1]
+ return self._poky_version
+
def search_for_bsp_dir(self):
path = os.path.normpath(os.getcwd())
while(path != "/"):