public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] Portage dependencies hell and PATCH to solve it
@ 2004-08-15  5:59 Javier Marcet
  2004-08-15 12:00 ` Jason Stubbs
  0 siblings, 1 reply; 6+ messages in thread
From: Javier Marcet @ 2004-08-15  5:59 UTC (permalink / raw
  To: gentoo-portage-dev


[-- Attachment #1.1: Type: text/plain, Size: 3958 bytes --]

Hi guys,
a long long time ago I began having problems with portage which
seemingly only affected me. I talked to some guys on #gentoo-dev or
#gentoo-portage (I'm not sure what was the channel) who did take part in
portage development, but couldn't fix it.

In the 2.0.51_pre series the last version I remember not giving me
problems was 2.0.51_pre10, with it I can emerge anything, from source
or binary and whatever DEPENDS the ebuild has.

From pre11 on I often get errors which always look like (this is with
the last one released, pre17):

# emerge mozilla -p


Invalid package name: moznomail

These are the packages that I would merge, in order:

Calculating dependencies   
!!! Problem in net-www/mozilla dependencies.
!!! 73

This time I decided to chase the problem until I found it.
One thing common to all the errors I was getting with pre17 is that it
involved negated dependencies, e.g. the above error results from this
RDEPEND in mozilla's ebuild:

RDEPEND="java? ( virtual/jre )
	crypt? ( !moznomail ( >=app-crypt/gnupg-1.2.1 ) )"

As you may see it is the negated moznomail which has, allegedly, an
invalid package name.

Another source of errors is depending on inexistent packages (this was
the good side of the bug, it found errors within gcc ebuilds). The
ebuild hardened-gcc does not exist anymore within portage yet gcc's
ebuilds include it within their list of DEPENDs. It is included negated,
but it is included:


DEPEND="virtual/libc
	!uclibc? ( >=sys-libs/glibc-2.3.3_pre20040420-r1 )
	!uclibc? ( hardened? ( >=sys-libs/glibc-2.3.3_pre20040529 ) )
	( !sys-devel/hardened-gcc )
...

The error for the above is:

Invalid package name: sys-devel/hardened-gcc

These are the packages that I would merge, in order:

Calculating dependencies   
!!! Problem in sys-devel/gcc dependencies.
!!! 73

As you can see, it is quite identical to the one with the negated
moznomail. Indeed, now that I think of it, the cause seems the same,
the !, not that hardened-gcc does not exist anymnore.
Anyhow, I think it is something needing a change.

I attach two patches.

The first one is the hunk of difference between pre10 and pre11 which made
the difference between a clean portage which gives no problems, and a
hosed one which often complain about invalid package names.

The second one is for the current _pre17. Unlike the former one which
affected bin/emerge, thus not touching ebuild.sh, pre17's bug is within
pym/portage.py, hence it makes `ebuild` also fail in some situations
(which as of now I cannot consistently reproduce, I have traced it
enough).
Hopefully it solves each and every problem. So far I've been able to
do and 'emerge -u world --deep --empty-tree -p' without any error, which
I couldn't before due to packages like mozilla, mozilla-firefox or gcc,
to name a few.
Oddly enough, the change I propose for _pre17 has been on purpose
judging by the comments the culprit line is surrounded. I read the bug
description and that's not the problem I've always had at all.

What I don't understand, but puzzles me quite a bit, is how is it possible
that this only shows on my systems?
This has been present since 2.0.49_something, with a lot of portage
released versions making havoc. I tried fresh installs, without moving
portage's dir to customs paths or anything like that and even so the bug
hit me, on different machines. All of them set up by me, though.
It seems it's me rather than the system having the problems.

Suggestions, comments, explanations for this behavior will be highly
appreciated.

Thanks for your help & time.

P.S I'm sorry for not narrowing down the first patch a little bit more,
but I haven't yet learned Python, maybe I do in the coming months, but
ATM I'm happy enough hacking with C, C++ & Perl all day long :)


-- 
Captain's Log, star date 21:34.5...
Ö\x01
Javier Marcet <javier@marcet.info>

[-- Attachment #1.2: portage-2.0.51_pre11-dependencies_hell.fix --]
[-- Type: text/plain, Size: 753 bytes --]

--- bin/emerge	2004-08-15 03:19:17.000000000 +0200
+++ bin.orig/emerge	2004-08-15 03:19:08.000000000 +0200
@@ -829,18 +823,9 @@
 			merging=2
 		if merging==1:
 			mybigkey.append("merge")
-			self.mydbapi[myroot].cpv_inject(mykey)
 		else:
 			mybigkey.append("nomerge")
 			
-		virts = portage.db[myroot]["porttree"].dbapi.aux_get(mykey, ["PROVIDE"])[0].split()
-		cp = portage.dep_getkey(mykey)
-		for virt in virts:
-			virt = portage.dep_getkey(virt)
-			while cp in portage.virts[virt]:
-				portage.virts[virt].remove(cp)
-			portage.virts[virt].insert(0, cp)
-		
 		# whatever the case, we need to add the node to our digraph so
 		# that children can depend upon it.
 		self.digraph.addnode(string.join(mybigkey),myparent)

[-- Attachment #1.3: portage-2.0.51_pre17-dependencies_hell.fix --]
[-- Type: text/plain, Size: 726 bytes --]

--- pym/portage.py.orig	2004-08-05 13:24:41.000000000 +0200
+++ pym/portage.py	2004-08-15 07:04:55.954353680 +0200
@@ -3932,7 +3932,7 @@
 				if mydep!=None:
 					tmp=(len(mydep)>=1)
 					if deplist[mypos][0]=="!":
-						#tmp=not tmp
+						tmp=not tmp
 						# This is ad-hoc code. We should rewrite this later.. (See #52377)
 						# The reason is that portage uses fakedb when --update option now.
 						# So portage considers that a block package doesn't exist even if it exists.
@@ -3940,7 +3940,7 @@
 						# ==== start
 						# emerge checks if it's block or not, so we can always set tmp=False.
 						# but it's not clean..
-						tmp=False
+						#tmp=False
 						# ==== end
 					deplist[mypos]=tmp
 				else:

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [gentoo-portage-dev] =* support in package.{keywords,mask,unmask}
@ 2004-08-08 18:10 Andy Lutomirski
  2004-08-08 19:00 ` Marius Mauch
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Lutomirski @ 2004-08-08 18:10 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

