public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2011-07-07  4:36 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2011-07-07  4:36 UTC (permalink / raw
  To: gentoo-commits

commit:     2ba193f01310cf2980dab881bff58e7bfeb33ea3
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Thu Jul  7 00:35:10 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jul  7 04:19:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2ba193f0

add FEATURES=allow-missing-manifests

The feature is as it sounds- primarily useful for temporary
trees or instances where manifests aren't used.

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>

---
 pym/_emerge/EbuildFetcher.py |    3 ++-
 pym/portage/const.py         |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py
index c9a107d..2150241 100644
--- a/pym/_emerge/EbuildFetcher.py
+++ b/pym/_emerge/EbuildFetcher.py
@@ -107,10 +107,11 @@ class EbuildFetcher(SpawnProcess):
 			not in ('yes', 'true')
 
 		rval = 1
+		allow_missing = 'allow-missing-manifests' in self._settings.features
 		try:
 			if fetch(self._uri_map, self._settings, fetchonly=self.fetchonly,
 				digests=copy.deepcopy(self._digests),
-				allow_missing_digests=False):
+				allow_missing_digests=allow_missing):
 				rval = os.EX_OK
 		except SystemExit:
 			raise

diff --git a/pym/portage/const.py b/pym/portage/const.py
index 6bca8f9..ecaa8f1 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -86,6 +86,7 @@ EBUILD_PHASES            = ("pretend", "setup", "unpack", "prepare", "configure"
                            "package", "preinst", "postinst","prerm", "postrm",
                            "nofetch", "config", "info", "other")
 SUPPORTED_FEATURES       = frozenset([
+                           "allow-missing-manifests",
                            "assume-digests", "binpkg-logs", "buildpkg", "buildsyspkg", "candy",
                            "ccache", "chflags", "collision-protect", "compress-build-logs",
                            "digest", "distcc", "distcc-pump", "distlocks", "ebuild-locks", "fakeroot",



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2011-07-12 23:21 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2011-07-12 23:21 UTC (permalink / raw
  To: gentoo-commits

commit:     6034b1210e2bda02095a157b55505ea652f67e3c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 12 23:20:45 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 23:20:45 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6034b121

Use portage.subprocess_getstatusoutput() more.

---
 pym/_emerge/actions.py       |    7 ++-----
 pym/_emerge/main.py          |    8 +++-----
 pym/portage/checksum.py      |    9 +++------
 pym/portage/dispatch_conf.py |    6 +-----
 pym/portage/output.py        |    6 +-----
 5 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 62dadee..f6c2721 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3,10 +3,6 @@
 
 from __future__ import print_function
 
-try:
-	from subprocess import getstatusoutput as subprocess_getstatusoutput
-except ImportError:
-	from commands import getstatusoutput as subprocess_getstatusoutput
 import errno
 import logging
 import platform
@@ -25,7 +21,7 @@ from itertools import chain
 
 import portage
 from portage import os
-from portage import digraph
+from portage import subprocess_getstatusoutput
 from portage import _unicode_decode
 from portage.cache.cache_errors import CacheError
 from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH
@@ -44,6 +40,7 @@ from portage._sets import load_default_config, SETPREFIX
 from portage._sets.base import InternalPackageSet
 from portage.util import cmp_sort_key, writemsg, \
 	writemsg_level, writemsg_stdout
+from portage.util.digraph import digraph
 from portage._global_updates import _global_updates
 
 from _emerge.clear_caches import clear_caches

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 21dea40..42ce810 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -9,10 +9,6 @@ import stat
 import sys
 import textwrap
 import platform
-try:
-	from subprocess import getstatusoutput as subprocess_getstatusoutput
-except ImportError:
-	from commands import getstatusoutput as subprocess_getstatusoutput
 import portage
 from portage import os
 from portage import _encodings
@@ -162,7 +158,9 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
 									raise
 								del e
 					processed_count += 1
-					myso=subprocess_getstatusoutput("LANG=C LANGUAGE=C /usr/bin/install-info --dir-file="+inforoot+"/dir "+inforoot+"/"+x)[1]
+					myso = portage.subprocess_getstatusoutput(
+						"LANG=C LANGUAGE=C /usr/bin/install-info " +
+						"--dir-file=%s/dir %s/%s" % (inforoot, inforoot, x))[1]
 					existsstr="already exists, for file `"
 					if myso!="":
 						if re.search(existsstr,myso):

diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py
index eeb5995..9e7e455 100644
--- a/pym/portage/checksum.py
+++ b/pym/portage/checksum.py
@@ -1,5 +1,5 @@
 # checksum.py -- core Portage functionality
-# Copyright 1998-2010 Gentoo Foundation
+# Copyright 1998-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import portage
@@ -11,10 +11,6 @@ from portage import _unicode_encode
 import errno
 import stat
 import tempfile
-try:
-	from subprocess import getstatusoutput as subprocess_getstatusoutput
-except ImportError:
-	from commands import getstatusoutput as subprocess_getstatusoutput
 
 #dict of all available hash functions
 hashfunc_map = {}
@@ -125,7 +121,8 @@ hashfunc_map["size"] = getsize
 
 prelink_capable = False
 if os.path.exists(PRELINK_BINARY):
-	results = subprocess_getstatusoutput(PRELINK_BINARY+" --version > /dev/null 2>&1")
+	results = portage.subprocess_getstatusoutput(
+		"%s --version > /dev/null 2>&1" % (PRELINK_BINARY,))
 	if (results[0] >> 8) == 0:
 		prelink_capable=1
 	del results

diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py
index 228638c..4991020 100644
--- a/pym/portage/dispatch_conf.py
+++ b/pym/portage/dispatch_conf.py
@@ -9,10 +9,6 @@
 from __future__ import print_function
 
 import os, sys, shutil
-try:
-    from subprocess import getstatusoutput as subprocess_getstatusoutput
-except ImportError:
-    from commands import getstatusoutput as subprocess_getstatusoutput
 
 import portage
 from portage.env.loaders import KeyValuePairFileLoader
@@ -36,7 +32,7 @@ def diffstatusoutput_len(cmd):
     UnicodeDecodeError when necessary.
     """
     try:
-        status, output = subprocess_getstatusoutput(cmd)
+        status, output = portage.subprocess_getstatusoutput(cmd)
         return (status, len(output))
     except UnicodeDecodeError:
         return (1, 1)

diff --git a/pym/portage/output.py b/pym/portage/output.py
index 1bceb0e..0e8245f 100644
--- a/pym/portage/output.py
+++ b/pym/portage/output.py
@@ -3,10 +3,6 @@
 
 __docformat__ = "epytext"
 
-try:
-	from subprocess import getstatusoutput as subprocess_getstatusoutput
-except ImportError:
-	from commands import getstatusoutput as subprocess_getstatusoutput
 import errno
 import io
 import formatter
@@ -435,7 +431,7 @@ def get_term_size():
 			pass
 	except ImportError:
 		pass
-	st, out = subprocess_getstatusoutput('stty size')
+	st, out = portage.subprocess_getstatusoutput('stty size')
 	if st == os.EX_OK:
 		out = out.split()
 		if len(out) == 2:



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2011-10-15  6:11 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2011-10-15  6:11 UTC (permalink / raw
  To: gentoo-commits

commit:     0c1bbb316ce2e7e9608af78f5e2f5dea1c667af7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 06:11:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 06:11:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0c1bbb31

emerge --metadata: fix empty INHERITED handling

Since changes to eclass validation code in commit
2ed1cb53cc4158af08c22d466b15b9a9a7767212, validation of cache for
packages with empty INHERITED metadata has been broken due to failure
to distinguish between None and empty dict return values from
eclass.cache.validate_and_rewrite_cache().

---
 pym/_emerge/actions.py      |    6 +++---
 pym/portage/eclass_cache.py |    5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 71a0902..0879510 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1743,7 +1743,7 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 					if not (dest['_mtime_'] == src['_mtime_'] and \
 						tree_data.eclass_db.validate_and_rewrite_cache(
 							dest['_eclasses_'], tree_data.dest_db.validation_chf,
-							tree_data.dest_db.store_eclass_paths) and \
+							tree_data.dest_db.store_eclass_paths) is not None and \
 						set(dest['_eclasses_']) == set(src['_eclasses_'])):
 						dest = None
 					else:
@@ -1768,9 +1768,9 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 					continue
 
 				if eclasses is not None:
-					if not tree_data.eclass_db.validate_and_rewrite_cache(
+					if tree_data.eclass_db.validate_and_rewrite_cache(
 						src['_eclasses_'], tree_data.src_db.validation_chf,
-						tree_data.src_db.store_eclass_paths):
+						tree_data.src_db.store_eclass_paths) is None:
 						continue
 					inherited = eclasses
 				else:

diff --git a/pym/portage/eclass_cache.py b/pym/portage/eclass_cache.py
index 2f6e947..808662b 100644
--- a/pym/portage/eclass_cache.py
+++ b/pym/portage/eclass_cache.py
@@ -133,6 +133,11 @@ class cache(object):
 				self._eclass_locations[ys] = x
 
 	def validate_and_rewrite_cache(self, ec_dict, chf_type, stores_paths):
+		"""
+		This will return an empty dict if the ec_dict parameter happens
+		to be empty, therefore callers must take care to distinguish
+		between empty dict and None return values.
+		"""
 		if not isinstance(ec_dict, dict):
 			return None
 		our_getter = operator.attrgetter(chf_type)



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2011-10-25  8:25 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2011-10-25  8:25 UTC (permalink / raw
  To: gentoo-commits

commit:     25aaf3e69b8ef0e9a21d0d74a9b7b690b76675cd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 25 08:25:24 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 25 08:25:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=25aaf3e6

create_trees: save target_root for later use

---
 pym/_emerge/actions.py         |    8 +-------
 pym/portage/__init__.py        |   14 ++++++++++++--
 pym/portage/_legacy_globals.py |   10 ++--------
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 0879510..edc0afd 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2983,13 +2983,7 @@ def load_emerge_config(trees=None):
 		setconfig = load_default_config(settings, root_trees)
 		root_trees["root_config"] = RootConfig(settings, root_trees, setconfig)
 
-	settings = trees["/"]["vartree"].settings
-
-	for myroot in trees:
-		if myroot != "/":
-			settings = trees[myroot]["vartree"].settings
-			break
-
+	settings = trees[trees._target_root]['vartree'].settings
 	mtimedbfile = os.path.join(settings['EROOT'], portage.CACHE_PATH, "mtimedb")
 	mtimedb = portage.MtimeDB(mtimedbfile)
 	portage.output._init(config_root=settings['PORTAGE_CONFIGROOT'])

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 7f781cf..3dc9ae5 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -479,9 +479,15 @@ def portageexit():
 	if data.secpass > 1 and os.environ.get("SANDBOX_ON") != "1":
 		close_portdbapi_caches()
 
+class _trees_dict(dict):
+	def __init__(self):
+		super(dict, self).__init__()
+		self._running_root = None
+		self._target_root = None
+
 def create_trees(config_root=None, target_root=None, trees=None, env=None):
 	if trees is None:
-		trees = {}
+		trees = _trees_dict()
 	else:
 		# clean up any existing portdbapi instances
 		for myroot in trees:
@@ -497,8 +503,11 @@ def create_trees(config_root=None, target_root=None, trees=None, env=None):
 		env=env, _eprefix=eprefix)
 	settings.lock()
 
+	trees._target_root = settings['ROOT']
 	myroots = [(settings["ROOT"], settings)]
-	if settings["ROOT"] != "/":
+	if settings["ROOT"] == "/":
+		trees._running_root = trees._target_root
+	else:
 
 		# When ROOT != "/" we only want overrides from the calling
 		# environment to apply to the config that's associated
@@ -513,6 +522,7 @@ def create_trees(config_root=None, target_root=None, trees=None, env=None):
 		settings = config(config_root=None, target_root="/",
 			env=clean_env, _eprefix=eprefix)
 		settings.lock()
+		trees._running_root = settings['ROOT']
 		myroots.append((settings["ROOT"], settings))
 
 	for myroot, mysettings in myroots:

diff --git a/pym/portage/_legacy_globals.py b/pym/portage/_legacy_globals.py
index 615591a..beba785 100644
--- a/pym/portage/_legacy_globals.py
+++ b/pym/portage/_legacy_globals.py
@@ -35,19 +35,13 @@ def _get_legacy_global(name):
 	constructed.add('db')
 	del portage._initializing_globals
 
-	settings = portage.db["/"]["vartree"].settings
-
-	for root in portage.db:
-		if root != "/":
-			settings = portage.db[root]["vartree"].settings
-			break
-
+	settings = portage.db[portage.db._target_root]["vartree"].settings
 	portage.output._init(config_root=settings['PORTAGE_CONFIGROOT'])
 
 	portage.settings = settings
 	constructed.add('settings')
 
-	portage.root = root
+	portage.root = portage.db._target_root
 	constructed.add('root')
 
 	# COMPATIBILITY



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2011-10-27  3:13 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2011-10-27  3:13 UTC (permalink / raw
  To: gentoo-commits

commit:     a7f9df6dac32d2efd31b1c84ce10981560913282
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 27 03:13:12 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 27 03:13:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a7f9df6d

Add public news functions for bug #388233.

count_unread_news(portdb, vardb, repos=None, update=True)
display_news_notifications(news_counts)

---
 pym/_emerge/actions.py |   78 +++++++-----------------------------------------
 pym/portage/news.py    |   72 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 82 insertions(+), 68 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 5485d75..88f5958 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -21,16 +21,20 @@ import time
 from itertools import chain
 
 import portage
+portage.proxy.lazyimport.lazyimport(globals(),
+	'portage.news:count_unread_news,display_news_notifications',
+)
+
 from portage import os
 from portage import subprocess_getstatusoutput
 from portage import _unicode_decode
 from portage.cache.cache_errors import CacheError
-from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH
+from portage.const import GLOBAL_CONFIG_PATH
 from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi._expand_new_virt import expand_new_virt
 from portage.dep import Atom, extended_cp_match
-from portage.exception import InvalidAtom, PermissionDenied
+from portage.exception import InvalidAtom
 from portage.output import blue, bold, colorize, create_color_func, darkgreen, \
 	red, yellow
 good = create_color_func("GOOD")
@@ -3021,46 +3025,12 @@ def chk_updated_cfg_files(eroot, config_protect):
 		print(" "+yellow("*")+" man page to learn how to update config files.")
 
 def display_news_notification(root_config, myopts):
-	target_root = root_config.settings['EROOT']
-	trees = root_config.trees
-	settings = trees["vartree"].settings
-	portdb = trees["porttree"].dbapi
-	vardb = trees["vartree"].dbapi
-	NEWS_PATH = os.path.join("metadata", "news")
-	UNREAD_PATH = os.path.join(target_root, NEWS_LIB_PATH, "news")
-	newsReaderDisplay = False
-	if "news" not in settings.features:
+	if "news" not in root_config.settings.features:
 		return
-
-	permission_msgs = set()
-	for repo in portdb.getRepositories():
-		try:
-			unreadItems = checkUpdatedNewsItems(
-				portdb, vardb, NEWS_PATH, UNREAD_PATH, repo, update=True)
-		except PermissionDenied as e:
-			# NOTE: The NewsManager typically handles permission errors by
-			# returning silently, so PermissionDenied won't necessarily be
-			# raised even if we do trigger a permission error above.
-			msg = _unicode_decode("Permission denied: '%s'\n") % (e,)
-			if msg in permission_msgs:
-				pass
-			else:
-				permission_msgs.add(msg)
-				writemsg_level(msg, level=logging.ERROR, noiselevel=-1)
-			unreadItems = None
-
-		if unreadItems:
-			if not newsReaderDisplay:
-				newsReaderDisplay = True
-				print()
-			print(colorize("WARN", " * IMPORTANT:"), end=' ')
-			print("%s news items need reading for repository '%s'." % (unreadItems, repo))
-
-
-	if newsReaderDisplay:
-		print(colorize("WARN", " *"), end=' ')
-		print("Use " + colorize("GOOD", "eselect news") + " to read news items.")
-		print()
+	portdb = root_config.trees["porttree"].dbapi
+	vardb = root_config.trees["vartree"].dbapi
+	news_counts = count_unread_news(portdb, vardb)
+	display_news_notifications(news_counts)
 
 def getgccversion(chost):
 	"""
@@ -3092,29 +3062,3 @@ def getgccversion(chost):
 
 	portage.writemsg(gcc_not_found_error, noiselevel=-1)
 	return "[unavailable]"
-
-def checkUpdatedNewsItems(portdb, vardb, NEWS_PATH, UNREAD_PATH, repo_id,
-	update=False):
-	"""
-	Examines news items in repodir + '/' + NEWS_PATH and attempts to find unread items
-	Returns the number of unread (yet relevent) items.
-
-	@param portdb: a portage tree database
-	@type portdb: pordbapi
-	@param vardb: an installed package database
-	@type vardb: vardbapi
-	@param NEWS_PATH:
-	@type NEWS_PATH:
-	@param UNREAD_PATH:
-	@type UNREAD_PATH:
-	@param repo_id:
-	@type repo_id:
-	@rtype: Integer
-	@returns:
-	1.  The number of unread but relevant news items.
-
-	"""
-	from portage.news import NewsManager
-	manager = NewsManager(portdb, vardb, NEWS_PATH, UNREAD_PATH)
-	return manager.getUnreadItems( repo_id, update=update )
-

diff --git a/pym/portage/news.py b/pym/portage/news.py
index 13d6832..24b5107 100644
--- a/pym/portage/news.py
+++ b/pym/portage/news.py
@@ -2,24 +2,30 @@
 # Copyright 2006-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+from __future__ import print_function
+
 __all__ = ["NewsManager", "NewsItem", "DisplayRestriction",
 	"DisplayProfileRestriction", "DisplayKeywordRestriction",
-	"DisplayInstalledRestriction"]
+	"DisplayInstalledRestriction",
+	"count_unread_news", "display_news_notifications"]
 
 import io
 import logging
 import os as _os
 import re
+from portage import OrderedDict
 from portage import os
 from portage import _encodings
 from portage import _unicode_decode
 from portage import _unicode_encode
+from portage.const import NEWS_LIB_PATH
 from portage.util import apply_secpass_permissions, ensure_dirs, \
 	grabfile, normalize_path, write_atomic, writemsg_level
 from portage.data import portage_gid
 from portage.dep import isvalidatom
 from portage.localization import _
 from portage.locks import lockfile, unlockfile
+from portage.output import colorize
 from portage.exception import InvalidLocation, OperationNotPermitted, \
 	PermissionDenied
 
@@ -349,3 +355,67 @@ class DisplayInstalledRestriction(DisplayRestriction):
 		if vdb.match(self.atom):
 			return True
 		return False
+
+def count_unread_news(portdb, vardb, repos=None, update=True):
+	"""
+	Returns a dictionary mapping repos to integer counts of unread news items.
+	By default, this will scan all repos and check for new items that have
+	appeared since the last scan.
+
+	@param portdb: a portage tree database
+	@type portdb: pordbapi
+	@param vardb: an installed package database
+	@type vardb: vardbapi
+	@param repos: names of repos to scan (None means to scan all available repos)
+	@type repos: list or None
+	@param update: check for new items (default is True)
+	@type update: boolean
+	@rtype: dict
+	@returns: dictionary mapping repos to integer counts of unread news items
+	"""
+
+	NEWS_PATH = os.path.join("metadata", "news")
+	UNREAD_PATH = os.path.join(vardb.settings['EROOT'], NEWS_LIB_PATH, "news")
+	news_counts = OrderedDict()
+	if repos is None:
+		repos = portdb.getRepositories()
+
+	permission_msgs = set()
+	for repo in repos:
+		try:
+			manager = NewsManager(portdb, vardb, NEWS_PATH, UNREAD_PATH)
+			count = manager.getUnreadItems(repo, update=True)
+		except PermissionDenied as e:
+			# NOTE: The NewsManager typically handles permission errors by
+			# returning silently, so PermissionDenied won't necessarily be
+			# raised even if we do trigger a permission error above.
+			msg = _unicode_decode("Permission denied: '%s'\n") % (e,)
+			if msg in permission_msgs:
+				pass
+			else:
+				permission_msgs.add(msg)
+				writemsg_level(msg, level=logging.ERROR, noiselevel=-1)
+			news_counts[repo] = 0
+		else:
+			news_counts[repo] = count
+
+	return news_counts
+
+def display_news_notifications(news_counts):
+	"""
+	Display a notification for unread news items, using a dictionary mapping
+	repos to integer counts, like that returned from count_unread_news().
+	"""
+	newsReaderDisplay = False
+	for repo, count in news_counts.items():
+		if count > 0:
+			if not newsReaderDisplay:
+				newsReaderDisplay = True
+				print()
+			print(colorize("WARN", " * IMPORTANT:"), end=' ')
+			print("%s news items need reading for repository '%s'." % (count, repo))
+
+	if newsReaderDisplay:
+		print(colorize("WARN", " *"), end=' ')
+		print("Use " + colorize("GOOD", "eselect news") + " to read news items.")
+		print()



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2012-06-11  0:58 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2012-06-11  0:58 UTC (permalink / raw
  To: gentoo-commits

commit:     b6ecc428a7e04afa3449df6a6844978eeb40d569
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 11 00:58:14 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 11 00:58:14 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b6ecc428

Package: use _eapi_attrs

---
 pym/_emerge/Package.py |    7 ++++---
 pym/portage/eapi.py    |    5 ++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index bdd4bc7..75021b9 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -10,7 +10,7 @@ from portage.const import EBUILD_PHASES
 from portage.dep import Atom, check_required_use, use_reduce, \
 	paren_enclose, _slot_re, _slot_separator, _repo_separator
 from portage.versions import _pkg_str, _unknown_repo
-from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use
+from portage.eapi import _get_eapi_attrs
 from portage.exception import InvalidDependString
 from _emerge.Task import Task
 
@@ -49,6 +49,7 @@ class Package(Task):
 		self.metadata = _PackageMetadataWrapper(self, self._raw_metadata)
 		if not self.built:
 			self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
+		eapi_attrs = _get_eapi_attrs(self.metadata["EAPI"])
 		slot = self.slot
 		if _slot_re.match(slot) is None:
 			self._invalid_metadata('SLOT.invalid',
@@ -62,7 +63,7 @@ class Package(Task):
 		# sync metadata with validated repo (may be UNKNOWN_REPO)
 		self.metadata['repository'] = self.cpv.repo
 		if (self.iuse.enabled or self.iuse.disabled) and \
-			not eapi_has_iuse_defaults(self.metadata["EAPI"]):
+			not eapi_attrs.iuse_defaults:
 			if not self.installed:
 				self._invalid_metadata('EAPI.incompatible',
 					"IUSE contains defaults, but EAPI doesn't allow them")
@@ -194,7 +195,7 @@ class Package(Task):
 		k = 'REQUIRED_USE'
 		v = self.metadata.get(k)
 		if v:
-			if not eapi_has_required_use(eapi):
+			if not _get_eapi_attrs(eapi).required_use:
 				self._invalid_metadata('EAPI.incompatible',
 					"REQUIRED_USE set, but EAPI='%s' doesn't allow it" % eapi)
 			else:

diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index ca8af9c..e36567d 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -64,7 +64,8 @@ def eapi_allows_dots_in_use_flags(eapi):
 	return eapi in ("4-python",)
 
 _eapi_attrs = collections.namedtuple('_eapi_attrs',
-	'dots_in_PN dots_in_use_flags repo_deps slot_deps '
+	'dots_in_PN dots_in_use_flags iuse_defaults '
+	'repo_deps required_use slot_deps '
 	'src_uri_arrows strong_blocks use_deps use_dep_defaults')
 
 _eapi_attrs_cache = {}
@@ -81,7 +82,9 @@ def _get_eapi_attrs(eapi):
 	eapi_attrs = _eapi_attrs(
 		dots_in_PN = (eapi is None or eapi_allows_dots_in_PN(eapi)),
 		dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)),
+		iuse_defaults = (eapi is None or eapi_has_iuse_defaults(eapi)),
 		repo_deps = (eapi is None or eapi_has_repo_deps(eapi)),
+		required_use = (eapi is None or eapi_has_required_use(eapi)),
 		slot_deps = (eapi is None or eapi_has_slot_deps(eapi)),
 		src_uri_arrows = (eapi is None or eapi_has_src_uri_arrows(eapi)),
 		strong_blocks = (eapi is None or eapi_has_strong_blocks(eapi)),



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2012-06-11  5:32 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2012-06-11  5:32 UTC (permalink / raw
  To: gentoo-commits

commit:     87613c4db824618f725875ca324c7ad800da0df9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 11 05:32:24 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 11 05:32:24 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=87613c4d

Package: move SLOT validation to _pkg_str

---
 pym/_emerge/Package.py  |   22 ++++++++--------------
 pym/portage/versions.py |   10 +++++++++-
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 91d7606..f74c333 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -8,7 +8,7 @@ from portage import _encodings, _unicode_decode, _unicode_encode
 from portage.cache.mappings import slot_dict_class
 from portage.const import EBUILD_PHASES
 from portage.dep import Atom, check_required_use, use_reduce, \
-	paren_enclose, _get_slot_re, _slot_separator, _repo_separator
+	paren_enclose, _slot_separator, _repo_separator
 from portage.versions import _pkg_str, _unknown_repo
 from portage.eapi import _get_eapi_attrs
 from portage.exception import InvalidDependString
@@ -50,16 +50,13 @@ class Package(Task):
 		if not self.built:
 			self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
 		eapi_attrs = _get_eapi_attrs(self.metadata["EAPI"])
-		slot = self.slot
-		if _get_slot_re(eapi_attrs).match(slot) is None:
-			self._invalid_metadata('SLOT.invalid',
-				"SLOT: invalid value: '%s'" % slot)
-			# Avoid an InvalidAtom exception when creating slot_atom.
-			# This package instance will be masked due to empty SLOT.
-			slot = '0'
-		self.cpv = _pkg_str(self.cpv, slot=slot,
+		self.cpv = _pkg_str(self.cpv, slot=self.metadata["SLOT"],
 			repo=self.metadata.get('repository', ''))
+		if hasattr(self.cpv, 'slot_invalid'):
+			self._invalid_metadata('SLOT.invalid',
+				"SLOT: invalid value: '%s'" % self.metadata["SLOT"])
 		self.cp = self.cpv.cp
+		self.slot = self.cpv.slot
 		# sync metadata with validated repo (may be UNKNOWN_REPO)
 		self.metadata['repository'] = self.cpv.repo
 		if (self.iuse.enabled or self.iuse.disabled) and \
@@ -67,7 +64,7 @@ class Package(Task):
 			if not self.installed:
 				self._invalid_metadata('EAPI.incompatible',
 					"IUSE contains defaults, but EAPI doesn't allow them")
-		self.slot_atom = portage.dep.Atom("%s%s%s" % (self.cp, _slot_separator, slot))
+		self.slot_atom = Atom("%s%s%s" % (self.cp, _slot_separator, self.slot))
 		self.category, self.pf = portage.catsplit(self.cpv)
 		self.cpv_split = self.cpv.cpv_split
 		self.version = self.cpv.version
@@ -588,7 +585,7 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
 
 	__slots__ = ("_pkg",)
 	_wrapped_keys = frozenset(
-		["COUNTER", "INHERITED", "IUSE", "SLOT", "USE", "_mtime_"])
+		["COUNTER", "INHERITED", "IUSE", "USE", "_mtime_"])
 	_use_conditional_keys = frozenset(
 		['LICENSE', 'PROPERTIES', 'PROVIDE', 'RESTRICT',])
 
@@ -661,9 +658,6 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
 		self._pkg.iuse = self._pkg._iuse(
 			v.split(), self._pkg.root_config.settings._iuse_implicit_match)
 
-	def _set_slot(self, k, v):
-		self._pkg.slot = v
-
 	def _set_counter(self, k, v):
 		if isinstance(v, basestring):
 			try:

diff --git a/pym/portage/versions.py b/pym/portage/versions.py
index a838800..a1ded67 100644
--- a/pym/portage/versions.py
+++ b/pym/portage/versions.py
@@ -19,6 +19,7 @@ else:
 
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
+	'portage.dep:_get_slot_re',
 	'portage.repository.config:_gen_valid_repo',
 	'portage.util:cmp_sort_key',
 )
@@ -355,7 +356,14 @@ class _pkg_str(_unicode):
 		# for match_from_list introspection
 		self.__dict__['cpv'] = self
 		if slot is not None:
-			self.__dict__['slot'] = slot
+			slot_match = _get_slot_re(_get_eapi_attrs(eapi)).match(slot)
+			if slot_match is None:
+				# Avoid an InvalidAtom exception when creating SLOT atoms
+				self.__dict__['slot'] = '0'
+				self.__dict__['slot_invalid'] = slot
+			else:
+				self.__dict__['slot'] = slot
+
 		if repo is not None:
 			repo = _gen_valid_repo(repo)
 			if not repo:



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2012-06-11  5:58 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2012-06-11  5:58 UTC (permalink / raw
  To: gentoo-commits

commit:     c0af31c9f216c86719486a8568aa07e6f32e4fc8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 11 05:32:24 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 11 05:57:30 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c0af31c9

Package: move SLOT validation to _pkg_str

---
 pym/_emerge/Package.py  |   23 +++++++++--------------
 pym/portage/versions.py |   10 +++++++++-
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 91d7606..18bc201 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -8,7 +8,7 @@ from portage import _encodings, _unicode_decode, _unicode_encode
 from portage.cache.mappings import slot_dict_class
 from portage.const import EBUILD_PHASES
 from portage.dep import Atom, check_required_use, use_reduce, \
-	paren_enclose, _get_slot_re, _slot_separator, _repo_separator
+	paren_enclose, _slot_separator, _repo_separator
 from portage.versions import _pkg_str, _unknown_repo
 from portage.eapi import _get_eapi_attrs
 from portage.exception import InvalidDependString
@@ -50,16 +50,14 @@ class Package(Task):
 		if not self.built:
 			self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
 		eapi_attrs = _get_eapi_attrs(self.metadata["EAPI"])
-		slot = self.slot
-		if _get_slot_re(eapi_attrs).match(slot) is None:
+		self.cpv = _pkg_str(self.cpv, slot=self.metadata["SLOT"],
+			repo=self.metadata.get('repository', ''),
+			eapi=self.metadata["EAPI"])
+		if hasattr(self.cpv, 'slot_invalid'):
 			self._invalid_metadata('SLOT.invalid',
-				"SLOT: invalid value: '%s'" % slot)
-			# Avoid an InvalidAtom exception when creating slot_atom.
-			# This package instance will be masked due to empty SLOT.
-			slot = '0'
-		self.cpv = _pkg_str(self.cpv, slot=slot,
-			repo=self.metadata.get('repository', ''))
+				"SLOT: invalid value: '%s'" % self.metadata["SLOT"])
 		self.cp = self.cpv.cp
+		self.slot = self.cpv.slot
 		# sync metadata with validated repo (may be UNKNOWN_REPO)
 		self.metadata['repository'] = self.cpv.repo
 		if (self.iuse.enabled or self.iuse.disabled) and \
@@ -67,7 +65,7 @@ class Package(Task):
 			if not self.installed:
 				self._invalid_metadata('EAPI.incompatible',
 					"IUSE contains defaults, but EAPI doesn't allow them")
-		self.slot_atom = portage.dep.Atom("%s%s%s" % (self.cp, _slot_separator, slot))
+		self.slot_atom = Atom("%s%s%s" % (self.cp, _slot_separator, self.slot))
 		self.category, self.pf = portage.catsplit(self.cpv)
 		self.cpv_split = self.cpv.cpv_split
 		self.version = self.cpv.version
@@ -588,7 +586,7 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
 
 	__slots__ = ("_pkg",)
 	_wrapped_keys = frozenset(
-		["COUNTER", "INHERITED", "IUSE", "SLOT", "USE", "_mtime_"])
+		["COUNTER", "INHERITED", "IUSE", "USE", "_mtime_"])
 	_use_conditional_keys = frozenset(
 		['LICENSE', 'PROPERTIES', 'PROVIDE', 'RESTRICT',])
 
@@ -661,9 +659,6 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
 		self._pkg.iuse = self._pkg._iuse(
 			v.split(), self._pkg.root_config.settings._iuse_implicit_match)
 
-	def _set_slot(self, k, v):
-		self._pkg.slot = v
-
 	def _set_counter(self, k, v):
 		if isinstance(v, basestring):
 			try:

diff --git a/pym/portage/versions.py b/pym/portage/versions.py
index a838800..a1ded67 100644
--- a/pym/portage/versions.py
+++ b/pym/portage/versions.py
@@ -19,6 +19,7 @@ else:
 
 import portage
 portage.proxy.lazyimport.lazyimport(globals(),
+	'portage.dep:_get_slot_re',
 	'portage.repository.config:_gen_valid_repo',
 	'portage.util:cmp_sort_key',
 )
@@ -355,7 +356,14 @@ class _pkg_str(_unicode):
 		# for match_from_list introspection
 		self.__dict__['cpv'] = self
 		if slot is not None:
-			self.__dict__['slot'] = slot
+			slot_match = _get_slot_re(_get_eapi_attrs(eapi)).match(slot)
+			if slot_match is None:
+				# Avoid an InvalidAtom exception when creating SLOT atoms
+				self.__dict__['slot'] = '0'
+				self.__dict__['slot_invalid'] = slot
+			else:
+				self.__dict__['slot'] = slot
+
 		if repo is not None:
 			repo = _gen_valid_repo(repo)
 			if not repo:



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2012-09-21 18:40 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2012-09-21 18:40 UTC (permalink / raw
  To: gentoo-commits

commit:     a574fd9e6f81a0a072cbaf34c6bd45ad7942cc94
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 21 18:40:20 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 21 18:40:20 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a574fd9e

Add _DEPCLEAN_LIB_CHECK_DEFAULT constant.

This will allow for the option to be available in the stable branch
without changing the default --depclean behavior.

---
 pym/_emerge/actions.py |    4 ++--
 pym/portage/const.py   |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 9a023a8..8e75dad 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -31,7 +31,7 @@ from portage import shutil
 from portage import eapi_is_supported, _unicode_decode
 from portage.cache.cache_errors import CacheError
 from portage.const import GLOBAL_CONFIG_PATH
-from portage.const import _ENABLE_DYN_LINK_MAP
+from portage.const import _ENABLE_DYN_LINK_MAP, _DEPCLEAN_LIB_CHECK_DEFAULT
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi._expand_new_virt import expand_new_virt
 from portage.dep import Atom
@@ -941,7 +941,7 @@ def calc_depclean(settings, trees, ldpath_mtimes,
 
 	if cleanlist and \
 		real_vardb._linkmap is not None and \
-		myopts.get("--depclean-lib-check") != "n" and \
+		myopts.get("--depclean-lib-check", _DEPCLEAN_LIB_CHECK_DEFAULT) != "n" and \
 		"preserve-libs" not in settings.features:
 
 		# Check if any of these packages are the sole providers of libraries

diff --git a/pym/portage/const.py b/pym/portage/const.py
index 49a14d3..1e3da36 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -167,6 +167,7 @@ if "PORTAGE_OVERRIDE_EPREFIX" in os.environ:
 # Private constants for use in conditional code in order to minimize the diff
 # between branches.
 _ENABLE_DYN_LINK_MAP    = True
+_DEPCLEAN_LIB_CHECK_DEFAULT = True
 _ENABLE_PRESERVE_LIBS   = True
 _ENABLE_REPO_NAME_WARN  = True
 _ENABLE_SET_CONFIG      = True


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2012-09-26  2:15 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2012-09-26  2:15 UTC (permalink / raw
  To: gentoo-commits

commit:     f7648d050e9f3936ff2bc278f6927aa0b901be50
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 26 02:14:32 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 26 02:14:32 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f7648d05

_add_pkg_deps: use _get_eapi_attrs

---
 pym/_emerge/depgraph.py |    5 +++--
 pym/portage/eapi.py     |    6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d228694..dee3f1f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -24,7 +24,7 @@ from portage.dep import Atom, best_match_to_list, extract_affecting_use, \
 	_repo_separator
 from portage.dep._slot_operator import ignore_built_slot_operator_deps
 from portage.eapi import eapi_has_strong_blocks, eapi_has_required_use, \
-	_get_eapi_attrs, eapi_has_hdepend
+	_get_eapi_attrs
 from portage.exception import (InvalidAtom, InvalidDependString,
 	PackageNotFound, PortageException)
 from portage.output import colorize, create_color_func, \
@@ -1679,6 +1679,7 @@ class depgraph(object):
 		myroot = pkg.root
 		metadata = pkg.metadata
 		removal_action = "remove" in self._dynamic_config.myparams
+		eapi_attrs = _get_eapi_attrs(pkg.metadata["EAPI"])
 
 		edepend={}
 		depkeys = ["DEPEND","RDEPEND","PDEPEND","HDEPEND"]
@@ -1718,7 +1719,7 @@ class depgraph(object):
 		if removal_action:
 			depend_root = myroot
 		else:
-			if eapi_has_hdepend(pkg.metadata['EAPI']):
+			if eapi_attrs.hdepend:
 				depend_root = myroot
 			else:
 				depend_root = self._frozen_config._running_root.root

diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index 7c45843..4936e6c 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -91,7 +91,8 @@ def eapi_has_targetroot(eapi):
 
 _eapi_attrs = collections.namedtuple('_eapi_attrs',
 	'dots_in_PN dots_in_use_flags exports_EBUILD_PHASE_FUNC '
-	'feature_flag_test feature_flag_targetroot iuse_defaults iuse_effective '
+	'feature_flag_test feature_flag_targetroot '
+	'hdepend iuse_defaults iuse_effective '
 	'repo_deps required_use required_use_at_most_one_of slot_operator slot_deps '
 	'src_uri_arrows strong_blocks use_deps use_dep_defaults')
 
@@ -118,7 +119,8 @@ def _get_eapi_attrs(eapi):
 		dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)),
 		exports_EBUILD_PHASE_FUNC = (eapi is None or eapi_exports_EBUILD_PHASE_FUNC(eapi)),
 		feature_flag_test = True,
-		feature_flag_targetroot = eapi_has_targetroot(eapi),
+		feature_flag_targetroot = (eapi is not None and eapi_has_targetroot(eapi)),
+		hdepend = (eapi is not None and eapi_has_hdepend(eapi)),
 		iuse_defaults = (eapi is None or eapi_has_iuse_defaults(eapi)),
 		iuse_effective = (eapi is not None and eapi_has_iuse_effective(eapi)),
 		repo_deps = (eapi is None or eapi_has_repo_deps(eapi)),


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2013-07-22 22:32 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 12+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-22 22:32 UTC (permalink / raw
  To: gentoo-commits

commit:     4b6c930ca908b3e6c0c56ca099310ba79398580c
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Jul 22 22:30:39 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Jul 22 22:30:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4b6c930c

Move hardcoded atoms of cvs, git and rsync to portage.const module and fix category of git atom.

---
 pym/_emerge/actions.py | 6 +++---
 pym/portage/const.py   | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 80afb0b..11a8698 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2112,7 +2112,7 @@ def _sync_repo(repo, settings, trees, myopts):
 		# git directly.
 		if portage.process.find_binary("git") is None:
 			msg = ["Command not found: git",
-			"Type \"emerge dev-util/git\" to enable git support."]
+			"Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM]
 			for l in msg:
 				writemsg_level("!!! %s\n" % l,
 					level=logging.ERROR, noiselevel=-1)
@@ -2140,7 +2140,7 @@ def _sync_repo(repo, settings, trees, myopts):
 		rsync_binary = portage.process.find_binary("rsync")
 		if rsync_binary is None:
 			print("!!! /usr/bin/rsync does not exist, so rsync support is disabled.")
-			print("!!! Type \"emerge net-misc/rsync\" to enable rsync support.")
+			print("!!! Type \"emerge %s\" to enable rsync support." % portage.const.RSYNC_PACKAGE_ATOM)
 			return os.EX_UNAVAILABLE
 		mytimeout=180
 
@@ -2540,7 +2540,7 @@ def _sync_repo(repo, settings, trees, myopts):
 	elif repo.sync_type == "cvs":
 		if not os.path.exists("/usr/bin/cvs"):
 			print("!!! /usr/bin/cvs does not exist, so CVS support is disabled.")
-			print("!!! Type \"emerge dev-vcs/cvs\" to enable CVS support.")
+			print("!!! Type \"emerge %s\" to enable CVS support." % portage.const.CVS_PACKAGE_ATOM)
 			return os.EX_UNAVAILABLE
 		cvs_root = syncuri
 		if cvs_root.startswith("cvs://"):

diff --git a/pym/portage/const.py b/pym/portage/const.py
index 087c0e7..c05b1c0 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -79,6 +79,9 @@ REPO_NAME_LOC            = "profiles" + "/" + REPO_NAME_FILE
 PORTAGE_PACKAGE_ATOM     = "sys-apps/portage"
 LIBC_PACKAGE_ATOM        = "virtual/libc"
 OS_HEADERS_PACKAGE_ATOM  = "virtual/os-headers"
+CVS_PACKAGE_ATOM         = "dev-vcs/cvs"
+GIT_PACKAGE_ATOM         = "dev-vcs/git"
+RSYNC_PACKAGE_ATOM       = "net-misc/rsync"
 
 INCREMENTALS             = ("USE", "USE_EXPAND", "USE_EXPAND_HIDDEN",
                            "FEATURES", "ACCEPT_KEYWORDS",


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/
@ 2013-08-12 21:25 Zac Medico
  0 siblings, 0 replies; 12+ messages in thread
From: Zac Medico @ 2013-08-12 21:25 UTC (permalink / raw
  To: gentoo-commits

commit:     60ce6cc9ad7b050d2cb6a66c84867bd5613a09a2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 12 21:24:43 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 12 21:24:43 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60ce6cc9

Exempt /usr/local/portage from repo_name warning.

This will fix bug #248603.

---
 pym/_emerge/actions.py | 12 ++++++++----
 pym/portage/const.py   |  1 -
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 4c53c25..52ceba4 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -3518,6 +3518,13 @@ def repo_name_check(trees):
 				# so don't warn about it.
 				missing_repo_names.remove(portdb.porttree_root)
 
+	# Skip warnings about missing repo_name entries for
+	# /usr/local/portage (see bug #248603).
+	try:
+		missing_repo_names.remove('/usr/local/portage')
+	except KeyError:
+		pass
+
 	if missing_repo_names:
 		msg = []
 		msg.append("WARNING: One or more repositories " + \
@@ -3652,10 +3659,7 @@ def run_action(emerge_config):
 	if "--quiet" not in emerge_config.opts:
 		portage.deprecated_profile_check(
 			settings=emerge_config.target_config.settings)
-		if portage.const._ENABLE_REPO_NAME_WARN:
-			# Bug #248603 - Disable warnings about missing
-			# repo_name entries for stable branch.
-			repo_name_check(emerge_config.trees)
+		repo_name_check(emerge_config.trees)
 		repo_name_duplicate_check(emerge_config.trees)
 		config_protect_check(emerge_config.trees)
 	check_procfs()

diff --git a/pym/portage/const.py b/pym/portage/const.py
index 0638170..bd55cb1 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -180,5 +180,4 @@ SUPPORTED_BINPKG_FORMATS = ("tar", "rpm")
 # Private constants for use in conditional code in order to minimize the diff
 # between branches.
 _DEPCLEAN_LIB_CHECK_DEFAULT = True
-_ENABLE_REPO_NAME_WARN  = True
 _ENABLE_SET_CONFIG      = True


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

end of thread, other threads:[~2013-08-12 21:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25  8:25 [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2013-08-12 21:25 Zac Medico
2013-07-22 22:32 Arfrever Frehtes Taifersar Arahesis
2012-09-26  2:15 Zac Medico
2012-09-21 18:40 Zac Medico
2012-06-11  5:58 Zac Medico
2012-06-11  5:32 Zac Medico
2012-06-11  0:58 Zac Medico
2011-10-27  3:13 Zac Medico
2011-10-15  6:11 Zac Medico
2011-07-12 23:21 Zac Medico
2011-07-07  4:36 Zac Medico

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