<sect1 id='package-ebuild-eapi-2'>
- <title>EAPI 2_pre0</title>
+ <title>EAPI 2_pre1</title>
<sect2 id='package-ebuild-eapi-2-helpers'>
<title>Helpers</title>
<sect3 id='package-ebuild-eapi-2-helpers-doman'>
<entry>bar? ( foo[bar] ) !bar? ( foo )</entry>
</row>
<row>
- <entry>foo[-bar?]</entry>
+ <entry>foo[!bar?]</entry>
<entry>bar? ( foo ) !bar? ( foo[-bar] )</entry>
</row>
<row>
</row>
<row>
<entry>foo[bar!=]</entry>
- <entry>bar? ( foo[-bar] ) !bar? ( foo[bar] )</entry>
+ <entry>bar? ( foo[-bar] ) !bar? ( foo[bar] )</entry>
</row>
</tbody>
</tgroup>
for x in use:
last_char = x[-1:]
+ first_char = x[:1]
if "?" == last_char:
- if "-" == x[:1]:
+ if "-" == first_char:
conditional.disabled.append(x[1:-1])
else:
conditional.enabled.append(x[:-1])
elif "=" == last_char:
- if "-" == x[:1]:
+ if "-" == first_char:
raise InvalidAtom("Invalid use dep: '%s'" % (x,))
if "!" == x[-2:-1]:
- conditional.not_equal.append(x[:-2])
+ raise InvalidAtom("Invalid use dep: '%s'" % (x,))
+ if "!" == first_char:
+ conditional.not_equal.append(x[1:-1])
else:
conditional.equal.append(x[:-1])
else:
- if "-" == x[:1]:
+ if "-" == first_char:
disabled_flags.append(x[1:])
else:
enabled_flags.append(x)
x x? x
-x x?
- x -x?
- -x -x? -x
+ x !x?
+ -x !x? -x
x x= x
-x x= -x
- x x!= -x
- -x x!= x
+ x !x= -x
+ -x !x= x
Conditional syntax examples:
- compact form equivalent expanded form
+ Compact Form Equivalent Expanded Form
foo[bar?] bar? ( foo[bar] ) !bar? ( foo )
- foo[-bar?] bar? ( foo ) !bar? ( foo[-bar] )
+ foo[!bar?] bar? ( foo ) !bar? ( foo[-bar] )
foo[bar=] bar? ( foo[bar] ) !bar? ( foo[-bar] )
- foo[bar!=] bar? ( foo[-bar] ) !bar? ( foo[bar] )
+ foo[!bar=] bar? ( foo[-bar] ) !bar? ( foo[bar] )
"""
tokens = []
( "sys-apps/portage:foo", True ),
( "sys-apps/portage-2.1:foo", False ),
( "sys-apps/portage-2.1:", False ),
- ( "=sys-apps/portage-2.2*:foo[bar?,-baz?,doc!=,build=]", True ),
- ( "=sys-apps/portage-2.2*:foo[build=]", True ),
- ( "=sys-apps/portage-2.2*:foo[doc!=]", True ),
+ ( "=sys-apps/portage-2.2*:foo[bar?,!baz?,!doc=,build=]", True ),
+ ( "=sys-apps/portage-2.2*:foo[doc?]", True ),
+ ( "=sys-apps/portage-2.2*:foo[!doc?]", True ),
+ ( "=sys-apps/portage-2.2*:foo[doc=]", True ),
+ ( "=sys-apps/portage-2.2*:foo[!doc=]", True ),
+ ( "=sys-apps/portage-2.2*:foo[-doc=]", False ),
( "=sys-apps/portage-2.2*:foo[-doc!=]", False ),
( "=sys-apps/portage-2.2*:foo[-doc=]", False ),
( "=sys-apps/portage-2.2*:foo[bar][-baz][doc?][-build?]", False ),
( "=sys-apps/portage-2.2*:foo[bar,-baz,doc?,-build?]", True ),
- ( "=sys-apps/portage-2.2*:foo[bar,-baz,doc?,-build?,]", False ),
- ( "=sys-apps/portage-2.2*:foo[,bar,-baz,doc?,-build?]", False ),
- ( "=sys-apps/portage-2.2*:foo[bar,-baz][doc?,-build?]", False ),
+ ( "=sys-apps/portage-2.2*:foo[bar,-baz,doc?,!build?,]", False ),
+ ( "=sys-apps/portage-2.2*:foo[,bar,-baz,doc?,!build?]", False ),
+ ( "=sys-apps/portage-2.2*:foo[bar,-baz][doc?,!build?]", False ),
( "=sys-apps/portage-2.2*:foo[bar][doc,build]", False ),
( ">~cate-gory/foo-1.0", False ),
( ">~category/foo-1.0", False ),