summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-30 02:27:53 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-30 02:27:53 +0000
commit0183b2c3c109ed19b0a43d58b93651b88753a4b3 (patch)
treeb7d37bf5c552ef8b381e7e2f37f896b7316e47ed
parent26a87d7e588b6ec5bacf0734985893fdc5adf5cf (diff)
downloadportage-0183b2c3c109ed19b0a43d58b93651b88753a4b3.tar.gz
portage-0183b2c3c109ed19b0a43d58b93651b88753a4b3.tar.bz2
portage-0183b2c3c109ed19b0a43d58b93651b88753a4b3.zip
Change conditional USE deps syntax and expermental EAPI from 2_pre0 to 2_pre1.
Conditional syntax examples: Compact Form Equivalent Expanded Form foo[bar?] bar? ( foo[bar] ) !bar? ( foo ) foo[!bar?] bar? ( foo ) !bar? ( foo[-bar] ) foo[bar=] bar? ( foo[bar] ) !bar? ( foo[-bar] ) foo[!bar=] bar? ( foo[-bar] ) !bar? ( foo[bar] ) svn path=/main/trunk/; revision=11274
-rw-r--r--doc/package/ebuild/eapi/2.docbook6
-rw-r--r--pym/portage/__init__.py2
-rw-r--r--pym/portage/dep.py25
-rw-r--r--pym/portage/tests/__init__.py2
-rw-r--r--pym/portage/tests/dep/test_isvalidatom.py15
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 ),