Use Package.cp instead of dep_getkey(cpv). (trunk r9679:9681)
authorZac Medico <zmedico@gentoo.org>
Wed, 2 Apr 2008 19:29:27 +0000 (19:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 2 Apr 2008 19:29:27 +0000 (19:29 -0000)
svn path=/main/branches/2.1.2/; revision=9682

bin/emerge

index 672c37ff811ecf25ecfafbbccd18570bc6348ee3..baba8283ed28a74cd7e553e2798139cf24325e27 100755 (executable)
@@ -3339,6 +3339,8 @@ class depgraph:
                                        mydbapi.aux_get(pkg_key, self._mydbapi_keys)))
                                ebuild_path = None
                                repo_name = metadata["repository"]
+                               built = pkg_type != "ebuild"
+                               installed = pkg_type == "installed"
                                if pkg_type == "ebuild":
                                        ebuild_path = portdb.findname(pkg_key)
                                        if not ebuild_path: # shouldn't happen
@@ -3349,6 +3351,9 @@ class depgraph:
                                        metadata["USE"] = pkgsettings["PORTAGE_USE"]
                                else:
                                        repo_path_real = portdb.getRepositoryPath(repo_name)
+                               pkg_node = Package(type_name=pkg_type, root=myroot,
+                                       cpv=pkg_key, built=built, installed=installed,
+                                       metadata=metadata)
                                pkg_use = metadata["USE"].split()
 
                                try:
@@ -4218,8 +4223,10 @@ class MergeTask(object):
 
                mergecount=0
                for x in mymergelist:
-                       mergecount+=1
                        pkg_type = x[0]
+                       if pkg_type == "blocks":
+                               continue
+                       mergecount+=1
                        myroot=x[1]
                        pkg_key = x[2]
                        pkgindex=2
@@ -4243,6 +4250,11 @@ class MergeTask(object):
                                        raise AssertionError("Package type: '%s'" % pkg_type)
                                metadata.update(izip(metadata_keys,
                                        mydbapi.aux_get(pkg_key, metadata_keys)))
+                       built = pkg_type != "ebuild"
+                       installed = pkg_type == "installed"
+                       pkg = Package(type_name=pkg_type, root=myroot,
+                               cpv=pkg_key, built=built, installed=installed,
+                               metadata=metadata)
                        if x[0]=="blocks":
                                pkgindex=3
                        y = portdb.findname(pkg_key)
@@ -4470,8 +4482,7 @@ class MergeTask(object):
                                        "--fetch-all-uri" not in self.myopts:
 
                                        # Figure out if we need a restart.
-                                       if myroot == "/" and \
-                                               portage.dep_getkey(pkg_key) == "sys-apps/portage":
+                                       if myroot == "/" and pkg.cp == "sys-apps/portage":
                                                if "livecvsportage" not in self.settings.features:
                                                        if len(mymergelist) > mergecount:
                                                                emergelog(xterm_titles,