summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-10-27 22:19:45 +0000
committerZac Medico <zmedico@gentoo.org>2008-10-27 22:19:45 +0000
commite80a33ac7188b30aabd564fc3a7bbe7475c721e2 (patch)
treef67f94b7d4f49c9c80f15d2881b83b3b7754bd3d /pym
parentEnable bashrc even when $EBUILD_PHASE is unset, so it's possible to override (diff)
downloadportage-e80a33ac7188b30aabd564fc3a7bbe7475c721e2.tar.gz
portage-e80a33ac7188b30aabd564fc3a7bbe7475c721e2.tar.bz2
portage-e80a33ac7188b30aabd564fc3a7bbe7475c721e2.zip
In fetch(), avoid the "Adjusting permissions recursively" message in cases
when the directory has just been created and therefore it must be empty. svn path=/main/trunk/; revision=11727
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index cb3ebed45..18ea6e838 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -3583,7 +3583,12 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
write_test_file = os.path.join(
mydir, ".__portage_test_write__")
- if os.path.isdir(mydir):
+ try:
+ st = os.stat(mydir)
+ except OSError:
+ st = None
+
+ if st is not None and stat.S_ISDIR(st.st_mode):
if not (userfetch or userpriv):
continue
if _userpriv_test_write_file(mysettings, write_test_file):
@@ -3591,6 +3596,10 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
_userpriv_test_write_file_cache.pop(write_test_file, None)
if portage.util.ensure_dirs(mydir, gid=dir_gid, mode=dirmode, mask=modemask):
+ if st is None:
+ # The directory has just been created
+ # and therefore it must be empty.
+ continue
writemsg("Adjusting permissions recursively: '%s'\n" % mydir,
noiselevel=-1)
def onerror(e):