FEATURES=xattr: wrap install binary, bug #465000
authorZac Medico <zmedico@gentoo.org>
Sat, 22 Jun 2013 01:15:36 +0000 (18:15 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 22 Jun 2013 01:15:36 +0000 (18:15 -0700)
The install wrapper is added to PATH only when FEATURES=xattr is
enabled, and the wrapper respects PORTAGE_XATTR_EXCLUDE.

bin/install.py
bin/phase-functions.sh
pym/portage/package/ebuild/_config/special_env_vars.py
pym/portage/package/ebuild/doebuild.py

index 4925564c34cf128fb0968018ff2ec2ca1a8111d1..cce68c34e20bbee7303248077adf6c9443e1fe92 100755 (executable)
@@ -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:
index 6d75ef10fee3152b7d0f20b01a57893f282963ce..6433c545e31b882676929ad501f1178c7abf9d7a 100644 (file)
@@ -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"
 
index 8b9cac12bf35362636b2ab4c9ec7489e84c14824..d34d60333ae6be5f5a062d07653efcf695dc6c4f 100644 (file)
@@ -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",
index 69463d2e8d57cf9d2570abb57075b5b21bb52ae6..690171968f29ca42d08888462baffb859d59e2ac 100644 (file)
@@ -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"))