merge from trunk r8897 and fix up for SVN support
authorFabian Groffen <grobian@gentoo.org>
Mon, 17 Dec 2007 18:14:25 +0000 (18:14 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 17 Dec 2007 18:14:25 +0000 (18:14 -0000)
svn path=/main/branches/prefix/; revision=8939

bin/repoman

index 885baeab3615dbb8e667b8aef28af6d255f3b869..81d71c866ad6e002dda7a5973161a3681a640d04 100755 (executable)
@@ -421,6 +421,24 @@ isSvn=False
 if os.path.isdir(".svn"):
        isSvn=True
 
+if isCvs or isSvn and \
+       "commit" == options.mode and \
+       "RMD160" not in portage.checksum.hashorigin_map:
+       from portage.util import grablines
+       repo_lines = grablines("./CVS/Repository")
+       if isSvn or (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 options.mode == 'commit' and not options.pretend and not isCvs and not isSvn:
        logging.info("Not in a CVS/SVN repository; enabling pretend mode.")
        options.pretend = True
@@ -824,21 +842,6 @@ if isCvs:
        mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
        new_ebuilds.update(x for x in mynew if x.endswith(".ebuild"))
        del mycvstree, mynew
-       if "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)
 
 dofail = 0
 arch_caches={}