summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-03-04 16:48:41 -0800
committerZac Medico <zmedico@gentoo.org>2012-03-04 16:54:39 -0800
commit43593de8225589fcd5c0d07ce70f45dfbe11bba9 (patch)
tree6a2e87e7d75dbc576e37ea7eb5410f13a79c6d85 /bin
parent6cd05a95afe799807c90e71d577fb87b1bd01093 (diff)
downloadportage-43593de8225589fcd5c0d07ce70f45dfbe11bba9.tar.gz
portage-43593de8225589fcd5c0d07ce70f45dfbe11bba9.tar.bz2
portage-43593de8225589fcd5c0d07ce70f45dfbe11bba9.zip
repoman: say Git >=1.7.9 needed for signed commit
Diffstat (limited to 'bin')
-rwxr-xr-xbin/repoman23
1 files changed, 22 insertions, 1 deletions
diff --git a/bin/repoman b/bin/repoman
index bcb48e464..3f16603f8 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1,5 +1,5 @@
#!/usr/bin/python -O
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Next to do: dep syntax checking in mask files
@@ -936,6 +936,20 @@ def vcs_files_to_cps(vcs_file_iter):
return frozenset(modified_cps)
+def git_supports_gpg_sign():
+ status, cmd_output = \
+ subprocess_getstatusoutput("git --version")
+ cmd_output = cmd_output.split()
+ if cmd_output:
+ version = re.match(r'^(\d+)\.(\d+)\.(\d+)', cmd_output[-1])
+ if version is not None:
+ version = [int(x) for x in version.groups()[1:]]
+ if version[0] > 1 or \
+ (version[0] == 1 and version[1] > 7) or \
+ (version[0] == 1 and version[1] == 7 and version[2] >= 9):
+ return True
+ return False
+
def dev_keywords(profiles):
"""
Create a set of KEYWORDS values that exist in 'dev'
@@ -2772,6 +2786,13 @@ else:
else:
retval = spawn(commit_cmd, env=os.environ)
if retval != os.EX_OK:
+
+ if repo_config.sign_commit and vcs == 'git' and \
+ not git_supports_gpg_sign():
+ # Inform user that newer git is needed (bug #403323).
+ logging.error(
+ "Git >=1.7.9 is required for signed commits!")
+
writemsg_level(("!!! Exiting on %s (shell) " + \
"error code: %s\n") % (vcs, retval),
level=logging.ERROR, noiselevel=-1)