* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-02-08 0:54 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-02-08 0:54 UTC (permalink / raw
To: gentoo-commits
commit: 71dc688daeb65996708620d78080607a123a5be1
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 7 11:11:08 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 8 00:52:54 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=71dc688d
expand_new_virtuals: save atom unevaluated use
This leads to a better unsatisfied USE message than the one reported
in bug 353933, comment #3. TODO: Fix it so that these generated
atoms don't break depgraph._get_dep_chain(), due to not being
identical to the original atoms and therefore breaking
extract_affecting_use().
---
pym/portage/dep/dep_check.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
index cd740cd..3381af9 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
@@ -121,8 +121,8 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
a = []
for pkg in pkgs:
virt_atom = '=' + pkg.cpv
- if x.use:
- virt_atom += str(x.use)
+ if x.unevaluated_atom.use:
+ virt_atom += str(x.unevaluated_atom.use)
virt_atom = Atom(virt_atom)
# According to GLEP 37, RDEPEND is the only dependency
# type that is valid for new-style virtuals. Repoman
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-04-13 7:52 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-04-13 7:52 UTC (permalink / raw
To: gentoo-commits
commit: 6b9995f6cf4d043cd8b79b56b4c021a375d11995
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 11 22:30:13 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr 13 07:50:25 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b9995f6
extract_affecting_use: allow parens in atoms
This fixes bug #363073 in which an InvalidDependString exception is
erroneously triggered by atoms containing EAPI 4 USE dependency
defaults. This case is very similar to bug #354003 which was fixed in
commit 8735222b77e66850213e2aa6a7ea48e744ba0d4f.
---
pym/portage/dep/__init__.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index a92b481..5911c8c 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -2310,6 +2310,7 @@ def extract_affecting_use(mystr, atom):
@rtype: Tuple of two lists of strings
@return: List of use flags that need to be enabled, List of use flag that need to be disabled
"""
+ useflag_re = _get_useflag_re(None)
mysplit = mystr.split()
level = 0
stack = [[]]
@@ -2322,9 +2323,10 @@ def extract_affecting_use(mystr, atom):
else:
flag = conditional[:-1]
- if not flag:
+ if useflag_re.match(flag) is None:
raise InvalidDependString(
- _("malformed syntax: '%s'") % mystr)
+ _("invalid use flag '%s' in conditional '%s'") % \
+ (flag, conditional))
return flag
@@ -2397,7 +2399,7 @@ def extract_affecting_use(mystr, atom):
need_bracket = True
stack[level].append(token)
else:
- if need_bracket or "(" in token or ")" in token or "|" in token:
+ if need_bracket:
raise InvalidDependString(
_("malformed syntax: '%s'") % mystr)
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-03-18 21:12 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-03-18 21:12 UTC (permalink / raw
To: gentoo-commits
commit: 7a4d48c09791118b4cfb39ebe7711b192603a466
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 18:39:28 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 18 19:49:44 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7a4d48c0
dep_check: return errors as unicode
This should prevent the following error due to returning raw bytes,
reported in forum thread #869281:
File "pym/_emerge/BlockerDB.py", line 72, in findInstalledBlockers
portage.writemsg("!!! %s/*DEPEND: %s\n" % \
(pkg_location, atoms), noiselevel=-1)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in
position 23: ordinal not in range(128)
---
pym/portage/dep/dep_check.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
index 4d26f51..7ec01fa 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
@@ -6,6 +6,7 @@ __all__ = ['dep_check', 'dep_eval', 'dep_wordreduce', 'dep_zapdeps']
import logging
import portage
+from portage import _unicode_decode
from portage.dep import Atom, match_from_list, use_reduce
from portage.exception import InvalidDependString, ParseError
from portage.localization import _
@@ -173,8 +174,8 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
del mytrees["virt_parent"]
if not mycheck[0]:
- raise ParseError(
- "%s: %s '%s'" % (pkg, mycheck[1], depstring))
+ raise ParseError(_unicode_decode("%s: %s '%s'") % \
+ (pkg, mycheck[1], depstring))
# pull in the new-style virtual
mycheck[1].append(virt_atom)
@@ -587,7 +588,7 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
matchall=(use=="all"), excludeall=useforce, opconvert=True, \
token_class=Atom, eapi=eapi)
except InvalidDependString as e:
- return [0, str(e)]
+ return [0, _unicode_decode("%s") % (e,)]
if mysplit == []:
#dependencies were reduced to nothing
@@ -601,7 +602,7 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
use_force=useforce, use_mask=mymasks, use_cache=use_cache,
use_binaries=use_binaries, myroot=myroot, trees=trees)
except ParseError as e:
- return [0, str(e)]
+ return [0, _unicode_decode("%s") % (e,)]
mysplit2=mysplit[:]
mysplit2=dep_wordreduce(mysplit2,mysettings,mydbapi,mode,use_cache=use_cache)
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-02-20 0:04 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-02-20 0:04 UTC (permalink / raw
To: gentoo-commits
commit: 91ae1f7c9902f48eb2d0826a96ea3ec6fae4cc62
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 19 22:53:45 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 20 00:03:24 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=91ae1f7c
check_required_use: improve missing IUSE error
This will fix bug #355629.
---
pym/portage/dep/__init__.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index a8d05f1..a92b481 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -2145,8 +2145,10 @@ def check_required_use(required_use, use, iuse_match):
is_negated = False
if not flag or not iuse_match(flag):
- raise InvalidDependString(
- _("malformed syntax: '%s'") % required_use)
+ msg = _("USE flag '%s' is not in IUSE") \
+ % (flag,)
+ e = InvalidData(msg, category='IUSE.missing')
+ raise InvalidDependString(msg, errors=(e,))
return (flag in use and not is_negated) or \
(flag not in use and is_negated)
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-02-08 20:48 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-02-08 20:48 UTC (permalink / raw
To: gentoo-commits
commit: ad5e303de8c4da3f38de7e2489b1a1e811165c36
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 8 18:54:51 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 8 20:46:05 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ad5e303d
expand_new_virtuals: fix pkg_use_enabled call
AttributeError: 'tuple' object has no attribute 'use'
---
pym/portage/dep/dep_check.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
index ca65601..6d2d99d 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
@@ -36,10 +36,10 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
if parent is not None:
if virt_parent is not None:
graph_parent = virt_parent
- eapi = virt_parent[0].metadata['EAPI']
+ parent = virt_parent[0]
else:
graph_parent = parent
- eapi = parent.metadata["EAPI"]
+ eapi = parent.metadata["EAPI"]
repoman = not mysettings.local_config
if kwargs["use_binaries"]:
portdb = trees[myroot]["bintree"].dbapi
@@ -124,7 +124,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
if x.unevaluated_atom.use:
virt_atom += str(x.unevaluated_atom.use)
virt_atom = Atom(virt_atom)
- if graph_parent is None:
+ if parent is None:
if myuse is None:
virt_atom = virt_atom.evaluate_conditionals(
mysettings.get("PORTAGE_USE", "").split())
@@ -132,7 +132,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
virt_atom = virt_atom.evaluate_conditionals(myuse)
else:
virt_atom = virt_atom.evaluate_conditionals(
- pkg_use_enabled(graph_parent))
+ pkg_use_enabled(parent))
else:
virt_atom = Atom(virt_atom)
# According to GLEP 37, RDEPEND is the only dependency
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-02-08 0:54 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-02-08 0:54 UTC (permalink / raw
To: gentoo-commits
commit: 7f2874ee2366a1a94534e9b3d97bd2f43573d4d4
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 7 22:19:33 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 8 00:53:30 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7f2874ee
expand_new_virtuals: fix last commit USE handling
---
pym/portage/dep/dep_check.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
index 60896c0..9373ecb 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
@@ -124,8 +124,11 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
if x.unevaluated_atom.use:
virt_atom += str(x.unevaluated_atom.use)
virt_atom = Atom(virt_atom)
- virt_atom = virt_atom.evaluate_conditionals(
- pkg_use_enabled(graph_parent))
+ if graph_parent is None:
+ virt_atom = virt_atom.evaluate_conditionals(myuse)
+ else:
+ virt_atom = virt_atom.evaluate_conditionals(
+ pkg_use_enabled(graph_parent))
else:
virt_atom = Atom(virt_atom)
# According to GLEP 37, RDEPEND is the only dependency
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-02-08 0:54 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-02-08 0:54 UTC (permalink / raw
To: gentoo-commits
commit: 8954c253e23261ff3674a96bc02ea7c4487c138b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 8 00:42:37 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 8 00:53:37 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8954c253
expand_new_virtuals: handle None for myuse
---
pym/portage/dep/dep_check.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
index 9373ecb..ca65601 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
@@ -125,7 +125,11 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
virt_atom += str(x.unevaluated_atom.use)
virt_atom = Atom(virt_atom)
if graph_parent is None:
- virt_atom = virt_atom.evaluate_conditionals(myuse)
+ if myuse is None:
+ virt_atom = virt_atom.evaluate_conditionals(
+ mysettings.get("PORTAGE_USE", "").split())
+ else:
+ virt_atom = virt_atom.evaluate_conditionals(myuse)
else:
virt_atom = virt_atom.evaluate_conditionals(
pkg_use_enabled(graph_parent))
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-02-08 0:54 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-02-08 0:54 UTC (permalink / raw
To: gentoo-commits
commit: f0ed96b6459746669adc880730c5e339f3851772
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 7 11:43:06 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 8 00:53:00 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f0ed96b6
expand_new_virtuals: fix logic from prev commit
We need to evaluate conditionals for dependency matching purposes,
though the unevaluated atom will still be available later for other
purposes.
---
pym/portage/dep/dep_check.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py
index 3381af9..da9b4e5 100644
--- a/pym/portage/dep/dep_check.py
+++ b/pym/portage/dep/dep_check.py
@@ -123,7 +123,11 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
virt_atom = '=' + pkg.cpv
if x.unevaluated_atom.use:
virt_atom += str(x.unevaluated_atom.use)
- virt_atom = Atom(virt_atom)
+ virt_atom = Atom(virt_atom)
+ virt_atom = virt_atom.evaluate_conditionals(
+ pkg_use_enabled(graph_parent))
+ else:
+ virt_atom = Atom(virt_atom)
# According to GLEP 37, RDEPEND is the only dependency
# type that is valid for new-style virtuals. Repoman
# should enforce this.
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-02-05 0:59 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-02-05 0:59 UTC (permalink / raw
To: gentoo-commits
commit: 2adc4b170114808b688df080bd5428feda61a425
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 5 00:27:25 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 5 00:31:14 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2adc4b17
check_required_use: remove obsolete hunk
---
pym/portage/dep/__init__.py | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 571f6c1..cf83e0a 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -2253,15 +2253,6 @@ def check_required_use(required_use, use, iuse_match):
node._parent._children.append(child)
if isinstance(child, _RequiredUseBranch):
child._parent = node._parent
- else:
- for index, child in enumerate(node._children):
- if isinstance(child, _RequiredUseBranch) and \
- child._operator is None and \
- len(child._children) == 1:
- child = child._children[0]
- node._children[index] = child
- if isinstance(child, _RequiredUseBranch):
- child._parent = node
node = node._parent
else:
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-02-05 0:59 Zac Medico
0 siblings, 0 replies; 11+ messages in thread
From: Zac Medico @ 2011-02-05 0:59 UTC (permalink / raw
To: gentoo-commits
commit: bddc55460cb4da3d8d329c772018119ba6bcfaaa
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 4 22:59:28 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 5 00:31:01 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bddc5546
REQUIRED_USE: fix single child conditionals disp
---
pym/portage/dep/__init__.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index b429e56..6b125f0 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -2226,15 +2226,14 @@ def check_required_use(required_use, use, iuse_match):
node._parent._children.append(child)
if isinstance(child, _RequiredUseBranch):
child._parent = node._parent
- node = node._parent
- continue
- if not node._children:
+ elif not node._children:
last_node = node._parent._children.pop()
if last_node is not node:
raise AssertionError(
"node is not last child of parent")
- elif len(node._children) == 1:
+
+ elif len(node._children) == 1 and op in ("||", "^^"):
last_node = node._parent._children.pop()
if last_node is not node:
raise AssertionError(
@@ -2243,6 +2242,7 @@ def check_required_use(required_use, use, iuse_match):
if isinstance(node._children[0], _RequiredUseBranch):
node._children[0]._parent = node._parent
node = node._children[0]
+
else:
for index, child in enumerate(node._children):
if isinstance(child, _RequiredUseBranch) and \
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/
@ 2011-02-04 6:33 zmedico
0 siblings, 0 replies; 11+ messages in thread
From: zmedico @ 2011-02-04 6:33 UTC (permalink / raw
To: gentoo-commits
commit: 34b0fcc882664b78911b8f67461ad70676e4debe
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 4 06:28:35 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 4 06:33:37 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=34b0fcc882664b78911b8f67461ad70676e4debe
Remove from list by index, not search.
---
pym/portage/dep/__init__.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 68e628b..62e96d2 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -2217,7 +2217,7 @@ def check_required_use(required_use, use, iuse_match):
node._satisfied = satisfied
if node._parent._operator not in ("||", "^^"):
offset = node._parent._children.index(node)
- node._parent._children.remove(node)
+ node._parent._children.pop(offset)
for i, child in enumerate(node._children):
node._parent._children.insert(offset + i, child)
if isinstance(child, _RequiredUseBranch):
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-04-13 7:53 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-08 0:54 [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/dep/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2011-04-13 7:52 Zac Medico
2011-03-18 21:12 Zac Medico
2011-02-20 0:04 Zac Medico
2011-02-08 20:48 Zac Medico
2011-02-08 0:54 Zac Medico
2011-02-08 0:54 Zac Medico
2011-02-08 0:54 Zac Medico
2011-02-05 0:59 Zac Medico
2011-02-05 0:59 Zac Medico
2011-02-04 6:33 zmedico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox