Merged from trunk 8226:8243
authorFabian Groffen <grobian@gentoo.org>
Wed, 24 Oct 2007 13:49:24 +0000 (13:49 -0000)
committerFabian Groffen <grobian@gentoo.org>
Wed, 24 Oct 2007 13:49:24 +0000 (13:49 -0000)
   | 8233    | In depgraph.create(), if a direct circular dependency is not |
   | zmedico | an unsatisfied buildtime dependency then drop it here since  |
   |         | otherwise it can skew the merge order calculation in an      |
   |         | unwanted way.                                                |

   | 8235    | Fix broken imports.                                          |
   | zmedico |                                                              |

   | 8236    | Bug #196652 - Check for useless ABOUT-NLS|COPYING|LICENSE    |
   | zmedico | files in dodoc arguments.                                    |

   | 8238    | Remove a redundant self.treeVirtuals deepcopy from the       |
   | zmedico | config constructor.                                          |

   | 8240    | Fix config.setinst() to return early when the given package  |
   | zmedico | already provides the virtual.                                |

   | 8242    | Fix the version Id tag.                                      |
   | zmedico |                                                              |

   | 8243    | Print the Id tag an it's own line to avoid going over 80     |
   | zmedico | columns.                                                     |

svn path=/main/branches/prefix/; revision=8271

bin/portageq
bin/repoman
pym/_emerge/__init__.py
pym/portage/__init__.py
pym/repoman/checks.py

index 79d9edca0a0c840963aba87a72dfac8233f119e5..e5490db445d25d218a91b7f9ea6fc21d6fd8b837 100755 (executable)
@@ -374,9 +374,8 @@ list_preserved_libs.uses_root = True
 #
 
 def usage(argv):
-       rev="$Revision: 1.13.2.1 $"
-       ver= rev.split(' ')[1]
-       print ">>> Portage information query tool -- version "+ver
+       print ">>> Portage information query tool"
+       print ">>> $Id$"
        print ">>> Usage: portageq <command> [<option> ...]"
        print ""
        print "Available commands:"
index 1b27172ebc4e48663ea1f00bd4992047f275c439..64d1330337ad99c54c26a4c41d1530ca999348e0 100755 (executable)
@@ -50,13 +50,13 @@ except ImportError:
 del os.environ["PORTAGE_LEGACY_GLOBALS"]
 
 try:
-       from repoman.checks import EbuildWhitespaceCheck, EbuildHeaderCheck, EbuildQuoteCheck, \
-               EbuildAssignmentCheck
+       from repoman.checks import EbuildWhitespace, EbuildHeader, EbuildQuote, \
+               EbuildAssignment, EbuildNestedDie, EbuildUselessDodoc
 except ImportError:
        from os import path as osp
        sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), 'pym'))
        from repoman.checks import EbuildWhitespace, EbuildHeader, EbuildQuote, \
-               EbuildAssignment, EbuildNestedDie
+               EbuildAssignment, EbuildNestedDie, EbuildUselessDodoc
 
 import portage.checksum
 import portage.const
@@ -1449,7 +1449,8 @@ for x in scanlist:
                path = checkdir + '/' + y + '.ebuild'
                myear = time.gmtime(os.stat(path)[ST_MTIME])[0]
                contents = StringIO.StringIO(open(path, 'rb').read())
-               for check in (EbuildWhitespace, EbuildQuote, EbuildAssignment):
+               for check in (EbuildWhitespace, EbuildQuote,
+                       EbuildAssignment, EbuildUselessDodoc):
                        c = check(contents)
                        errors = c.Run()
                        for e in errors:
index 9a9d763e005b5d2cf4e100f798fc9673b633cf24..b39a5edb6733cdd6e72402f13c84c6c0d46c105c 100644 (file)
@@ -1301,13 +1301,16 @@ class depgraph(object):
                        if existing_node:
                                e_type, myroot, e_cpv, e_status = existing_node
                                if mykey == e_cpv:
-                                       # The existing node can be reused. It's okay for a
-                                       # node to depend on itself here if priority.satisfied
-                                       # is True, otherwise it is a circular dependency that
-                                       # can not be ignored.
+                                       # The existing node can be reused.
                                        self._parent_child_digraph.add(existing_node, myparent)
-                                       self.digraph.addnode(existing_node, myparent,
-                                               priority=priority)
+                                       # If a direct circular dependency is not an unsatisfied
+                                       # buildtime dependency then drop it here since otherwise
+                                       # it can skew the merge order calculation in an unwanted
+                                       # way.
+                                       if existing_node != myparent or \
+                                               (priority.buildtime and not priority.satisfied):
+                                               self.digraph.addnode(existing_node, myparent,
+                                                       priority=priority)
                                        return 1
                                else:
                                        if jbigkey in self._slot_collision_nodes:
index 28bb2d77b396a05481c98051ebd888b1966ea5e8..1568d2618c685c9342cc57ec3137442ed05171ad 100644 (file)
@@ -921,6 +921,7 @@ class config(object):
                        self.packages = copy.deepcopy(clone.packages)
                        self.virtuals = copy.deepcopy(clone.virtuals)
 
+                       self.dirVirtuals = copy.deepcopy(clone.dirVirtuals)
                        self.treeVirtuals = copy.deepcopy(clone.treeVirtuals)
                        self.userVirtuals = copy.deepcopy(clone.userVirtuals)
                        self.negVirtuals  = copy.deepcopy(clone.negVirtuals)
@@ -960,8 +961,6 @@ class config(object):
                        self.punmaskdict = copy.deepcopy(clone.punmaskdict)
                        self.prevmaskdict = copy.deepcopy(clone.prevmaskdict)
                        self.pprovideddict = copy.deepcopy(clone.pprovideddict)
-                       self.dirVirtuals = copy.deepcopy(clone.dirVirtuals)
-                       self.treeVirtuals = copy.deepcopy(clone.treeVirtuals)
                        self.features = copy.deepcopy(clone.features)
 
                        self._accept_license = copy.deepcopy(clone._accept_license)
@@ -2075,6 +2074,9 @@ class config(object):
                cp = dep_getkey(mycpv)
                for virt in virts:
                        virt = dep_getkey(virt)
+                       providers = self.virtuals.get(virt)
+                       if providers and cp in providers:
+                               continue
                        providers = self._depgraphVirtuals.get(virt)
                        if providers is None:
                                providers = []
index d956b83f8f3a0e7488d614bfc8fbc39322e1cbc2..93c3222b338debfddd36ca10743b1b49d0a6940d 100644 (file)
@@ -224,3 +224,22 @@ class EbuildNestedDie(ContentCheck):
                        if match:
                                errors.append((num + 1, NESTED_DIE_ERROR))
                return errors
+
+class EbuildUselessDodoc(ContentCheck):
+       """Check ebuild for useless files in dodoc arguments."""
+       repoman_check_name = 'ebuild.minorsyn'
+       uselessdodoc_re = re.compile(
+               r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENSE)($|\s)')
+
+       def __init__(self, contents):
+               ContentCheck.__init__(self, contents)
+
+       def Run(self):
+               errors = []
+               uselessdodoc_re = self.uselessdodoc_re
+               for num, line in enumerate(self.contents):
+                       match = uselessdodoc_re.match(line)
+                       if match:
+                               errors.append((num + 1, "Useless dodoc '%s'" % \
+                                       (match.group(2), ) + " on line: %d"))
+               return errors