From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
Date: Thu, 28 Jul 2011 19:54:46 +0000 (UTC) [thread overview]
Message-ID: <35ccdf9b9c1ccef8482e8d2f2ed1dac3d50849d6.mgorny@gentoo> (raw)
commit: 35ccdf9b9c1ccef8482e8d2f2ed1dac3d50849d6
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 28 19:25:57 2011 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 28 19:25:57 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=35ccdf9b
Paludis: support passing more args to depspecs.
---
gentoopm/paludispm/depend.py | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/gentoopm/paludispm/depend.py b/gentoopm/paludispm/depend.py
index ee5ad4c..9084f3d 100644
--- a/gentoopm/paludispm/depend.py
+++ b/gentoopm/paludispm/depend.py
@@ -4,6 +4,7 @@
# Released under the terms of the 2-clause BSD license.
import paludis, re
+from collections import namedtuple
from gentoopm.basepm.depend import PMPackageDepSet, PMConditionalDep, \
PMAnyOfDep, PMAllOfDep, PMExactlyOneOfDep, PMBaseDep
@@ -12,25 +13,25 @@ from gentoopm.paludispm.atom import PaludisAtom
_block_re = re.compile('^!*')
class PaludisBaseDep(PMBaseDep):
- def __init__(self, deps, pkg):
+ def __init__(self, deps, args):
self._deps = deps
- self._pkg = pkg
+ self._args = args
def __iter__(self):
for d in self._deps:
if isinstance(d, paludis.PackageDepSpec):
- yield PaludisAtom(d, self._pkg._env)
+ yield PaludisAtom(d, self._args.env)
elif isinstance(d, paludis.BlockDepSpec):
- yield PaludisAtom(d.blocking, self._pkg._env,
+ yield PaludisAtom(d.blocking, self._args.env,
block = _block_re.match(d.text).group(0))
elif isinstance(d, paludis.AnyDepSpec):
- yield PaludisAnyOfDep(d, self._pkg)
+ yield PaludisAnyOfDep(d, self._args)
elif isinstance(d, paludis.AllDepSpec):
- yield PaludisAllOfDep(d, self._pkg)
+ yield PaludisAllOfDep(d, self._args)
elif isinstance(d, paludis.ExactlyOneDepSpec):
- yield PaludisExactlyOneOfDep(d, self._pkg)
+ yield PaludisExactlyOneOfDep(d, self._args)
elif isinstance(d, paludis.ConditionalDepSpec):
- yield PaludisConditionalDep(d, self._pkg)
+ yield PaludisConditionalDep(d, self._args)
elif isinstance(d, paludis.PlainTextDepSpec):
# XXX: this is in REQUIRED_USE as well
yield str(d)
@@ -49,7 +50,10 @@ class PaludisExactlyOneOfDep(PMExactlyOneOfDep, PaludisBaseDep):
class PaludisConditionalDep(PMConditionalDep, PaludisBaseDep):
@property
def enabled(self):
- return self._deps.condition_met(self._pkg._env, self._pkg._pkg)
+ return self._deps.condition_met(self._args.env, self._args.pkg)
+
+_argtuple = namedtuple('PaludisDepArgTuple', ('env', 'pkg', 'cls'))
class PaludisPackageDepSet(PMPackageDepSet, PaludisAllOfDep):
- pass
+ def __init__(self, deps, pkg, cls = None):
+ PaludisAllOfDep.__init__(self, deps, _argtuple(pkg._env, pkg._pkg, cls))
next reply other threads:[~2011-07-28 19:54 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 19:54 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-10-10 13:35 [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/ Michał Górny
2012-01-03 18:18 Michał Górny
2011-12-09 15:09 Michał Górny
2011-07-29 6:38 Michał Górny
2011-07-28 19:54 Michał Górny
2011-07-28 16:24 Michał Górny
2011-07-25 17:06 Michał Górny
2011-07-23 20:14 Michał Górny
2011-07-23 20:14 Michał Górny
2011-07-23 20:14 Michał Górny
2011-07-23 9:27 Michał Górny
2011-07-22 6:18 Michał Górny
2011-07-21 8:47 Michał Górny
2011-07-21 8:47 Michał Górny
2011-07-21 8:47 Michał Górny
2011-07-21 8:47 Michał Górny
2011-07-21 8:47 Michał Górny
2011-07-21 8:47 Michał Górny
2011-07-16 22:55 Michał Górny
2011-07-16 22:55 Michał Górny
2011-07-16 9:40 Michał Górny
2011-07-16 9:08 Michał Górny
2011-07-16 8:34 Michał Górny
2011-07-15 13:32 Michał Górny
2011-07-15 12:34 Michał Górny
2011-07-15 9:52 Michał Górny
2011-07-15 9:52 Michał Górny
2011-07-15 9:52 Michał Górny
2011-07-14 22:51 Michał Górny
2011-07-14 17:10 Michał Górny
2011-07-14 17:10 Michał Górny
2011-07-14 14:05 Michał Górny
2011-07-14 14:05 Michał Górny
2011-07-10 22:17 Michał Górny
2011-07-10 22:17 Michał Górny
2011-07-09 7:20 Michał Górny
2011-07-08 21:05 Michał Górny
2011-07-08 21:05 Michał Górny
2011-07-08 16:37 Michał Górny
2011-07-08 16:37 Michał Górny
2011-07-08 7:18 Michał Górny
2011-07-06 20:54 Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35ccdf9b9c1ccef8482e8d2f2ed1dac3d50849d6.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox