public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/pkgcorepm/
Date: Tue, 26 Jul 2011 07:24:10 +0000 (UTC)	[thread overview]
Message-ID: <38f9d3fda6203bf31a2fb5e12fcc7cfc3c840a71.mgorny@gentoo> (raw)

commit:     38f9d3fda6203bf31a2fb5e12fcc7cfc3c840a71
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 26 07:24:37 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jul 26 07:24:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=38f9d3fd

pkgcore: support dropping conditionals using evaluate_depset().

---
 gentoopm/pkgcorepm/depend.py |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/gentoopm/pkgcorepm/depend.py b/gentoopm/pkgcorepm/depend.py
index 5c38500..eaa6333 100644
--- a/gentoopm/pkgcorepm/depend.py
+++ b/gentoopm/pkgcorepm/depend.py
@@ -37,4 +37,31 @@ class PkgCoreConditionalUseDep(PMConditionalDep, PkgCoreBaseDep):
 		return self._deps.restriction.match(self._pkg.use)
 
 class PkgCorePackageDepSet(PMPackageDepSet, PkgCoreBaseDep):
+	@property
+	def without_conditionals(self):
+		return PkgCoreUncondPackageDepSet(
+				self._deps.evaluate_depset(self._pkg.use))
+
+class PkgCoreUncondDep(PkgCoreBaseDep):
+	def __init__(self, deps):
+		self._deps = deps
+
+	@property
+	def without_conditionals(self):
+		return self
+
+	def __iter__(self):
+		for d in self._deps:
+			if isinstance(d, atom):
+				yield PkgCoreAtom(d)
+			elif isinstance(d, OrRestriction):
+				yield PkgCoreUncondOneOfDep(d)
+			else:
+				raise NotImplementedError('Parsing %s not implemented' \
+						% repr(d))
+
+class PkgCoreUncondOneOfDep(PMOneOfDep, PkgCoreUncondDep):
+	pass
+
+class PkgCoreUncondPackageDepSet(PkgCoreUncondDep):
 	pass



             reply	other threads:[~2011-07-26  7:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26  7:24 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-10-14 21:35 [gentoo-commits] proj/gentoopm:master commit in: gentoopm/pkgcorepm/ Michał Górny
2011-11-14 22:12 Michał Górny
2011-11-14 21:44 Michał Górny
2011-11-14 21:44 Michał Górny
2011-08-13 18:49 Michał Górny
2011-07-27 20:45 Michał Górny
2011-07-26 16:36 Michał Górny
2011-07-25 19:06 Michał Górny
2011-07-25 19:06 Michał Górny
2011-07-21  8:47 Michał Górny
2011-07-21  8:47 Michał Górny
2011-07-15 13:32 Michał Górny
2011-07-15 12:34 Michał Górny
2011-07-14 13:31 Michał Górny
2011-07-13 17:16 Michał Górny
2011-07-13 17:05 Michał Górny
2011-07-12  9:14 Michał Górny
2011-07-10 22:17 Michał Górny
2011-07-09  7:15 Michał Górny
2011-07-09  7:15 Michał Górny
2011-07-09  7:15 Michał Górny
2011-07-08  7:18 Michał Górny
2011-07-07  9:51 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=38f9d3fda6203bf31a2fb5e12fcc7cfc3c840a71.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