summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 != "/"):