summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-03-23 11:22:23 -0700
committerZac Medico <zmedico@gentoo.org>2012-03-23 11:22:23 -0700
commitc33fe80a46e7ba5046c14c5fae8e6fbb8934cac5 (patch)
tree61217af17daf1afea2330ab5b43d9c7ed0e8a294
parent6d2be766e6056e266522c9e39d663d7c0ac42e0d (diff)
downloadportage-c33fe80a46e7ba5046c14c5fae8e6fbb8934cac5.tar.gz
portage-c33fe80a46e7ba5046c14c5fae8e6fbb8934cac5.tar.bz2
portage-c33fe80a46e7ba5046c14c5fae8e6fbb8934cac5.zip
movefile: clarify message for xattr copy errorv2.2.0_alpha95
This will fix bug #402323.
-rw-r--r--pym/portage/util/movefile.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/pym/portage/util/movefile.py b/pym/portage/util/movefile.py
index 252f4a292..43f1b338c 100644
--- a/pym/portage/util/movefile.py
+++ b/pym/portage/util/movefile.py
@@ -8,6 +8,7 @@ import os as _os
import shutil as _shutil
import stat
import subprocess
+import textwrap
import portage
from portage import bsd_chflags, _encodings, _os_overrides, _selinux, \
@@ -229,7 +230,18 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None,
try: # For safety copy then move it over.
_copyfile(src_bytes, dest_tmp_bytes)
if xattr_enabled:
- _copyxattr(src_bytes, dest_tmp_bytes)
+ try:
+ _copyxattr(src_bytes, dest_tmp_bytes)
+ except SystemExit:
+ raise
+ except:
+ msg = _("Failed to copy extended attributes. "
+ "In order to avoid this error, set "
+ "FEATURES=\"-xattr\" in make.conf.")
+ msg = textwrap.wrap(msg, 65)
+ for line in msg:
+ writemsg("!!! %s\n" % (line,), noiselevel=-1)
+ raise
_apply_stat(sstat, dest_tmp_bytes)
_rename(dest_tmp_bytes, dest_bytes)
_os.unlink(src_bytes)