public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: man/, pym/_emerge/
Date: Mon, 10 Oct 2011 18:05:57 +0000 (UTC)	[thread overview]
Message-ID: <f8e0c75e0952d04cb518ad0914ad440f1b43f52d.zmedico@gentoo> (raw)

commit:     f8e0c75e0952d04cb518ad0914ad440f1b43f52d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 10 18:01:36 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 18:01:36 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f8e0c75e

Add emerge --dynamic-deps <y|n> option.

This makes it possible to disable the dynamic dependency updates that
FakeVartree performs by default.

WARNING: If --dynamic-deps is disabled, then it is necessary to
ensure that an alternative method is used to handle package moves
in dependencies of installed packages. Normally, this is handled
by FEATURES="fixpackages", which is enabled by default and may be
disabled via make.conf(5). Alternatively, in order to manually apply
package moves, run `emaint --fix moveinst` after each emerge --sync
operation (see emaint(1)).

---
 man/emerge.1                          |   16 ++++++++++++++++
 pym/_emerge/FakeVartree.py            |    7 +++++--
 pym/_emerge/Scheduler.py              |    3 ++-
 pym/_emerge/create_depgraph_params.py |    4 ++++
 pym/_emerge/depgraph.py               |   13 ++++++++++---
 pym/_emerge/main.py                   |    6 ++++++
 6 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 62bfd5e..10be789 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -407,6 +407,22 @@ when FEATURES="preserve\-libs" is enabled in
 \fBmake.conf\fR(5), since any libraries that have
 consumers will simply be preserved.
 .TP
+.BR "\-\-dynamic\-deps < y | n >"
+In dependency calculations, substitute the dependencies of installed
+packages with the dependencies of corresponding unbuilt ebuilds from
+source repositories. This causes the effective dependencies of
+installed packages to vary dynamically when source ebuild dependencies
+are modified. This option is enabled by default.
+
+\fBWARNING:\fR
+If \-\-dynamic\-deps is disabled, then it is necessary to ensure that
+an alternative method is used to handle package moves in dependencies
+of installed packages. Normally, this is handled by
+FEATURES="fixpackages", which is enabled by default and may be
+disabled via \fBmake.conf\fR(5). Alternatively, in order to manually
+apply package moves, run `emaint \-\-fix moveinst` after each
+emerge \-\-sync operation (see \fBemaint\fR(1)).
+.TP
 .BR "\-\-emptytree " (\fB\-e\fR)
 Reinstalls target atoms and their entire deep
 dependency tree, as though no packages are currently

diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py
index a11966f..a9c1b90 100644
--- a/pym/_emerge/FakeVartree.py
+++ b/pym/_emerge/FakeVartree.py
@@ -37,8 +37,10 @@ class FakeVartree(vartree):
 	global updates are necessary (updates are performed when necessary if there
 	is not a matching ebuild in the tree). Instances of this class are not
 	populated until the sync() method is called."""
-	def __init__(self, root_config, pkg_cache=None, pkg_root_config=None):
+	def __init__(self, root_config, pkg_cache=None, pkg_root_config=None,
+		dynamic_deps=True):
 		self._root_config = root_config
+		self._dynamic_deps = dynamic_deps
 		if pkg_root_config is None:
 			pkg_root_config = self._root_config
 		self._pkg_root_config = pkg_root_config
@@ -60,7 +62,8 @@ class FakeVartree(vartree):
 		# metadata.  This ensures that the vardb lock is released ASAP, without
 		# being delayed in case cache generation is triggered.
 		self._aux_get = self.dbapi.aux_get
-		self.dbapi.aux_get = self._aux_get_wrapper
+		if dynamic_deps:
+			self.dbapi.aux_get = self._aux_get_wrapper
 		self._match = self.dbapi.match
 		self.dbapi.match = self._match_wrapper
 		self._aux_get_history = set()

diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index a6dd98c..11a72f3 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -304,10 +304,11 @@ class Scheduler(PollScheduler):
 		"""
 		self._set_graph_config(graph_config)
 		self._blocker_db = {}
+		dynamic_deps = myopts.get("--dynamic-deps", "y") != "n"
 		for root in self.trees:
 			if graph_config is None:
 				fake_vartree = FakeVartree(self.trees[root]["root_config"],
-					pkg_cache=self._pkg_cache)
+					pkg_cache=self._pkg_cache, dynamic_deps=dynamic_deps)
 				fake_vartree.sync()
 			else:
 				fake_vartree = graph_config.trees[root]['vartree']

diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 42983fe..8f15c68 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -21,6 +21,10 @@ def create_depgraph_params(myopts, myaction):
 	if bdeps is not None:
 		myparams["bdeps"] = bdeps
 
