diff options
-rw-r--r-- | doc/package/ebuild/eapi/2.docbook | 6 | ||||
-rw-r--r-- | pym/portage/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/dep.py | 25 | ||||
-rw-r--r-- | pym/portage/tests/__init__.py | 2 | ||||
-rw-r--r-- | pym/portage/tests/dep/test_isvalidatom.py | 15 |
5 files changed, 28 insertions, 22 deletions
diff --git a/doc/package/ebuild/eapi/2.docbook b/doc/package/ebuild/eapi/2.docbook index 08386cc2f..b8827f8b8 100644 --- a/doc/package/ebuild/eapi/2.docbook +++ b/doc/package/ebuild/eapi/2.docbook @@ -1,5 +1,5 @@ <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'> @@ -80,7 +80,7 @@ <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> @@ -89,7 +89,7 @@ </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> diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index cd065d25d..d489891ee 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -4478,7 +4478,7 @@ def _spawn_misc_sh(mysettings, commands, **kwargs): def eapi_is_supported(eapi): eapi = str(eapi).strip() - if eapi == "2_pre0": + if eapi == "2_pre1": return True try: eapi = int(eapi) diff --git a/pym/portage/dep.py b/pym/portage/dep.py index 8528da4f8..704a3060b 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -356,20 +356,23 @@ class _use_dep(object): 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) @@ -413,22 +416,22 @@ class _use_dep(object): 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 = [] diff --git a/pym/portage/tests/__init__.py b/pym/portage/tests/__init__.py index 7ca048b9a..927af49c7 100644 --- a/pym/portage/tests/__init__.py +++ b/pym/portage/tests/__init__.py @@ -178,4 +178,4 @@ test_cps = ['sys-apps/portage','virtual/portage'] test_versions = ['1.0', '1.0-r1','2.3_p4','1.0_alpha57'] test_slots = [ None, '1','gentoo-sources-2.6.17','spankywashere'] test_usedeps = ['foo','-bar', ('foo','bar'), - ('foo','-bar'), ('foo?', '-bar?') ] + ('foo','-bar'), ('foo?', '!bar?') ] diff --git a/pym/portage/tests/dep/test_isvalidatom.py b/pym/portage/tests/dep/test_isvalidatom.py index f7cc3b844..e21f54afc 100644 --- a/pym/portage/tests/dep/test_isvalidatom.py +++ b/pym/portage/tests/dep/test_isvalidatom.py @@ -25,16 +25,19 @@ class IsValidAtom(TestCase): ( "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 ), |