Re: [gentoo-portage-dev] Display of keyword in emerge : code proposal
On Tue, 22 Nov 2005 21:47:40 +0100 jb benoit <[EMAIL PROTECTED]> wrote: > Marius Mauch wrote: > > >- Doesn't work with binpkgs (though that's probably also a problem in > >getmaskingstatus() itself) > >- there is more than keyword and p.mask for masking (profiles) > >- the function name is misleading (you're not checking the actual > >masking status) > >- you don't check for non-~arch and package.mask'ed packages > >- you don't check for non-$ARCH ACCEPT_KEYWORDS/package.keywords > >entries > >- other semantic issues I' not going to repeat > >- completely useless without docs. > > > > > > > If this can help, i'll respond to some of your question : > My aims is very different to the one of getmaskingstatus(). Not really, you basically just want to ignore parts of the local config, that's all. > I don't have to check everywere for the status : > The package which status I'm searching were already checked by > getmaskingstatus(). > This is very important. Wrong. getmaskingstatus() doesn't decide if a package is masked (gvivsible() does that), it only checks for possible reasons. And if this should be considered for inclusion you *have* to check for all possible masks (though with profiles this gets tricky). > The only 2 thinks I implemented was to search : > > if the package beeing checked is an unstable version, > which can be done only by looking at the supported keywords in the > ebuild. Again wrong. Example: - ebuild foo has KEYWORDS="~x86" - my system has ARCH="amd64" - in package.keywords I have a line "foo ~x86" So while this package isn't even marked as "testing" for my arch your patch would treat it as "stable" (at least that's how I would interpret the output). This example is rather common. > if the package beeing checked is a masked version. > I only need to check is the package was masked in packages.mask, > don't mind the reason for which it's now unmasked. I didn't say anything about checking why it's unmasked, maybe you misunderstood the following comment: "you don't check for non-~arch and package.mask'ed packages" What I mean is when a package is marked stable but in package.mask, your patch simply ignores that (instead of adding a "M" status). > If you thinks this can be usefull, I can made the corection needed. > If you think this is just a bunch of trash, just tell me to forget, > but i'll miss this feature. Well, not trash, but it has a ton of semantic issues (likely more than just the few I posted above) to resolve first making this much more complicated than you probably think. That's probably not important for you or 90% of all users, but if we add such a feature it has to work for at least 98% of all users (ideally of course for 100%). Marius -- Public Key at http://www.genone.de/info/gpg-key.pub In the beginning, there was nothing. And God said, 'Let there be Light.' And there was still nothing, but you could see a bit better. signature.asc Description: PGP signature
Re: [gentoo-portage-dev] Display of keyword in emerge : code proposal
On Tue, 2005-22-11 at 21:47 +0100, jb benoit wrote: > If you thinks this can be usefull, I can made the corection needed. > If you think this is just a bunch of trash, just tell me to forget, but > i'll miss this feature. > > Jb We do something very similar in porthole now. It is very usefull and we like it. I think it would be a good addition to the emerge-vp output. Our display goes farther and more detailed showing individual ebuild keyword status. Whether it is stable, keyword masked or hard masked. We even add a tooltip with the reason it is hard masked. After all how many people can remember which packages they have in /etc/portage/package.keywords . Much like the USE flag status is checked, the keyword status can also be checked. -- Brian <[EMAIL PROTECTED]> -- gentoo-portage-dev@gentoo.org mailing list
Re: [gentoo-portage-dev] Display of keyword in emerge : code proposal
Marius Mauch wrote: On Fri, 18 Nov 2005 19:13:13 +0100 jb benoit <[EMAIL PROTECTED]> wrote: $ diff -Naur portage.py.sav portage.py --- portage.py.sav 2005-11-17 15:32:20.0 +0100 +++ portage.py 2005-11-17 15:15:24.0 +0100 @@ -3866,6 +3866,42 @@ pmaskfile.close() return None +def getprintablemaskingstatus(mycpv): + + #checking + global portdb + mysplit = catpkgsplit(mycpv) + if not mysplit: + raise ValueError("invalid CPV: %s" % mycpv) + if not portdb.cpv_exists(mycpv): + raise KeyError("CPV %s does not exist" % mycpv) + mycp=mysplit[0]+"/"+mysplit[1] + + #gathering data + mygroups = portdb.aux_get(mycpv, ["KEYWORDS"])[0].split() + myarch = settings["ARCH"] + maskdict=settings.pmaskdict + + rValue=[] + test=0 + + # keyword chercking + for gp in mygroups: + if gp=="~"+myarch: + kmask="~"+myarch + rValue.append(kmask) + test = 1 + + # package.mask checking +if test == 1: + if maskdict.has_key(mycp): + for x in maskdict[mycp]: + if mycpv in portdb.xmatch("match-all", x): + rValue.append("~M") + + return rValue + + def getmaskingstatus(mycpv): global portdb mysplit = catpkgsplit(mycpv) - Doesn't work with binpkgs (though that's probably also a problem in getmaskingstatus() itself) - there is more than keyword and p.mask for masking (profiles) - the function name is misleading (you're not checking the actual masking status) - you don't check for non-~arch and package.mask'ed packages - you don't check for non-$ARCH ACCEPT_KEYWORDS/package.keywords entries - other semantic issues I' not going to repeat - completely useless without docs. If this can help, i'll respond to some of your question : My aims is very different to the one of getmaskingstatus(). I don't have to check everywere for the status : The package which status I'm searching were already checked by getmaskingstatus(). This is very important. The only 2 thinks I implemented was to search : if the package beeing checked is an unstable version, which can be done only by looking at the supported keywords in the ebuild. if the package beeing checked is a masked version. I only need to check is the package was masked in packages.mask, don't mind the reason for which it's now unmasked. If you thinks this can be usefull, I can made the corection needed. If you think this is just a bunch of trash, just tell me to forget, but i'll miss this feature. Jb We didn't say "it's complicated" for no reason ;) Marius PS: But thanks anyway, looking at getmaskingstatus() reminds me of removing the stupid -* message. -- gentoo-portage-dev@gentoo.org mailing list
Re: [gentoo-portage-dev] Display of keyword in emerge : code proposal
On Fri, 18 Nov 2005 19:13:13 +0100 jb benoit <[EMAIL PROTECTED]> wrote: > $ diff -Naur portage.py.sav portage.py > --- portage.py.sav 2005-11-17 15:32:20.0 +0100 > +++ portage.py 2005-11-17 15:15:24.0 +0100 > @@ -3866,6 +3866,42 @@ > pmaskfile.close() > return None > > +def getprintablemaskingstatus(mycpv): > + > + #checking > + global portdb > + mysplit = catpkgsplit(mycpv) > + if not mysplit: > + raise ValueError("invalid CPV: %s" % mycpv) > + if not portdb.cpv_exists(mycpv): > + raise KeyError("CPV %s does not exist" % mycpv) > + mycp=mysplit[0]+"/"+mysplit[1] > + > + #gathering data > + mygroups = portdb.aux_get(mycpv, ["KEYWORDS"])[0].split() > + myarch = settings["ARCH"] > + maskdict=settings.pmaskdict > + > + rValue=[] > + test=0 > + > + # keyword chercking > + for gp in mygroups: > + if gp=="~"+myarch: > + kmask="~"+myarch > + rValue.append(kmask) > + test = 1 > + > + # package.mask checking > +if test == 1: > + if maskdict.has_key(mycp): > + for x in maskdict[mycp]: > + if mycpv in > portdb.xmatch("match-all", x): > + rValue.append("~M") > + > + return rValue > + > + > def getmaskingstatus(mycpv): > global portdb > mysplit = catpkgsplit(mycpv) - Doesn't work with binpkgs (though that's probably also a problem in getmaskingstatus() itself) - there is more than keyword and p.mask for masking (profiles) - the function name is misleading (you're not checking the actual masking status) - you don't check for non-~arch and package.mask'ed packages - you don't check for non-$ARCH ACCEPT_KEYWORDS/package.keywords entries - other semantic issues I' not going to repeat - completely useless without docs. We didn't say "it's complicated" for no reason ;) Marius PS: But thanks anyway, looking at getmaskingstatus() reminds me of removing the stupid -* message. -- Public Key at http://www.genone.de/info/gpg-key.pub In the beginning, there was nothing. And God said, 'Let there be Light.' And there was still nothing, but you could see a bit better. signature.asc Description: PGP signature
[gentoo-portage-dev] Display of keyword in emerge : code proposal
Hello, I'm a newcomer here. The subject deal here was originaly posted here : http://forums.gentoo.org/viewtopic-t-403287.html I have always wanted to display the keywords involved when you emerge a package. Per exemple, i want to know if the xchat-2.6.0 i'll emerge is a stable version, an unstable or a hard-masked one. I have already posted a feature request, but people said it was too difficult. So I decided to make it work myself. Here is the output of the current portage : Code: #emerge portage initng -pv These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild U ] sys-apps/portage-2.1.0_alpha20050718 [2.0.51.22-r3] -build 456 kB [ebuild U ] sys-apps/initng-0.4.2 [0.4.0] 0 kB [1] Total size of downloads: 456 kB Portage overlays: [1] /usr/local/portage My version : Code: #./emerge initng portage -pv These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild U ] sys-apps/initng-0.4.2 [0.4.0] 0 kB [1] ~x86 [ebuild U ] sys-apps/portage-2.1.0_alpha20050718 [2.0.51.22-r3] -build 456 kB ~x86 ~M Total size of downloads: 456 kB Portage overlays: [1] /usr/local/portage So you know that you are going to emerge a development version, and another which is a hard masked one. My code take near 30 lines, so i think it can be easely cheked. So here is the code : for /usr/lib/portage/pym/portage.py Code: $ diff -Naur portage.py.sav portage.py --- portage.py.sav 2005-11-17 15:32:20.0 +0100 +++ portage.py 2005-11-17 15:15:24.0 +0100 @@ -3866,6 +3866,42 @@ pmaskfile.close() return None +def getprintablemaskingstatus(mycpv): + + #checking + global portdb + mysplit = catpkgsplit(mycpv) + if not mysplit: + raise ValueError("invalid CPV: %s" % mycpv) + if not portdb.cpv_exists(mycpv): + raise KeyError("CPV %s does not exist" % mycpv) + mycp=mysplit[0]+"/"+mysplit[1] + + #gathering data + mygroups = portdb.aux_get(mycpv, ["KEYWORDS"])[0].split() + myarch = settings["ARCH"] + maskdict=settings.pmaskdict + + rValue=[] + test=0 + + # keyword chercking + for gp in mygroups: + if gp=="~"+myarch: + kmask="~"+myarch + rValue.append(kmask) + test = 1 + + # package.mask checking + if test == 1: + if maskdict.has_key(mycp): + for x in maskdict[mycp]: + if mycpv in portdb.xmatch("match-all", x): + rValue.append("~M") + + return rValue + + def getmaskingstatus(mycpv): global portdb mysplit = catpkgsplit(mycpv) for /usr/bin/emerge : Code: $ diff -Naur /usr/bin/emerge emerge --- /usr/bin/emerge 2005-11-17 15:16:31.0 +0100 +++ emerge 2005-11-17 15:11:48.0 +0100 @@ -1625,7 +1625,14 @@ display_overlays=True else: verboseadd += "[No ebuild?]" - + + # keywords display + status = portage.getprintablemaskingstatus(x[2]) + if status: + for keywords in status: + verboseadd+=teal(keywords+" ") + + xs=portage.pkgsplit(x[2]) if xs[2]=="r0": xs[2]="" I'm working with : sys-apps/portage-2.0.51.22-r3 Nota: the display of the arch is only available when emerge is called with the -v option I'll be pleased to hear your though about, and to know if this can be merged in portage. Thanxs