summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-08 20:23:14 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-08 20:23:14 +0000
commit105076fd745b6f93907d403aa768432395b71230 (patch)
treeac536da1d7d86570766ad0ff02072142746a23b1
parent1dd22e980db952be5edfae0cd864bfd0925c547b (diff)
downloadportage-105076fd745b6f93907d403aa768432395b71230.tar.gz
portage-105076fd745b6f93907d403aa768432395b71230.tar.bz2
portage-105076fd745b6f93907d403aa768432395b71230.zip
When inside fakeroot, directories with portage's gid appear
to have root's gid. Therefore, use root's gid instead of portage's gid to avoid spurrious permissions adjustments when inside fakeroot. svn path=/main/trunk/; revision=10608
-rw-r--r--pym/portage/__init__.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 7f8d96f22..d4ad4b3ff 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -3370,6 +3370,13 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
dirmode = 02070
filemode = 060
modemask = 02
+ dir_gid = portage_gid
+ if "FAKED_MODE" in mysettings:
+ # When inside fakeroot, directories with portage's gid appear
+ # to have root's gid. Therefore, use root's gid instead of
+ # portage's gid to avoid spurrious permissions adjustments
+ # when inside fakeroot.
+ dir_gid = 0
distdir_dirs = [""]
if "distlocks" in features:
distdir_dirs.append(".locks")
@@ -3377,13 +3384,13 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
for x in distdir_dirs:
mydir = os.path.join(mysettings["DISTDIR"], x)
- if portage.util.ensure_dirs(mydir, gid=portage_gid, mode=dirmode, mask=modemask):
+ if portage.util.ensure_dirs(mydir, gid=dir_gid, mode=dirmode, mask=modemask):
writemsg("Adjusting permissions recursively: '%s'\n" % mydir,
noiselevel=-1)
def onerror(e):
raise # bail out on the first error that occurs during recursion
if not apply_recursive_permissions(mydir,
- gid=portage_gid, dirmode=dirmode, dirmask=modemask,
+ gid=dir_gid, dirmode=dirmode, dirmask=modemask,
filemode=filemode, filemask=modemask, onerror=onerror):
raise portage.exception.OperationNotPermitted(
"Failed to apply recursive permissions for the portage group.")