Make sure that portdb.findname() returns the correct ebuild.
authorZac Medico <zmedico@gentoo.org>
Fri, 11 Jan 2008 02:03:15 +0000 (02:03 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 11 Jan 2008 02:03:15 +0000 (02:03 -0000)
svn path=/main/trunk/; revision=9164

bin/ebuild

index 7aebd8a3647587986856e535389f6e7d46bad254..1c4acef79fe70e33350bfa6f8eefabc15d5a4bc8 100755 (executable)
@@ -60,6 +60,11 @@ ebuild = portage.normalize_path(ebuild)
 ebuild_portdir = os.path.realpath(os.path.dirname(os.path.dirname(ebuild)))
 ebuild = os.path.join(ebuild_portdir, *ebuild.split(os.path.sep)[-2:])
 
+# Make sure that portdb.findname() returns the correct ebuild.
+del portage.portdb.porttrees[1:]
+if ebuild_portdir != portage.portdb.porttree_root:
+       portage.portdb.porttrees.append(ebuild_portdir)
+
 if not os.path.exists(ebuild):
        print "'%s' does not exist." % ebuild
        sys.exit(1)