I like to use

=*gnome-base/ ~amd64

in my portage.keywords.  It looks like this is supposed to work, but it 
doesn't.  Here's a short patch to fix it.  Is this the right place to 
submit it?

Thanks,
Andy

[-- Attachment #2: portage.patch --]
[-- Type: text/plain, Size: 311 bytes --]

--- ./portage.py.orig	2004-08-08 10:46:45.009821264 -0700
+++ ./portage.py	2004-08-08 11:05:33.467269656 -0700
@@ -3541,7 +3541,11 @@
 		if not operator:
 			return []
 	else:
-		operator = None
+		if mydep[0:2] == '=*':
+			operator = '=*'
+			mycpv = mydep[2:]
+		else:
+			operator = None
 
 	mylist = []
 


[-- Attachment #3: Type: text/plain, Size: 45 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-15 21:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-15  5:59 [gentoo-portage-dev] Portage dependencies hell and PATCH to solve it Javier Marcet
2004-08-15 12:00 ` Jason Stubbs
2004-08-15 16:59   ` [gentoo-portage-dev] " Javier Marcet
  -- strict thread matches above, loose matches on Subject: below --
2004-08-08 18:10 [gentoo-portage-dev] =* support in package.{keywords,mask,unmask} Andy Lutomirski
2004-08-08 19:00 ` Marius Mauch
2004-08-09 20:23   ` Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox