diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-05-28 13:57:12 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 12:04:46 +0100 |
commit | e8dac5a58a77d01d427add12617a7c01f412bcc4 (patch) | |
tree | bbecd5777c11b06d7eead55fc622ee68b5b51762 | |
parent | 1fe254f123ad4748ad16163ab773a39ba9ad77cd (diff) | |
download | poky-e8dac5a58a77d01d427add12617a7c01f412bcc4.tar.gz |
scripts/buildhistory-diff: add GitPython version check
Display an error if the user does not have at least version 0.3.1 of
GitPython installed.
(From OE-Core rev: 2f0f5a895504924b5a21699854678e9bc25b447c)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/buildhistory-diff | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/buildhistory-diff b/scripts/buildhistory-diff index 9936a4b605..3f27eabcdb 100755 --- a/scripts/buildhistory-diff +++ b/scripts/buildhistory-diff | |||
@@ -7,16 +7,20 @@ | |||
7 | 7 | ||
8 | import sys | 8 | import sys |
9 | import os | 9 | import os |
10 | from distutils.version import LooseVersion | ||
10 | 11 | ||
11 | # Ensure PythonGit is installed (buildhistory_analysis needs it) | 12 | # Ensure PythonGit is installed (buildhistory_analysis needs it) |
12 | try: | 13 | try: |
13 | import git | 14 | import git |
14 | except ImportError: | 15 | except ImportError: |
15 | print("Please install PythonGit 0.3.1 or later in order to use this script") | 16 | print("Please install GitPython (python-git) 0.3.1 or later in order to use this script") |
16 | sys.exit(1) | 17 | sys.exit(1) |
17 | 18 | ||
18 | |||
19 | def main(): | 19 | def main(): |
20 | if LooseVersion(git.__version__) < '0.3.1': | ||
21 | print("Version of GitPython is too old, please install GitPython (python-git) 0.3.1 or later in order to use this script") | ||
22 | sys.exit(1) | ||
23 | |||
20 | if (len(sys.argv) < 3): | 24 | if (len(sys.argv) < 3): |
21 | print("Report significant differences in the buildhistory repository") | 25 | print("Report significant differences in the buildhistory repository") |
22 | print("Syntax: %s <buildhistory-path> <since-revision> [to-revision]" % os.path.basename(sys.argv[0])) | 26 | print("Syntax: %s <buildhistory-path> <since-revision> [to-revision]" % os.path.basename(sys.argv[0])) |