[prev in list] [next in list] [prev in thread] [next in thread]
List: openembedded-core
Subject: [OE-core] [PATCH 3/3] oeqa/utils/metadata: Add commit_count to fallback logic
From: Richard Purdie <richard.purdie () linuxfoundation ! org>
Date: 2019-02-28 13:37:02
Message-ID: 20190228133702.22445-3-richard.purdie () linuxfoundation ! org
[Download RAW message or body]
Currently if python3-git isn't installed we can get odd behaviours when the
commit_count is absent. Avoid this set of bugs by adding a fallback here.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
meta/lib/oeqa/utils/metadata.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oeqa/utils/metadata.py b/meta/lib/oeqa/utils/metadata.py
index b7def772240..70a27569f26 100644
--- a/meta/lib/oeqa/utils/metadata.py
+++ b/meta/lib/oeqa/utils/metadata.py
@@ -72,8 +72,10 @@ def git_rev_info(path):
info['commit'] = subprocess.check_output(["git", "rev-parse", "HEAD"], \
cwd=path).decode('utf-8').strip() except subprocess.CalledProcessError:
pass
- return info
-
+ try:
+ info['commit_count'] = int(subprocess.check_output(["git", "rev-list", \
"--count", "HEAD"], cwd=path).decode('utf-8').strip()) + except \
subprocess.CalledProcessError: + pass
try:
repo = Repo(path, search_parent_directories=True)
except (InvalidGitRepositoryError, NoSuchPathError):
--
2.20.1
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic