This patch allows emerge to merge a package without specifying the category. eg, 'emerge portage' instead of 'emerge sys-apps/portage'. Someone asked for this on gentoo-dev recently, so I figured I'd try making a patch. The patch seems to work for me, and as far as I can tell it shouldn't have any negative effects. All the changes are in dep_bestmatch in portage.py. This was my first time looking at the portage code, so I hope I didn't violate any style constraints or anything like that. Any feedback would be appreciated. :)
for some reason, I cannot create an attachment with this file in mozilla or konqueror, so I'm going to include the text of the patch here. This patch is against portage-1.8.6-r3: diff -ru portage-1.8.6-r3/pym/portage.py portage-1.8.6-r3-patched/pym/portage.py --- portage-1.8.6-r3/pym/portage.py Mon Jan 28 15:16:33 2002 +++ portage-1.8.6-r3-patched/pym/portage.py Tue Jan 29 20:54:39 2002 @@ -1576,7 +1576,14 @@ return mymatch elif not isspecific(mypkgdep): if not self.hasnode(mypkgdep): - return "" + mypkgdep2 = mypkgdep + for cat in categories: + if self.hasnode( cat+"/"+mypkgdep ): + mypkgdep2 = cat+"/"+mypkgdep + break + if mypkgdep2 == mypkgdep: + return "" + mypkgdep = mypkgdep2 mynodes=self.getnode(mypkgdep)[:] if len(mynodes)==0: return ""
at your discretion, Geert.
added to portage v1.8.7