+	dynamic_deps = myopts.get("--dynamic-deps")
+	if dynamic_deps is not None:
+		myparams["dynamic_deps"] = dynamic_deps
+
 	if myaction == "remove":
 		myparams["remove"] = True
 		myparams["complete"] = True

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a409bed..ab62dc7 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -109,6 +109,7 @@ class _frozen_depgraph_config(object):
 		# All Package instances
 		self._pkg_cache = {}
 		self._highest_license_masked = {}
+		dynamic_deps = myopts.get("--dynamic-deps", "y") != "n"
 		for myroot in trees:
 			self.trees[myroot] = {}
 			# Create a RootConfig instance that references
@@ -122,7 +123,8 @@ class _frozen_depgraph_config(object):
 			self.trees[myroot]["vartree"] = \
 				FakeVartree(trees[myroot]["root_config"],
 					pkg_cache=self._pkg_cache,
-					pkg_root_config=self.roots[myroot])
+					pkg_root_config=self.roots[myroot],
+					dynamic_deps=dynamic_deps)
 			self.pkgsettings[myroot] = portage.config(
 				clone=self.trees[myroot]["vartree"].settings)
 
@@ -514,6 +516,8 @@ class depgraph(object):
 
 		for myroot in self._frozen_config.trees:
 
+			dynamic_deps = self._dynamic_config.myparams.get(
+				"dynamic_deps", "y") != "n"
 			preload_installed_pkgs = \
 				"--nodeps" not in self._frozen_config.myopts
 
@@ -535,8 +539,11 @@ class depgraph(object):
 
 				for pkg in vardb:
 					self._spinner_update()
-					# This triggers metadata updates via FakeVartree.
-					vardb.aux_get(pkg.cpv, [])
+					if dynamic_deps:
+						# This causes FakeVartree to update the
+						# Package instance dependencies via
+						# PackageVirtualDbapi.aux_update()
+						vardb.aux_get(pkg.cpv, [])
 					fakedb.cpv_inject(pkg)
 
 		self._dynamic_config._vdb_loaded = True

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index f4ea36c..ed07c09 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -684,6 +684,12 @@ def parse_opts(tmpcmdline, silent=False):
 			"choices" : true_y_or_n
 		},
 
+		"--dynamic-deps": {
+			"help": "substitute the dependencies of installed packages with the dependencies of unbuilt ebuilds",
+			"type": "choice",
+			"choices": y_or_n
+		},
+
 		"--exclude": {
 			"help"   :"A space separated list of package names or slot atoms. " + \
 				"Emerge won't  install any ebuild or binary package that " + \



             reply	other threads:[~2011-10-10 18:06 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 18:05 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-02-03  3:07 [gentoo-commits] proj/portage:master commit in: man/, pym/_emerge/ Zac Medico
2018-01-30  4:24 Zac Medico
2017-05-14 18:12 Zac Medico
2016-08-08 15:56 Zac Medico
2014-12-07 23:14 Zac Medico
2014-10-21 23:11 Zac Medico
2014-10-20  0:08 Zac Medico
2014-09-24 22:36 Brian Dolbec
2014-06-14 21:46 Alexander Berntsen
2014-06-14 21:46 Alexander Berntsen
2014-06-14 20:58 Alexander Berntsen
2013-07-18 20:25 Zac Medico
2013-07-18 20:23 Zac Medico
2013-02-23 19:17 Zac Medico
2012-12-29 22:35 Zac Medico
2012-12-08  9:25 Zac Medico
2012-11-29  7:53 Zac Medico
2012-10-08 20:30 Zac Medico
2011-12-14  4:47 Zac Medico
2011-10-16 18:58 Zac Medico
2011-09-21 14:00 Zac Medico
2011-09-19 16:03 Zac Medico
2011-09-19 14:15 Zac Medico
2011-09-18 20:16 Zac Medico
2011-07-19  8:38 Zac Medico
2011-06-04 23:32 Zac Medico
2011-06-03  5:40 Zac Medico
2011-05-17  4:31 Zac Medico
2011-05-15 19:20 Zac Medico
2011-05-11 19:04 Zac Medico
2011-04-28 16:16 Zac Medico
2011-04-27 22:07 Zac Medico
2011-04-27 22:03 Zac Medico
2011-04-27 22:00 Zac Medico
2011-03-24 18:18 Zac Medico
2011-03-14 17:52 Zac Medico
2011-02-13  0:24 Zac Medico

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=f8e0c75e0952d04cb518ad0914ad440f1b43f52d.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --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