* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, bin/, ...
@ 2011-12-11 6:52 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2011-12-11 6:52 UTC (permalink / raw
To: gentoo-commits
commit: c1edb7a9bb5162b0781cfbebd475a65562aa6dd7
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 11 06:51:56 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 11 06:51:56 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c1edb7a9
Remove _SANDBOX_COMPAT_LEVEL.
---
bin/ebuild.sh | 9 ---------
bin/phase-functions.sh | 2 +-
pym/portage/const.py | 1 -
.../package/ebuild/_config/special_env_vars.py | 4 ++--
pym/portage/package/ebuild/config.py | 4 ----
5 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1f95adb..af7b3a9 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -40,15 +40,6 @@ else
unset x
fi
-if [[ $PORTAGE_SANDBOX_COMPAT_LEVEL -lt 22 ]] ; then
- # Ensure that /dev/std* streams have appropriate sandbox permission for
- # bug #288863. This can be removed after sandbox is fixed and portage
- # depends on the fixed version (sandbox-2.2 has the fix but it is
- # currently unstable).
- export SANDBOX_WRITE="${SANDBOX_WRITE:+${SANDBOX_WRITE}:}/dev/stdout:/dev/stderr"
- export SANDBOX_READ="${SANDBOX_READ:+${SANDBOX_READ}:}/dev/stdin"
-fi
-
# Don't use sandbox's BASH_ENV for new shells because it does
# 'source /etc/profile' which can interfere with the build
# environment by modifying our PATH.
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index f862b30..bd8708c 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -23,7 +23,7 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE \
PORTAGE_IPC_DAEMON PORTAGE_IUSE PORTAGE_LOG_FILE \
PORTAGE_MUTABLE_FILTERED_VARS PORTAGE_PYM_PATH PORTAGE_PYTHON \
PORTAGE_READONLY_METADATA PORTAGE_READONLY_VARS \
- PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_SANDBOX_COMPAT_LEVEL \
+ 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 \
diff --git a/pym/portage/const.py b/pym/portage/const.py
index 37abb16..77c68eb 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -165,7 +165,6 @@ _ENABLE_PRESERVE_LIBS = True
_ENABLE_REPO_NAME_WARN = True
_ENABLE_SET_CONFIG = True
_ENABLE_XATTR = True
-_SANDBOX_COMPAT_LEVEL = "22"
# The definitions above will differ between branches, so it's useful to have
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 3911e97..fd0bf2d 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -20,7 +20,7 @@ env_blacklist = frozenset((
"PDEPEND", "PF", "PKGUSE", "PORTAGE_BACKGROUND",
"PORTAGE_BACKGROUND_UNMERGE", "PORTAGE_BUILDIR_LOCKED",
"PORTAGE_BUILT_USE", "PORTAGE_CONFIGROOT", "PORTAGE_IUSE",
- "PORTAGE_NONFATAL", "PORTAGE_REPO_NAME", "PORTAGE_SANDBOX_COMPAT_LEVEL",
+ "PORTAGE_NONFATAL", "PORTAGE_REPO_NAME",
"PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "RESTRICT",
"ROOT", "SLOT", "SRC_URI"
))
@@ -59,7 +59,7 @@ environ_whitelist += [
"PORTAGE_LOG_FILE",
"PORTAGE_PYM_PATH", "PORTAGE_PYTHON", "PORTAGE_QUIET",
"PORTAGE_REPO_NAME", "PORTAGE_RESTRICT",
- "PORTAGE_SANDBOX_COMPAT_LEVEL", "PORTAGE_SIGPIPE_STATUS",
+ "PORTAGE_SIGPIPE_STATUS",
"PORTAGE_TMPDIR", "PORTAGE_UPDATE_ENV", "PORTAGE_USERNAME",
"PORTAGE_VERBOSE", "PORTAGE_WORKDIR_MODE",
"PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", "PROFILE_PATHS",
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 21af0de..9a8486c 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -27,7 +27,6 @@ from portage.const import CACHE_PATH, \
MODULES_FILE_PATH, \
PRIVATE_PATH, PROFILE_PATH, USER_CONFIG_PATH, \
USER_VIRTUALS_FILE
-from portage.const import _SANDBOX_COMPAT_LEVEL
from portage.dbapi import dbapi
from portage.dbapi.porttree import portdbapi
from portage.dbapi.vartree import vartree
@@ -512,9 +511,6 @@ class config(object):
self["EROOT"] = eroot
self.backup_changes("EROOT")
- self["PORTAGE_SANDBOX_COMPAT_LEVEL"] = _SANDBOX_COMPAT_LEVEL
- self.backup_changes("PORTAGE_SANDBOX_COMPAT_LEVEL")
-
self._ppropertiesdict = portage.dep.ExtendedAtomDict(dict)
self._penvdict = portage.dep.ExtendedAtomDict(dict)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, bin/, ...
@ 2012-01-08 6:22 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 6+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-08 6:22 UTC (permalink / raw
To: gentoo-commits
commit: 0d9ea2752aa7819e5b26b47920c09218d9f5b7c2
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jan 8 06:19:06 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jan 8 06:19:06 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0d9ea275
Set REPOSITORY variable in ebuild environment in EAPI="4-python".
---
bin/phase-functions.sh | 4 ++--
pym/portage/eapi.py | 5 ++++-
.../package/ebuild/_config/special_env_vars.py | 6 +++---
pym/portage/package/ebuild/doebuild.py | 11 ++++++++---
4 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 2167853..ce251ce 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Hardcoded bash lists are needed for backward compatibility with
@@ -9,7 +9,7 @@
PORTAGE_READONLY_METADATA="DEFINED_PHASES DEPEND DESCRIPTION
EAPI HOMEPAGE INHERITED IUSE REQUIRED_USE KEYWORDS LICENSE
- PDEPEND PROVIDE RDEPEND RESTRICT SLOT SRC_URI"
+ PDEPEND PROVIDE RDEPEND REPOSITORY RESTRICT SLOT SRC_URI"
PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE \
EBUILD_SH_ARGS ECLASSDIR EMERGE_FROM FILESDIR MERGE_TYPE \
diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index da5fd8c..65c99c7 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -1,4 +1,4 @@
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
def eapi_has_iuse_defaults(eapi):
@@ -34,6 +34,9 @@ def eapi_exports_merge_type(eapi):
def eapi_exports_replace_vars(eapi):
return eapi not in ("0", "1", "2", "3")
+def eapi_exports_REPOSITORY(eapi):
+ return eapi in ("4-python",)
+
def eapi_has_pkg_pretend(eapi):
return eapi not in ("0", "1", "2", "3")
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index c1628f7..132f8eb 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = (
@@ -21,8 +21,8 @@ env_blacklist = frozenset((
"PORTAGE_BACKGROUND_UNMERGE", "PORTAGE_BUILDIR_LOCKED",
"PORTAGE_BUILT_USE", "PORTAGE_CONFIGROOT", "PORTAGE_IUSE",
"PORTAGE_NONFATAL", "PORTAGE_REPO_NAME",
- "PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "RESTRICT",
- "ROOT", "SLOT", "SRC_URI"
+ "PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "REPOSITORY",
+ "RESTRICT", "ROOT", "SLOT", "SRC_URI"
))
environ_whitelist = []
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 3c0d023..cb7cc1c 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild']
@@ -41,8 +41,9 @@ from portage.dbapi.porttree import _parse_uri_map
from portage.dep import Atom, check_required_use, \
human_readable_required_use, paren_enclose, use_reduce
from portage.eapi import eapi_exports_KV, eapi_exports_merge_type, \
- eapi_exports_replace_vars, eapi_has_required_use, \
- eapi_has_src_prepare_and_src_configure, eapi_has_pkg_pretend
+ eapi_exports_replace_vars, eapi_exports_REPOSITORY, \
+ eapi_has_required_use, eapi_has_src_prepare_and_src_configure, \
+ eapi_has_pkg_pretend
from portage.elog import elog_process, _preload_elog_modules
from portage.elog.messages import eerror, eqawarn
from portage.exception import DigestException, FileNotFound, \
@@ -243,6 +244,7 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
mysettings['PORTDIR'] = repo.eclass_db.porttrees[0]
mysettings['PORTDIR_OVERLAY'] = ' '.join(repo.eclass_db.porttrees[1:])
mysettings.configdict["pkg"]["PORTAGE_REPO_NAME"] = repo.name
+ mysettings.configdict["pkg"]["REPOSITORY"] = repo.name
mysettings["PORTDIR"] = os.path.realpath(mysettings["PORTDIR"])
mysettings["DISTDIR"] = os.path.realpath(mysettings["DISTDIR"])
@@ -412,6 +414,9 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
mysettings["KV"] = ""
mysettings.backup_changes("KV")
+ if mydo != "depend" and not eapi_exports_REPOSITORY(eapi):
+ mysettings.pop('REPOSITORY', None)
+
_doebuild_manifest_cache = None
_doebuild_broken_ebuilds = set()
_doebuild_broken_manifests = set()
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, bin/, ...
@ 2012-08-29 16:28 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2012-08-29 16:28 UTC (permalink / raw
To: gentoo-commits
commit: cbd3ea6cad4d7ef8103ddbb71245c1ea47fa49ed
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 29 16:26:38 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Aug 29 16:26:38 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cbd3ea6c
EAPI 5: EBUILD_PHASE_FUNC variable
See bug #390765 and the PMS patch:
http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=76ddca560da42fd968c53a2a0c38a6ac840a7ad4
---
bin/phase-functions.sh | 2 +-
pym/portage/eapi.py | 7 ++++++-
.../package/ebuild/_config/special_env_vars.py | 5 +++--
pym/portage/package/ebuild/config.py | 7 +++++++
pym/portage/package/ebuild/doebuild.py | 18 ++++++++++++++++++
5 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 3520199..c23be74 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -11,7 +11,7 @@ PORTAGE_READONLY_METADATA="DEFINED_PHASES DEPEND DESCRIPTION
EAPI HOMEPAGE INHERITED IUSE REQUIRED_USE KEYWORDS LICENSE
PDEPEND PROVIDE RDEPEND REPOSITORY RESTRICT SLOT SRC_URI"
-PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE \
+PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \
EBUILD_SH_ARGS ECLASSDIR EMERGE_FROM FILESDIR MERGE_TYPE \
PM_EBUILD_HOOK_DIR \
PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST PORTAGE_BASHRC \
diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index 00ce2a5..1d8da39 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -44,6 +44,9 @@ def eapi_exports_merge_type(eapi):
def eapi_exports_replace_vars(eapi):
return eapi not in ("0", "1", "2", "3")
+def eapi_exports_EBUILD_PHASE_FUNC(eapi):
+ return eapi not in ("0", "1", "2", "3", "4", "4-python", "4-slot-abi")
+
def eapi_exports_REPOSITORY(eapi):
return eapi in ("4-python",)
@@ -75,7 +78,8 @@ def eapi_allows_dots_in_use_flags(eapi):
return eapi in ("4-python",)
_eapi_attrs = collections.namedtuple('_eapi_attrs',
- 'dots_in_PN dots_in_use_flags iuse_defaults iuse_effective '
+ 'dots_in_PN dots_in_use_flags exports_EBUILD_PHASE_FUNC '
+ 'iuse_defaults iuse_effective '
'repo_deps required_use required_use_at_most_one_of slot_abi slot_deps '
'src_uri_arrows strong_blocks use_deps use_dep_defaults')
@@ -100,6 +104,7 @@ def _get_eapi_attrs(eapi):
eapi_attrs = _eapi_attrs(
dots_in_PN = (eapi is None or eapi_allows_dots_in_PN(eapi)),
dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)),
+ exports_EBUILD_PHASE_FUNC = (eapi is None or eapi_exports_EBUILD_PHASE_FUNC(eapi)),
iuse_defaults = (eapi is None or eapi_has_iuse_defaults(eapi)),
iuse_effective = (eapi is not None and eapi_has_iuse_effective(eapi)),
repo_deps = (eapi is None or eapi_has_repo_deps(eapi)),
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 2505ce3..4d42537 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -13,7 +13,8 @@ import re
# configuration files.
env_blacklist = frozenset((
"A", "AA", "CATEGORY", "DEPEND", "DESCRIPTION", "EAPI",
- "EBUILD_FORCE_TEST", "EBUILD_PHASE", "EBUILD_SKIP_MANIFEST",
+ "EBUILD_FORCE_TEST", "EBUILD_PHASE",
+ "EBUILD_PHASE_FUNC", "EBUILD_SKIP_MANIFEST",
"ED", "EMERGE_FROM", "EPREFIX", "EROOT",
"GREP_OPTIONS", "HOMEPAGE", "INHERITED", "IUSE", "IUSE_EFFECTIVE",
"KEYWORDS", "LICENSE", "MERGE_TYPE",
@@ -39,7 +40,7 @@ environ_whitelist += [
"ACCEPT_LICENSE", "BASH_ENV", "BUILD_PREFIX", "COLUMNS", "D",
"DISTDIR", "DOC_SYMLINKS_DIR", "EAPI", "EBUILD",
"EBUILD_FORCE_TEST",
- "EBUILD_PHASE", "ECLASSDIR", "ECLASS_DEPTH", "ED",
+ "EBUILD_PHASE", "EBUILD_PHASE_FUNC", "ECLASSDIR", "ECLASS_DEPTH", "ED",
"EMERGE_FROM", "EPREFIX", "EROOT",
"FEATURES", "FILESDIR", "HOME", "MERGE_TYPE", "NOCOLOR", "PATH",
"PKGDIR",
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 6a9ed08..e871382 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -19,6 +19,7 @@ from _emerge.Package import Package
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.data:portage_gid',
+ 'portage.package.ebuild.doebuild:_phase_func_map',
)
from portage import bsd_chflags, \
load_mod, os, selinux, _unicode_decode
@@ -2402,6 +2403,7 @@ class config(object):
environ_filter = self._environ_filter
eapi = self.get('EAPI')
+ eapi_attrs = _get_eapi_attrs(eapi)
phase = self.get('EBUILD_PHASE')
filter_calling_env = False
if self.mycpv is not None and \
@@ -2483,6 +2485,11 @@ class config(object):
not eapi_exports_replace_vars(eapi):
mydict.pop("REPLACED_BY_VERSION", None)
+ if phase is not None and eapi_attrs.exports_EBUILD_PHASE_FUNC:
+ phase_func = _phase_func_map.get(phase)
+ if phase_func is not None:
+ mydict["EBUILD_PHASE_FUNC"] = phase_func
+
return mydict
def thirdpartymirrors(self):
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 3ba8ebd..5856f69 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -75,6 +75,24 @@ _unsandboxed_phases = frozenset([
"prerm", "setup"
])
+_phase_func_map = {
+ "config": "pkg_config",
+ "setup": "pkg_setup",
+ "nofetch": "pkg_nofetch",
+ "unpack": "src_unpack",
+ "prepare": "src_prepare",
+ "configure": "src_configure",
+ "compile": "src_compile",
+ "test": "src_test",
+ "install": "src_install",
+ "preinst": "pkg_preinst",
+ "postinst": "pkg_postinst",
+ "prerm": "pkg_prerm",
+ "postrm": "pkg_postrm",
+ "info": "pkg_info",
+ "pretend": "pkg_pretend",
+}
+
def _doebuild_spawn(phase, settings, actionmap=None, **kwargs):
"""
All proper ebuild phases which execute ebuild.sh are spawned
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, bin/, ...
@ 2012-11-16 4:38 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 6+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-11-16 4:38 UTC (permalink / raw
To: gentoo-commits
commit: 4b22701aa7733e53778fc4d456819fc010e198b0
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Nov 16 04:35:57 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Fri Nov 16 04:35:57 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4b22701a
EAPI="5-progress": Add package_manager_build_user() and package_manager_build_group().
---
bin/eapi.sh | 8 +++++++
bin/phase-functions.sh | 3 +-
bin/phase-helpers.sh | 12 ++++++++++
bin/save-ebuild-env.sh | 2 +
doc/package/ebuild/eapi/5-progress.docbook | 12 ++++++++++
.../package/ebuild/_config/special_env_vars.py | 3 +-
pym/portage/package/ebuild/doebuild.py | 22 ++++++++++++++++---
7 files changed, 56 insertions(+), 6 deletions(-)
diff --git a/bin/eapi.sh b/bin/eapi.sh
index d21b69d..e63f145 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -84,6 +84,14 @@ ___eapi_has_license_path() {
[[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
}
+___eapi_has_package_manager_build_user() {
+ [[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
+}
+
+___eapi_has_package_manager_build_group() {
+ [[ ${1-${EAPI}} =~ ^(5-progress)$ ]]
+}
+
# HELPERS BEHAVIOR
___eapi_best_version_and_has_version_support_--host-root() {
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 714f7a6..9de9436 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -16,7 +16,8 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \
PM_EBUILD_HOOK_DIR \
PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST PORTAGE_BASHRC \
PORTAGE_BINPKG_FILE PORTAGE_BINPKG_TAR_OPTS PORTAGE_BINPKG_TMPFILE \
- PORTAGE_BIN_PATH PORTAGE_BUILDDIR PORTAGE_BUNZIP2_COMMAND \
+ PORTAGE_BIN_PATH PORTAGE_BUILDDIR PORTAGE_BUILD_GROUP \
+ PORTAGE_BUILD_USER PORTAGE_BUNZIP2_COMMAND \
PORTAGE_BZIP2_COMMAND PORTAGE_COLORMAP PORTAGE_CONFIGROOT \
PORTAGE_DEBUG PORTAGE_DEPCACHEDIR PORTAGE_EBUILD_EXIT_FILE \
PORTAGE_GID PORTAGE_GRPNAME PORTAGE_INST_GID PORTAGE_INST_UID \
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 5055060..bc00e44 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -895,3 +895,15 @@ if ___eapi_has_license_path; then
esac
}
fi
+
+if ___eapi_has_package_manager_build_user; then
+ package_manager_build_user() {
+ echo "${PORTAGE_BUILD_USER}"
+ }
+fi
+
+if ___eapi_has_package_manager_build_group; then
+ package_manager_build_group() {
+ echo "${PORTAGE_BUILD_GROUP}"
+ }
+fi
diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index f6dc2c5..5b68b07 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -82,6 +82,8 @@ __save_ebuild_env() {
___eapi_has_available_eclasses && unset -f available_eclasses
___eapi_has_eclass_path && unset -f eclass_path
___eapi_has_license_path && unset -f license_path
+ ___eapi_has_package_manager_build_user && unset -f package_manager_build_user
+ ___eapi_has_package_manager_build_group && unset -f package_manager_build_group
unset -f $(compgen -A function ___eapi_)
diff --git a/doc/package/ebuild/eapi/5-progress.docbook b/doc/package/ebuild/eapi/5-progress.docbook
index bc7c300..3346464 100644
--- a/doc/package/ebuild/eapi/5-progress.docbook
+++ b/doc/package/ebuild/eapi/5-progress.docbook
@@ -35,6 +35,18 @@
New license_path function prints path to specified license for current repository.
</para>
</section>
+ <section id='package-ebuild-eapi-5-progress-helpers-package-manager-build-user'>
+ <title>package_manager_build_user</title>
+ <para>
+ New package_manager_build_user function prints name of user used by package manager in build phases.
+ </para>
+ </section>
+ <section id='package-ebuild-eapi-5-progress-helpers-package-manager-build-group'>
+ <title>package_manager_build_group</title>
+ <para>
+ New package_manager_build_group function prints name of group used by package manager in build phases.
+ </para>
+ </section>
<section id='package-ebuild-eapi-5-progress-helpers-dohtml-extended-default-list-of-extensions'>
<title>Extended default list of extensions in dohtml</title>
<para>
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 3ca9687..150dafe 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -51,7 +51,8 @@ environ_whitelist += [
"PORTAGE_BINPKG_FILE", "PORTAGE_BINPKG_TAR_OPTS",
"PORTAGE_BINPKG_TMPFILE",
"PORTAGE_BIN_PATH",
- "PORTAGE_BUILDDIR", "PORTAGE_BUNZIP2_COMMAND", "PORTAGE_BZIP2_COMMAND",
+ "PORTAGE_BUILDDIR", "PORTAGE_BUILD_GROUP", "PORTAGE_BUILD_USER",
+ "PORTAGE_BUNZIP2_COMMAND", "PORTAGE_BZIP2_COMMAND",
"PORTAGE_COLORMAP", "PORTAGE_COMPRESS",
"PORTAGE_COMPRESS_EXCLUDE_SUFFIXES",
"PORTAGE_CONFIGROOT", "PORTAGE_DEBUG", "PORTAGE_DEPCACHEDIR",
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 0a1f1df..5002c5b 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -3,12 +3,14 @@
__all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild']
+import grp
import gzip
import errno
import io
from itertools import chain
import logging
import os as _os
+import pwd
import re
import signal
import stat
@@ -1419,10 +1421,22 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
# fake ownership/permissions will have to be converted to real
# permissions in the merge phase.
fakeroot = fakeroot and uid != 0 and portage.process.fakeroot_capable
- if droppriv and uid == 0 and portage_gid and portage_uid and \
- hasattr(os, "setgroups"):
- keywords.update({"uid":portage_uid,"gid":portage_gid,
- "groups":userpriv_groups,"umask":0o02})
+ portage_build_uid = os.getuid()
+ portage_build_gid = os.getgid()
+ if uid == 0 and portage_uid and portage_gid and hasattr(os, "setgroups"):
+ if droppriv:
+ keywords.update({
+ "uid": portage_uid,
+ "gid": portage_gid,
+ "groups": userpriv_groups,
+ "umask": 0o02
+ })
+ if "userpriv" in features and "userpriv" not in mysettings["PORTAGE_RESTRICT"].split() and secpass >= 2:
+ portage_build_uid = portage_uid
+ portage_build_gid = portage_gid
+ mysettings["PORTAGE_BUILD_USER"] = pwd.getpwuid(portage_build_uid).pw_name
+ mysettings["PORTAGE_BUILD_GROUP"] = grp.getgrgid(portage_build_gid).gr_name
+
if not free:
free=((droppriv and "usersandbox" not in features) or \
(not droppriv and "sandbox" not in features and \
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, bin/, ...
@ 2013-07-13 5:33 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 6+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-13 5:33 UTC (permalink / raw
To: gentoo-commits
commit: 7b2d968c768ac77d23e28de96727440e4da5af94
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Jul 13 05:30:39 2013 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sat Jul 13 05:30:39 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7b2d968c
Support PORTAGE_REPOSITORIES environmental variable, which overrides
whole configuration of repositories (repos.conf, PORTDIR, PORTDIR_OVERLAY).
Format of PORTAGE_REPOSITORIES is identical to format of repos.conf.
---
bin/phase-functions.sh | 2 +-
.../package/ebuild/_config/special_env_vars.py | 2 +-
pym/portage/package/ebuild/doebuild.py | 1 +
pym/portage/repository/config.py | 31 ++++++++++++++++++----
4 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 5c17243..f67879e 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -25,7 +25,7 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \
PORTAGE_MUTABLE_FILTERED_VARS PORTAGE_OVERRIDE_EPREFIX \
PORTAGE_PYM_PATH PORTAGE_PYTHON \
PORTAGE_READONLY_METADATA PORTAGE_READONLY_VARS \
- PORTAGE_REPO_NAME PORTAGE_RESTRICT \
+ PORTAGE_REPO_NAME PORTAGE_REPOSITORIES PORTAGE_RESTRICT \
PORTAGE_SAVED_READONLY_VARS PORTAGE_SIGPIPE_STATUS \
PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \
PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTAGE_XATTR_EXCLUDE \
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index d34d603..85b699e 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -69,7 +69,7 @@ environ_whitelist += [
"PORTAGE_IPC_DAEMON", "PORTAGE_IUSE",
"PORTAGE_LOG_FILE", "PORTAGE_OVERRIDE_EPREFIX", "PORTAGE_PIPE_FD",
"PORTAGE_PYM_PATH", "PORTAGE_PYTHON", "PORTAGE_QUIET",
- "PORTAGE_REPO_NAME", "PORTAGE_RESTRICT",
+ "PORTAGE_REPO_NAME", "PORTAGE_REPOSITORIES", "PORTAGE_RESTRICT",
"PORTAGE_SIGPIPE_STATUS",
"PORTAGE_TMPDIR", "PORTAGE_UPDATE_ENV", "PORTAGE_USERNAME",
"PORTAGE_VERBOSE", "PORTAGE_WORKDIR_MODE", "PORTAGE_XATTR_EXCLUDE",
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 06ea111..7ffe66b 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -306,6 +306,7 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
repo = mydbapi.repositories.get_repo_for_location(mytree)
mysettings['PORTDIR'] = repo.eclass_db.porttrees[0]
mysettings['PORTDIR_OVERLAY'] = ' '.join(repo.eclass_db.porttrees[1:])
+ mysettings['PORTAGE_REPOSITORIES'] = mydbapi.repositories.config_string()
mysettings.configdict["pkg"]["PORTAGE_REPO_NAME"] = repo.name
mysettings["PORTDIR"] = os.path.realpath(mysettings["PORTDIR"])
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index fded7bd..5d4966a 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -548,8 +548,12 @@ class RepoConfigLoader(object):
ignored_map = {}
ignored_location_map = {}
- portdir = settings.get('PORTDIR', '')
- portdir_overlay = settings.get('PORTDIR_OVERLAY', '')
+ if "PORTAGE_REPOSITORIES" in settings:
+ portdir = ""
+ portdir_overlay = ""
+ else:
+ portdir = settings.get("PORTDIR", "")
+ portdir_overlay = settings.get("PORTDIR_OVERLAY", "")
try:
self._parse(paths, prepos, ignored_map,
@@ -827,11 +831,28 @@ class RepoConfigLoader(object):
def __contains__(self, repo_name):
return repo_name in self.prepos
+ def config_string(self):
+ config_string = ""
+ for repo_name, repo in self.prepos.items():
+ config_string += "[%s]\n" % repo_name
+ for key in ("format", "location", "main_repo", "priority", "sync"):
+ if getattr(repo, key) is not None:
+ config_string += "%s = %s\n" % (key.replace("_", "-"), getattr(repo, key))
+ for key in ("aliases", "eclass_overrides"):
+ if getattr(repo, key) is not None:
+ config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(getattr(repo, key)))
+ for key in ("masters",):
+ if getattr(repo, key) is not None:
+ config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(x.name for x in getattr(repo, key)))
+ return config_string
+
def load_repository_config(settings):
- #~ repoconfigpaths = [os.path.join(settings.global_config_path, "repos.conf")]
repoconfigpaths = []
- repoconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
- USER_CONFIG_PATH, "repos.conf"))
+ if "PORTAGE_REPOSITORIES" in settings:
+ repoconfigpaths.append(io.StringIO(settings["PORTAGE_REPOSITORIES"]))
+ else:
+ # repoconfigpaths.append(os.path.join(settings.global_config_path, "repos.conf"))
+ repoconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH, "repos.conf"))
return RepoConfigLoader(repoconfigpaths, settings)
def _get_repo_name(repo_location, cached=None):
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, bin/, ...
@ 2013-07-22 18:08 Zac Medico
0 siblings, 0 replies; 6+ messages in thread
From: Zac Medico @ 2013-07-22 18:08 UTC (permalink / raw
To: gentoo-commits
commit: 56f416255d0fd5ccf29c08af2eb983080be40dc4
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 22 18:08:09 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 22 18:08:09 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=56f41625
inherit: optimize eclass search
Use PORTAGE_ECLASS_LOCATIONS variable ordered so that we can break out
of the eclass search loop as soon as the first match is found.
---
bin/ebuild.sh | 8 +++++---
bin/phase-functions.sh | 1 +
pym/portage/__init__.py | 4 ++++
pym/portage/eclass_cache.py | 14 +++++++++++++-
pym/portage/package/ebuild/_config/special_env_vars.py | 2 +-
pym/portage/package/ebuild/config.py | 5 +----
pym/portage/package/ebuild/doebuild.py | 1 +
7 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index fc7fd9e..7ef8a76 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -207,7 +207,6 @@ inherit() {
| fmt -w 75 | while read -r ; do eqawarn "$REPLY" ; done
fi
- local repo
local repo_location
local location
local potential_location
@@ -246,12 +245,12 @@ inherit() {
fi
fi
- for repo in $(__repo_key ${PORTAGE_REPO_NAME} masters) ${PORTAGE_REPO_NAME} $(__repo_key ${PORTAGE_REPO_NAME} eclass-overrides); do
- repo_location="$(__repo_key ${repo} location)"
+ for repo_location in ${PORTAGE_ECLASS_LOCATIONS[@]}; do
potential_location="${repo_location}/eclass/${1}.eclass"
if [[ -f ${potential_location} ]]; then
location="${potential_location}"
debug-print " eclass exists: ${location}"
+ break
fi
done
debug-print "inherit: $1 -> $location"
@@ -515,6 +514,9 @@ if ___eapi_enables_globstar; then
shopt -s globstar
fi
+# Convert quoted paths to array.
+eval "PORTAGE_ECLASS_LOCATIONS=(${PORTAGE_ECLASS_LOCATIONS})"
+
# Source the ebuild every time for FEATURES=noauto, so that ebuild
# modifications take effect immediately.
if ! has "$EBUILD_PHASE" clean cleanrm ; then
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 8a52f30..37503bf 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -20,6 +20,7 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \
PORTAGE_BUILD_USER PORTAGE_BUNZIP2_COMMAND \
PORTAGE_BZIP2_COMMAND PORTAGE_COLORMAP PORTAGE_CONFIGROOT \
PORTAGE_DEBUG PORTAGE_DEPCACHEDIR PORTAGE_EBUILD_EXIT_FILE \
+ PORTAGE_ECLASS_LOCATIONS \
PORTAGE_GID PORTAGE_GRPNAME PORTAGE_INST_GID PORTAGE_INST_UID \
PORTAGE_INTERNAL_CALLER PORTAGE_IPC_DAEMON PORTAGE_IUSE PORTAGE_LOG_FILE \
PORTAGE_MUTABLE_FILTERED_VARS PORTAGE_OVERRIDE_EPREFIX \
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 51aa61b..13a34e6 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -404,12 +404,16 @@ def _get_stdin():
return sys.__stdin__
return sys.stdin
+_shell_quote_re = re.compile(r"[\s><=*\\\"'$`]")
+
def _shell_quote(s):
"""
Quote a string in double-quotes and use backslashes to
escape any backslashes, double-quotes, dollar signs, or
backquotes in the string.
"""
+ if _shell_quote_re.search(s) is None:
+ return s
for letter in "\\\"$`":
if letter in s:
s = s.replace(letter, "\\" + letter)
diff --git a/pym/portage/eclass_cache.py b/pym/portage/eclass_cache.py
index cb2cf8a..8c209c8 100644
--- a/pym/portage/eclass_cache.py
+++ b/pym/portage/eclass_cache.py
@@ -1,7 +1,9 @@
-# Copyright 2005-2011 Gentoo Foundation
+# Copyright 2005-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Author(s): Nicholas Carpaski (carpaski@gentoo.org), Brian Harring (ferringb@gentoo.org)
+from __future__ import unicode_literals
+
__all__ = ["cache"]
import stat
@@ -12,6 +14,7 @@ import errno
from portage.exception import FileNotFound, PermissionDenied
from portage import os
from portage import checksum
+from portage import _shell_quote
if sys.hexversion >= 0x3000000:
long = int
@@ -60,6 +63,7 @@ class cache(object):
self.eclasses = {} # {"Name": hashed_path}
self._eclass_locations = {}
+ self._eclass_locations_str = None
# screw with the porttree ordering, w/out having bash inherit match it, and I'll hurt you.
# ~harring
@@ -98,6 +102,7 @@ class cache(object):
self.porttrees = self.porttrees + other.porttrees
self.eclasses.update(other.eclasses)
self._eclass_locations.update(other._eclass_locations)
+ self._eclass_locations_str = None
def update_eclasses(self):
self.eclasses = {}
@@ -169,3 +174,10 @@ class cache(object):
ec_dict[x] = self.eclasses[x]
return ec_dict
+
+ @property
+ def eclass_locations_string(self):
+ if self._eclass_locations_str is None:
+ self._eclass_locations_str = " ".join(_shell_quote(x)
+ for x in reversed(self.porttrees))
+ return self._eclass_locations_str
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 35f80e3..2855722 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -66,7 +66,7 @@ environ_whitelist += [
"PORTAGE_GID", "PORTAGE_GRPNAME",
"PORTAGE_INTERNAL_CALLER",
"PORTAGE_INST_GID", "PORTAGE_INST_UID",
- "PORTAGE_IPC_DAEMON", "PORTAGE_IUSE",
+ "PORTAGE_IPC_DAEMON", "PORTAGE_IUSE", "PORTAGE_ECLASS_LOCATIONS",
"PORTAGE_LOG_FILE", "PORTAGE_OVERRIDE_EPREFIX", "PORTAGE_PIPE_FD",
"PORTAGE_PYM_PATH", "PORTAGE_PYTHON",
"PORTAGE_PYTHONPATH", "PORTAGE_QUIET",
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 5066008..6871bdf 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -524,13 +524,10 @@ class config(object):
new_ov = []
if portdir_overlay:
- shell_quote_re = re.compile(r"[\s\\\"'$`]")
for ov in portdir_overlay:
ov = normalize_path(ov)
if isdir_raise_eaccess(ov):
- if shell_quote_re.search(ov) is not None:
- ov = portage._shell_quote(ov)
- new_ov.append(ov)
+ new_ov.append(portage._shell_quote(ov))
else:
writemsg(_("!!! Invalid PORTDIR_OVERLAY"
" (not a dir): '%s'\n") % ov, noiselevel=-1)
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 9db600e..00159a5 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -305,6 +305,7 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
if hasattr(mydbapi, 'repositories'):
repo = mydbapi.repositories.get_repo_for_location(mytree)
mysettings['PORTDIR'] = repo.eclass_db.porttrees[0]
+ mysettings['PORTAGE_ECLASS_LOCATIONS'] = repo.eclass_db.eclass_locations_string
mysettings['PORTAGE_REPOSITORIES'] = mydbapi.repositories.config_string()
mysettings.configdict["pkg"]["PORTAGE_REPO_NAME"] = repo.name
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-07-22 18:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-11 6:52 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, bin/, Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2012-01-08 6:22 Arfrever Frehtes Taifersar Arahesis
2012-08-29 16:28 Zac Medico
2012-11-16 4:38 Arfrever Frehtes Taifersar Arahesis
2013-07-13 5:33 Arfrever Frehtes Taifersar Arahesis
2013-07-22 18:08 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox