summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/emerge21
-rwxr-xr-xbin/portageq11
2 files changed, 23 insertions, 9 deletions
diff --git a/bin/emerge b/bin/emerge
index f42c2cb96..1e4926752 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -29,7 +29,7 @@ except ImportError:
sys.path.insert(0, "/usr/lib/portage/pym")
import portage
del os.environ["PORTAGE_LEGACY_GLOBALS"]
-from portage import digraph
+from portage import digraph, portdbapi
import emergehelp, xpak, commands, errno, re, socket, time, types
import output
@@ -3561,13 +3561,20 @@ def post_emerge(settings, mtimedb, retval):
NEWS_PATH = os.path.join( "metadata", "news" )
UNREAD_PATH = os.path.join( target_root, portage.PRIVATE_PATH, 'news')
- repo_id = 'gentoo'
- unreadItems = checkUpdatedNewsItems(target_root, NEWS_PATH, UNREAD_PATH, repo_id)
- if unreadItems:
- print colorize("WARN", " * IMPORTANT:"),
- print "%s news items need reading." % unreadItems
+ porttree = portdbapi( porttree_root = settings["PORTDIR"], mysettings = settings )
+ newsReaderDisplay = False
+
+ for repo in porttree.getRepositories():
+ unreadItems = checkUpdatedNewsItems(target_root, NEWS_PATH, UNREAD_PATH, repo)
+ if unreadItems:
+ print colorize("WARN", " * IMPORTANT:"),
+ print "%s news items need reading for repository '%s'." % (unreadItems, repo)
+ newsReaderDisplay = True
+
+ if newsReaderDisplay:
print colorize("WARN", " *"),
- print "Type something to read the news"
+ print "Use " + colorize("GOOD", "eselect news") + " to read news items."
+
mtimedb.commit()
sys.exit(retval)
diff --git a/bin/portageq b/bin/portageq
index 6485d7c79..aa302555d 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -274,13 +274,20 @@ def get_repos(argv):
"""<root>
Returns all repos with names (repo_name file) argv[0] = $ROOT
"""
+ if len(argv) < 1:
+ print "ERROR: insufficient parameters!"
+ sys.exit(2)
print " ".join(portage.db[argv[0]]["porttree"].dbapi.getRepositories())
def get_repo_path(argv):
- """<root> <repo_id>
+ """<root> <repo_id>+
Returns the path to the repo named argv[1], argv[0] = $ROOT
"""
- print portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(argv[1])
+ if len(argv) < 2:
+ print "ERROR: insufficient parameters!"
+ sys.exit(2)
+ for arg in arvg[1:]
+ print portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(argv[1])
#-----------------------------------------------------------------------------
#