[gentoo-portage-dev] PATCH: Bumping portage to top of dependancy list (bug 48531)

2005-10-18 Thread Zac Medico

http://bugs.gentoo.org/show_bug.cgi?id=48531

This simple patch automatically bumps portage to the top of the merge list.  
I've always wanted this feature and it is a dependency of bug 108262.  Feedback 
please. :)

Zac
Index: bin/emerge
===
--- bin/emerge	(revision 2139)
+++ bin/emerge	(working copy)
@@ -1383,6 +1383,7 @@
 		for x in dolist:
 			for y in portage.db[x][merge]:
 retlist.append(y)
+		bump_portage_top_mergelist(retlist)
 		return retlist
 
 	def xcreate(self,mode=system):
@@ -1805,7 +1806,7 @@
 			print  Recording,myfavkey,in \world\ favorites file...
 			if not --fetchonly in myopts:
 portage.writedict(myfavdict,portage.root+portage.WORLD_FILE,writekey=0)
-
+			bump_portage_top_mergelist(mymergelist)
 			portage.mtimedb[resume][mergelist]=mymergelist[:]
 
 		# We need to yank the harmful-to-new-builds settings from features.
@@ -2372,6 +2373,14 @@
 			print  +yellow(*)+ Type +green(emerge --help config)+ to learn how to update config files.
 		print
 
+def bump_portage_top_mergelist(mergelist):
+	for x in mergelist:
+		mysplit=portage.pkgsplit(x[2])
+		if mysplit[0]==sys-apps/portage:
+			mergelist.remove(x)
+			mergelist.insert(0,x)
+			break
+
 # general options that should be taken into account before any action
 if --debug in myopts:
 	edebug=1


Re: [gentoo-portage-dev] PATCH: Bumping portage to top of dependancy list (bug 48531)

2005-10-18 Thread Jason Stubbs
On Tuesday 18 October 2005 16:49, Zac Medico wrote:
 http://bugs.gentoo.org/show_bug.cgi?id=48531

 This simple patch automatically bumps portage to the top of the merge list.
  I've always wanted this feature and it is a dependency of bug 108262. 
 Feedback please. :)

No good. ;)

What if portage's dependencies aren't satisfied? Something like the below 
(possibly combined with the pprovided stuff) would be better...

--- emerge  (revision 2138)
+++ emerge  (working copy)
@@ -875,8 +875,15 @@
mynewlines.remove(atom)
break

-   return mynewlines
+   mynewlist = []
+   for atom in mynewlines:
+   if portage.dep_getkey(atom) == sys-apps/portage:
+   mynewlist.insert(0, atom)
+   else:
+   mynewlist.append(atom)

+   return mynewlist
+
 def genericdict(mylist):
mynewdict={}
for x in mylist:
-- 
gentoo-portage-dev@gentoo.org mailing list



Re: [gentoo-portage-dev] PATCH: Bumping portage to top of dependancy list (bug 48531)

2005-10-18 Thread Jason Stubbs
On Tuesday 18 October 2005 19:52, Marius Mauch wrote:
 On Tue, 18 Oct 2005 19:32:26 +0900

 Jason Stubbs [EMAIL PROTECTED] wrote:
  On Tuesday 18 October 2005 16:49, Zac Medico wrote:
   http://bugs.gentoo.org/show_bug.cgi?id=48531
  
   This simple patch automatically bumps portage to the top of the
   merge list. I've always wanted this feature and it is a dependency
   of bug 108262. Feedback please. :)
 
  No good. ;)
 
  What if portage's dependencies aren't satisfied? Something like the
  below (possibly combined with the pprovided stuff) would be better...

 Hmm, how would that work with virtual/portage != sys-apps/portage?
 (rhetoric question)

That's where the something like comes into it. What do you expect for less 
than one minute's work? (rhetoric question)

--
Jason Stubbs
-- 
gentoo-portage-dev@gentoo.org mailing list