Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/
Date: Sat, 07 May 2022 17:16:02
Message-Id: 1651943480.2c25a3a6e88f32d94c63ab38baa34f2d79a2699e.floppym@gentoo
1 commit: 2c25a3a6e88f32d94c63ab38baa34f2d79a2699e
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 26 19:22:10 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sat May 7 17:11:20 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=2c25a3a6
7
8 install-qa-check.d/60pkgconfig: add QA_PKGCONFIG_VERSION
9
10 This allows ebuild maintainers to override the expected version in the
11 .pc file when it differs from ${PV}.
12
13 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
14
15 bin/install-qa-check.d/60pkgconfig | 43 +++++++++++++++++++++++---------------
16 1 file changed, 26 insertions(+), 17 deletions(-)
17
18 diff --git a/bin/install-qa-check.d/60pkgconfig b/bin/install-qa-check.d/60pkgconfig
19 index 58f533e83..25143275f 100644
20 --- a/bin/install-qa-check.d/60pkgconfig
21 +++ b/bin/install-qa-check.d/60pkgconfig
22 @@ -92,25 +92,34 @@ pkgconfig_check() {
23 # about, while avoiding any pathological cases e.g. multiple libraries
24 # with different versioning within one package.
25 # Example bugs: bug #833895, bug #833887.
26 - local all_bad=yes
27 - # Record the last bad file matched
28 - local bad_file
29 - for f in "${files[@]}" ; do
30 - if [[ ${PV} == $(pkg-config --modversion "${f}") ]] ; then
31 - all_bad=no
32 - break
33 - fi
34
35 - bad_file="${f//${D}}"
36 - done
37 + # Default to PV if QA_PKGCONFIG_VERSION is unset.
38 + if [[ -z ${QA_PKGCONFIG_VERSION+set} ]]; then
39 + local QA_PKGCONFIG_VERSION=${PV}
40 + fi
41 +
42 + # Skip the check if QA_PKGCONFIG_VERSION is set to empty string.
43 + if [[ -n ${QA_PKGCONFIG_VERSION} ]]; then
44 + local all_bad=yes
45 + # Record the last bad file matched
46 + local bad_file
47 + for f in "${files[@]}" ; do
48 + if [[ ${QA_PKGCONFIG_VERSION} == $(pkg-config --modversion "${f}") ]] ; then
49 + all_bad=no
50 + break
51 + fi
52
53 - # Skip result reporting if *_p* because for both _pN and _preN, we
54 - # don't generally expect the versions to be exactly accurate, and
55 - # we want to avoid false positives.
56 - if [[ ${all_bad} == "yes" && ${PV} != *_p* ]] && ! has live ${PROPERTIES} ; then
57 - eqawarn "QA Notice: pkg-config files with mismatched Version found!"
58 - eqawarn "At least ${bad_file}'s Version field does not match ${PV}"
59 - eqawarn "Please check all .pc files installed by this package."
60 + bad_file="${f//${D}}"
61 + done
62 +
63 + # Skip result reporting if *_p* because for both _pN and _preN, we
64 + # don't generally expect the versions to be exactly accurate, and
65 + # we want to avoid false positives.
66 + if [[ ${all_bad} == "yes" && ${PV} != *_p* ]] && ! has live ${PROPERTIES} ; then
67 + eqawarn "QA Notice: pkg-config files with mismatched Version found!"
68 + eqawarn "At least ${bad_file}'s Version field does not match ${PV}"
69 + eqawarn "Please check all .pc files installed by this package."
70 + fi
71 fi
72 }