public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-02-23  9:10 Brian Dolbec
  0 siblings, 0 replies; 36+ messages in thread
From: Brian Dolbec @ 2011-02-23  9:10 UTC (permalink / raw
  To: gentoo-commits

commit:     768096f120ac1aec161416e284eeec97ef376b3d
Author:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Fri Feb 11 05:49:11 2011 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Feb 11 05:50:59 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=768096f1

apply djanderson's idea for a simpler/better fix to bug 353430 and commit 000ce49860b253ad6c917c5a58bc0ff31225134a for
use conditionals causing errors in equery results.

---
 pym/gentoolkit/atom.py         |   17 ++++++++++-------
 pym/gentoolkit/dependencies.py |    4 ++--
 pym/gentoolkit/helpers.py      |   14 +-------------
 3 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/pym/gentoolkit/atom.py b/pym/gentoolkit/atom.py
index fe9adaa..7282fac 100644
--- a/pym/gentoolkit/atom.py
+++ b/pym/gentoolkit/atom.py
@@ -81,10 +81,13 @@ class Atom(portage.dep.Atom, CPV):
 			if self.blocker.overlap.forbid != other.blocker.overlap.forbid:
 				return False
 
+		if self.use_conditional != other.use_conditional:
+			return False
+
 		# Don't believe Portage has something like this
 		#c = cmp(self.negate_vers, other.negate_vers)
 		#if c:
-		#	return c
+		#   return c
 
 		if self.slot != other.slot:
 			return False
@@ -133,7 +136,7 @@ class Atom(portage.dep.Atom, CPV):
 		# Don't believe Portage has something like this
 		#c = cmp(self.negate_vers, other.negate_vers)
 		#if c:
-		#	return c
+		#   return c
 
 		if self.slot != other.slot:
 			if self.slot is None:
@@ -229,8 +232,8 @@ class Atom(portage.dep.Atom, CPV):
 
 		# TODO: Uncomment when Portage's Atom supports repo
 		#if (self.repo_name is not None and other.repo_name is not None and
-		#	self.repo_name != other.repo_name):
-		#	return False
+		#   self.repo_name != other.repo_name):
+		#   return False
 
 		# Use deps are similar: if one of us forces a flag on and the
 		# other forces it off we do not intersect. If only one of us
@@ -247,9 +250,9 @@ class Atom(portage.dep.Atom, CPV):
 				if flag[0] == '-' and flag[1:] in flags:
 					return False
 
-        # Remaining thing to check is version restrictions. Get the
-        # ones we can check without actual version comparisons out of
-        # the way first.
+		# Remaining thing to check is version restrictions. Get the
+		# ones we can check without actual version comparisons out of
+		# the way first.
 
 		# If one of us is unversioned we intersect:
 		if not self.operator or not other.operator:

diff --git a/pym/gentoolkit/dependencies.py b/pym/gentoolkit/dependencies.py
index 6aadc35..feced63 100644
--- a/pym/gentoolkit/dependencies.py
+++ b/pym/gentoolkit/dependencies.py
@@ -19,7 +19,7 @@ from portage.dep import paren_reduce
 from gentoolkit import errors
 from gentoolkit.atom import Atom
 from gentoolkit.cpv import CPV
-from gentoolkit.helpers import uniqify_atoms
+from gentoolkit.helpers import uniqify
 from gentoolkit.dbapi import PORTDB, VARDB
 from gentoolkit.query import Query
 
@@ -243,7 +243,7 @@ class Dependencies(Query):
 			try:
 				all_depends = depcache[pkgdep]
 			except KeyError:
-				all_depends = uniqify_atoms(pkgdep.get_all_depends())
+				all_depends = uniqify(pkgdep.get_all_depends())
 				depcache[pkgdep] = all_depends
 
 			dep_is_displayed = False

diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index cf1b138..cd8b763 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -7,7 +7,7 @@
 """Miscellaneous helper functions and classes.
 
 @note: find_* functions that previously lived here have moved to
-       the query module, where they are called as: Query('portage').find_*().
+	   the query module, where they are called as: Query('portage').find_*().
 """
 
 __all__ = (
@@ -476,16 +476,4 @@ def uniqify(seq, preserve_order=True):
 
 	return result
 
-def uniqify_atoms(seq):
-	"""Return a uniqified list."""
-	seen = set()
-	result = []
-	for x in seq:
-		dep = x.get_depstr()
-		if dep not in seen:
-			result.append(x)
-			seen.add(dep)
-
-	return result
-
 # vim: set ts=4 sw=4 tw=79:



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-03-31 21:53 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2011-03-31 21:53 UTC (permalink / raw
  To: gentoo-commits

commit:     eb134645c0bc8938a87a076c386c37571b61fc00
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 31 21:48:31 2011 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Thu Mar 31 21:48:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=eb134645

Fix extend_realpaths in FileOwner class. (Bug 96515)

Removed the os.path.islink check since it oly returns true if the last
part of the path is a symbolic link.  We want to add the realpath to the
list if it already doesn't exist in the list, since that indicates that
something in the path is a symbolic link.

---
 pym/gentoolkit/helpers.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index cd8b763..225a198 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -333,7 +333,7 @@ class FileOwner(object):
 
 		osp = os.path
 		paths.extend([osp.realpath(x) for x in paths
-			if osp.islink(x) and osp.realpath(x) not in paths])
+			if osp.realpath(x) not in paths])
 
 		return paths
 



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-04-18 18:28 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2011-04-18 18:28 UTC (permalink / raw
  To: gentoo-commits

commit:     6e7df927a6225066de1c4f100cd4e8541b5aa3f0
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 18 18:27:17 2011 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Apr 18 18:27:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=6e7df927

Change eprefix.py to only look at portage for the value of EPREFIX

---
 pym/gentoolkit/eprefix.py |   28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/pym/gentoolkit/eprefix.py b/pym/gentoolkit/eprefix.py
index 9a04e4b..48bd140 100644
--- a/pym/gentoolkit/eprefix.py
+++ b/pym/gentoolkit/eprefix.py
@@ -10,25 +10,15 @@
 used in all gentoolkit modules
 
 Example useage:  from gentoolkit.eprefix import EPREFIX
-then in code add it to the filepath eg.:  
+then in code add it to the filepath eg.:
 	exclude_file = "%s/etc/%s/%s.exclude" % (EPREFIX,__productname__ , action)
 
 """
-
-import os
-
-
-EPREFIX = ''
-
-# the following code is used to set it when
-# non-installed code is being run
-if 'EPREFIX' in os.environ:
-	EPREFIX = os.environ['EPREFIX']
-else:
-	try:
-		import portage.const
-		EPREFIX = portage.BPREFIX
-	except AttributeError:
-		EPREFIX = ''
-
-#print("EPREFIX set to:", EPREFIX)
+# Load EPREFIX from Portage, fall back to the empty string if it fails
+try:
+	from portage.const import EPREFIX
+except ImportError:
+	EPREFIX = ''
+
+if __name__ == "__main__":
+	print("EPREFIX set to:", EPREFIX)



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-05-18 21:18 Brian Dolbec
  0 siblings, 0 replies; 36+ messages in thread
From: Brian Dolbec @ 2011-05-18 21:18 UTC (permalink / raw
  To: gentoo-commits

commit:     28fbebb3c0d0cc04cdd84963c3a7168dc13fb048
Author:     dol-sen <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Wed May 18 21:17:19 2011 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed May 18 21:17:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=28fbebb3

add keywords formatter option.

---
 pym/gentoolkit/package.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py
index a4031a3..e405412 100644
--- a/pym/gentoolkit/package.py
+++ b/pym/gentoolkit/package.py
@@ -36,7 +36,7 @@ __all__ = (
 
 FORMAT_TMPL_VARS = (
 	'$location', '$mask', '$mask2', '$cp', '$cpv', '$category', '$name',
-	'$version', '$revision', '$fullversion', '$slot', '$repo'
+	'$version', '$revision', '$fullversion', '$slot', '$repo', '$keywords'
 ) 
 
 # =======
@@ -470,6 +470,7 @@ class PackageFormatter(object):
 			"fullversion")
 		fmt_vars.addLazySingleton("slot", self.format_slot)
 		fmt_vars.addLazySingleton("repo", self.pkg.repo_name)
+		fmt_vars.addLazySingleton("keywords", self.format_keywords)
 
 	def format_package_location(self):
 		"""Get the install status (in /var/db/?) and origin (from an overlay
@@ -570,5 +571,12 @@ class PackageFormatter(object):
 		else:
 			return value
 
+	def format_keywords(self):
+		value = self.pkg.environment("KEYWORDS")
+		if self._do_format:
+			return pp.keyword(value)
+		else:
+			return value
+
 
 # vim: set ts=4 sw=4 tw=79:



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-05-20  5:54 Brian Dolbec
  0 siblings, 0 replies; 36+ messages in thread
From: Brian Dolbec @ 2011-05-20  5:54 UTC (permalink / raw
  To: gentoo-commits

commit:     668d1a8666e27e94855107fcf5345c1b7fa9316f
Author:     dol-sen <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Fri May 20 05:26:09 2011 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri May 20 05:53:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=668d1a86

fix bug 368113 dupe'd USE flags

---
 pym/gentoolkit/flag.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/flag.py b/pym/gentoolkit/flag.py
index a7d944f..b5c8228 100644
--- a/pym/gentoolkit/flag.py
+++ b/pym/gentoolkit/flag.py
@@ -36,7 +36,8 @@ def get_iuse(cpv):
 	@returns [] or the list of IUSE flags
 	"""
 	try:
-		return PORTDB.aux_get(cpv, ["IUSE"])[0].split()
+		# aux_get might return dupes, so run them through set() to remove them
+		return list(set(PORTDB.aux_get(cpv, ["IUSE"])[0].split()))
 	except:
 		return []
 



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-05-23  3:45 Brian Dolbec
  0 siblings, 0 replies; 36+ messages in thread
From: Brian Dolbec @ 2011-05-23  3:45 UTC (permalink / raw
  To: gentoo-commits

commit:     665ee8fc8c85bceda7ec86e5df1c7f8c580d9be0
Author:     dol-sen <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Mon May 23 03:44:38 2011 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon May 23 03:44:38 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=665ee8fc

fix the Dependencies.graph_depends() api return value not being correct.

---
 pym/gentoolkit/dependencies.py |   41 ++++++++++++++++++---------------------
 1 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/pym/gentoolkit/dependencies.py b/pym/gentoolkit/dependencies.py
index feced63..0396952 100644
--- a/pym/gentoolkit/dependencies.py
+++ b/pym/gentoolkit/dependencies.py
@@ -115,7 +115,7 @@ class Dependencies(Query):
 		max_depth=1,
 		printer_fn=None,
 		# The rest of these are only used internally:
-		depth=0,
+		depth=1,
 		seen=None,
 		depcache=None,
 		result=None
@@ -151,32 +151,29 @@ class Dependencies(Query):
 			except KeyError:
 				pkgdep = Query(dep.atom).find_best()
 				depcache[dep.atom] = pkgdep
-			if pkgdep and pkgdep.cpv in seen:
+			if not pkgdep:
 				continue
-			if depth < max_depth or max_depth <= 0:
-
+			elif pkgdep.cpv in seen:
+				continue
+			if depth <= max_depth or max_depth == 0:
 				if printer_fn is not None:
 					printer_fn(depth, pkgdep, dep)
-				if not pkgdep:
-					continue
+				result.append((depth,pkgdep))
 
 				seen.add(pkgdep.cpv)
-				result.append((
-					depth,
-					pkgdep.deps.graph_depends(
-						max_depth=max_depth,
-						printer_fn=printer_fn,
-						# The rest of these are only used internally:
-						depth=depth+1,
-						seen=seen,
-						depcache=depcache,
-						result=result
-					)
-				))
-
-		if depth == 0:
-			return result
-		return pkgdep
+				if depth < max_depth or max_depth == 0:
+					# result is passed in and added to directly
+					# so rdeps is disposable
+					rdeps = pkgdep.deps.graph_depends(
+							max_depth=max_depth,
+							printer_fn=printer_fn,
+							# The rest of these are only used internally:
+							depth=depth+1,
+							seen=seen,
+							depcache=depcache,
+							result=result
+						)
+		return result
 
 	def graph_reverse_depends(
 		self,



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-07-15 20:02 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2011-07-15 20:02 UTC (permalink / raw
  To: gentoo-commits

commit:     0382df255affced93b59322611a58bf98aec6c64
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 15 19:59:23 2011 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 19:59:23 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=0382df25

Do not index ChangeLog entries with an invalid CPV. (Bug 375293)

---
 pym/gentoolkit/helpers.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index 225a198..a0b29ab 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -175,7 +175,7 @@ class ChangeLog(object):
 			if not pkg_name.strip():
 				continue
 			try:
-				entry_ver = CPV(pkg_name)
+				entry_ver = CPV(pkg_name, validate=True)
 			except errors.GentoolkitInvalidCPV:
 				if self.invalid_entry_is_fatal:
 					raise ValueError(entry_ver)



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-07-16  3:21 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2011-07-16  3:21 UTC (permalink / raw
  To: gentoo-commits

commit:     e93234d3f899e2e5577b8085bbfd90c7447576cd
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 03:16:56 2011 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 03:16:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=e93234d3

Update Package Class to allow passing of local_config.

The local_config variable determines if the portage.config settings
object takes the /etc/portage/package.* files into account.

---
 pym/gentoolkit/package.py |   42 +++++++++++++++++++++++++++---------------
 1 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py
index e405412..45e59bd 100644
--- a/pym/gentoolkit/package.py
+++ b/pym/gentoolkit/package.py
@@ -47,7 +47,6 @@ import os
 from string import Template
 
 import portage
-from portage import settings
 from portage.util import LazyItemsDict
 
 import gentoolkit.pprinter as pp
@@ -58,13 +57,22 @@ from gentoolkit.keyword import determine_keyword
 from gentoolkit.flag import get_flags
 
 # =======
+# Settings
+# =======
+
+default_settings = portage.config(local_config=True)
+default_settings.lock()
+nolocal_settings = portage.config(local_config=False)
+nolocal_settings.lock()
+
+# =======
 # Classes
 # =======
 
 class Package(CPV):
 	"""Exposes the state of a given CPV."""
 
-	def __init__(self, cpv, validate=False):
+	def __init__(self, cpv, validate=False, local_config=True):
 		if isinstance(cpv, CPV):
 			self.__dict__.update(cpv.__dict__)
 		else:
@@ -76,6 +84,11 @@ class Package(CPV):
 			# CPV allows some things that Package must not
 			raise errors.GentoolkitInvalidPackage(self.cpv)
 
+		if local_config:
+			self._settings = default_settings
+		else:
+			self._settings = nolocal_settings
+
 		# Set dynamically
 		self._package_path = None
 		self._dblink = None
@@ -123,8 +136,8 @@ class Package(CPV):
 			self._dblink = portage.dblink(
 				self.category,
 				"%s-%s" % (self.name, self.fullversion),
-				settings["ROOT"],
-				settings
+				self._settings["ROOT"],
+				self._settings
 			)
 
 		return self._dblink
@@ -209,17 +222,16 @@ class Package(CPV):
 
 		return bool(PORTDB.cpv_exists(self.cpv))
 
-	@staticmethod
-	def settings(key):
+	def settings(self, key):
 		"""Returns the value of the given key for this package (useful
 		for package.* files."""
 
-		if settings.locked:
-			settings.unlock()
+		if self._settings.locked:
+			self._settings.unlock()
 		try:
-			result = settings[key]
+			result = self._settings[key]
 		finally:
-			settings.lock()
+			self._settings.lock()
 		return result
 
 	def mask_status(self):
@@ -234,11 +246,11 @@ class Package(CPV):
 			'missing keyword'
 		"""
 
-		if settings.locked:
-			settings.unlock()
+		if self._settings.locked:
+			self._settings.unlock()
 		try:
 			result = portage.getmaskingstatus(self.cpv,
-				settings=settings,
+				settings=self._settings,
 				portdb=PORTDB)
 		except KeyError:
 			# getmaskingstatus doesn't support packages without ebuilds in the
@@ -257,7 +269,7 @@ class Package(CPV):
 
 		try:
 			result = portage.getmaskingreason(self.cpv,
-				settings=settings,
+				settings=self._settings,
 				portdb=PORTDB,
 				return_location=True)
 			if result is None:
@@ -372,7 +384,7 @@ class Package(CPV):
 		if not ebuild:
 			return None
 		if self._portdir_path is None:
-			self._portdir_path = os.path.realpath(settings["PORTDIR"])
+			self._portdir_path = os.path.realpath(self._settings["PORTDIR"])
 		return (tree and tree != self._portdir_path)
 
 	def is_masked(self):



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-07-16  4:04 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2011-07-16  4:04 UTC (permalink / raw
  To: gentoo-commits

commit:     af81292035e8d3559b11ab16fc54ccd921cb3587
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 16 04:02:07 2011 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Sat Jul 16 04:02:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=af812920

Fix updated Package class to work correctly with prefix portage

---
 pym/gentoolkit/package.py |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py
index 45e59bd..85dbfd0 100644
--- a/pym/gentoolkit/package.py
+++ b/pym/gentoolkit/package.py
@@ -55,15 +55,22 @@ from gentoolkit.cpv import CPV
 from gentoolkit.dbapi import PORTDB, VARDB
 from gentoolkit.keyword import determine_keyword
 from gentoolkit.flag import get_flags
+from gentoolkit.eprefix import EPREFIX
 
 # =======
 # Settings
 # =======
 
-default_settings = portage.config(local_config=True)
-default_settings.lock()
-nolocal_settings = portage.config(local_config=False)
-nolocal_settings.lock()
+if EPREFIX:
+	default_settings = portage.config(local_config=True, _eprefix=EPREFIX)
+	default_settings.lock()
+	nolocal_settings = portage.config(local_config=False, _eprefix=EPREFIX)
+	nolocal_settings.lock()
+else:
+	default_settings = portage.config(local_config=True)
+	default_settings.lock()
+	nolocal_settings = portage.config(local_config=False)
+	nolocal_settings.lock()
 
 # =======
 # Classes



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2011-12-23  6:05 Brian Dolbec
  0 siblings, 0 replies; 36+ messages in thread
From: Brian Dolbec @ 2011-12-23  6:05 UTC (permalink / raw
  To: gentoo-commits

commit:     96236b49a1da4bd32ac64ba97ab828e0a7b5e9e8
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 23 06:01:45 2011 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Dec 23 06:03:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=96236b49

Fix the term_width setting for the recent portage change, which is now returning 0 instead of -1.
This should work for all portage versions.

---
 pym/gentoolkit/base.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/base.py b/pym/gentoolkit/base.py
index 832d902..3d662d5 100644
--- a/pym/gentoolkit/base.py
+++ b/pym/gentoolkit/base.py
@@ -40,7 +40,7 @@ def initialize_configuration():
 
 	# Get terminal size
 	term_width = pp.output.get_term_size()[1]
-	if term_width == -1:
+	if term_width < 1:
 		# get_term_size() failed. Set a sane default width:
 		term_width = 80
 	# Terminal size, minus a 1-char margin for text wrapping



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-03-02  0:01 Brian Dolbec
  0 siblings, 0 replies; 36+ messages in thread
From: Brian Dolbec @ 2012-03-02  0:01 UTC (permalink / raw
  To: gentoo-commits

commit:     4ee500e06ca5625b48ec22e1ba431b191423f6e7
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  2 00:01:06 2012 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Mar  2 00:01:06 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=4ee500e0

fix bug 406495.  renamed portage.config() parameter from _eprefix to eprefix.

---
 pym/gentoolkit/package.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py
index 85dbfd0..38f2901 100644
--- a/pym/gentoolkit/package.py
+++ b/pym/gentoolkit/package.py
@@ -62,9 +62,9 @@ from gentoolkit.eprefix import EPREFIX
 # =======
 
 if EPREFIX:
-	default_settings = portage.config(local_config=True, _eprefix=EPREFIX)
+	default_settings = portage.config(local_config=True, eprefix=EPREFIX)
 	default_settings.lock()
-	nolocal_settings = portage.config(local_config=False, _eprefix=EPREFIX)
+	nolocal_settings = portage.config(local_config=False, eprefix=EPREFIX)
 	nolocal_settings.lock()
 else:
 	default_settings = portage.config(local_config=True)



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-05-16 21:18 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-05-16 21:18 UTC (permalink / raw
  To: gentoo-commits

commit:     df024db3a4573d89d11a59d0c05be7d4f3d7e143
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Wed May 16 21:12:03 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Wed May 16 21:12:03 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=df024db3

Make colors for useflags be the same as portage.

The current colors are the opposite of how portage uses the colors.
This just switches them so portage and equery show the same color for
the same meaning, Red is a set useflag and blue is an unset useflag.

Note: This ignores any user defined colormaps in portage.

---
 pym/gentoolkit/pprinter.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/pprinter.py b/pym/gentoolkit/pprinter.py
index d9f0375..7d8dc2c 100644
--- a/pym/gentoolkit/pprinter.py
+++ b/pym/gentoolkit/pprinter.py
@@ -116,7 +116,7 @@ def subsection(string):
 
 def useflag(string, enabled=True):
 	"""Returns a USE flag string."""
-	return output.blue(string) if enabled else output.red(string)
+	return output.red(string) if enabled else output.blue(string)
 
 def keyword(string, stable=True, hard_masked=False):
 	"""Returns a keyword string."""



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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-07-24 17:18 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-07-24 17:18 UTC (permalink / raw
  To: gentoo-commits

commit:     391f40a6e2f3b384ebe4c07312b18829880ecc20
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 24 17:16:26 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Tue Jul 24 17:16:26 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=391f40a6

Return string from Package.__str__ (Bug 423209)

Patch from Brennan Shacklett

---
 pym/gentoolkit/package.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py
index 38f2901..cbb7131 100644
--- a/pym/gentoolkit/package.py
+++ b/pym/gentoolkit/package.py
@@ -113,7 +113,7 @@ class Package(CPV):
 		return key in self.cpv
 
 	def __str__(self):
-		return self.cpv
+		return str(self.cpv)
 
 	@property
 	def metadata(self):


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-08-01  3:34 Brian Dolbec
  0 siblings, 0 replies; 36+ messages in thread
From: Brian Dolbec @ 2012-08-01  3:34 UTC (permalink / raw
  To: gentoo-commits

commit:     99c97cf9f39c6b0b5574827bcde981fbc9d92e9c
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  1 03:34:16 2012 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Aug  1 03:34:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=99c97cf9

mark dbapi as deprecated.

---
 pym/gentoolkit/dbapi.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/dbapi.py b/pym/gentoolkit/dbapi.py
index fbf0bc4..113545d 100644
--- a/pym/gentoolkit/dbapi.py
+++ b/pym/gentoolkit/dbapi.py
@@ -5,7 +5,16 @@
 #
 # $Header$
 
-"""Provides access to Portage database api"""
+"""Provides access to Portage database api
+	Note: this file is deprecated, please replace all use
+	of these variable with the assigned calls.  That will
+	take advantage of them being lazy-loaded.
+"""
+
+from __future__ import print_function
+
+print("gentoolkit.dbapi is deprecated.\n",
+	"Please migrate to using the assigned calls directly")
 
 import portage
 


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-10-09 21:35 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-10-09 21:35 UTC (permalink / raw
  To: gentoo-commits

commit:     da1013f7067ca4272423802bccfe17f19a9d3e48
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  9 21:32:01 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Tue Oct  9 21:34:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=da1013f7

Modify _pkg_re to work with EAPI 4-python which is in use by Funtoo.

Testing on a Gentoo system showed no adverse affects with the change.

---
 pym/gentoolkit/cpv.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/cpv.py b/pym/gentoolkit/cpv.py
index 8d81c93..97fc76b 100644
--- a/pym/gentoolkit/cpv.py
+++ b/pym/gentoolkit/cpv.py
@@ -33,7 +33,7 @@ from gentoolkit import errors
 isvalid_version_re = re.compile("^(?:cvs\\.)?(?:\\d+)(?:\\.\\d+)*[a-z]?"
 	"(?:_(p(?:re)?|beta|alpha|rc)\\d*)*$")
 isvalid_cat_re = re.compile("^(?:[a-zA-Z0-9][-a-zA-Z0-9+._]*(?:/(?!$))?)+$")
-_pkg_re = re.compile("^[a-zA-Z0-9+_]+$")
+_pkg_re = re.compile("^[a-zA-Z0-9+._]+$")
 # Prefix specific revision is of the form -r0<digit>+.<digit>+
 isvalid_rev_re = re.compile(r'(\d+|0\d+\.\d+)')
 


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     87eaae1c3e4ec5d15ba0212606fc5b42e6464f9b
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 01:22:54 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 01:22:54 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=87eaae1c

metadata: use print() in PackageFormatter doctest for Python 3 compatibility

---
 pym/gentoolkit/metadata.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/metadata.py b/pym/gentoolkit/metadata.py
index 9bcc17b..352fbef 100644
--- a/pym/gentoolkit/metadata.py
+++ b/pym/gentoolkit/metadata.py
@@ -14,11 +14,11 @@
 		>>> pkg_md.herds()
 		['no-herd']
 		>>> for maint in pkg_md.maintainers():
-		...     print "{0} ({1})".format(maint.email, maint.name)
+		...     print('{0} ({1})'.format(maint.email, maint.name))
 		...
 		nixphoeni@gentoo.org (Joe Sapp)
 		>>> for flag in pkg_md.use():
-		...     print flag.name, "->", flag.description
+		...     print(flag.name, '->', flag.description)
 		...
 		rtf -> Enable export to RTF
 		gnome-print -> Enable printing support using gnome-print


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     6f3e339859bb779a2ff6dc69b97595f9a4770d6c
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 01:23:27 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 01:23:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=6f3e3398

metadata: gourmet package no longer part of a herd

---
 pym/gentoolkit/metadata.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/metadata.py b/pym/gentoolkit/metadata.py
index 352fbef..3b678f2 100644
--- a/pym/gentoolkit/metadata.py
+++ b/pym/gentoolkit/metadata.py
@@ -12,7 +12,7 @@
 		>>> pkg_md
 		<MetaData '/usr/portage/app-misc/gourmet/metadata.xml'>
 		>>> pkg_md.herds()
-		['no-herd']
+		[]
 		>>> for maint in pkg_md.maintainers():
 		...     print('{0} ({1})'.format(maint.email, maint.name))
 		...


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     4f42fbfc09e131ddcc40f67cb7628eddefc242c3
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 01:28:36 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 01:28:43 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=4f42fbfc

metadata: fix 'maintainer' -> 'maintainers' in module doctest

---
 pym/gentoolkit/metadata.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/metadata.py b/pym/gentoolkit/metadata.py
index 08472d3..f9f9f8c 100644
--- a/pym/gentoolkit/metadata.py
+++ b/pym/gentoolkit/metadata.py
@@ -29,7 +29,7 @@
 		  'maintainers':
 		  [<_Maintainer 'Thomas_Hinkle@alumni.brown.edu'>],
 		  'changelogs': [], 'bugtrackers': []}>]
-		>>> upstream[0].maintainer[0].name
+		>>> upstream[0].maintainers[0].name
 		'Thomas Mills Hinkle'
 """
 


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     82d07c64bc279e88d01b943c9b40240e3ec851ff
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 01:25:10 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 01:25:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=82d07c64

metadata: update gnome-print USE description

---
 pym/gentoolkit/metadata.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/metadata.py b/pym/gentoolkit/metadata.py
index 3b678f2..08b4b52 100644
--- a/pym/gentoolkit/metadata.py
+++ b/pym/gentoolkit/metadata.py
@@ -21,7 +21,7 @@
 		...     print(flag.name, '->', flag.description)
 		...
 		rtf -> Enable export to RTF
-		gnome-print -> Enable printing support using gnome-print
+		gnome-print -> Enable pretty Python printing with gnome-print
 		>>> upstream = pkg_md.upstream()
 		>>> upstream
 		[<_Upstream {'docs': [], 'remoteid': [], 'maintainer':


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     88ac4e9030ab5827d1ab4d01ee6c0aff85184d28
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 01:35:08 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 01:35:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=88ac4e90

keyword: use Python 2/3-agnostic set notation in reduce_keywords doctest

Python 2.7 prints sets as "set([1, 2])", but Python 3.2 prints them as
"{1, 2}".  Avoid having to chose by showing that the result of
reduce_keywords() is a set, and then printing the elements in a list.

---
 pym/gentoolkit/keyword.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/keyword.py b/pym/gentoolkit/keyword.py
index 17b3472..a234116 100644
--- a/pym/gentoolkit/keyword.py
+++ b/pym/gentoolkit/keyword.py
@@ -95,8 +95,11 @@ def reduce_keywords(keywords):
 	"""Reduce a list of keywords to a unique set of stable keywords.
 
 	Example usage:
-		>>> reduce_keywords(['~amd64', 'x86', '~x86'])
-		set(['amd64', 'x86'])
+		>>> kw = reduce_keywords(['~amd64', 'x86', '~x86'])
+		>>> isinstance(kw, set)
+		True
+		>>> sorted(kw)
+		['amd64', 'x86']
 
 	@type keywords: array
 	@rtype: set


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     66ff38b27402e0412a842bc00788887d24da56b4
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 01:41:55 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 01:41:55 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=66ff38b2

keyword: define keyword_list in compare_strs doctest

This is not much of a doctest, since we aren't using compare_strs()
anywhere, but at least it doesn't error out.  Note that comparisons
have been reworked in Python 3 where cmp() has been removed.

---
 pym/gentoolkit/keyword.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pym/gentoolkit/keyword.py b/pym/gentoolkit/keyword.py
index a234116..0f3807c 100644
--- a/pym/gentoolkit/keyword.py
+++ b/pym/gentoolkit/keyword.py
@@ -75,6 +75,7 @@ def compare_strs(kw1, kw2):
 	as: keyword_list.sort(keyword.compare_strs)
 
 	An alternative is to use the Keyword descriptor directly:
+	>>> keyword_list = ['~x86', '~amd64', 'x86']
 	>>> kwds = sorted(Keyword(x) for x in keyword_list)
 
 	@see: >>> help(cmp)


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     fef019e0dcc37346a5344fd3fa644a44fcdd22f1
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 01:31:16 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 01:31:16 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=fef019e0

keyword: remove shebang from module without __name__ == '__main__' block

---
 pym/gentoolkit/keyword.py |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/keyword.py b/pym/gentoolkit/keyword.py
index 057f77c..17b3472 100644
--- a/pym/gentoolkit/keyword.py
+++ b/pym/gentoolkit/keyword.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-#
 # Copyright(c) 2004-2010, Gentoo Foundation
 #
 # Licensed under the GNU General Public License, v2


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     5f7072beb9db8d7829a64aad21bdd10380488479
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 01:28:08 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 01:28:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=5f7072be

metadata: add new _Upstream attributes in module doctest

---
 pym/gentoolkit/metadata.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/pym/gentoolkit/metadata.py b/pym/gentoolkit/metadata.py
index 08b4b52..08472d3 100644
--- a/pym/gentoolkit/metadata.py
+++ b/pym/gentoolkit/metadata.py
@@ -23,10 +23,12 @@
 		rtf -> Enable export to RTF
 		gnome-print -> Enable pretty Python printing with gnome-print
 		>>> upstream = pkg_md.upstream()
-		>>> upstream
-		[<_Upstream {'docs': [], 'remoteid': [], 'maintainer':
-		 [<_Maintainer 'Thomas_Hinkle@alumni.brown.edu'>], 'bugtracker': [],
-		 'changelog': []}>]
+		>>> upstream  # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
+		[<_Upstream {'node': <Element 'upstream' at 0x...>,
+		  'remoteids': [], 'docs': [],
+		  'maintainers':
+		  [<_Maintainer 'Thomas_Hinkle@alumni.brown.edu'>],
+		  'changelogs': [], 'bugtrackers': []}>]
 		>>> upstream[0].maintainer[0].name
 		'Thomas Mills Hinkle'
 """


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     cfe01271c3c64f290acf3ce3ae42eb55887e295d
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 02:05:13 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 02:05:13 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=cfe01271

helpers: use print() in ChangeLog doctest for Python 3 compatibility

Also update the expected portage.latest.

---
 pym/gentoolkit/helpers.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index 90e0939..706b526 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -51,11 +51,12 @@ class ChangeLog(object):
 	Example usage:
 		>>> from gentoolkit.helpers import ChangeLog
 		>>> portage = ChangeLog('/usr/portage/sys-apps/portage/ChangeLog')
-		>>> print portage.latest.strip()
-		*portage-2.2_rc50 (15 Nov 2009)
-
-		  15 Nov 2009; Zac Medico <zmedico@gentoo.org> +portage-2.2_rc50.ebuild:
-		  2.2_rc50 bump. This includes all fixes in 2.1.7.5.
+		>>> print(portage.latest.strip())
+		*portage-2.2.0_alpha142 (26 Oct 2012)
+		<BLANKLINE>
+		  26 Oct 2012; Zac Medico <zmedico@gentoo.org> +portage-2.2.0_alpha142.ebuild:
+		  2.2.0_alpha142 version bump. This includes all of the fixes in 2.1.11.31. Bug
+		  #210077 tracks all bugs fixed since portage-2.1.x.
 		>>> len(portage.full)
 		75
 		>>> len(portage.entries_matching_range(


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     da15ffa5a762cbfa16c02dd56819f27d09f221db
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 02:32:27 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 02:32:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=da15ffa5

dependencies: update Dependencies doctest to use portage-9999

---
 pym/gentoolkit/dependencies.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pym/gentoolkit/dependencies.py b/pym/gentoolkit/dependencies.py
index 84e3672..726d546 100644
--- a/pym/gentoolkit/dependencies.py
+++ b/pym/gentoolkit/dependencies.py
@@ -31,12 +31,14 @@ class Dependencies(Query):
 
 	Example usage:
 		>>> from gentoolkit.dependencies import Dependencies
-		>>> portage = Dependencies('sys-apps/portage-2.1.6.13')
+		>>> portage = Dependencies('sys-apps/portage-9999')
 		>>> portage
-		<Dependencies 'sys-apps/portage-2.1.6.13'>
+		<Dependencies 'sys-apps/portage-9999'>
 		>>> # All methods return gentoolkit.atom.Atom instances
 		... portage.get_depend()
-		[<Atom '>=dev-lang/python-2.5'>, <Atom '<dev-lang/python-3.0'>, ...]
+		... # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
+		[<Atom 'python3? =dev-lang/python-3*'>,
+		 <Atom '!python3? >=dev-lang/python-2.7'>, ...]
 
 	"""
 	def __init__(self, query, parser=None):


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     6c751ebd67a981557e5bc9657efef2e6f5f4614d
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 02:54:17 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 02:54:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=6c751ebd

cpv: define package_list in compare_strs doctest

This is not much of a doctest, since we aren't using compare_strs()
anywhere, but at least it doesn't error out.  Note that comparisons
have been reworked in Python 3 where cmp() has been removed.

---
 pym/gentoolkit/cpv.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pym/gentoolkit/cpv.py b/pym/gentoolkit/cpv.py
index cda68d7..9c72431 100644
--- a/pym/gentoolkit/cpv.py
+++ b/pym/gentoolkit/cpv.py
@@ -178,6 +178,7 @@ def compare_strs(pkg1, pkg2):
 	as: package_list.sort(cpv.compare_strs)
 
 	An alternative is to use the CPV descriptor from gentoolkit.cpv:
+	>>> package_list = ['sys-apps/portage-9999', 'media-video/ffmpeg-9999']
 	>>> cpvs = sorted(CPV(x) for x in package_list)
 
 	@see: >>> help(cmp)


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     14bb81fb3801caf6b09e7c4cbe2dfdc36cb03525
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 02:06:58 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 02:06:58 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=14bb81fb

helpers: convert get_cpvs output to a set before calculating len()

This avoids "TypeError: object of type 'generator' has no len()".

---
 pym/gentoolkit/helpers.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index 706b526..cc3bf35 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -373,7 +373,7 @@ def get_cpvs(predicate=None, include_installed=True):
 		>>> len(set(get_cpvs()))
 		26065
 		>>> fn = lambda x: x.startswith('app-portage')
-		>>> len(get_cpvs(fn, include_installed=False))
+		>>> len(set(get_cpvs(fn, include_installed=False)))
 		112
 
 	@type predicate: function


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     c14f2e750c85f08a1fc92a548cebb96654c1be05
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 02:12:19 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 02:12:19 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=c14f2e75

helpers: update package counts in get_cpvs doctest

---
 pym/gentoolkit/helpers.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index cc3bf35..7f30a24 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -371,10 +371,10 @@ def get_cpvs(predicate=None, include_installed=True):
 	Example usage:
 		>>> from gentoolkit.helpers import get_cpvs
 		>>> len(set(get_cpvs()))
-		26065
+		33518
 		>>> fn = lambda x: x.startswith('app-portage')
 		>>> len(set(get_cpvs(fn, include_installed=False)))
-		112
+		137
 
 	@type predicate: function
 	@param predicate: a function to filter the package list with


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     1f2349ffc2c4e8437aa571928eb36881d4bd41f8
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 02:24:29 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 02:24:29 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=1f2349ff

helpers: update entry counts and version range in ChangeLog doctest

---
 pym/gentoolkit/helpers.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index 7f30a24..637d3a7 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -58,12 +58,11 @@ class ChangeLog(object):
 		  2.2.0_alpha142 version bump. This includes all of the fixes in 2.1.11.31. Bug
 		  #210077 tracks all bugs fixed since portage-2.1.x.
 		>>> len(portage.full)
-		75
+		270
 		>>> len(portage.entries_matching_range(
-		...     from_ver='2.2_rc40',
-		...     to_ver='2.2_rc50'))
-		11
-
+		...     from_ver='2.1.11.31',
+		...     to_ver='9999'))
+		140
 	"""
 	def __init__(self, changelog_path, invalid_entry_is_fatal=False):
 		if not (os.path.isfile(changelog_path) and


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     d505769fd55daab8ed64534b000732a801f5b2fa
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 02:45:38 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 02:48:45 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=d505769f

dependencies: avoid Package-is-not-iterable in graph_reverse_depends doctest

Dependency is a subclass of Query, so we need to initialize it with a
CPV string, not a Package instance.  The old doctest was raising:

  File ".../pym/gentoolkit/dependencies.py", line 202, in
    gentoolkit.dependencies.Dependencies.graph_reverse_depends
  Failed example:
    deptree = ffmpeg.graph_reverse_depends(
        only_direct=False,  # Include indirect revdeps
        pkgset=installed)   # from installed pkgset
  Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.2/doctest.py", line 1288, in __run
        compileflags, 1), test.globs)
      File "<doctest gentoolkit.dependencies.Dependencies.graph_reverse_depends[5]>", line 3, in <module>
        pkgset=installed)   # from installed pkgset
      File ".../pym/gentoolkit/dependencies.py", line 237, in graph_reverse_depends
        pkgset = tuple(Dependencies(x) for x in pkgset)
      File ".../pym/gentoolkit/dependencies.py", line 237, in <genexpr>
        pkgset = tuple(Dependencies(x) for x in pkgset)
      File ".../pym/gentoolkit/dependencies.py", line 45, in __init__
        Query.__init__(self, query)
      File "/home/wking/src/gentoolkit/pym/gentoolkit/query.py", line 51, in __init__
        if not set(query).intersection(needed_chars):
    TypeError: 'Package' object is not iterable

Also use ffmpeg-9999 (for better future-proofing) and update the
length of the resulting deptree.

---
 pym/gentoolkit/dependencies.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/gentoolkit/dependencies.py b/pym/gentoolkit/dependencies.py
index 726d546..3019a54 100644
--- a/pym/gentoolkit/dependencies.py
+++ b/pym/gentoolkit/dependencies.py
@@ -192,18 +192,18 @@ class Dependencies(Query):
 
 		Example usage:
 			>>> from gentoolkit.dependencies import Dependencies
-			>>> ffmpeg = Dependencies('media-video/ffmpeg-0.5_p20373')
+			>>> ffmpeg = Dependencies('media-video/ffmpeg-9999')
 			>>> # I only care about installed packages that depend on me:
 			... from gentoolkit.helpers import get_installed_cpvs
 			>>> # I want to pass in a sorted list. We can pass strings or
 			... # Package or Atom types, so I'll use Package to sort:
 			... from gentoolkit.package import Package
-			>>> installed = sorted(Package(x) for x in get_installed_cpvs())
+			>>> installed = sorted(get_installed_cpvs())
 			>>> deptree = ffmpeg.graph_reverse_depends(
 			...     only_direct=False,  # Include indirect revdeps
 			...     pkgset=installed)   # from installed pkgset
 			>>> len(deptree)
-			44
+			24
 
 		@type pkgset: iterable
 		@keyword pkgset: sorted pkg cpv strings or anything sublassing


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-11-13 20:40 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2012-11-13 20:40 UTC (permalink / raw
  To: gentoo-commits

commit:     e8db7d799af467c3eff7ec7beb5eee3e3b1da538
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Mon Nov 12 02:51:58 2012 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Nov 12 02:51:58 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=e8db7d79

cpv: remove shebang from module without __name__ == '__main__' block

---
 pym/gentoolkit/cpv.py |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/cpv.py b/pym/gentoolkit/cpv.py
index 97fc76b..cda68d7 100644
--- a/pym/gentoolkit/cpv.py
+++ b/pym/gentoolkit/cpv.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-#
 # Copyright(c) 2005 Jason Stubbs <jstubbs@gentoo.org>                         
 # Copyright(c) 2005-2006 Brian Harring <ferringb@gmail.com>
 # Copyright(c) 2009-2010 Gentoo Foundation


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2012-12-30 20:25 Brian Dolbec
  0 siblings, 0 replies; 36+ messages in thread
From: Brian Dolbec @ 2012-12-30 20:25 UTC (permalink / raw
  To: gentoo-commits

commit:     9dc72ec11c464f1fad4ddca0608a0593be23b9b5
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 30 20:24:19 2012 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Dec 30 20:24:19 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=9dc72ec1

fix bug 449300, duped use flags due to non defaulted use flags added from eclasses not matching against IUSE defaults during set() duplicate elimination.

---
 pym/gentoolkit/flag.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/gentoolkit/flag.py b/pym/gentoolkit/flag.py
index 9983ba7..d92d904 100644
--- a/pym/gentoolkit/flag.py
+++ b/pym/gentoolkit/flag.py
@@ -36,7 +36,10 @@ def get_iuse(cpv):
 	"""
 	try:
 		# aux_get might return dupes, so run them through set() to remove them
-		return list(set(portage.db[portage.root]["porttree"].dbapi.aux_get(cpv, ["IUSE"])[0].split()))
+		iuse = set(portage.db[portage.root]["porttree"].dbapi.aux_get(cpv, ["IUSE"])[0].split())
+		# there could still be dupes due to IUSE defaults
+		iuse = [x for x in iuse if '+'+x not in iuse and '-'+x not in iuse]
+		return list(iuse)
 	except:
 		return []
 
@@ -173,7 +176,6 @@ def get_flags(cpv, final_setting=False):
 	"""
 	final_use, use_expand_hidden, usemasked, useforced = get_all_cpv_use(cpv)
 	iuse_flags = filter_flags(get_iuse(cpv), use_expand_hidden, usemasked, useforced)
-	#flags = filter_flags(use_flags, use_expand_hidden, usemasked, useforced)
 	if final_setting:
 		final_flags = filter_flags(final_use,  use_expand_hidden, usemasked, useforced)
 		return iuse_flags, final_flags


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2013-01-04 22:23 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2013-01-04 22:23 UTC (permalink / raw
  To: gentoo-commits

commit:     de264bbe75fe45ff7d457343a8a8a5f96cd14a7f
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  4 22:16:36 2013 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Fri Jan  4 22:16:36 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=de264bbe

Fix regular expression queries to work properly. (Bug 447406)

There were two issues in the code:
1. query.py was trying to treat regular expressions as CPVs
2. helpers.py get_cpv functions were applying the predicate to only
   the CPs and not all of the CPVs

---
 pym/gentoolkit/helpers.py |   52 +++++++++++++++++++-------------------------
 pym/gentoolkit/query.py   |   15 +++++++++++-
 2 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py
index 637d3a7..55fecdb 100644
--- a/pym/gentoolkit/helpers.py
+++ b/pym/gentoolkit/helpers.py
@@ -386,17 +386,15 @@ def get_cpvs(predicate=None, include_installed=True):
 		Portage tree
 	"""
 
-	if predicate:
-		all_cps = iter(
-			x for x
-			in portage.db[portage.root]["porttree"].dbapi.cp_all()
-			if predicate(x))
-	else:
-		all_cps = portage.db[portage.root]["porttree"].dbapi.cp_all()
+	if not predicate:
+		predicate = lambda x: x
+
+	all_cps = portage.db[portage.root]["porttree"].dbapi.cp_all()
 
-	all_cpvs = chain.from_iterable(
+	all_cpvs = iter(x for x in chain.from_iterable(
 		portage.db[portage.root]["porttree"].dbapi.cp_list(x)
-		for x in all_cps)
+		for x in all_cps) if predicate(x))
+
 	all_installed_cpvs = set(get_installed_cpvs(predicate))
 
 	if include_installed:
@@ -427,18 +425,16 @@ def get_installed_cpvs(predicate=None):
 		from VARDB
 	"""
 
-	if predicate:
-		installed_cps = iter(
-			x for x
-			in portage.db[portage.root]["vartree"].dbapi.cp_all()
-			if predicate(x))
-	else:
-		installed_cps = (
-			portage.db[portage.root]["vartree"].dbapi.cp_all())
+	if not predicate:
+		predicate = lambda x: x
+
+	installed_cps = portage.db[portage.root]["vartree"].dbapi.cp_all()
 
-	for cpv in chain.from_iterable(
+	installed_cpvs = iter(x for x in chain.from_iterable(
 		portage.db[portage.root]["vartree"].dbapi.cp_list(x)
-		for x in installed_cps):
+		for x in installed_cps) if predicate(x))
+
+	for cpv in installed_cpvs:
 		yield cpv
 
 
@@ -452,18 +448,16 @@ def get_bintree_cpvs(predicate=None):
 		from BINDB
 	"""
 
-	if predicate:
-		installed_cps = iter(
-			x for x
-			in portage.db[portage.root]["bintree"].dbapi.cp_all()
-			if predicate(x))
-	else:
-		installed_cps = (
-			portage.db[portage.root]["bintree"].dbapi.cp_all())
+	if not predicate:
+		predicate = lambda x: x
 
-	for cpv in chain.from_iterable(
+	installed_cps = portage.db[portage.root]["bintree"].dbapi.cp_all()
+
+	installed_cpvs = iter(x for x in chain.from_iterable(
 		portage.db[portage.root]["bintree"].dbapi.cp_list(x)
-		for x in installed_cps):
+		for x in installed_cps) if predicate(x))
+
+	for cpv in installed_cpvs:
 		yield cpv
 
 

diff --git a/pym/gentoolkit/query.py b/pym/gentoolkit/query.py
index cd8efcc..c0ce977 100644
--- a/pym/gentoolkit/query.py
+++ b/pym/gentoolkit/query.py
@@ -89,7 +89,11 @@ class Query(CPV):
 			cat_str = ""
 			pkg_str = pp.emph(self.query)
 		else:
-			cat, pkg = self.category, self.name + self.fullversion
+			try:
+				cat, pkg = self.category, self.name + self.fullversion
+			except errors.GentoolkitInvalidCPV:
+				cat = ''
+				pkg = self.atom
 			if cat and not self.is_regex:
 				cat_str = "in %s " % pp.emph(cat.lstrip('><=~!'))
 			else:
@@ -303,7 +307,10 @@ class Query(CPV):
 		if show_progress and not CONFIG["piping"]:
 			self.print_summary()
 
-		cat = CPV(self.query).category
+		try:
+			cat = CPV(self.query).category
+		except errors.GentoolkitInvalidCPV:
+			cat = ''
 
 		pre_filter = []
 		# The "get_" functions can pre-filter against the whole package key,
@@ -322,6 +329,10 @@ class Query(CPV):
 
 		# Post-filter
 		if self.is_regex:
+			try:
+				re.compile(self.query)
+			except re.error:
+				raise errors.GentoolkitInvalidRegex(self.query)
 			predicate = lambda x: re.search(self.query, x)
 		else:
 			if cat:


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2013-03-12 16:06 Mike Frysinger
  0 siblings, 0 replies; 36+ messages in thread
From: Mike Frysinger @ 2013-03-12 16:06 UTC (permalink / raw
  To: gentoo-commits

commit:     95648e0369e74d65582ee3ef44b0a0a338f82cf0
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 12 16:08:56 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 16:08:56 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=95648e03

equery: respect PORTAGE_CONFIGROOT too

Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

---
 pym/gentoolkit/package.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pym/gentoolkit/package.py b/pym/gentoolkit/package.py
index 2a103de..da9d65c 100644
--- a/pym/gentoolkit/package.py
+++ b/pym/gentoolkit/package.py
@@ -61,6 +61,7 @@ from gentoolkit.eprefix import EPREFIX
 def _NewPortageConfig(local_config):
 	ret = portage.config(local_config=local_config,
 			eprefix=EPREFIX if EPREFIX else None,
+			config_root=os.environ.get('PORTAGE_CONFIGROOT', None),
 			target_root=os.environ.get('ROOT', None))
 	ret.lock()
 	return ret


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2014-02-22 19:28 Brian Dolbec
  0 siblings, 0 replies; 36+ messages in thread
From: Brian Dolbec @ 2014-02-22 19:28 UTC (permalink / raw
  To: gentoo-commits

commit:     29de73337a703bcfe706d8b7df35c92781854ad5
Author:     Merlijn Wajer <merlijn <AT> wizzup <DOT> org>
AuthorDate: Sat Feb 22 19:22:19 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Feb 22 19:22:19 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=29de7333

Fix the broken import statement for sets.

This udates gentoolkit for the renamed sets module to _sets.

---
 pym/gentoolkit/sets.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pym/gentoolkit/sets.py b/pym/gentoolkit/sets.py
index b9c3601..70315e9 100644
--- a/pym/gentoolkit/sets.py
+++ b/pym/gentoolkit/sets.py
@@ -10,9 +10,11 @@ __docformat__ = 'epytext'
 
 import portage
 try:
-	import portage.sets
+	# Per commit 25d8427b3b29cbcee97279186983dae818495f8f in portage,
+	# portage.sets is renamed to portage._sets.
+	import portage._sets
 	_sets_available = True
-	SETPREFIX = portage.sets.SETPREFIX
+	SETPREFIX = portage._sets.SETPREFIX
 except ImportError:
 	_sets_available = False
 	SETPREFIX = "@"
@@ -25,7 +27,7 @@ _set_config = None
 def _init_set_config():
 	global _set_config
 	if _set_config is None:
-		_set_config = portage.sets.load_default_config(
+		_set_config = portage._sets.load_default_config(
 			portage.settings, portage.db[portage.root])
 
 def get_available_sets():
@@ -50,7 +52,7 @@ def get_set_atoms(setname):
 		try:
 			return set([Atom(str(x))
 				for x in _set_config.getSetAtoms(setname)])
-		except portage.sets.PackageSetNotFound:
+		except portage._sets.PackageSetNotFound:
 			raise errors.GentoolkitSetNotFound(setname)
 	raise errors.GentoolkitSetNotFound(setname)
 


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

* [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
@ 2015-06-02 22:10 Paul Varner
  0 siblings, 0 replies; 36+ messages in thread
From: Paul Varner @ 2015-06-02 22:10 UTC (permalink / raw
  To: gentoo-commits

commit:     1c0c61bc2b4ed4d53612d5effb36c8483fea1bca
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  2 22:09:14 2015 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Tue Jun  2 22:09:14 2015 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1c0c61bc

gentoolkit: Fix query.py to properly work with sets (Bug 546726)

 pym/gentoolkit/query.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/gentoolkit/query.py b/pym/gentoolkit/query.py
index c0ce977..df6e2fd 100644
--- a/pym/gentoolkit/query.py
+++ b/pym/gentoolkit/query.py
@@ -362,7 +362,7 @@ class Query(CPV):
 
 		q = self.query
 		for atom in atoms:
-			self.query = atom
+			self.query = str(atom)
 			result.extend(self._do_simple_lookup(show_progress=False))
 		self.query = q
 


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

end of thread, other threads:[~2015-06-02 22:10 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-13 20:40 [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/ Paul Varner
  -- strict thread matches above, loose matches on Subject: below --
2015-06-02 22:10 Paul Varner
2014-02-22 19:28 Brian Dolbec
2013-03-12 16:06 Mike Frysinger
2013-01-04 22:23 Paul Varner
2012-12-30 20:25 Brian Dolbec
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-10-09 21:35 Paul Varner
2012-08-01  3:34 Brian Dolbec
2012-07-24 17:18 Paul Varner
2012-05-16 21:18 Paul Varner
2012-03-02  0:01 Brian Dolbec
2011-12-23  6:05 Brian Dolbec
2011-07-16  4:04 Paul Varner
2011-07-16  3:21 Paul Varner
2011-07-15 20:02 Paul Varner
2011-05-23  3:45 Brian Dolbec
2011-05-20  5:54 Brian Dolbec
2011-05-18 21:18 Brian Dolbec
2011-04-18 18:28 Paul Varner
2011-03-31 21:53 Paul Varner
2011-02-23  9:10 Brian Dolbec

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