Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 190376 Details for
Bug 267565
app-portage/gentoolkit-dev: rewrite ekeyword in python
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ekeyword2_updates.patch
ekeyword2_updates.patch (text/plain), 2.77 KB, created by
michael@smith-li.com
on 2009-05-05 00:59:43 UTC
(
hide
)
Description:
ekeyword2_updates.patch
Filename:
MIME Type:
Creator:
michael@smith-li.com
Created:
2009-05-05 00:59:43 UTC
Size:
2.77 KB
patch
obsolete
>Index: ekeyword2 >=================================================================== >--- ekeyword2 (revision 579) >+++ ekeyword2 (working copy) >@@ -10,6 +10,7 @@ > from sys import argv > from fnmatch import fnmatch > from shutil import copyfile >+from os import environ as env > > import re > import string >@@ -17,16 +18,18 @@ > from portage import settings > > STABLE_KEYWORDS = frozenset(settings["PORTAGE_ARCHLIST"].split()) >-TEST_KEYWORDS = frozenset(['~'+k for k in STABLE_KEYWORDS]) >-KNOWN_KEYWORDS = STABLE_KEYWORDS | TEST_KEYWORDS >+BROKEN_KEYWORDS = frozenset(['-*'] + ['-'+k for k in STABLE_KEYWORDS]) >+TEST_KEYWORDS = frozenset(['~'+k for k in STABLE_KEYWORDS]) >+KNOWN_KEYWORDS = STABLE_KEYWORDS | TEST_KEYWORDS | BROKEN_KEYWORDS > >+argv = set(argv[1:]) > kw_re = re.compile(r'KEYWORDS="([^"]*)"') >-ebuilds = set([x for x in argv[1:] if fnmatch(x, '*.ebuild')]) >-pretend = not bool(set(('-p', '--pretend',)) - set(argv)) >-keywords = frozenset(argv[1:]) - ebuilds - set(('-p', '--pretend')) >+ebuilds = frozenset([x for x in argv if fnmatch(x, '*.ebuild')]) >+pretend = bool(argv.intersection(('-p', '--pretend',))) >+keywords = argv.difference(('-p', '--pretend',)) - ebuilds > > if not ebuilds: >- print 'usage: ekeyword [-p|--pretend] [~] [[~|-]arch [[~|-]arch]...] ebuild [ebuild...]' >+ print 'usage: ekeyword [-p|--pretend] [^|~|-][all] [[^|~|-]arch [[^|~|-]arch]...] ebuild [ebuild...]' > > for e in ebuilds: > # TODO: error handling for file I/O >@@ -47,20 +50,33 @@ > orig = kw_re.search(ebuild) > curkw = set(orig.groups()[0].split()) > >- if '~' in kw: >- kw.remove('~') >+ # ^ or ^all by itself means remove all keywords >+ # (however, other keywords established in the same args still get set.) >+ if kw.intersection(('^', '^all',)): >+ kw -= set(('^', '^all',)) >+ curkw = set() >+ >+ # ~ or ~all by itself means set ~keyword for all keywords >+ # since ~ expands to "$HOME" in the shell, assume the user meant ~ if we see >+ # the expansion of "$HOME". (Hope there's no user named 'all'.) >+ if kw.intersection(('~', '~all', env['HOME'],)): >+ kw -= set(('~', '~all', env['HOME'],)) > curkw = set(['~'+k if k in STABLE_KEYWORDS else k for k in curkw]) > > for k in kw: >- if k[0] == '-': >- curkw -= set(('~'+k[1:], k[1:],)) >- elif k[0] == '~': >- curkw -= set((k[1:],)) >+ # Remove keywords starting with ^ >+ if k[0] == '^': >+ curkw -= set((k[1:], '-'+k[1:], '~'+k[1:], )) >+ # Set ~ and - keywords to TEST and BROKEN, respectively >+ elif k[0] == '~' or k[0] == '-': >+ curkw -= set((k[1:], '-'+k[1:], '~'+k[1:], )) > curkw |= set((k,)) >+ # Set remaining keywords to STABLE > else: > curkw -= set(('~'+k,)) > curkw |= set((k,)) > >+ # Sort by arch, then OS (Luckily, this makes -* show up first if it's there) > result = 'KEYWORDS="%s"' % ' '.join(sorted(curkw, > key=lambda x: x.strip(string.punctuation).lower())) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 267565
:
189526
|
190332
| 190376