Here is ekeyword rewritten in python. Reproducible: Always
Created attachment 189526 [details] ekeyword2
hard coding of KEYWORDS is not ok ... one of the advantages of ekeyword in perl is that there is no hardcoding while you could pull arch.list from profiles/, it would prevent using ekeyword on packages with arches that havent been merged into the official tree (like the eprefix stuff) what might be a useful addition is having ekeyword warn about unknown entries (for cases where people typo something like "amd46") and the keyword doesnt already exist in the ebuild ...
(In reply to comment #2) > hard coding of KEYWORDS is not ok ... one of the advantages of ekeyword in perl > is that there is no hardcoding > > while you could pull arch.list from profiles/, it would prevent using ekeyword > on packages with arches that havent been merged into the official tree (like > the eprefix stuff) This pythonized ekeyword doesn't prevent anything. It merely puts out a warning if a keyword isn't recognized, and proceeds anyway. I had in mind to pull the STABLE_KEYWORDS from profiles, but I realized some keywords (particularly for alt projects) wouldn't be there, so the warnings would get annoying. Another alternative would be an ~/.ekeyword file where known keywords could be configured by individual devs. Regardless of the method, ekeyword(.py) will not prevent the dev from doing anything, but I think the warnings are helpful. Do you still disagree, despite the fact that ekeyword doesn't actually refuse anything?
Created attachment 190332 [details, diff] ekeywords2_getknown.patch idl0r gave me this improved getting of known keywords. Should work well if the dev has set his PORTDIR_OVERLAY correctly.
Created attachment 190376 [details, diff] ekeyword2_updates.patch < FuzzyRay> I just noticed, ekeyword2 doesn't support the remove keywords (i.e ^x86) or the all shortcut With this update it does, although the 'all' parameter itself is optional. It also supports the -* keyword, handles tildes expanded by the shell. Also, removes happen first, so you can remove all keywords before adding some back. So for example: # Remove all keywords $ ekeyword2 ^ foo.ebuild # or... $ ekeyword2 ^all foo.ebuild # Drop mips support $ ekeyword2 ^mips foo.ebuild # Remove all keywords except ppc $ ekeyword2 ^ ppc foo.ebuild # Set all keywords to testing $ ekeyword2 ~ foo.ebuild # or... $ ekeyword2 ~all foo.ebuild # Set all keywords to broken $ ekeyword2 - foo.ebuild # or... $ ekeyword2 -all foo.ebuild
$ svn commit -m "Add patch from kojiro to support keyword removal and all" Sending ekeyword2/ekeyword2 Transmitting file data . Committed revision 580.
i wrote a new ekeyword from scratch in python. i didn't realize there was an existing ekeyword2, so i got annoyed when i saw one existed, but then didn't feel bad when i read the code ;). i've deleted both the old perl ekeyword and python ekeyword2. there is now just one ekeyword in the tree and it's written cleanly in python. http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commitdiff;h=840bf7e8df3c86e161f7855a37b008b5cf16f2d8 if you find issues in it, please file new bugs