public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-06 20:54 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-06 20:54 UTC (permalink / raw
  To: gentoo-commits

commit:     92537be60a116b1633c55b34df3c69a9cb8f5629
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  6 20:12:23 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jul  6 20:13:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=92537be6

paludis: support sorting ebuilds.

---
 gentoopm/paludispm/__init__.py |    7 ++++++-
 gentoopm/paludispm/pkg.py      |   10 ++++++----
 gentoopm/paludispm/repo.py     |   22 +++++++++++++++++++---
 3 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/gentoopm/paludispm/__init__.py b/gentoopm/paludispm/__init__.py
index 4e62095..e06b5aa 100644
--- a/gentoopm/paludispm/__init__.py
+++ b/gentoopm/paludispm/__init__.py
@@ -6,7 +6,8 @@
 import paludis
 
 from gentoopm.basepm import PackageManager
-from gentoopm.paludispm.repo import PaludisRepoDict, PaludisInstalledRepo
+from gentoopm.paludispm.repo import PaludisRepoDict, PaludisInstalledRepo, \
+		PaludisStackRepo
 
 class PaludisPM(PackageManager):
 	name = 'paludis'
@@ -21,3 +22,7 @@ class PaludisPM(PackageManager):
 	@property
 	def installed(self):
 		return PaludisInstalledRepo(self._env)
+
+	@property
+	def stack(self):
+		return PaludisStackRepo(self._env)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index c816f96..99fc707 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -9,8 +9,10 @@ from gentoopm.basepm.metadata import PMPackageMetadata
 from gentoopm.basepm.pkg import PMPackage
 
 class PaludisID(PMPackage):
-	def __init__(self, pkg):
+	def __init__(self, pkg, num = 0, enum_id = None):
 		self._pkg = pkg
+		self._num = num
+		self._enum_id = enum_id
 
 	@property
 	def metadata(self):
@@ -24,9 +26,9 @@ class PaludisID(PMPackage):
 		if not isinstance(other, PaludisID):
 			raise TypeError('Unable to compare %s against %s' % \
 					self, other)
-		if self._pkg.name != other._pkg.name:
-			raise TypeError('Unable to compare IDs with different PNs')
-		return self._pkg.version.__cmp__(other._pkg.version)
+		if self._enum_id != other._enum_id:
+			raise TypeError('Unable to compare results of two enumerations')
+		return cmp(self._num, other._num)
 
 class PaludisMetadata(PMPackageMetadata):
 	def __init__(self, pkg):

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 71214de..cd8cc16 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -18,13 +18,29 @@ class PaludisRepoDict(PMRepositoryDict):
 	def __init__(self, env):
 		self._env = env
 
+class PaludisEnumID(object):
+	pass
+
 class PaludisRepository(PMRepository):
+	def __init__(self, env):
+		self._env = env
+
 	def __iter__(self):
-		for p in self._env[paludis.Selection.AllVersionsSorted(
+		enum = PaludisEnumID()
+		for i, p in enumerate(self._env[paludis.Selection.AllVersionsSorted(
 				paludis.FilteredGenerator(
 					paludis.Generator.InRepository(self._repo.name),
-					paludis.Filter.All()))]:
-			yield PaludisID(p)
+					paludis.Filter.All()))]):
+			yield PaludisID(p, i, enum)
+
+class PaludisStackRepo(PaludisRepository):
+	def __iter__(self):
+		enum = PaludisEnumID()
+		for i, p in enumerate(self._env[paludis.Selection.AllVersionsSorted(
+				paludis.FilteredGenerator(
+					paludis.Generator.All(),
+					paludis.Filter.SupportsInstallAction()))]):
+			yield PaludisID(p, i, enum)
 
 class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
 	def __init__(self, repo_obj, env):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-08  7:18 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-08  7:18 UTC (permalink / raw
  To: gentoo-commits

commit:     b6feaf9e3476a4cb6166ea80a206b090a5f5b299
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 07:06:23 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 07:06:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=b6feaf9e

Paludis: use wildcard atoms for category unspecified.

Instead of expanding category, use '*' wildcard.

---
 gentoopm/paludispm/atom.py |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/gentoopm/paludispm/atom.py b/gentoopm/paludispm/atom.py
index 5e1949d..a67a308 100644
--- a/gentoopm/paludispm/atom.py
+++ b/gentoopm/paludispm/atom.py
@@ -3,23 +3,33 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-import paludis
+import paludis, re
 
 from gentoopm.basepm.atom import PMAtom
 
+_category_wildcard_re = re.compile(r'\w')
+
 class PaludisAtom(PMAtom):
-	def __init__(self, s, pm):
+	def _init_atom(self, s, pm, wildcards = False):
+		opts = paludis.UserPackageDepSpecOptions() \
+				+ paludis.UserPackageDepSpecOption.NO_DISAMBIGUATION
+		if wildcards:
+			opts += paludis.UserPackageDepSpecOption.ALLOW_WILDCARDS
+
 		try:
 			self._atom = paludis.parse_user_package_dep_spec(
-					s, pm._env,
-					paludis.UserPackageDepSpecOptions(),
+					s, pm._env, opts,
 					paludis.Filter.All())
-		except (paludis.BadVersionOperatorError, paludis.PackageDepSpecError):
+		except (paludis.BadVersionOperatorError, paludis.PackageDepSpecError,
+				paludis.RepositoryNameError):
 			raise ValueError('Incorrect atom: %s' % s)
-		except paludis.AmbiguousPackageNameError:
-			raise KeyError('Ambiguous atom: %s' % s)
-		except paludis.NoSuchPackageError:
-			raise KeyError('Unable to expand atom: %s' % s)
+
+	def __init__(self, s, pm):
+		try:
+			self._init_atom(s, pm)
+		except ValueError:
+			# try */ for the category
+			self._init_atom(_category_wildcard_re.sub(r'*/\g<0>', s, 1), pm, True)
 
 	def __contains__(self, pkg):
 		raise NotImplementedError('Direct atom matching not implemented in Paludis')



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-08 16:37 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-08 16:37 UTC (permalink / raw
  To: gentoo-commits

commit:     b0572d4b95f033e6f1d9c360e8d60fa0828e5d8a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 16:38:07 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 16:38:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=b0572d4b

Paludis: don't sort if sorted already.

---
 gentoopm/paludispm/pkg.py  |   26 +++++++++++++++++++++++++-
 gentoopm/paludispm/repo.py |    3 ++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 923376e..5f40984 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -10,11 +10,35 @@ from gentoopm.basepm.pkg import PMPackageSet, PMPackage, \
 		PMFilteredPackageSet
 
 class PaludisPackageSet(PMPackageSet):
+	_sorted = False
+
 	def filter(self, *args, **kwargs):
 		return PaludisFilteredPackageSet(self, args, kwargs)
 
+	@property
+	def best(self):
+		if self._sorted:
+			it = iter(self)
+
+			try:
+				f = next(it)
+			except StopIteration:
+				raise TypeError('.best called on an empty set')
+			for p in it:
+				if p.key != f.key:
+					raise KeyError('.best called on a set of differently-named packages')
+
+			try:
+				return p
+			except NameError:
+				return f
+		else:
+			return PMPackageSet.best.fget(self)
+
 class PaludisFilteredPackageSet(PMFilteredPackageSet, PaludisPackageSet):
-	pass
+	def __init__(self, pset, args, kwargs):
+		self._sorted = pset._sorted
+		PMFilteredPackageSet.__init__(self, pset, args, kwargs)
 
 class PaludisID(PMPackage):
 	def __init__(self, pkg, num = 0, enum_id = None):

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 217242f..0a884fd 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -24,6 +24,7 @@ class PaludisEnumID(object):
 class PaludisRepository(PMRepository, PaludisPackageSet):
 	def __init__(self, env):
 		self._env = env
+		self._sorted = True
 
 	def __iter__(self):
 		enum = PaludisEnumID()
@@ -44,7 +45,7 @@ class PaludisStackRepo(PaludisRepository):
 
 class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
 	def __init__(self, repo_obj, env):
-		self._env = env
+		PaludisRepository.__init__(self, env)
 		self._repo = repo_obj
 
 	@property



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-08 16:37 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-08 16:37 UTC (permalink / raw
  To: gentoo-commits

commit:     b2431df1d848cac88618598beb0799ef6f23802f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 15:37:20 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 15:38:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=b2431df1

Paludis: wrap PackageSets.

---
 gentoopm/paludispm/pkg.py  |   10 +++++++++-
 gentoopm/paludispm/repo.py |    4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 017cd07..923376e 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -6,7 +6,15 @@
 import paludis
 
 from gentoopm.basepm.metadata import PMPackageMetadata
-from gentoopm.basepm.pkg import PMPackage
+from gentoopm.basepm.pkg import PMPackageSet, PMPackage, \
+		PMFilteredPackageSet
+
+class PaludisPackageSet(PMPackageSet):
+	def filter(self, *args, **kwargs):
+		return PaludisFilteredPackageSet(self, args, kwargs)
+
+class PaludisFilteredPackageSet(PMFilteredPackageSet, PaludisPackageSet):
+	pass
 
 class PaludisID(PMPackage):
 	def __init__(self, pkg, num = 0, enum_id = None):

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index cd8cc16..217242f 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -7,7 +7,7 @@ import paludis
 
 from gentoopm.basepm.repo import PMRepository, PMRepositoryDict, \
 		PMEbuildRepository
-from gentoopm.paludispm.pkg import PaludisID
+from gentoopm.paludispm.pkg import PaludisID, PaludisPackageSet
 
 class PaludisRepoDict(PMRepositoryDict):
 	def __iter__(self):
@@ -21,7 +21,7 @@ class PaludisRepoDict(PMRepositoryDict):
 class PaludisEnumID(object):
 	pass
 
-class PaludisRepository(PMRepository):
+class PaludisRepository(PMRepository, PaludisPackageSet):
 	def __init__(self, env):
 		self._env = env
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-08 21:05 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-08 21:05 UTC (permalink / raw
  To: gentoo-commits

commit:     87eed3cc74ea06f0b6cb4cf2ebb18b27ee508e6f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 21:00:18 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 21:00:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=87eed3cc

Paludis: support atom matching.

---
 gentoopm/paludispm/repo.py |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 01f57a8..caa29e8 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -40,6 +40,38 @@ class PaludisRepository(PMRepository, PaludisPackageSet):
 				paludis.FilteredGenerator(self._gen, self._filt))]):
 			yield PaludisID(p, i, enum)
 
+	def filter(self, *args, **kwargs):
+		pset = self
+		newargs = []
+
+		for f in args:
+			if not callable(f): # an atom!
+				pset = PaludisAtomFilteredRepo(pset, f)
+			else:
+				newargs.append(f)
+
+		if pset == self:
+			return PaludisPackageSet.filter(self, args, kwargs)
+		elif newargs or kwargs:
+			return pset.filter(self, newargs, kwargs)
+		else:
+			return pset
+
+class PaludisAtomFilteredRepo(PaludisRepository):
+	@property
+	def _gen(self):
+		return self._mygen
+
+	@property
+	def _filt(self):
+		return self._myfilt
+
+	def __init__(self, repo, atom):
+		PaludisRepository.__init__(self, repo._env)
+		self._myfilt = repo._filt
+		self._mygen = repo._gen & paludis.Generator.Matches(atom._atom,
+				paludis.MatchPackageOptions())
+
 class PaludisStackRepo(PaludisRepository):
 	@property
 	def _gen(self):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-08 21:05 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-08 21:05 UTC (permalink / raw
  To: gentoo-commits

commit:     094ce09c41677dc13db2de512213d0c49f066a8e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 20:45:22 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 20:45:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=094ce09c

Paludis: make __iter__() a little more reusable.

---
 gentoopm/paludispm/repo.py |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 0a884fd..01f57a8 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -26,22 +26,28 @@ class PaludisRepository(PMRepository, PaludisPackageSet):
 		self._env = env
 		self._sorted = True
 
+	@property
+	def _gen(self):
+		return paludis.Generator.InRepository(self._repo.name)
+
+	@property
+	def _filt(self):
+		return paludis.Filter.All()
+
 	def __iter__(self):
 		enum = PaludisEnumID()
 		for i, p in enumerate(self._env[paludis.Selection.AllVersionsSorted(
-				paludis.FilteredGenerator(
-					paludis.Generator.InRepository(self._repo.name),
-					paludis.Filter.All()))]):
+				paludis.FilteredGenerator(self._gen, self._filt))]):
 			yield PaludisID(p, i, enum)
 
 class PaludisStackRepo(PaludisRepository):
