aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-06-22 01:15:36 (GMT)
committerZac Medico <zmedico@gentoo.org>2013-06-22 01:15:36 (GMT)
commit8a78f4d99606a2aa15ee0c049449d98ec27a2c41 (patch)
treeef3b5b56f71f20421cbea1c8e8c1c4d2db5723cc
parentinstall.py: add bash wrapper for python script (diff)
downloadportage-8a78f4d99606a2aa15ee0c049449d98ec27a2c41.zip
portage-8a78f4d99606a2aa15ee0c049449d98ec27a2c41.tar.gz
portage-8a78f4d99606a2aa15ee0c049449d98ec27a2c41.tar.bz2
FEATURES=xattr: wrap install binary, bug #465000
The install wrapper is added to PATH only when FEATURES=xattr is enabled, and the wrapper respects PORTAGE_XATTR_EXCLUDE.
-rwxr-xr-xbin/install.py6
-rw-r--r--bin/phase-functions.sh3
-rw-r--r--pym/portage/package/ebuild/_config/special_env_vars.py4
-rw-r--r--pym/portage/package/ebuild/doebuild.py3
4 files changed, 11 insertions, 5 deletions
diff --git a/bin/install.py b/bin/install.py
index 4925564..cce68c3 100755
--- a/bin/install.py
+++ b/bin/install.py
@@ -184,13 +184,15 @@ def copy_xattrs(opts, files):
source, target = files, opts.target_directory
target_is_directory = True
+ exclude = os.environ.get("PORTAGE_XATTR_EXCLUDE", "security.*")
+
try:
if target_is_directory:
for s in source:
abs_path = os.path.join(target, os.path.basename(s))
- _copyxattr(s, abs_path)
+ _copyxattr(s, abs_path, exclude=exclude)
else:
- _copyxattr(source[0], target)
+ _copyxattr(source[0], target, exclude=exclude)
return os.EX_OK
except OperationNotSupported:
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 6d75ef1..6433c54 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -28,7 +28,8 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \
PORTAGE_REPO_NAME PORTAGE_RESTRICT \
PORTAGE_SAVED_READONLY_VARS PORTAGE_SIGPIPE_STATUS \
PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \
- PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR PORTDIR_OVERLAY \
+ PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTAGE_XATTR_EXCLUDE \
+ PORTDIR PORTDIR_OVERLAY \
PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR \
__PORTAGE_HELPER __PORTAGE_TEST_HARDLINK_LOCKS"
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 8b9cac1..d34d603 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -72,7 +72,7 @@ environ_whitelist += [
"PORTAGE_REPO_NAME", "PORTAGE_RESTRICT",
"PORTAGE_SIGPIPE_STATUS",
"PORTAGE_TMPDIR", "PORTAGE_UPDATE_ENV", "PORTAGE_USERNAME",
- "PORTAGE_VERBOSE", "PORTAGE_WORKDIR_MODE",
+ "PORTAGE_VERBOSE", "PORTAGE_WORKDIR_MODE", "PORTAGE_XATTR_EXCLUDE",
"PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", "PROFILE_PATHS",
"REPLACING_VERSIONS", "REPLACED_BY_VERSION",
"ROOT", "ROOTPATH", "T", "TMP", "TMPDIR",
@@ -172,7 +172,7 @@ environ_filter += [
"PORTAGE_RO_DISTDIRS",
"PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS",
"PORTAGE_RSYNC_RETRIES", "PORTAGE_SSH_OPTS", "PORTAGE_SYNC_STALE",
- "PORTAGE_USE", "PORTAGE_XATTR_EXCLUDE",
+ "PORTAGE_USE",
"PORT_LOGDIR", "PORT_LOGDIR_CLEAN",
"QUICKPKG_DEFAULT_OPTS", "REPOMAN_DEFAULT_OPTS",
"RESUMECOMMAND", "RESUMECOMMAND_FTP",
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 69463d2..6901719 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -172,6 +172,9 @@ def _doebuild_path(settings, eapi=None):
path = overrides
+ if "xattr" in settings.features:
+ path.append(os.path.join(portage_bin_path, "ebuild-helpers", "xattr"))
+
if eprefix and uid != 0 and "fakeroot" not in settings.features:
path.append(os.path.join(portage_bin_path,
"ebuild-helpers", "unprivileged"))