aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-10-31 22:19:02 -0700
committerZac Medico <zmedico@gentoo.org>2020-11-01 14:25:27 -0800
commit15ac405fecf3e52ffd93d9a34e472bdc18604a4f (patch)
tree9e72c24ea50fbc1ac639ede2140dd8b0c65ccafb /lib/_emerge/depgraph.py
parentpid-sandbox: Forward SIGTSTP and SIGCONT (bug 704498) (diff)
downloadportage-15ac405fecf3e52ffd93d9a34e472bdc18604a4f.tar.gz
portage-15ac405fecf3e52ffd93d9a34e472bdc18604a4f.tar.bz2
portage-15ac405fecf3e52ffd93d9a34e472bdc18604a4f.zip
emerge: add --quickpkg-direct-root option
Specify the root to use as the --quickpkg-direct package source. This root is assumed to be immutable during the entire emerge operation. The default is set to "/". Bug: https://bugs.gentoo.org/752066 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge/depgraph.py')
-rw-r--r--lib/_emerge/depgraph.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 0bb0352e7..6aaacfe44 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -41,7 +41,7 @@ from portage._sets import SETPREFIX
from portage._sets.base import InternalPackageSet
from portage.util import ConfigProtect, shlex_split, new_protect_filename
from portage.util import cmp_sort_key, writemsg, writemsg_stdout
-from portage.util import ensure_dirs
+from portage.util import ensure_dirs, normalize_path
from portage.util import writemsg_level, write_atomic
from portage.util.digraph import digraph
from portage.util.futures import asyncio
@@ -4567,8 +4567,15 @@ class depgraph:
self._dynamic_config._skip_restart = True
return False, myfavorites
+ # Since --quickpkg-direct assumes that --quickpkg-direct-root is
+ # immutable, assert that there are no merge or unmerge tasks
+ # for --quickpkg-direct-root.
+ quickpkg_root = normalize_path(os.path.abspath(
+ self._frozen_config.myopts.get('--quickpkg-direct-root',
+ self._frozen_config._running_root.settings['ROOT']))).rstrip(os.path.sep) + os.path.sep
if (self._frozen_config.myopts.get('--quickpkg-direct', 'n') == 'y' and
- self._frozen_config.target_root is not self._frozen_config._running_root):
+ self._frozen_config.settings['ROOT'] != quickpkg_root and
+ self._frozen_config._running_root.settings['ROOT'] == quickpkg_root):
running_root = self._frozen_config._running_root.root
for node in self._dynamic_config.digraph:
if (isinstance(node, Package) and node.operation in ('merge', 'uninstall') and