Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: lib/_emerge/
Date: Thu, 28 Oct 2021 04:52:43
Message-Id: 1635396752.216e962ae494e8291b667665007d045788b3e391.sam@gentoo
1 commit: 216e962ae494e8291b667665007d045788b3e391
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 28 04:40:09 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 28 04:52:32 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=216e962a
7
8 Binpkg.py: check for inconsistent PROVIDES/image when unpacking binpkg
9
10 This is part of a series of fixes for the linked bug (failure
11 to preserve libraries in some situations).
12
13 When unpacking a binpkg to be installed, we should check
14 for the existence of PROVIDES if we're installing any
15 dynamic libraries. If PROVIDES does not exist in that case,
16 this suggests that e.g. scanelf malfunctioned or some corruption occurred.
17
18 Bug: https://bugs.gentoo.org/811462
19 Signed-off-by: Sam James <sam <AT> gentoo.org>
20
21 lib/_emerge/Binpkg.py | 15 ++++++++++++++-
22 1 file changed, 14 insertions(+), 1 deletion(-)
23
24 diff --git a/lib/_emerge/Binpkg.py b/lib/_emerge/Binpkg.py
25 index c7dde69bd..001283611 100644
26 --- a/lib/_emerge/Binpkg.py
27 +++ b/lib/_emerge/Binpkg.py
28 @@ -2,7 +2,6 @@
29 # Distributed under the terms of the GNU General Public License v2
30
31 import functools
32 -
33 import _emerge.emergelog
34 from _emerge.EbuildPhase import EbuildPhase
35 from _emerge.BinpkgFetcher import BinpkgFetcher
36 @@ -13,8 +12,10 @@ from _emerge.EbuildMerge import EbuildMerge
37 from _emerge.EbuildBuildDir import EbuildBuildDir
38 from _emerge.SpawnProcess import SpawnProcess
39 from portage.eapi import eapi_exports_replace_vars
40 +from portage.output import colorize
41 from portage.util import ensure_dirs
42 from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
43 +from portage.util._dyn_libs.dyn_libs import check_dyn_libs_inconsistent
44 import portage
45 from portage import os
46 from portage import shutil
47 @@ -425,6 +426,18 @@ class Binpkg(CompositeTask):
48 self._async_unlock_builddir(returncode=self.returncode)
49 return
50
51 + # Before anything else, let's do an integrity check.
52 + (provides,) = self._bintree.dbapi.aux_get(self.pkg.cpv, ["PROVIDES"])
53 + if check_dyn_libs_inconsistent(self.settings["D"], provides):
54 + self._writemsg_level(
55 + colorize(
56 + "BAD",
57 + "!!! Error! Installing dynamic libraries (.so) with blank PROVIDES!",
58 + ),
59 + noiselevel=-1,
60 + level=logging.ERROR,
61 + )
62 +
63 try:
64 with io.open(
65 _unicode_encode(