Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 423 - Patch to allow emerge to find packages without the category
Summary: Patch to allow emerge to find packages without the category
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Geert Bevin
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-29 23:11 UTC by Brent Rahn
Modified: 2011-10-30 22:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Rahn 2002-01-29 23:11:17 UTC
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. :)
Comment 1 Brent Rahn 2002-01-30 01:51:27 UTC
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 ""

Comment 2 Daniel Robbins (RETIRED) gentoo-dev 2002-01-30 01:52:43 UTC
at your discretion, Geert.
Comment 3 Geert Bevin 2002-01-30 07:13:29 UTC
added to portage v1.8.7