-	def __iter__(self):
-		enum = PaludisEnumID()
-		for i, p in enumerate(self._env[paludis.Selection.AllVersionsSorted(
-				paludis.FilteredGenerator(
-					paludis.Generator.All(),
-					paludis.Filter.SupportsInstallAction()))]):
-			yield PaludisID(p, i, enum)
+	@property
+	def _gen(self):
+		return paludis.Generator.All()
+
+	@property
+	def _filt(self):
+		return paludis.Filter.SupportInstallAction()
 
 class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
 	def __init__(self, repo_obj, env):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-09  7:20 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-09  7:20 UTC (permalink / raw
  To: gentoo-commits

commit:     aa999b70254436b82cf62391c8662821da359df7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  9 07:21:25 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul  9 07:21:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=aa999b70

Paludis: match PaludisAtom explicitly.

---
 gentoopm/paludispm/repo.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index caa29e8..fbf8207 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -7,6 +7,7 @@ import paludis
 
 from gentoopm.basepm.repo import PMRepository, PMRepositoryDict, \
 		PMEbuildRepository
+from gentoopm.paludispm.atom import PaludisAtom
 from gentoopm.paludispm.pkg import PaludisID, PaludisPackageSet
 
 class PaludisRepoDict(PMRepositoryDict):
@@ -45,7 +46,7 @@ class PaludisRepository(PMRepository, PaludisPackageSet):
 		newargs = []
 
 		for f in args:
-			if not callable(f): # an atom!
+			if isinstance(f, PaludisAtom):
 				pset = PaludisAtomFilteredRepo(pset, f)
 			else:
 				newargs.append(f)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-10 22:17 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-10 22:17 UTC (permalink / raw
  To: gentoo-commits

commit:     1959ef7497bd0bd79927099dc5281dd7bc54b22b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 22:15:46 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 22:17:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=1959ef74

Paludis: pass environment to atom initializer instead of pm.

---
 gentoopm/paludispm/__init__.py |    2 +-
 gentoopm/paludispm/atom.py     |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gentoopm/paludispm/__init__.py b/gentoopm/paludispm/__init__.py
index 060eb2b..cb7fc69 100644
--- a/gentoopm/paludispm/__init__.py
+++ b/gentoopm/paludispm/__init__.py
@@ -30,4 +30,4 @@ class PaludisPM(PackageManager):
 
 	@property
 	def Atom(self):
-		return functools.partial(PaludisAtom, pm = self)
+		return functools.partial(PaludisAtom, env = self._env)

diff --git a/gentoopm/paludispm/atom.py b/gentoopm/paludispm/atom.py
index 85bc81e..38557ce 100644
--- a/gentoopm/paludispm/atom.py
+++ b/gentoopm/paludispm/atom.py
@@ -11,7 +11,7 @@ from gentoopm.exceptions import InvalidAtomStringError
 _category_wildcard_re = re.compile(r'\w')
 
 class PaludisAtom(PMAtom):
-	def _init_atom(self, s, pm, wildcards = False):
+	def _init_atom(self, s, env, wildcards = False):
 		opts = paludis.UserPackageDepSpecOptions() \
 				+ paludis.UserPackageDepSpecOption.NO_DISAMBIGUATION
 		if wildcards:
@@ -19,18 +19,18 @@ class PaludisAtom(PMAtom):
 
 		try:
 			self._atom = paludis.parse_user_package_dep_spec(
-					s, pm._env, opts,
+					s, env, opts,
 					paludis.Filter.All())
 		except (paludis.BadVersionOperatorError, paludis.PackageDepSpecError,
 				paludis.RepositoryNameError):
 			raise InvalidAtomStringError('Incorrect atom: %s' % s)
 
-	def __init__(self, s, pm):
+	def __init__(self, s, env):
 		try:
-			self._init_atom(s, pm)
+			self._init_atom(s, env)
 		except InvalidAtomStringError:
 			# try */ for the category
-			self._init_atom(_category_wildcard_re.sub(r'*/\g<0>', s, 1), pm, True)
+			self._init_atom(_category_wildcard_re.sub(r'*/\g<0>', s, 1), env, True)
 
 	def __contains__(self, pkg):
 		raise NotImplementedError('Direct atom matching not implemented in Paludis')



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-10 22:17 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-10 22:17 UTC (permalink / raw
  To: gentoo-commits

commit:     8b063eecef4a6858b75b4dd510779522faafed04
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 10 22:18:05 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jul 10 22:18:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=8b063eec

Paludis: support transforming strings to atoms in filter().

---
 gentoopm/paludispm/repo.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index fbf8207..8296dbb 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -46,6 +46,8 @@ class PaludisRepository(PMRepository, PaludisPackageSet):
 		newargs = []
 
 		for f in args:
+			if isinstance(f, basestring):
+				f = PaludisAtom(f, self._env)
 			if isinstance(f, PaludisAtom):
 				pset = PaludisAtomFilteredRepo(pset, f)
 			else:



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-14 14:05 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-14 14:05 UTC (permalink / raw
  To: gentoo-commits

commit:     7d1c641d3fee46319e2a3350a79a26071af37603
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 14:04:12 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 14:04:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=7d1c641d

Paludis: fix filtering.

---
 gentoopm/paludispm/repo.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 6a47596..4813c7b 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -82,7 +82,7 @@ class PaludisStackRepo(PaludisRepository):
 
 	@property
 	def _filt(self):
-		return paludis.Filter.SupportInstallAction()
+		return paludis.Filter.SupportsInstallAction()
 
 class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
 	def __init__(self, repo_obj, env):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-14 14:05 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-14 14:05 UTC (permalink / raw
  To: gentoo-commits

commit:     51a871f381e3d101dc72f4ffc7ef370e53fd869c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 14:05:24 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 14:05:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=51a871f3

Paludis: fix getting atoms.

---
 gentoopm/paludispm/pkg.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 5a34802..50b8927 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -9,6 +9,7 @@ from gentoopm.basepm.metadata import PMPackageMetadata
 from gentoopm.basepm.pkg import PMPackageSet, PMPackage, \
 		PMFilteredPackageSet
 from gentoopm.exceptions import EmptyPackageSetError, AmbiguousPackageSetError
+from gentoopm.paludispm.atom import PaludisAtom
 
 class PaludisPackageSet(PMPackageSet):
 	_sorted = False



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-14 17:10 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-14 17:10 UTC (permalink / raw
  To: gentoo-commits

commit:     0d56d09b6e3f42326f2d6c59397df73c6e1f2886
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 17:08:23 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 17:10:57 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=0d56d09b

Paludis: get package atom via uniquely_identifying_spec().

---
 gentoopm/paludispm/atom.py |   16 +++++++++-------
 gentoopm/paludispm/pkg.py  |    4 ++--
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/gentoopm/paludispm/atom.py b/gentoopm/paludispm/atom.py
index 1680859..9f1128b 100644
--- a/gentoopm/paludispm/atom.py
+++ b/gentoopm/paludispm/atom.py
@@ -26,14 +26,16 @@ class PaludisAtom(PMAtom):
 			raise InvalidAtomStringError('Incorrect atom: %s' % s)
 
 	def __init__(self, s, env, pkg = None):
-		try:
-			self._init_atom(s, env)
-		except InvalidAtomStringError:
-			# try */ for the category
-			self._init_atom(_category_wildcard_re.sub(r'*/\g<0>', s, 1), env, True)
-			self._incomplete = True
+		self._incomplete = False
+		if isinstance(s, paludis.PackageDepSpec):
+			self._atom = s
 		else:
-			self._incomplete = False
+			try:
+				self._init_atom(s, env)
+			except InvalidAtomStringError:
+				# try */ for the category
+				self._init_atom(_category_wildcard_re.sub(r'*/\g<0>', s, 1), env, True)
+				self._incomplete = True
 		self._pkg = pkg
 		self._env = env
 

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 50b8927..201c443 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -67,8 +67,8 @@ class PaludisID(PMPackage):
 
 	@property
 	def atom(self):
-		# XXX: newer version wraps getting atom
-		return PaludisAtom('=%s' % self.id, self._env, self)
+		return PaludisAtom(self.uniquely_identifying_spec(),
+				self._env, self)
 
 	def __cmp__(self, other):
 		if not isinstance(other, PaludisID):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-14 17:10 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-14 17:10 UTC (permalink / raw
  To: gentoo-commits

commit:     578c5ddf5b9e3eda6db1271c31bcb709524e9f32
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 17:02:20 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 17:02:20 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=578c5ddf

Paludis: support getting userpriv uid/gid.

---
 gentoopm/paludispm/config.py |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/gentoopm/paludispm/config.py b/gentoopm/paludispm/config.py
index f58803f..6bdd17c 100644
--- a/gentoopm/paludispm/config.py
+++ b/gentoopm/paludispm/config.py
@@ -8,3 +8,18 @@ from gentoopm.basepm.config import PMConfig
 class PaludisConfig(PMConfig):
 	def __init__(self, env):
 		self._env = env
+
+	# XXX: the userpriv_* funcs return current UID/GID
+	# when run by an unprivileged user
+
+	@property
+	def userpriv_enabled(self):
+		return True
+
+	@property
+	def userpriv_uid(self):
+		return self._env.reduced_uid()
+
+	@property
+	def userpriv_gid(self):
+		return self._env.reduced_gid()



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-14 22:51 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-14 22:51 UTC (permalink / raw
  To: gentoo-commits

commit:     350f17a4c07462fc9fff6e3a87c837e155d611bd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 22:42:02 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 22:42:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=350f17a4

Paludis: fix getting atoms.

---
 gentoopm/paludispm/pkg.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 201c443..f70c67b 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -67,7 +67,7 @@ class PaludisID(PMPackage):
 
 	@property
 	def atom(self):
-		return PaludisAtom(self.uniquely_identifying_spec(),
+		return PaludisAtom(self._pkg.uniquely_identifying_spec(),
 				self._env, self)
 
 	def __cmp__(self, other):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-15  9:52 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-15  9:52 UTC (permalink / raw
  To: gentoo-commits

commit:     e68f8d2efd2462d614933a6eeff9c5123e21b07b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 08:58:09 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 08:58:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=e68f8d2e

Paludis: don't assume userpriv enabled when reduced_uid==0.

---
 gentoopm/paludispm/config.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/config.py b/gentoopm/paludispm/config.py
index 6bdd17c..5c521ba 100644
--- a/gentoopm/paludispm/config.py
+++ b/gentoopm/paludispm/config.py
@@ -14,7 +14,7 @@ class PaludisConfig(PMConfig):
 
 	@property
 	def userpriv_enabled(self):
-		return True
+		return self.userpriv_uid != 0
 
 	@property
 	def userpriv_uid(self):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-15  9:52 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-15  9:52 UTC (permalink / raw
  To: gentoo-commits

commit:     3ab3887d3272558d630de21ff3812ab68708c16f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 09:09:16 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 09:09:16 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=3ab3887d

Paludis: support repo1 == repo2.

---
 gentoopm/paludispm/repo.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 4813c7b..f5a8341 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -97,6 +97,9 @@ class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
 	def path(self):
 		return self._repo.location_key().parse_value()
 
+	def __eq__(self, other):
+		return self.name == other.name and self.path == other.path
+
 class PaludisInstalledRepo(PaludisRepository):
 	def __init__(self, env):
 		self._env = env



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-15  9:52 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-15  9:52 UTC (permalink / raw
  To: gentoo-commits

commit:     6e90f9705a2994bfb76c12bbc49f6c0888115268
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 09:16:12 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 09:16:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=6e90f970

Paludis: fix checking whether 'pset' var changed.

---
 gentoopm/paludispm/repo.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index f5a8341..7326850 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -53,7 +53,7 @@ class PaludisRepository(PMRepository, PaludisPackageSet):
 			else:
 				newargs.append(f)
 
-		if pset == self:
+		if id(pset) == id(self):
 			return PaludisPackageSet.filter(self, args, kwargs)
 		elif newargs or kwargs:
 			return pset.filter(self, newargs, kwargs)



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-15 12:34 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-15 12:34 UTC (permalink / raw
  To: gentoo-commits

commit:     53588b1d36488918c463c780ef1f4ee4c44ac2c3
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 11:22:52 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 11:22:52 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=53588b1d

Paludis: support '==' for packages in different enums.

---
 gentoopm/paludispm/pkg.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index f70c67b..ba7d56d 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -78,6 +78,12 @@ class PaludisID(PMPackage):
 			raise TypeError('Unable to compare results of two enumerations')
 		return cmp(self._num, other._num)
 
+	def __eq__(self, other):
+		if not isinstance(other, PaludisID):
+			raise TypeError('Unable to compare %s against %s' % \
+					self, other)
+		return self.id == other.id
+
 class PaludisMetadata(PMPackageMetadata):
 	def __init__(self, pkg):
 		self._pkg = pkg



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-15 13:32 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-15 13:32 UTC (permalink / raw
  To: gentoo-commits

commit:     d4ee3452a518c377c57cbcfc062e9513292b774b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 13:16:07 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 13:16:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=d4ee3452

Paludis: use rich comparisons.

---
 gentoopm/paludispm/pkg.py  |   10 ++--------
 gentoopm/paludispm/repo.py |    3 ---
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index ba7d56d..42b6fc7 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -70,19 +70,13 @@ class PaludisID(PMPackage):
 		return PaludisAtom(self._pkg.uniquely_identifying_spec(),
 				self._env, self)
 
-	def __cmp__(self, other):
+	def __lt__(self, other):
 		if not isinstance(other, PaludisID):
 			raise TypeError('Unable to compare %s against %s' % \
 					self, other)
 		if self._enum_id != other._enum_id:
 			raise TypeError('Unable to compare results of two enumerations')
-		return cmp(self._num, other._num)
-
-	def __eq__(self, other):
-		if not isinstance(other, PaludisID):
-			raise TypeError('Unable to compare %s against %s' % \
-					self, other)
-		return self.id == other.id
+		return self._num < other._num
 
 class PaludisMetadata(PMPackageMetadata):
 	def __init__(self, pkg):

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 04a651c..78214e5 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -97,9 +97,6 @@ class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
 	def path(self):
 		return self._repo.location_key().parse_value()
 
-	def __eq__(self, other):
-		return self.name == other.name and self.path == other.path
-
 class PaludisInstalledRepo(PaludisRepository):
 	def __init__(self, env):
 		self._env = env



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-16  8:34 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-16  8:34 UTC (permalink / raw
  To: gentoo-commits

commit:     840eb96485a51d363558173dde3ceda680827f06
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 08:34:53 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 08:34:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=840eb964

Paludis: implement direct (manual) atom matching.

---
 gentoopm/paludispm/atom.py |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/atom.py b/gentoopm/paludispm/atom.py
index 510dfcf..036c22e 100644
--- a/gentoopm/paludispm/atom.py
+++ b/gentoopm/paludispm/atom.py
@@ -81,7 +81,30 @@ class PaludisAtom(PMAtom):
 		self._env = env
 
 	def __contains__(self, pkg):
-		raise NotImplementedError('Direct atom matching not implemented in Paludis')
+		# we have to implementing matching by hand, boo
+		# 1) category, our may be unset
+		if self.key.category is not None \
+				and self.key.category != pkg.atom.key.category:
+			return False
+		# 2) package name
+		if self.key.package != pkg.atom.key.package:
+			return False
+		# 3) package version (if any requirement set)
+		try:
+			vr = next(iter(self._atom.version_requirements))
+		except StopIteration:
+			pass
+		else:
+			if not vr.version_operator.compare(pkg._pkg.version,
+					vr.version_spec):
+				return False
+		# 4) slot
+		# XXX
+		# 5) repository
+		if self._atom.in_repository is not None \
+				and self._atom.in_repository != pkg._pkg.repository_name:
+			return False
+		return True
 
 	def __str__(self):
 		if self._incomplete:



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-16  9:08 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-16  9:08 UTC (permalink / raw
  To: gentoo-commits

commit:     811bb72f01f4ac828e835c16b64855c38b48f321
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 09:09:05 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 09:09:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=811bb72f

Paludis: use new atom properties for matching.

---
 gentoopm/paludispm/atom.py |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/gentoopm/paludispm/atom.py b/gentoopm/paludispm/atom.py
index f6fe592..adafef5 100644
--- a/gentoopm/paludispm/atom.py
+++ b/gentoopm/paludispm/atom.py
@@ -82,12 +82,13 @@ class PaludisAtom(PMAtom):
 
 	def __contains__(self, pkg):
 		# we have to implementing matching by hand, boo
+		other = pkg.atom
 		# 1) category, our may be unset
 		if self.key.category is not None \
-				and self.key.category != pkg.atom.key.category:
+				and self.key.category != other.key.category:
 			return False
 		# 2) package name
-		if self.key.package != pkg.atom.key.package:
+		if self.key.package != other.key.package:
 			return False
 		# 3) package version (if any requirement set)
 		try:
@@ -99,10 +100,12 @@ class PaludisAtom(PMAtom):
 					vr.version_spec):
 				return False
 		# 4) slot
-		# XXX
+		if self.slot is not None \
+				and self.slot != other.slot:
+			return False
 		# 5) repository
-		if self._atom.in_repository is not None \
-				and self._atom.in_repository != pkg._pkg.repository_name:
+		if self.repository is not None \
+				and self.repository != other.repository:
 			return False
 		return True
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-16  9:40 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-16  9:40 UTC (permalink / raw
  To: gentoo-commits

commit:     3453afab6f0cc8db8b379382c13bee4806acea04
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 09:41:22 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 09:41:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=3453afab

Paludis: refuse running with <paludis-0.64.2.

---
 gentoopm/paludispm/__init__.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gentoopm/paludispm/__init__.py b/gentoopm/paludispm/__init__.py
index a64657e..64cf799 100644
--- a/gentoopm/paludispm/__init__.py
+++ b/gentoopm/paludispm/__init__.py
@@ -5,6 +5,11 @@
 
 import functools, paludis
 
+try:
+	paludis.PackageDepSpec.slot
+except (NameError, AttributeError):
+	raise ImportError('paludis version too old (at least 0.64.2 required)')
+
 from gentoopm.basepm import PackageManager
 from gentoopm.paludispm.atom import PaludisAtom
 from gentoopm.paludispm.config import PaludisConfig



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-16 22:55 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-16 22:55 UTC (permalink / raw
  To: gentoo-commits

commit:     4290ee1a9aec8c3a444d1971c27aec1a4f383b11
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 22:55:27 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 22:55:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=4290ee1a

Update the paludis version check to match upstream API.

---
 gentoopm/paludispm/__init__.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/__init__.py b/gentoopm/paludispm/__init__.py
index 64cf799..40ae49a 100644
--- a/gentoopm/paludispm/__init__.py
+++ b/gentoopm/paludispm/__init__.py
@@ -6,7 +6,7 @@
 import functools, paludis
 
 try:
-	paludis.PackageDepSpec.slot
+	paludis.PackageDepSpec.slot_requirement
 except (NameError, AttributeError):
 	raise ImportError('paludis version too old (at least 0.64.2 required)')
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-16 22:55 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-16 22:55 UTC (permalink / raw
  To: gentoo-commits

commit:     c67f6dc41514345aff57508db4e4a0fe88845ab1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 22:51:42 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 22:51:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=c67f6dc4

Paludis: support getting slot from atoms.

---
 gentoopm/paludispm/atom.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gentoopm/paludispm/atom.py b/gentoopm/paludispm/atom.py
index adafef5..808e8ea 100644
--- a/gentoopm/paludispm/atom.py
+++ b/gentoopm/paludispm/atom.py
@@ -151,8 +151,9 @@ class PaludisAtom(PMAtom):
 
 	@property
 	def slot(self):
-		# XXX
-		raise NotImplementedError('PaludisAtom.slot not yet implemented.')
+		if self._atom.slot_requirement is None:
+			return None
+		return str(self._atom.slot_requirement.slot)
 
 	@property
 	def repository(self):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-21  8:47 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-21  8:47 UTC (permalink / raw
  To: gentoo-commits

commit:     16f0dbad74ac245066259a62787ca3464c3b31dc
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 07:48:28 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 07:48:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=16f0dbad

Paludis: default out _filt&_gen in PaludisBaseRepo.

---
 gentoopm/paludispm/repo.py |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index c4c5a12..d2c2a20 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -29,13 +29,13 @@ class PaludisBaseRepo(PMRepository, PaludisPackageSet):
 	def __init__(self, env):
 		PaludisPackageSet.__init__(self, env, True)
 
-	@abstractproperty
+	@property
 	def _gen(self):
-		pass
+		return paludis.Generator.All()
 
-	@abstractproperty
+	@property
 	def _filt(self):
-		pass
+		return paludis.Filter.All()
 
 	def __iter__(self):
 		enum = PaludisEnumID()
@@ -67,10 +67,6 @@ class PaludisRepository(PaludisBaseRepo):
 	def _gen(self):
 		return paludis.Generator.InRepository(self._repo.name)
 
-	@property
-	def _filt(self):
-		return paludis.Filter.All()
-
 class PaludisAtomFilteredRepo(PaludisBaseRepo):
 	@property
 	def _gen(self):
@@ -88,10 +84,6 @@ class PaludisAtomFilteredRepo(PaludisBaseRepo):
 
 class PaludisStackRepo(PaludisBaseRepo):
 	@property
-	def _gen(self):
-		return paludis.Generator.All()
-
-	@property
 	def _filt(self):
 		return paludis.Filter.SupportsInstallAction()
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-21  8:47 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-21  8:47 UTC (permalink / raw
  To: gentoo-commits

commit:     1419fc1b49f84b46f35e0c6b221e91c9cdc39c3f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 08:01:44 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 08:01:44 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=1419fc1b

Paludis: use _pkg_class.

---
 gentoopm/paludispm/repo.py |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 9c32eab..a0df635 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -37,11 +37,15 @@ class PaludisBaseRepo(PMRepository, PaludisPackageSet):
 	def _filt(self):
 		return paludis.Filter.All()
 
+	@abstractproperty
+	def _pkg_class(self):
+		pass
+
 	def __iter__(self):
 		enum = PaludisEnumID()
 		for i, p in enumerate(self._env[paludis.Selection.AllVersionsSorted(
 				paludis.FilteredGenerator(self._gen, self._filt))]):
-			yield PaludisID(p, i, enum, self._env)
+			yield self._pkg_class(p, i, enum, self._env)
 
 	def filter(self, *args, **kwargs):
 		pset = self
@@ -76,18 +80,27 @@ class PaludisAtomFilteredRepo(PaludisBaseRepo):
 	def _filt(self):
 		return self._myfilt
 
+	@property
+	def _pkg_class(self):
+		return self._mypkg_class
+
 	def __init__(self, repo, atom):
 		PaludisBaseRepo.__init__(self, repo._env)
 		self._myfilt = repo._filt
 		self._mygen = repo._gen & paludis.Generator.Matches(atom._atom,
 				paludis.MatchPackageOptions())
+		self._mypkg_class = repo._pkg_class
 
 class PaludisStackRepo(PaludisBaseRepo):
+	_pkg_class = PaludisID
+
 	@property
 	def _filt(self):
 		return paludis.Filter.SupportsInstallAction()
 
 class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
+	_pkg_class = PaludisID
+
 	def __init__(self, repo_obj, env):
 		PaludisRepository.__init__(self, env)
 		self._repo = repo_obj
@@ -101,6 +114,8 @@ class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
 		return self._repo.location_key().parse_value()
 
 class PaludisInstalledRepo(PaludisBaseRepo):
+	_pkg_class = PaludisID
+
 	@property
 	def _filt(self):
 		return paludis.Filter.InstalledAtRoot('/')



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-21  8:47 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-21  8:47 UTC (permalink / raw
  To: gentoo-commits

commit:     f53097f316a7ecffb47a3cdc2deafa583d5e6ae5
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 07:53:03 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 07:53:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=f53097f3

Paludis: use Filter.InstalledAtRoot() for installed repo.

---
 gentoopm/paludispm/repo.py |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index d2c2a20..9c32eab 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -100,12 +100,7 @@ class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
 	def path(self):
 		return self._repo.location_key().parse_value()
 
-class PaludisInstalledRepo(PaludisRepository):
-	def __init__(self, env):
-		PaludisRepository.__init__(self, env)
-		for r in env.repositories:
-			if str(r.name) == 'installed': # XXX
-				self._repo = r
-				break
-		else:
-			raise Exception('Unable to find installed repository.')
+class PaludisInstalledRepo(PaludisBaseRepo):
+	@property
+	def _filt(self):
+		return paludis.Filter.InstalledAtRoot('/')



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-21  8:47 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-21  8:47 UTC (permalink / raw
  To: gentoo-commits

commit:     7794ed5de6c3684fc8f68c9f4fc91b7920456c32
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 07:46:37 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 07:46:37 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=7794ed5d

Paludis: split out PaludisBaseRepo.

---
 gentoopm/paludispm/repo.py |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index e1be9cc..c4c5a12 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -3,6 +3,8 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
+from abc import abstractproperty
+
 import paludis
 
 from gentoopm.basepm.repo import PMRepository, PMRepositoryDict, \
@@ -23,17 +25,17 @@ class PaludisRepoDict(PMRepositoryDict):
 class PaludisEnumID(object):
 	pass
 
-class PaludisRepository(PMRepository, PaludisPackageSet):
+class PaludisBaseRepo(PMRepository, PaludisPackageSet):
 	def __init__(self, env):
 		PaludisPackageSet.__init__(self, env, True)
 
-	@property
+	@abstractproperty
 	def _gen(self):
-		return paludis.Generator.InRepository(self._repo.name)
+		pass
 
-	@property
+	@abstractproperty
 	def _filt(self):
-		return paludis.Filter.All()
+		pass
 
 	def __iter__(self):
 		enum = PaludisEnumID()
@@ -60,7 +62,16 @@ class PaludisRepository(PMRepository, PaludisPackageSet):
 		else:
 			return pset
 
-class PaludisAtomFilteredRepo(PaludisRepository):
+class PaludisRepository(PaludisBaseRepo):
+	@property
+	def _gen(self):
+		return paludis.Generator.InRepository(self._repo.name)
+
+	@property
+	def _filt(self):
+		return paludis.Filter.All()
+
+class PaludisAtomFilteredRepo(PaludisBaseRepo):
 	@property
 	def _gen(self):
 		return self._mygen
@@ -70,12 +81,12 @@ class PaludisAtomFilteredRepo(PaludisRepository):
 		return self._myfilt
 
 	def __init__(self, repo, atom):
-		PaludisRepository.__init__(self, repo._env)
+		PaludisBaseRepo.__init__(self, repo._env)
 		self._myfilt = repo._filt
 		self._mygen = repo._gen & paludis.Generator.Matches(atom._atom,
 				paludis.MatchPackageOptions())
 
-class PaludisStackRepo(PaludisRepository):
+class PaludisStackRepo(PaludisBaseRepo):
 	@property
 	def _gen(self):
 		return paludis.Generator.All()



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-21  8:47 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-21  8:47 UTC (permalink / raw
  To: gentoo-commits

commit:     6d0a2574daf156fe86497712a47fb9948bc2bbca
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 08:04:28 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 08:04:28 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=6d0a2574

Paludis: merge PaludisRepository into PaludisLivefsRepository.

---
 gentoopm/paludispm/repo.py |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index a0df635..ebc8af1 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -66,11 +66,6 @@ class PaludisBaseRepo(PMRepository, PaludisPackageSet):
 		else:
 			return pset
 
-class PaludisRepository(PaludisBaseRepo):
-	@property
-	def _gen(self):
-		return paludis.Generator.InRepository(self._repo.name)
-
 class PaludisAtomFilteredRepo(PaludisBaseRepo):
 	@property
 	def _gen(self):
@@ -98,14 +93,18 @@ class PaludisStackRepo(PaludisBaseRepo):
 	def _filt(self):
 		return paludis.Filter.SupportsInstallAction()
 
-class PaludisLivefsRepository(PaludisRepository, PMEbuildRepository):
+class PaludisLivefsRepository(PaludisBaseRepo, PMEbuildRepository):
 	_pkg_class = PaludisID
 
 	def __init__(self, repo_obj, env):
-		PaludisRepository.__init__(self, env)
+		PaludisBaseRepo.__init__(self, env)
 		self._repo = repo_obj
 
 	@property
+	def _gen(self):
+		return paludis.Generator.InRepository(self._repo.name)
+
+	@property
 	def name(self):
 		return str(self._repo.name)
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-21  8:47 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-21  8:47 UTC (permalink / raw
  To: gentoo-commits

commit:     caf886384c873f86acd2828a6a2cc7258a01772f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 08:06:42 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 08:06:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=caf88638

Paludis: split out PaludisInstalledID.

---
 gentoopm/paludispm/pkg.py  |    6 +++++-
 gentoopm/paludispm/repo.py |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index b262080..437ddaf 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -6,7 +6,8 @@
 import paludis
 
 from gentoopm.basepm.metadata import PMPackageMetadata
-from gentoopm.basepm.pkg import PMPackage, PMPackageDescription
+from gentoopm.basepm.pkg import PMPackage, PMPackageDescription, \
+		PMInstalledPackage
 from gentoopm.paludispm.atom import PaludisAtom, \
 		PaludisPackageKey, PaludisPackageVersion
 from gentoopm.util import SpaceSepTuple
@@ -97,6 +98,9 @@ class PaludisID(PMPackage, PaludisAtom):
 			raise TypeError('Unable to compare results of two enumerations')
 		return self._num < other._num
 
+class PaludisInstalledID(PaludisID, PMInstalledPackage):
+	pass
+
 class PaludisMetadata(PMPackageMetadata):
 	def __init__(self, pkg):
 		self._pkg = pkg

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index ebc8af1..dc46ffe 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -10,7 +10,7 @@ import paludis
 from gentoopm.basepm.repo import PMRepository, PMRepositoryDict, \
 		PMEbuildRepository
 from gentoopm.paludispm.atom import PaludisAtom
-from gentoopm.paludispm.pkg import PaludisID
+from gentoopm.paludispm.pkg import PaludisID, PaludisInstalledID
 from gentoopm.paludispm.pkgset import PaludisPackageSet
 
 class PaludisRepoDict(PMRepositoryDict):
@@ -113,7 +113,7 @@ class PaludisLivefsRepository(PaludisBaseRepo, PMEbuildRepository):
 		return self._repo.location_key().parse_value()
 
 class PaludisInstalledRepo(PaludisBaseRepo):
-	_pkg_class = PaludisID
+	_pkg_class = PaludisInstalledID
 
 	@property
 	def _filt(self):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-22  6:18 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-22  6:18 UTC (permalink / raw
  To: gentoo-commits

commit:     dbe711c989764fc0fb13200fb598c5587bd980b7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 22 06:15:19 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 22 06:15:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=dbe711c9

Paludis: sort packages directly.

---
 gentoopm/paludispm/pkg.py  |   11 +++++------
 gentoopm/paludispm/repo.py |    6 +++---
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 557deee..4af56c8 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -38,10 +38,8 @@ class PaludisPackageDescription(PMPackageDescription):
 		return k.parse_value() if k is not None else None
 
 class PaludisID(PMPackage, PaludisAtom):
-	def __init__(self, pkg, num = 0, enum_id = None, env = None):
+	def __init__(self, pkg, env):
 		self._pkg = pkg
-		self._num = num
-		self._enum_id = enum_id
 		self._env = env
 
 	@property
@@ -106,9 +104,10 @@ class PaludisID(PMPackage, PaludisAtom):
 		if not isinstance(other, PaludisID):
 			raise TypeError('Unable to compare %s against %s' % \
 					self, other)
-		if self._enum_id != other._enum_id:
-			raise TypeError('Unable to compare results of two enumerations')
-		return self._num < other._num
+		return str(self.key) < str(other.key) \
+				or self._pkg.version < other._pkg.version \
+				or self._env.more_important_than( \
+						other.repository, self.repository)
 
 class PaludisInstallableID(PaludisID, PMInstallablePackage):
 	pass

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 27419a9..1449923 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -43,9 +43,9 @@ class PaludisBaseRepo(PMRepository, PaludisPackageSet):
 
 	def __iter__(self):
 		enum = PaludisEnumID()
-		for i, p in enumerate(self._env[paludis.Selection.AllVersionsSorted(
-				paludis.FilteredGenerator(self._gen, self._filt))]):
-			yield self._pkg_class(p, i, enum, self._env)
+		for p in self._env[paludis.Selection.AllVersionsUnsorted(
+				paludis.FilteredGenerator(self._gen, self._filt))]:
+			yield self._pkg_class(p, self._env)
 
 	def filter(self, *args, **kwargs):
 		pset = self



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-23  9:27 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-23  9:27 UTC (permalink / raw
  To: gentoo-commits

commit:     ce7ceb28bdda7829199b2f412c78bbcff4eacb47
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 23 08:38:15 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 23 08:38:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=ce7ceb28

Paludis: remove 'issorted'.

---
 gentoopm/paludispm/pkgset.py |   25 ++-----------------------
 gentoopm/paludispm/repo.py   |    3 ---
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/gentoopm/paludispm/pkgset.py b/gentoopm/paludispm/pkgset.py
index f41fd16..86572ea 100644
--- a/gentoopm/paludispm/pkgset.py
+++ b/gentoopm/paludispm/pkgset.py
@@ -8,9 +8,8 @@ from gentoopm.exceptions import EmptyPackageSetError, AmbiguousPackageSetError
 from gentoopm.paludispm.atom import PaludisAtom
 
 class PaludisPackageSet(object):
-	def __init__(self, env, issorted = False):
+	def __init__(self, env):
 		self._env = env
-		self._sorted = issorted
 
 	def filter(self, *args, **kwargs):
 		newargs = [(a if not isinstance(a, str)
@@ -18,27 +17,7 @@ class PaludisPackageSet(object):
 
 		return PaludisFilteredPackageSet(self, newargs, kwargs)
 
-	@property
-	def best(self):
-		if self._sorted:
-			it = iter(self)
-
-			try:
-				f = next(it)
-			except StopIteration:
-				raise EmptyPackageSetError('.best called on an empty set')
-			for p in it:
-				if p.key != f.key:
-					raise AmbiguousPackageSetError('.best called on a set of differently-named packages')
-
-			try:
-				return p
-			except NameError:
-				return f
-		else:
-			return PMPackageSet.best.fget(self)
-
 class PaludisFilteredPackageSet(PaludisPackageSet, PMFilteredPackageSet):
 	def __init__(self, pset, args, kwargs):
-		PaludisPackageSet.__init__(self, pset._env, pset._sorted)
+		PaludisPackageSet.__init__(self, pset._env)
 		PMFilteredPackageSet.__init__(self, pset, args, kwargs)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 1449923..3f82bcd 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -26,9 +26,6 @@ class PaludisEnumID(object):
 	pass
 
 class PaludisBaseRepo(PMRepository, PaludisPackageSet):
-	def __init__(self, env):
-		PaludisPackageSet.__init__(self, env, True)
-
 	@property
 	def _gen(self):
 		return paludis.Generator.All()



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-23 20:14 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-23 20:14 UTC (permalink / raw
  To: gentoo-commits

commit:     53f77023d911e21c72cd406c2c1800dfec96f72b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 23 19:54:29 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 23 19:54:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=53f77023

Paludis: support overriding selection type.

---
 gentoopm/paludispm/repo.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 6179c9a..115f195 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -34,13 +34,17 @@ class PaludisBaseRepo(PMRepository, PaludisPackageSet):
 	def _filt(self):
 		return paludis.Filter.All()
 
+	@property
+	def _sel(self):
+		return paludis.Selection.AllVersionsUnsorted
+
 	@abstractproperty
 	def _pkg_class(self):
 		pass
 
 	def __iter__(self):
 		enum = PaludisEnumID()
-		for p in self._env[paludis.Selection.AllVersionsUnsorted(
+		for p in self._env[self._sel(
 				paludis.FilteredGenerator(self._gen, self._filt))]:
 			yield self._pkg_class(p, self._env)
 



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-23 20:14 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-23 20:14 UTC (permalink / raw
  To: gentoo-commits

commit:     a98910961a52f4c2a29fad19f4dbd328818183db
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 23 20:00:38 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 23 20:00:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=a9891096

Paludis: transform atom-filtered repo into more general override repo.

Now the caller is supposed to instantiate necessary filters/generators
and the repo just sets them up.

---
 gentoopm/paludispm/repo.py |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 115f195..44547c3 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -56,7 +56,9 @@ class PaludisBaseRepo(PMRepository, PaludisPackageSet):
 			if isinstance(f, str):
 				f = PaludisAtom(f, self._env)
 			if isinstance(f, PaludisAtom):
-				pset = PaludisAtomFilteredRepo(pset, f)
+				newgen = paludis.Generator.Matches(f._atom,
+						paludis.MatchPackageOptions())
+				pset = PaludisOverrideRepo(pset, gen = newgen)
 			else:
 				newargs.append(f)
 
@@ -67,7 +69,7 @@ class PaludisBaseRepo(PMRepository, PaludisPackageSet):
 		else:
 			return pset
 
-class PaludisAtomFilteredRepo(PaludisBaseRepo):
+class PaludisOverrideRepo(PaludisBaseRepo):
 	@property
 	def _gen(self):
 		return self._mygen
@@ -77,14 +79,20 @@ class PaludisAtomFilteredRepo(PaludisBaseRepo):
 		return self._myfilt
 
 	@property
+	def _sel(self):
+		return self._mysel
+
+	@property
 	def _pkg_class(self):
 		return self._mypkg_class
 
-	def __init__(self, repo, atom):
+	def __init__(self, repo, filt = None, gen = None, sel = None):
 		PaludisBaseRepo.__init__(self, repo._env)
-		self._myfilt = repo._filt
-		self._mygen = repo._gen & paludis.Generator.Matches(atom._atom,
-				paludis.MatchPackageOptions())
+		self._myfilt = filt or repo._filt
+		self._mygen = repo._gen
+		if gen is not None:
+			self._mygen &= gen
+		self._mysel = sel or repo._sel
 		self._mypkg_class = repo._pkg_class
 
 class PaludisStackRepo(PaludisBaseRepo):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-23 20:14 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-23 20:14 UTC (permalink / raw
  To: gentoo-commits

commit:     9c653c4c078da438620d0aa9459cd4f34ab5b059
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 23 20:15:19 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jul 23 20:15:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=9c653c4c

Paludis: use C++ API for sorting.

---
 gentoopm/paludispm/repo.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py
index 44547c3..20cd1e2 100644
--- a/gentoopm/paludispm/repo.py
+++ b/gentoopm/paludispm/repo.py
@@ -69,6 +69,11 @@ class PaludisBaseRepo(PMRepository, PaludisPackageSet):
 		else:
 			return pset
 
+	@property
+	def sorted(self):
+		return PaludisOverrideRepo(self,
+				sel = paludis.Selection.AllVersionsSorted)
+
 class PaludisOverrideRepo(PaludisBaseRepo):
 	@property
 	def _gen(self):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-25 17:06 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-25 17:06 UTC (permalink / raw
  To: gentoo-commits

commit:     dfd84bfb63bbf8283fd0eb63bbbb73e30393f076
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 25 16:58:35 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jul 25 17:06:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=dfd84bfb

Paludis: support getting package contents.

---
 gentoopm/paludispm/contents.py |   15 +++++++++++++++
 gentoopm/paludispm/pkg.py      |    5 ++++-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/gentoopm/paludispm/contents.py b/gentoopm/paludispm/contents.py
new file mode 100644
index 0000000..f9ec46e
--- /dev/null
+++ b/gentoopm/paludispm/contents.py
@@ -0,0 +1,15 @@
+#!/usr/bin/python
+#	vim:fileencoding=utf-8
+# (c) 2011 Michał Górny <mgorny@gentoo.org>
+# Released under the terms of the 2-clause BSD license.
+
+from gentoopm.basepm.contents import PMPackageContents, \
+		PMContentObj
+
+class PaludisPackageContents(PMPackageContents):
+	def __init__(self, cont):
+		self._cont = cont
+
+	def __iter__(self):
+		for f in self._cont:
+			yield PMContentObj(f.location_key().parse_value())

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 1c3fb6e..97d64cd 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -11,6 +11,7 @@ from gentoopm.basepm.pkg import PMPackage, PMPackageDescription, \
 		PMPackageState
 from gentoopm.paludispm.atom import PaludisAtom, \
 		PaludisPackageKey, PaludisPackageVersion
+from gentoopm.paludispm.contents import PaludisPackageContents
 from gentoopm.util import SpaceSepTuple
 
 class PaludisBoundPackageKey(PaludisPackageKey, PMBoundPackageKey):
@@ -113,7 +114,9 @@ class PaludisInstallableID(PaludisID, PMInstallablePackage):
 	pass
 
 class PaludisInstalledID(PaludisID, PMInstalledPackage):
-	pass
+	@property
+	def contents(self):
+		return PaludisPackageContents(self._pkg.contents_key().parse_value())
 
 class PaludisMetadata(PMPackageMetadata):
 	def __init__(self, pkg):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-28 16:24 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-28 16:24 UTC (permalink / raw
  To: gentoo-commits

commit:     ec043d62f5056b9d7f7bcd929ae578ed0b553368
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 28 15:39:03 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 28 15:39:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=ec043d62

Paludis: support blocking atoms.

---
 gentoopm/paludispm/atom.py   |    5 +++--
 gentoopm/paludispm/depend.py |    7 ++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/gentoopm/paludispm/atom.py b/gentoopm/paludispm/atom.py
index c416cb1..ea1d233 100644
--- a/gentoopm/paludispm/atom.py
+++ b/gentoopm/paludispm/atom.py
@@ -69,8 +69,9 @@ class PaludisAtom(PMAtom):
 				paludis.RepositoryNameError):
 			raise InvalidAtomStringError('Incorrect atom: %s' % s)
 
-	def __init__(self, s, env):
+	def __init__(self, s, env, block = ''):
 		self._incomplete = False
+		self._blocking = block
 		if isinstance(s, paludis.PackageDepSpec):
 			self._atom = s
 		else:
@@ -114,7 +115,7 @@ class PaludisAtom(PMAtom):
 	def __str__(self):
 		if self._incomplete:
 			raise ValueError('Unable to stringify incomplete atom')
-		return str(self._atom)
+		return '%s%s' % (self._blocking, str(self._atom))
 
 	@property
 	def complete(self):

diff --git a/gentoopm/paludispm/depend.py b/gentoopm/paludispm/depend.py
index 91a2e3c..ee5ad4c 100644
--- a/gentoopm/paludispm/depend.py
+++ b/gentoopm/paludispm/depend.py
@@ -3,12 +3,14 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
-import paludis
+import paludis, re
 
 from gentoopm.basepm.depend import PMPackageDepSet, PMConditionalDep, \
 	PMAnyOfDep, PMAllOfDep, PMExactlyOneOfDep, PMBaseDep
 from gentoopm.paludispm.atom import PaludisAtom
 
+_block_re = re.compile('^!*')
+
 class PaludisBaseDep(PMBaseDep):
 	def __init__(self, deps, pkg):
 		self._deps = deps
@@ -18,6 +20,9 @@ class PaludisBaseDep(PMBaseDep):
 		for d in self._deps:
 			if isinstance(d, paludis.PackageDepSpec):
 				yield PaludisAtom(d, self._pkg._env)
+			elif isinstance(d, paludis.BlockDepSpec):
+				yield PaludisAtom(d.blocking, self._pkg._env,
+						block = _block_re.match(d.text).group(0))
 			elif isinstance(d, paludis.AnyDepSpec):
 				yield PaludisAnyOfDep(d, self._pkg)
 			elif isinstance(d, paludis.AllDepSpec):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-28 19:54 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-28 19:54 UTC (permalink / raw
  To: gentoo-commits

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))



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-28 19:54 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-28 19:54 UTC (permalink / raw
  To: gentoo-commits

commit:     aba8a872b2e4c22ff726409ce6ca01162185cd1c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 28 19:55:21 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 28 19:55:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=aba8a872

Paludis: use helper function for metadata gets.

This should fix issues with empty *DEPEND as well.

---
 gentoopm/paludispm/pkg.py |   45 ++++++++++++++++++++++++---------------------
 1 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 151cd92..368344c 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -74,10 +74,16 @@ class PaludisID(PMPackage, PaludisAtom):
 	def version(self):
 		return PaludisPackageVersion(self._pkg.version)
 
+	def _get_meta(self, key):
+		if isinstance(key, str):
+			key = self._pkg.find_metadata(key)
+		if key is None:
+			return ()
+		return key.parse_value()
+
 	@property
 	def eapi(self):
-		k = self._pkg.find_metadata('EAPI')
-		return str(k.parse_value())
+		return str(self._get_meta('EAPI'))
 
 	@property
 	def description(self):
@@ -85,35 +91,30 @@ class PaludisID(PMPackage, PaludisAtom):
 
 	@property
 	def inherits(self):
-		k = self._pkg.find_metadata('INHERITED')
-		if k is None:
-			return SpaceSepFrozenSet(())
-		return SpaceSepFrozenSet(k.parse_value())
+		return SpaceSepFrozenSet(self._get_meta('INHERITED'))
 
 	@property
 	def defined_phases(self):
-		k = self._pkg.find_metadata('DEFINED_PHASES')
-		if k is None:
+		ret = SpaceSepFrozenSet(self._get_meta('DEFINED_PHASES'))
+		if not ret:
 			return None
-		ret = SpaceSepFrozenSet(k.parse_value())
-		if ret == ('-',):
+		elif ret == ('-',):
 			return SpaceSepFrozenSet(())
 		return ret
 
 	@property
 	def homepages(self):
-		spec = self._pkg.homepage_key().parse_value()
+		spec = self._get_meta(self._pkg.homepage_key())
 		return SpaceSepTuple([str(x) for x in spec])
 
 	@property
 	def keywords(self):
-		kws = self._pkg.keywords_key().parse_value()
+		kws = self._get_meta(self._pkg.keywords_key())
 		return SpaceSepFrozenSet([str(x) for x in kws])
 
 	@property
 	def slot(self):
-		k = self._pkg.slot_key()
-		return str(k.parse_value())
+		return str(self._get_meta(self._pkg.slot_key()))
 
 	@property
 	def repository(self):
@@ -122,19 +123,19 @@ class PaludisID(PMPackage, PaludisAtom):
 	@property
 	def build_dependencies(self):
 		return PaludisPackageDepSet(
-				self._pkg.build_dependencies_key().parse_value(),
+				self._get_meta(self._pkg.build_dependencies_key()),
 				self)
 
 	@property
 	def run_dependencies(self):
 		return PaludisPackageDepSet(
-				self._pkg.run_dependencies_key().parse_value(),
+				self._get_meta(self._pkg.run_dependencies_key()),
 				self)
 
 	@property
 	def post_dependencies(self):
 		return PaludisPackageDepSet(
-				self._pkg.post_dependencies_key().parse_value(),
+				self._get_meta(self._pkg.post_dependencies_key()),
 				self)
 
 	@property
@@ -142,12 +143,13 @@ class PaludisID(PMPackage, PaludisAtom):
 		k = self._pkg.find_metadata('REQUIRED_USE')
 		if k is None:
 			return None
-		return PaludisPackageDepSet(k.parse_value(), self,
-				PMRequiredUseAtom)
+		return PaludisPackageDepSet(
+				self._get_meta('REQUIRED_USE'),
+				self, PMRequiredUseAtom)
 
 	@property
 	def use(self):
-		iuse = self._pkg.find_metadata('IUSE').parse_value()
+		iuse = self._get_meta('IUSE')
 		return SpaceSepFrozenSet([PaludisUseFlag(x) for x in iuse])
 
 	@property
@@ -172,7 +174,8 @@ class PaludisInstallableID(PaludisID, PMInstallablePackage):
 class PaludisInstalledID(PaludisID, PMInstalledPackage):
 	@property
 	def contents(self):
-		return PaludisPackageContents(self._pkg.contents_key().parse_value())
+		return PaludisPackageContents(
+				self._get_meta(self._pkg.contents_key()))
 
 class PaludisMetadata(PMPackageMetadata):
 	def __init__(self, pkg):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-07-29  6:38 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-07-29  6:38 UTC (permalink / raw
  To: gentoo-commits

commit:     510300cdf687df85ed1ab5f049f8502e1e3e3814
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 29 06:39:27 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 29 06:39:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=510300cd

Paludis: start using choices_key().

This will allow getting USE values in the future.

---
 gentoopm/paludispm/pkg.py |   32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 368344c..fe680ee 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -40,8 +40,31 @@ class PaludisPackageDescription(PMPackageDescription):
 		k = self._pkg.long_description_key()
 		return k.parse_value() if k is not None else None
 
-class PaludisUseFlag(PMUseFlag):
-	pass
+class PaludisChoice(PMUseFlag):
+	def __init__(self, choice, default = None):
+		self._c = choice
+		self._default = default
+
+	@property
+	def default(self):
+		return self._default
+
+	@property
+	def name(self):
+		return str(self._c.name_with_prefix)
+
+class PaludisChoiceSet(SpaceSepFrozenSet):
+	def __new__(self, choices, iuse):
+		iuse = SpaceSepFrozenSet([PMUseFlag(x) for x in iuse])
+		l = []
+		for group in choices:
+			if group.raw_name == 'build_options': # paludis specific
+				continue
+			for c in group:
+				if c.explicitly_listed:
+					miuse = iuse[str(c.name_with_prefix)]
+					l.append(PaludisChoice(c, miuse.default))
+		return SpaceSepFrozenSet.__new__(self, l)
 
 class PaludisID(PMPackage, PaludisAtom):
 	def __init__(self, pkg, env):
@@ -149,8 +172,9 @@ class PaludisID(PMPackage, PaludisAtom):
 
 	@property
 	def use(self):
-		iuse = self._get_meta('IUSE')
-		return SpaceSepFrozenSet([PaludisUseFlag(x) for x in iuse])
+		return PaludisChoiceSet(
+				self._get_meta(self._pkg.choices_key()),
+				self._get_meta('IUSE'))
 
 	@property
 	def _atom(self):



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2011-12-09 15:09 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2011-12-09 15:09 UTC (permalink / raw
  To: gentoo-commits

commit:     82846ec07f7a868597db4f51f756fb7b2d8e8a7d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  9 15:09:48 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Dec  9 15:09:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=82846ec0

Paludis: update getting package contents wrt Paludis API change.

---
 gentoopm/paludispm/pkg.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 1470dbd..ba34e5d 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -205,5 +205,8 @@ class PaludisInstallableID(PaludisID, PMInstallablePackage):
 class PaludisInstalledID(PaludisID, PMInstalledPackage):
 	@property
 	def contents(self):
-		return PaludisPackageContents(
-				self._get_meta(self._pkg.contents_key()))
+		try:
+			return PaludisPackageContents(self._pkg.contents())
+		except AttributeError:
+			return PaludisPackageContents(
+					self._get_meta(self._pkg.contents_key()))



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2012-01-03 18:18 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2012-01-03 18:18 UTC (permalink / raw
  To: gentoo-commits

commit:     bf623fe3a1dcab55c03e906b1be395d3b772a0eb
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  3 18:19:08 2012 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jan  3 18:19:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=bf623fe3

Paludis: update USEflag grepping API.

---
 gentoopm/paludispm/pkg.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index ba34e5d..15b5995 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -59,8 +59,13 @@ class PaludisChoiceSet(SpaceSepFrozenSet):
 				if group.raw_name == 'build_options': # paludis specific
 					continue
 				for c in group:
-					if c.explicitly_listed:
-						yield PaludisChoice(c)
+					try:
+						if c.origin != paludis.ChoiceOrigin.EXPLICIT:
+							continue
+					except AttributeError:
+						if not c.explicitly_listed:
+							continue
+					yield PaludisChoice(c)
 
 		self._choices = choices
 		return SpaceSepFrozenSet.__new__(self, _get_iuse())



^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/
@ 2013-10-10 13:35 Michał Górny
  0 siblings, 0 replies; 43+ messages in thread
From: Michał Górny @ 2013-10-10 13:35 UTC (permalink / raw
  To: gentoo-commits

commit:     b0d2e0b3a9f926746e942fe17832008a06b621c1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 10 13:34:59 2013 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Oct 10 13:34:59 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=b0d2e0b3

Fix getting slots in Paludis.

---
 gentoopm/paludispm/pkg.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gentoopm/paludispm/pkg.py b/gentoopm/paludispm/pkg.py
index 15b5995..972123f 100644
--- a/gentoopm/paludispm/pkg.py
+++ b/gentoopm/paludispm/pkg.py
@@ -147,7 +147,11 @@ class PaludisID(PMPackage, PaludisAtom):
 
 	@property
 	def slot(self):
-		return str(self._get_meta(self._pkg.slot_key()))
+		slot = self._get_meta(self._pkg.slot_key())
+		if hasattr(slot, 'raw_value'): # paludis-1.4
+			return slot.raw_value
+		else:
+			return str(slot)
 
 	@property
 	def repository(self):


^ permalink raw reply related	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2013-10-10 13:35 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-21  8:47 [gentoo-commits] proj/gentoopm:master commit in: gentoopm/paludispm/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2013-10-10 13:35 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 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-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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox