public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/merges/
Date: Thu,  4 Dec 2014 20:16:10 +0000 (UTC)	[thread overview]
Message-ID: <1417722995.ca7966d72cdb1522d3d29536a07c7bb8d7ecaa3f.dol-sen@gentoo> (raw)

commit:     ca7966d72cdb1522d3d29536a07c7bb8d7ecaa3f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 21 02:09:01 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec  4 19:56:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ca7966d7

MergesHandler: don't use load_emerge_config

Use the old portage.db API since load_emerge_config isn't really
needed here. In order to reload the config, use
portage._reset_legacy_globals().

---
 pym/portage/emaint/modules/merges/merges.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/pym/portage/emaint/modules/merges/merges.py b/pym/portage/emaint/modules/merges/merges.py
index 1a67cb5..7146c76 100644
--- a/pym/portage/emaint/modules/merges/merges.py
+++ b/pym/portage/emaint/modules/merges/merges.py
@@ -1,8 +1,6 @@
 # Copyright 2005-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-from _emerge.actions import load_emerge_config
-
 import portage
 from portage import os, _unicode_encode
 from portage.const import MERGING_IDENTIFIER, PORTAGE_BIN_PATH, PRIVATE_PATH, \
@@ -174,8 +172,7 @@ class MergesHandler(object):
 		@type pkg_invalid_entries: set
 		"""
 
-		emerge_config = load_emerge_config()
-		portdb = emerge_config.target_config.trees['porttree'].dbapi
+		portdb = portage.db[portage.root]['porttree'].dbapi
 		for failed_pkg in failed_pkgs:
 			# validate pkg name
 			pkg_name = '%s' % failed_pkg.replace(MERGING_IDENTIFIER, '')
@@ -271,8 +268,8 @@ class MergesHandler(object):
 		for pkg in sorted(self._scan()):
 			results.append("'%s' still found as a failed merge." % pkg)
 		# reload config and remove successful packages from tracking file
-		emerge_config = load_emerge_config()
-		vardb = emerge_config.target_config.trees['vartree'].dbapi
+		portage._reset_legacy_globals()
+		vardb = portage.db[portage.root]['vartree'].dbapi
 		still_failed_pkgs = {}
 		for pkg, mtime in failed_pkgs.items():
 			pkg_name = '%s' % pkg.replace(MERGING_IDENTIFIER, '')


WARNING: multiple messages have this Message-ID (diff)
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/emaint/modules/merges/
Date: Thu,  4 Dec 2014 20:04:31 +0000 (UTC)	[thread overview]
Message-ID: <1417722995.ca7966d72cdb1522d3d29536a07c7bb8d7ecaa3f.dol-sen@gentoo> (raw)
Message-ID: <20141204200431.00dSYRS1v3oGjulF1JwqYM5BdaqQKl-LJvnWu2wON9Y@z> (raw)

commit:     ca7966d72cdb1522d3d29536a07c7bb8d7ecaa3f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 21 02:09:01 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec  4 19:56:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ca7966d7

MergesHandler: don't use load_emerge_config

Use the old portage.db API since load_emerge_config isn't really
needed here. In order to reload the config, use
portage._reset_legacy_globals().

---
 pym/portage/emaint/modules/merges/merges.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/pym/portage/emaint/modules/merges/merges.py b/pym/portage/emaint/modules/merges/merges.py
index 1a67cb5..7146c76 100644
--- a/pym/portage/emaint/modules/merges/merges.py
+++ b/pym/portage/emaint/modules/merges/merges.py
@@ -1,8 +1,6 @@
 # Copyright 2005-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-from _emerge.actions import load_emerge_config
-
 import portage
 from portage import os, _unicode_encode
 from portage.const import MERGING_IDENTIFIER, PORTAGE_BIN_PATH, PRIVATE_PATH, \
@@ -174,8 +172,7 @@ class MergesHandler(object):
 		@type pkg_invalid_entries: set
 		"""
 
-		emerge_config = load_emerge_config()
-		portdb = emerge_config.target_config.trees['porttree'].dbapi
+		portdb = portage.db[portage.root]['porttree'].dbapi
 		for failed_pkg in failed_pkgs:
 			# validate pkg name
 			pkg_name = '%s' % failed_pkg.replace(MERGING_IDENTIFIER, '')
@@ -271,8 +268,8 @@ class MergesHandler(object):
 		for pkg in sorted(self._scan()):
 			results.append("'%s' still found as a failed merge." % pkg)
 		# reload config and remove successful packages from tracking file
-		emerge_config = load_emerge_config()
-		vardb = emerge_config.target_config.trees['vartree'].dbapi
+		portage._reset_legacy_globals()
+		vardb = portage.db[portage.root]['vartree'].dbapi
 		still_failed_pkgs = {}
 		for pkg, mtime in failed_pkgs.items():
 			pkg_name = '%s' % pkg.replace(MERGING_IDENTIFIER, '')


             reply	other threads:[~2014-12-04 20:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 20:16 Brian Dolbec [this message]
2014-12-04 20:04 ` [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/emaint/modules/merges/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2015-02-21 19:52 [gentoo-commits] proj/portage:master " Pavel Kazakov
2015-12-29 21:21 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1417722995.ca7966d72cdb1522d3d29536a07c7bb8d7ecaa3f.dol-sen@gentoo \
    --to=brian.dolbec@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox