diff options
author | Brian Harring <ferringb@gmail.com> | 2008-10-07 07:07:23 -0700 |
---|---|---|
committer | Brian Harring <ferringb@gmail.com> | 2008-10-07 07:07:23 -0700 |
commit | 2934189fe087cca2fa1c768e44ab3717eb674226 (patch) | |
tree | d15c767d264bb7223f4936482db8ad9edaf9763e | |
parent | 0.4.7.9 (diff) | |
download | pkgcore-2934189fe087cca2fa1c768e44ab3717eb674226.tar.gz pkgcore-2934189fe087cca2fa1c768e44ab3717eb674226.tar.bz2 pkgcore-2934189fe087cca2fa1c768e44ab3717eb674226.zip |
host of eapi2 related fixups.
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | pkgcore/const.py | 2 | ||||
-rw-r--r-- | pkgcore/ebuild/atom.py | 45 | ||||
-rw-r--r-- | pkgcore/ebuild/conditionals.py | 9 | ||||
-rw-r--r-- | pkgcore/test/ebuild/test_atom.py | 6 | ||||
-rw-r--r-- | pkgcore/test/ebuild/test_ebuild_src.py | 8 | ||||
-rw-r--r-- | setup.py | 1 |
7 files changed, 31 insertions, 47 deletions
@@ -4,6 +4,13 @@ Pkgcore Release Notes See ChangeLog for full commit logs; this is summarized/major changes. +* api for depset inspection for tristate (pcheck visibility mode) is fixed + to not tell the consumer to lovingly 'die in a fire'. + +* correct a failure in EAPI=2 src_uri parsing complaining about + missing checksums for nonexistant files + + pkgcore 0.4.7.9: * eapi2 is now supported. diff --git a/pkgcore/const.py b/pkgcore/const.py index 16a7c987..0ece6594 100644 --- a/pkgcore/const.py +++ b/pkgcore/const.py @@ -36,4 +36,4 @@ WORLD_FILE = '/var/lib/portage/world' LIBFAKEROOT_PATH = "/usr/lib/libfakeroot.so" FAKED_PATH = "/usr/bin/faked" -VERSION = '0.4.7.9' +VERSION = '0.4.7.10' diff --git a/pkgcore/ebuild/atom.py b/pkgcore/ebuild/atom.py index 6eb142f1..2be4b428 100644 --- a/pkgcore/ebuild/atom.py +++ b/pkgcore/ebuild/atom.py @@ -563,41 +563,6 @@ class transitive_use_atom(atom): def _stripped_use(self): return str(self).split("[", 1)[0] - def evaluate_depset(self, cond_dict, tristate_filter=None): - if tristate_filter is not None: - raise Exception("die in a fire.") - req_use_state = [] - for use in self.use: - if use[-1] == '?': - if use[0] == '!': - use = use[1:-1] - if use not in cond_dict: - req_use_state.append('-' + use) - else: - use = use[:-1] - if use in cond_dict: - req_use_state.append(use) - elif use[-1] == '=': - if use[0] == '!': - use = use[1:-1] - if use in cond_dict: - # ok... negate the flag. - use = '-' + use - else: - use = use[:-1] - if use not in cond_dict: - use = '-' + use - req_use_state.append(use) - else: - req_use_state.append(use) - - if req_use_state: - a = self._nontransitive_use_atom('%s[%s]' % (self._stripped_use(), - ','.join(req_use_state))) - else: - a = self._nontransitive_use_atom(self._stripped_use()) - return (boolean.AndRestriction, iter([a])) - @staticmethod def _mk_conditional(flag, payload, negate=False): return Conditional('use', ContainmentMatch(flag, negate=negate), @@ -647,6 +612,13 @@ class transitive_use_atom(atom): forced_use + use_states[1], varied), negate=True) ) + def __getattr__(self, attr): + if attr != 'restrictions': + return atom.__getattr__(self, attr) + obj = self.convert_to_conditionals() + object.__setattr__(self, 'restrictions', obj) + return obj + def convert_to_conditionals(self): static_use = [use for use in self.use if use[-1] not in '?='] variable = [use for use in self.use if use[-1] in '?='] @@ -654,6 +626,9 @@ class transitive_use_atom(atom): self._recurse_transitive_use_conds(self._stripped_use(), static_use, variable)) + iter_dnf_solutions = boolean.AndRestriction.iter_dnf_solutions + cnf_solutions = boolean.AndRestriction.cnf_solutions + atom._transitive_use_atom = transitive_use_atom diff --git a/pkgcore/ebuild/conditionals.py b/pkgcore/ebuild/conditionals.py index b3f2376d..5b017e45 100644 --- a/pkgcore/ebuild/conditionals.py +++ b/pkgcore/ebuild/conditionals.py @@ -163,7 +163,7 @@ class DepSet(boolean.AndRestriction): else: if k2 != '->': depsets[-1].append(element_func(k)) - words.appendleft(k2) + words.appendleft((k2,)) else: k3 = words.next() # file ename. @@ -223,10 +223,9 @@ class DepSet(boolean.AndRestriction): count = 1 while count: for node in stack[-1]: - if getattr(node, 'evaluate_depset', None): - stack += node.evaluate_depset(cond_dict, - tristate_filter=tristate_filter) - elif isinstance(node, self.element_class): + if getattr(node, 'convert_to_conditionals', None): + node = node.convert_to_conditionals() + if isinstance(node, self.element_class): restricts[-1].append(node) continue elif isinstance(node, packages.Conditional): diff --git a/pkgcore/test/ebuild/test_atom.py b/pkgcore/test/ebuild/test_atom.py index 13d4b459..9e1e1261 100644 --- a/pkgcore/test/ebuild/test_atom.py +++ b/pkgcore/test/ebuild/test_atom.py @@ -135,12 +135,6 @@ class Test_native_atom(TestCase): self.assertFalse(self.kls("%s[-debug]" % astr).match(c)) self.assertTrue(self.kls("%s[debug,-not]" % astr).match(c)) self.assertTrue(self.kls("%s:1[debug,-not]" % astr).match(c)) - kls, vals = self.kls("%s:1[debug=]" % astr).evaluate_depset(["debug"]) - restrict = kls(*list(vals)) - self.assertTrue(restrict.match(c)) - kls, vals = self.kls("%s:1[debug=]" % astr).evaluate_depset([""]) - restrict = kls(*list(vals)) - self.assertFalse(restrict.match(c)) self.assertRaises(errors.MalformedAtom, self.kls, "%s[]" % astr) self.assertRaises(errors.MalformedAtom, self.kls, "dev-util/diffball[foon") self.assertRaises(errors.MalformedAtom, self.kls, "dev-util/diffball[[fo]") diff --git a/pkgcore/test/ebuild/test_ebuild_src.py b/pkgcore/test/ebuild/test_ebuild_src.py index 166d8e83..3e70122b 100644 --- a/pkgcore/test/ebuild/test_ebuild_src.py +++ b/pkgcore/test/ebuild/test_ebuild_src.py @@ -169,6 +169,14 @@ class test_base(TestCase): self.assertEqual(list(f[0].uri), ['http://foo.com/monkey.tgz']) self.assertEqual(f[0].filename, 'monkey.tgz') + f = self.get_pkg({'SRC_URI':'http://foo.com/monkey.tgz ' + 'http://dar/boon.tgz', 'EAPI':'2'}, + repo=parent).fetchables + self.assertEqual([list(x.uri) for x in f], + [['http://foo.com/monkey.tgz'], ['http://dar/boon.tgz']]) + self.assertEqual([x.filename for x in f], + ['monkey.tgz', 'boon.tgz']) + f = self.get_pkg({'SRC_URI':'http://foo.com/monkey.tgz -> foon.tar.gz', 'EAPI':'2'}, repo=parent).fetchables @@ -385,6 +385,7 @@ core.setup( package_data={ 'pkgcore': [ 'bin/ebuild-env/*', + 'bin/ebuild-env/eapi/*', 'bin/ebuild-helpers/*', ], }, |