diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-10-21 11:08:28 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-28 22:20:17 +0100 |
commit | 2737db5050c94b3a65c25b4bea482dd79fdfc50b (patch) | |
tree | e91c1a7a9a0eac577442c3c5d10b1640b5d7c4b8 | |
parent | b5aa4260da3180e4f4bd6d6d86d02e93722b477b (diff) |
lib/bpgit.py: add git tree verification support
Upstream commit: 455aae0352d34e97fc5910927428c9f8ff44f77a
This verifies that the tree provided has its last commit
both tagged and also digitally signed. In short it does:
git tag -v $(git describe --dirty)
This will be used later.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rw-r--r-- | lib/bpgit.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/bpgit.py b/lib/bpgit.py index f4af314a..02f6d8a7 100644 --- a/lib/bpgit.py +++ b/lib/bpgit.py @@ -107,6 +107,18 @@ def describe(rev='HEAD', tree=None, extra_args=[]): return stdout.strip() +def verify(git_tree): + tag = describe(rev=None, tree=git_tree, extra_args=['--dirty']) + cmd = ['git', 'tag', '-v', tag] + + process = subprocess.Popen(cmd, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + close_fds=True, universal_newlines=True, cwd=git_tree) + stdout = process.communicate()[0] + process.wait() + + return dict(r=process.returncode, output=stdout) + def init(tree=None): process = subprocess.Popen(['git', 'init'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, |