Revert back to some known working code from the 2.1.2 branch.
authorZac Medico <zmedico@gentoo.org>
Tue, 19 Feb 2008 02:32:37 +0000 (02:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 19 Feb 2008 02:32:37 +0000 (02:32 -0000)
svn path=/main/trunk/; revision=9352

bin/repoman

index 067a7715d4d99d16cf607f7198506122ea2dc8ab..e048d18e1932a71a9d0cd9b9b24d5c72c3489342 100755 (executable)
@@ -7,6 +7,7 @@
 # Then, check to make sure deps are satisfiable (to avoid "can't find match for" problems)
 # that last one is tricky because multiple profiles need to be checked.
 
+import commands
 import codecs
 import errno
 import formatter
@@ -489,6 +490,29 @@ repodir = startdir
 for x in range(0, repolevel - 1):
        repodir = os.path.dirname(repodir)
 
+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.")
+
+def parse_use_local_desc(mylines, usedict=None):
+       """returns a dict of the form {cpv:set(flags)}"""
+       if usedict is None:
+               usedict = {}
+       lineno = 0
+       for l in mylines:
+               lineno += 1
+               if not l or l.startswith("#"):
+                       continue
+               mysplit = l.split(None, 1)
+               if not mysplit:
+                       continue
+               mysplit = mysplit[0].split(":")
+               if len(mysplit) != 2:
+                       raise ParseError("line %d: Malformed input: '%s'" % \
+                               (lineno, l.rstrip("\n")))
+               usedict.setdefault(mysplit[0], set())
+               usedict[mysplit[0]].add(mysplit[1])
+       return usedict
+
 # retreive local USE list
 luselist={}
 try:
@@ -544,8 +568,34 @@ if portdir_overlay != portdir:
        kwlist.update(portage.grabfile(
                os.path.join(portdir_overlay, "profiles", "arch.list")))
 
-scanlist = utilities.FindPackagesToScan(repoman_settings, startdir, reposplit)
+scanlist=[]
+if repolevel==2:
+       #we are inside a category directory
+       catdir=reposplit[-1]
+       if catdir not in repoman_settings.categories:
+               caterror(catdir)
+       mydirlist=os.listdir(startdir)
+       for x in mydirlist:
+               if x == "CVS" or x.startswith("."):
+                       continue
+               if os.path.isdir(startdir+"/"+x):
+                       scanlist.append(catdir+"/"+x)
+elif repolevel==1:
+       for x in repoman_settings.categories:
+               if not os.path.isdir(startdir+"/"+x):
+                       continue
+               for y in os.listdir(startdir+"/"+x):
+                       if y == "CVS" or y.startswith("."):
+                               continue
+                       if os.path.isdir(startdir+"/"+x+"/"+y):
+                               scanlist.append(x+"/"+y)
+elif repolevel==3:
+       catdir = reposplit[-2]
+       if catdir not in repoman_settings.categories:
+               caterror(catdir)
+       scanlist.append(catdir+"/"+reposplit[-1])
 scanlist.sort()
+
 logging.debug("Found the following packages to scan:\n%s" % '\n'.join(scanlist))
 
 profiles={}