diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-06-16 11:13:12 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-06-16 11:13:12 +0000 |
commit | 8d19cc8f27020d00b8992d3bf71a95e7b933dedc (patch) | |
tree | c64ffc3b11cc615ac5e11cedbda52db8df5925d7 /bin/emerge | |
parent | cdd2f8408101ca9368eeeaed453c85deb94d2c8d (diff) | |
download | portage-8d19cc8f27020d00b8992d3bf71a95e7b933dedc.tar.gz portage-8d19cc8f27020d00b8992d3bf71a95e7b933dedc.tar.bz2 portage-8d19cc8f27020d00b8992d3bf71a95e7b933dedc.zip |
Add some write access checks in post_merge() in order to avoid triggering
permission related exceptions. (trunk r10658)
svn path=/main/branches/2.1.2/; revision=10665
Diffstat (limited to 'bin/emerge')
-rwxr-xr-x | bin/emerge | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/emerge b/bin/emerge index 2fb07ef7f..78f792428 100755 --- a/bin/emerge +++ b/bin/emerge @@ -6802,7 +6802,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) @@ -6913,13 +6914,16 @@ def post_emerge(settings, 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) |