summaryrefslogtreecommitdiffstats
path: root/pym/portage
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-01-14 07:29:08 -0800
committerZac Medico <zmedico@gentoo.org>2012-01-14 07:29:08 -0800
commit93b654199a32fc3df1299b030317720b9294b0c3 (patch)
tree8f29a7005ac7ff28f0132b7f2cb59c8f017a359a /pym/portage
parentc978b14d9a400c30616f27b63d8aa2d6d0522c0f (diff)
downloadportage-93b654199a32fc3df1299b030317720b9294b0c3.tar.gz
portage-93b654199a32fc3df1299b030317720b9294b0c3.tar.bz2
portage-93b654199a32fc3df1299b030317720b9294b0c3.zip
Apply INSTALL_MASK prior to collision-protect.
It may be useful to avoid collisions in some scenarios.
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/dbapi/vartree.py25
-rw-r--r--pym/portage/package/ebuild/doebuild.py2
2 files changed, 18 insertions, 9 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index af70ec3fe..5bb4fa404 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3506,14 +3506,6 @@ class dblink(object):
if installed_files:
return 1
- # check for package collisions
- blockers = self._blockers
- if blockers is None:
- blockers = []
- collisions, symlink_collisions, plib_collisions = \
- self._collision_protect(srcroot, destroot,
- others_in_slot + blockers, myfilelist, mylinklist)
-
# Make sure the ebuild environment is initialized and that ${T}/elog
# exists for logging of collision-protect eerror messages.
if myebuild is None:
@@ -3525,6 +3517,23 @@ class dblink(object):
for other in others_in_slot])
prepare_build_dirs(settings=self.settings, cleanup=cleanup)
+ if self.settings.get("INSTALL_MASK"):
+ # Apply INSTALL_MASK before collision-protect, since it may
+ # be useful to avoid collisions in some scenarios.
+ phase = MiscFunctionsProcess(background=False,
+ commands=["preinst_mask"], phase="preinst",
+ scheduler=self._scheduler, settings=self.settings)
+ phase.start()
+ phase.wait()
+
+ # check for package collisions
+ blockers = self._blockers
+ if blockers is None:
+ blockers = []
+ collisions, symlink_collisions, plib_collisions = \
+ self._collision_protect(srcroot, destroot,
+ others_in_slot + blockers, myfilelist, mylinklist)
+
if collisions:
collision_protect = "collision-protect" in self.settings.features
protect_owned = "protect-owned" in self.settings.features
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index cb7cc1cb3..c52ab3120 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1487,7 +1487,7 @@ _post_phase_cmds = {
"preinst_sfperms",
"preinst_selinux_labels",
"preinst_suid_scan",
- "preinst_mask"]
+ ]
}
def _post_phase_userpriv_perms(mysettings):