summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-04-01 10:25:34 -0700
committerZac Medico <zmedico@gentoo.org>2013-04-01 10:25:34 -0700
commitf8c222902193ca5005bdc56f26525d7172866488 (patch)
tree790b569ae7ecc6490c0425de651a1ef94f493dd7
parentegencache,emirrordist: export NOCOLOR if no tty (diff)
downloadportage-f8c222902193ca5005bdc56f26525d7172866488.tar.gz
portage-f8c222902193ca5005bdc56f26525d7172866488.tar.bz2
portage-f8c222902193ca5005bdc56f26525d7172866488.zip
binarytree: copy g+rw from PKGDIR to filesv2.2.0_alpha171
-rw-r--r--pym/portage/dbapi/bintree.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index 875e95515..01dbad18a 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -563,6 +563,20 @@ class binarytree(object):
if not os.path.isdir(path):
raise
+ def _file_permissions(self, path):
+ try:
+ pkgdir_st = os.stat(self.pkgdir)
+ except OSError:
+ pass
+ else:
+ pkgdir_gid = pkgdir_st.st_gid
+ pkgdir_grp_mode = 0o0060 & pkgdir_st.st_mode
+ try:
+ portage.util.apply_permissions(path, gid=pkgdir_gid,
+ mode=pkgdir_grp_mode, mask=0)
+ except PortageException:
+ pass
+
def _move_to_all(self, cpv):
"""If the file exists, move it. Whether or not it exists, update state
for future getname() calls."""
@@ -1075,6 +1089,10 @@ class binarytree(object):
if not samefile:
self._ensure_dir(os.path.dirname(new_filename))
_movefile(filename, new_filename, mysettings=self.settings)
+ full_path = new_filename
+
+ self._file_permissions(full_path)
+
if self._all_directory and \
self.getname(cpv).split(os.path.sep)[-2] == "All":
self._create_symlink(cpv)
@@ -1147,6 +1165,7 @@ class binarytree(object):
f.close()
if f_close is not None:
f_close.close()
+ self._file_permissions(fname)
# some seconds might have elapsed since TIMESTAMP
os.utime(fname, (atime, mtime))