[gentoo-commits] proj/portage:master commit in: lib/portage/package/ebuild/, lib/portage/package/ebuild/_config/

2020-11-21 Thread Zac Medico
commit: 309e28b2da9a7e98039b45e7555833fe6a4bc2f9
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Nov  9 02:41:36 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Nov 22 00:45:46 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=309e28b2

emerge: Disable profile deprecation warning inheritance (bug 753497)

According to PMS, a deprecated profile warning is not inherited. Since
the current profile node may have been inherited by a user profile
node, the deprecation warning may be relevant even if it is not a
top-level profile node. Therefore, consider the deprecated warning
to be irrelevant when the current profile node belongs to the same
repo as the previous profile node.

Bug: https://bugs.gentoo.org/753497
Signed-off-by: Zac Medico  gentoo.org>

 .../package/ebuild/_config/LocationsManager.py | 30 --
 .../package/ebuild/deprecated_profile_check.py |  9 ---
 2 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/lib/portage/package/ebuild/_config/LocationsManager.py 
b/lib/portage/package/ebuild/_config/LocationsManager.py
index b90b9227c..327400ad6 100644
--- a/lib/portage/package/ebuild/_config/LocationsManager.py
+++ b/lib/portage/package/ebuild/_config/LocationsManager.py
@@ -30,7 +30,9 @@ _PORTAGE1_DIRECTORIES = frozenset([
 
 _profile_node = collections.namedtuple('_profile_node',
('location', 'portage1_directories', 'user_config',
-   'profile_formats', 'eapi', 'allow_build_id'))
+   'profile_formats', 'eapi', 'allow_build_id',
+   'show_deprecated_warning',
+))
 
 _allow_parent_colon = frozenset(
["portage-2"])
@@ -132,7 +134,7 @@ class LocationsManager:
if self.profile_path:
try:

self._addProfile(os.path.realpath(self.profile_path),
-   repositories, known_repos)
+   repositories, known_repos, ())
except ParseError as e:
if not portage._sync_mode:
writemsg(_("!!! Unable to parse 
profile: '%s'\n") % self.profile_path, noiselevel=-1)
@@ -154,7 +156,9 @@ class LocationsManager:
('profile-bashrcs', 'profile-set'),
read_corresponding_eapi_file(
custom_prof + os.sep, default=None),
-   True))
+   True,
+   show_deprecated_warning=False,
+   ))
del custom_prof
 
self.profiles = tuple(self.profiles)
@@ -167,7 +171,7 @@ class LocationsManager:
noiselevel=-1)
raise DirectoryNotFound(var)
 
-   def _addProfile(self, currentPath, repositories, known_repos):
+   def _addProfile(self, currentPath, repositories, known_repos, 
previous_repos):
current_abs_path = os.path.abspath(currentPath)
allow_directories = True
allow_parent_colon = True
@@ -176,8 +180,8 @@ class LocationsManager:
current_formats = ()
eapi = None
 
-   intersecting_repos = [x for x in known_repos
-   if current_abs_path.startswith(x[0])]
+   intersecting_repos = tuple(x for x in known_repos
+   if current_abs_path.startswith(x[0]))
if intersecting_repos:
# Handle nested repositories. The longest path
# will be the correct one.
@@ -214,6 +218,14 @@ class LocationsManager:
for x in layout_data['profile-formats'])
current_formats = tuple(layout_data['profile-formats'])
 
+   # According to PMS, a deprecated profile warning is not 
inherited. Since
+   # the current profile node may have been inherited by a user 
profile
+   # node, the deprecation warning may be relevant even if it is 
not a
+   # top-level profile node. Therefore, consider the deprecated 
warning
+   # to be irrelevant when the current profile node belongs to the 
same
+   # repo as the previous profile node.
+   show_deprecated_warning = \
+   tuple(x[0] for x in previous_repos) != tuple(x[0] for x 
in intersecting_repos)
 
if compat_mode:
offenders = 
_PORTAGE1_DIRECTORIES.intersection(os.listdir(currentPath))
@@ -256,7 +268,7 @@ class LocationsManager:
parentPath = 
os.path.realpath(parentPath)
 
