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/portage/util/_dyn_libs/
Date: Thu, 28 Oct 2021 04:52:42
Message-Id: 1635396738.cba2156dba89a22f2858238013469b4d80208854.sam@gentoo
1 commit: cba2156dba89a22f2858238013469b4d80208854
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:18 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=cba2156d
7
8 portage/util/_dyn_libs/dyn_libs.py: add helper
9
10 Needed for binpkg/image verification commits coming...
11
12 Bug: https://bugs.gentoo.org/811462
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 lib/portage/util/_dyn_libs/dyn_libs.py | 23 +++++++++++++++++++++++
16 1 file changed, 23 insertions(+)
17
18 diff --git a/lib/portage/util/_dyn_libs/dyn_libs.py b/lib/portage/util/_dyn_libs/dyn_libs.py
19 new file mode 100644
20 index 000000000..2a014812c
21 --- /dev/null
22 +++ b/lib/portage/util/_dyn_libs/dyn_libs.py
23 @@ -0,0 +1,23 @@
24 +# Copyright 2021 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +import glob
28 +
29 +from portage.output import colorize
30 +
31 +
32 +def check_dyn_libs_inconsistent(directory, provides):
33 + """Checks directory for whether any dynamic libraries were installed and
34 + if PROVIDES corresponds."""
35 +
36 + # Let's check if we've got inconsistent results.
37 + # If we're installing dynamic libraries (.so files), we should
38 + # really have a PROVIDES.
39 + # (This is a complementary check at the point of ingestion for the
40 + # creation check in doebuild.py)
41 + # Note: we could check a non-empty PROVIDES against the list of .sos,
42 + # but this doesn't gain us anything. We're interested in failure
43 + # to properly parse the installed files at all, which should really
44 + # be a global problem (e.g. bug #811462)
45 + installed_dynlibs = glob.glob(directory + "/**/*.so", recursive=True)
46 + return installed_dynlibs and not provides