1 |
commit: 350c094fd54644cbb49bcf8d483a75eb22cb4b6e |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 5 00:48:41 2012 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 5 00:48:41 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=350c094f |
7 |
|
8 |
repoman: say Git >=1.7.9 needed for signed commit |
9 |
|
10 |
--- |
11 |
bin/repoman | 23 ++++++++++++++++++++++- |
12 |
1 files changed, 22 insertions(+), 1 deletions(-) |
13 |
|
14 |
diff --git a/bin/repoman b/bin/repoman |
15 |
index bcb48e4..d430a6d 100755 |
16 |
--- a/bin/repoman |
17 |
+++ b/bin/repoman |
18 |
@@ -1,5 +1,5 @@ |
19 |
#!/usr/bin/python -O |
20 |
-# Copyright 1999-2011 Gentoo Foundation |
21 |
+# Copyright 1999-2012 Gentoo Foundation |
22 |
# Distributed under the terms of the GNU General Public License v2 |
23 |
|
24 |
# Next to do: dep syntax checking in mask files |
25 |
@@ -936,6 +936,20 @@ def vcs_files_to_cps(vcs_file_iter): |
26 |
|
27 |
return frozenset(modified_cps) |
28 |
|
29 |
+def git_supports_gpg_sign(): |
30 |
+ status, cmd_output = \ |
31 |
+ subprocess_getstatusoutput("git --version") |
32 |
+ cmd_output = cmd_output.split() |
33 |
+ if cmd_output: |
34 |
+ version = re.match(r'^(\d*)\.(\d*)\.(\d*)', cmd_output[-1]) |
35 |
+ if version is not None: |
36 |
+ version = [int(x) for x in version.groups()[1:]] |
37 |
+ if version[0] > 1 or \ |
38 |
+ (version[0] == 1 and version[1] > 7) or \ |
39 |
+ (version[0] == 1 and version[1] == 7 and version[2] >= 9): |
40 |
+ return True |
41 |
+ return False |
42 |
+ |
43 |
def dev_keywords(profiles): |
44 |
""" |
45 |
Create a set of KEYWORDS values that exist in 'dev' |
46 |
@@ -2772,6 +2786,13 @@ else: |
47 |
else: |
48 |
retval = spawn(commit_cmd, env=os.environ) |
49 |
if retval != os.EX_OK: |
50 |
+ |
51 |
+ if repo_config.sign_commit and vcs == 'git' and \ |
52 |
+ not git_supports_gpg_sign(): |
53 |
+ # Inform user that newer git is needed (bug #403323). |
54 |
+ logging.error( |
55 |
+ "Git >=1.7.9 is required for signed commits!") |
56 |
+ |
57 |
writemsg_level(("!!! Exiting on %s (shell) " + \ |
58 |
"error code: %s\n") % (vcs, retval), |
59 |
level=logging.ERROR, noiselevel=-1) |