summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-16 08:10:49 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-16 08:10:49 +0000
commit46d84b1283e73cb9280aae735a155a7c5a6da3d3 (patch)
treeae1820a5cedce4c4d6c9fb6a0ac9a7088bdc506e
parent6bf0cfbece7ccab5c59a2e20f78473cc6e393357 (diff)
downloadportage-46d84b1283e73cb9280aae735a155a7c5a6da3d3.tar.gz
portage-46d84b1283e73cb9280aae735a155a7c5a6da3d3.tar.bz2
portage-46d84b1283e73cb9280aae735a155a7c5a6da3d3.zip
Add some write access checks in post_merge() in order to avoid triggering
permission related exceptions. svn path=/main/trunk/; revision=10658
-rw-r--r--pym/_emerge/__init__.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index fef25c3f0..208635a02 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -6766,7 +6766,8 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
if inforoot=='':
continue
- if not os.path.isdir(inforoot):
+ if not os.path.isdir(inforoot) or \
+ not os.access(inforoot, os.W_OK):
continue
errmsg = ""
file_list = os.listdir(inforoot)
@@ -6929,13 +6930,16 @@ def post_emerge(trees, mtimedb, retval):
vdb_path = os.path.join(target_root, portage.VDB_PATH)
portage.util.ensure_dirs(vdb_path)
- vdb_lock = portage.locks.lockdir(vdb_path)
+ vdb_lock = None
+ if os.access(vdb_path, os.W_OK):
+ vdb_lock = portage.locks.lockdir(vdb_path)
try:
if "noinfo" not in settings.features:
chk_updated_info_files(target_root, infodirs, info_mtimes, retval)
mtimedb.commit()
finally:
- portage.locks.unlockdir(vdb_lock)
+ if vdb_lock:
+ portage.locks.unlockdir(vdb_lock)
chk_updated_cfg_files(target_root, config_protect)