summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-12 09:23:06 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-12 09:23:06 +0000
commit1d7c35a506b470e4d1fb2ca3e82ab1b824237384 (patch)
tree7e0393cf59221def61fbd43b2cbad9b732605016 /pym/portage.py
parent9649d7ecb5489e1c736be8011fd9de81b23ae476 (diff)
downloadportage-1d7c35a506b470e4d1fb2ca3e82ab1b824237384.tar.gz
portage-1d7c35a506b470e4d1fb2ca3e82ab1b824237384.tar.bz2
portage-1d7c35a506b470e4d1fb2ca3e82ab1b824237384.zip
Make binarytree.prevent_collision() adjust permissions on directories
and raise a PermissionDenied error if the required directories is not writable. (trunk r9850) svn path=/main/branches/2.1.2/; revision=9851
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 5f829ac0d..aa5234ca7 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -7901,6 +7901,16 @@ class binarytree(object):
use for a given cpv. If a collision will occur with an existing
package from another category, the existing package will be bumped to
${PKGDIR}/${CATEGORY}/${PF}.tbz2 so that both can coexist."""
+
+ # Copy group permissions for new directories that
+ # may have been created.
+ for path in ("All", catsplit(cpv)[0]):
+ path = os.path.join(self.pkgdir, path)
+ self._ensure_dir(path)
+ if not os.access(path, os.W_OK):
+ raise portage_exception.PermissionDenied(
+ "access('%s', W_OK)" % path)
+
if not self.populated:
# Try to avoid the population routine when possible, so that
# FEATURES=buildpkg doesn't always force population.