Bug #198398 - Make repoman bail out if support for RMD160 hash
authorZac Medico <zmedico@gentoo.org>
Thu, 13 Dec 2007 05:40:46 +0000 (05:40 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 13 Dec 2007 05:40:46 +0000 (05:40 -0000)
creation appears to be missing. (trunk r8886:8888 and r8897)

svn path=/main/branches/2.1.2/; revision=8898

bin/repoman

index 387a1382fe6f24382f0955049b1d95cb5fe2bdaf..7ca861e789de5aa6ff402f3d37cad1e6728fb553 100755 (executable)
@@ -412,6 +412,24 @@ myreporoot=None
 if os.path.isdir("CVS"):
        isCvs = True
 
+if isCvs and \
+       "commit" == options.mode and \
+       "RMD160" not in portage.checksum.hashorigin_map:
+       from portage_util import grablines
+       repo_lines = grablines("./CVS/Repository")
+       if repo_lines and \
+               "gentoo-x86" == repo_lines[0].strip().split(os.path.sep)[0]:
+               msg = "Please install " \
+               "pycrypto or enable python's ssl USE flag in order " \
+               "to enable RMD160 hash support. See bug #198398 for " \
+               "more information."
+               prefix = red(" * ")
+               from textwrap import wrap
+               for line in wrap(msg, 70):
+                       print prefix + line
+               sys.exit(1)
+       del repo_lines
+
 if mymode == "commit" and \
        not isCvs and \
        "--pretend" not in myoptions: