For bug #185153, in commit mode do the "Fetching trivial updates" routine before...
authorZac Medico <zmedico@gentoo.org>
Sat, 21 Jul 2007 10:41:28 +0000 (10:41 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 Jul 2007 10:41:28 +0000 (10:41 -0000)
svn path=/main/branches/2.1.2/; revision=7339

bin/repoman

index 6154e3c89b521a878019154803ff42e17061936c..b68d3c99a1dced77f055c191cf97eb171f6353eb 100755 (executable)
@@ -519,12 +519,6 @@ for x in range(0,repolevel-1):
 
 def caterror(mycat):
        err(mycat+" is not an official category.  Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.")
-if mymode == "manifest":
-       pass
-elif "--pretend" in myoptions:
-       print green("\nRepoMan does a once-over of the neighborhood...")
-elif quiet < 1:
-       print green("\nRepoMan scours the neighborhood...")
 
 def parse_use_local_desc(mylines, usedict=None):
        """returns a dict of the form {cpv:set(flags)}"""
@@ -746,6 +740,49 @@ def x11_deprecation_check(depstr):
                                return True
        return False
 
+if mymode == "commit":
+       retval = ("","")
+       if isCvs:
+               print
+               print "Performing a " + green("cvs -n up") + \
+                       " with a little magic grep to check for updates."
+               retval = getstatusoutput("/usr/bin/cvs -n up 2>&1 | " + \
+                       "egrep '^[^\?] .*' | " + \
+                       "egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'")
+
+       mylines = retval[1].splitlines()
+       myupdates = []
+       for x in mylines:
+               if not x:
+                       continue
+               if x[0] not in "UPMAR": # Updates,Patches,Modified,Added,Removed
+                       print red("!!! Please fix the following issues reported " + \
+                               "from cvs: ")+green("(U,P,M,A,R are ok)")
+                       print red("!!! Note: This is a pretend/no-modify pass...")
+                       print retval[1]
+                       print
+                       sys.exit(1)
+               elif x[0] in "UP":
+                       myupdates.append(x[2:])
+
+       if myupdates:
+               print green("Fetching trivial updates...")
+               if "--pretend" in myoptions:
+                       print "(/usr/bin/cvs up "+" ".join(myupdates)+")"
+                       retval = os.EX_OK
+               else:
+                       retval = os.system("/usr/bin/cvs up " + " ".join(myupdates))
+               if retval != os.EX_OK:
+                       print "!!! cvs exited with an error. Terminating."
+                       sys.exit(retval)
+
+if mymode == "manifest":
+       pass
+elif "--pretend" in myoptions:
+       print green("\nRepoMan does a once-over of the neighborhood...")
+elif quiet < 1:
+       print green("\nRepoMan scours the neighborhood...")
+
 dofail = 0
 arch_caches={}
 arch_xmatch_caches = {}
@@ -1592,44 +1629,13 @@ else:
                print
                sys.exit(1)
 
-       retval=["",""]
-       if isCvs:
-               print "Performing a "+green("cvs -n up")+" with a little magic grep to check for updates."
-               retval=getstatusoutput("/usr/bin/cvs -n up 2>&1 | egrep '^[^\?] .*' | egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'")
-               
-       mylines=retval[1].split("\n")
-       myupdates=[]
-       for x in mylines:
-               if not x:
-                       continue
-               if x[0] not in "UPMAR": # Updates,Patches,Modified,Added,Removed
-                       print red("!!! Please fix the following issues reported from cvs: ")+green("(U,P,M,A,R are ok)")
-                       print red("!!! Note: This is a pretend/no-modify pass...")
-                       print retval[1]
-                       print
-                       sys.exit(1)
-               elif x[0] in ["U","P"]:
-                       myupdates+=[x[2:]]
-       
-       if myupdates:
-               print green("Fetching trivial updates...")
-               if "--pretend" in myoptions:
-                       print "(/usr/bin/cvs up "+" ".join(myupdates)+")"
-                       retval=0
-               else:
-                       retval=os.system("/usr/bin/cvs up "+" ".join(myupdates))
-               if retval!=0:
-                       print "!!! cvs exited with an error. Terminating."
-                       sys.exit(retval)
-       
        if isCvs:
                mycvstree=cvstree.getentries("./",recursive=1)
                mychanged=cvstree.findchanged(mycvstree,recursive=1,basedir="./")
                mynew=cvstree.findnew(mycvstree,recursive=1,basedir="./")
                myremoved=cvstree.findremoved(mycvstree,recursive=1,basedir="./")
                if not (mychanged or mynew or myremoved):
-                       print
-                       print green("RepoMan sez:"), "\"Doing nothing is not always good for QA.\"\n"
+                       print green("RepoMan sez:"), "\"Doing nothing is not always good for QA.\""
                        print
                        print "(Didn't find any changed files...)"
                        print