summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/package/ebuild/doebuild.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 5bba19ff8..3071cf8d4 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1453,11 +1453,12 @@ def _post_src_install_uid_fix(mysettings, out):
fixlafiles_announced = True
writemsg("Fixing .la files\n", fd=out)
writemsg(" %s\n" % fpath[len(destdir):], fd=out)
- f = open(_unicode_encode(fpath,
+ # write_atomic succeeds even in some cases in which
+ # a normal write might fail due to file permission
+ # settings on some operating systems such as HP-UX
+ write_atomic(_unicode_encode(fpath,
encoding=_encodings['merge'], errors='strict'),
- mode='wb')
- f.write(new_contents)
- f.close()
+ new_contents, mode='wb')
mystat = os.lstat(fpath)
if stat.S_ISREG(mystat.st_mode) and \