if exists_raise_eaccess(parentPath):
-   

[gentoo-commits] proj/portage:master commit in: lib/portage/package/ebuild/, lib/portage/package/ebuild/_config/

2020-01-22 Thread Zac Medico
commit: 1b18d8257ecd6c8c8f10c711b41a2be0fe7d587f
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Jan 18 05:31:16 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Thu Jan 23 06:08:31 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1b18d825

doebuild: export SANDBOX_LOG=${T}/sandbox.log (bug 704848)

In order to avoid a SANDBOX_LOG collision with another process
having the same pid when pid-sandbox is enabled, export a
unique SANDBOX_LOG value. The ${T} directory is a convenient
location, since it is guaranteed to exist and be writable during
relevant ebuild phases.

Bug: https://bugs.gentoo.org/704848
Signed-off-by: Zac Medico  gentoo.org>

 lib/portage/package/ebuild/_config/special_env_vars.py | 4 ++--
 lib/portage/package/ebuild/doebuild.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/portage/package/ebuild/_config/special_env_vars.py 
b/lib/portage/package/ebuild/_config/special_env_vars.py
index 5e7ca6d47..dc01339f7 100644
--- a/lib/portage/package/ebuild/_config/special_env_vars.py
+++ b/lib/portage/package/ebuild/_config/special_env_vars.py
@@ -28,7 +28,7 @@ env_blacklist = frozenset((
"PORTAGE_INTERNAL_CALLER", "PORTAGE_IUSE",
"PORTAGE_NONFATAL", "PORTAGE_PIPE_FD", "PORTAGE_REPO_NAME",
"PORTAGE_USE", "PROPERTIES", "RDEPEND", "REPOSITORY",
-   "REQUIRED_USE", "RESTRICT", "ROOT", "SLOT", "SRC_URI", "_"
+   "REQUIRED_USE", "RESTRICT", "ROOT", "SANDBOX_LOG", "SLOT", "SRC_URI", 
"_"
 ))
 
 environ_whitelist = []
@@ -78,7 +78,7 @@ environ_whitelist += [
"PORTAGE_VERBOSE", "PORTAGE_WORKDIR_MODE", "PORTAGE_XATTR_EXCLUDE",
"PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", "PYTHONDONTWRITEBYTECODE",
"REPLACING_VERSIONS", "REPLACED_BY_VERSION",
-   "ROOT", "ROOTPATH", "SYSROOT", "T", "TMP", "TMPDIR",
+   "ROOT", "ROOTPATH", "SANDBOX_LOG", "SYSROOT", "T", "TMP", "TMPDIR",
"USE_EXPAND", "USE_ORDER", "WORKDIR",
"XARGS", "__PORTAGE_TEST_HARDLINK_LOCKS",
 ]

diff --git a/lib/portage/package/ebuild/doebuild.py 
b/lib/portage/package/ebuild/doebuild.py
index 584ff798b..92e9d755c 100644
--- a/lib/portage/package/ebuild/doebuild.py
+++ b/lib/portage/package/ebuild/doebuild.py
@@ -369,7 +369,6 @@ def doebuild_environment(myebuild, mydo, myroot=None, 
settings=None,
mysettings["RPMDIR"]  = os.path.realpath(mysettings["RPMDIR"])
 
mysettings["ECLASSDIR"]   = mysettings["PORTDIR"]+"/eclass"
-   mysettings["SANDBOX_LOG"] = mycpv.replace("/", "_-_")
 
mysettings["PORTAGE_BASHRC_FILES"] = "\n".join(mysettings._pbashrc)
 
@@ -407,6 +406,7 @@ def doebuild_environment(myebuild, mydo, myroot=None, 
settings=None,
mysettings["WORKDIR"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], 
"work")
mysettings["D"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "image") 
+ os.sep
mysettings["T"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "temp")
+   mysettings["SANDBOX_LOG"] = os.path.join(mysettings["T"], "sandbox.log")
mysettings["FILESDIR"] = os.path.join(settings["PORTAGE_BUILDDIR"], 
"files")
 
# Prefix forward compatability