From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A4C98158090 for ; Sat, 7 May 2022 17:16:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A4798E07D4; Sat, 7 May 2022 17:16:01 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7845DE07D4 for ; Sat, 7 May 2022 17:16:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5F5AC34177C for ; Sat, 7 May 2022 17:16:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 74534430 for ; Sat, 7 May 2022 17:15:58 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1651943480.2c25a3a6e88f32d94c63ab38baa34f2d79a2699e.floppym@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/ X-VCS-Repository: proj/portage X-VCS-Files: bin/install-qa-check.d/60pkgconfig X-VCS-Directories: bin/install-qa-check.d/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: 2c25a3a6e88f32d94c63ab38baa34f2d79a2699e X-VCS-Branch: master Date: Sat, 7 May 2022 17:15:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9d57c7d9-a312-4b32-81a2-35d70e18ba68 X-Archives-Hash: aef365ff27fbd7a561f91dfdfdf7815a commit: 2c25a3a6e88f32d94c63ab38baa34f2d79a2699e Author: Mike Gilbert gentoo org> AuthorDate: Tue Apr 26 19:22:10 2022 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Sat May 7 17:11:20 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=2c25a3a6 install-qa-check.d/60pkgconfig: add QA_PKGCONFIG_VERSION This allows ebuild maintainers to override the expected version in the .pc file when it differs from ${PV}. Signed-off-by: Mike Gilbert gentoo.org> bin/install-qa-check.d/60pkgconfig | 43 +++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/bin/install-qa-check.d/60pkgconfig b/bin/install-qa-check.d/60pkgconfig index 58f533e83..25143275f 100644 --- a/bin/install-qa-check.d/60pkgconfig +++ b/bin/install-qa-check.d/60pkgconfig @@ -92,25 +92,34 @@ pkgconfig_check() { # about, while avoiding any pathological cases e.g. multiple libraries # with different versioning within one package. # Example bugs: bug #833895, bug #833887. - local all_bad=yes - # Record the last bad file matched - local bad_file - for f in "${files[@]}" ; do - if [[ ${PV} == $(pkg-config --modversion "${f}") ]] ; then - all_bad=no - break - fi - bad_file="${f//${D}}" - done + # Default to PV if QA_PKGCONFIG_VERSION is unset. + if [[ -z ${QA_PKGCONFIG_VERSION+set} ]]; then + local QA_PKGCONFIG_VERSION=${PV} + fi + + # Skip the check if QA_PKGCONFIG_VERSION is set to empty string. + if [[ -n ${QA_PKGCONFIG_VERSION} ]]; then + local all_bad=yes + # Record the last bad file matched + local bad_file + for f in "${files[@]}" ; do + if [[ ${QA_PKGCONFIG_VERSION} == $(pkg-config --modversion "${f}") ]] ; then + all_bad=no + break + fi - # Skip result reporting if *_p* because for both _pN and _preN, we - # don't generally expect the versions to be exactly accurate, and - # we want to avoid false positives. - if [[ ${all_bad} == "yes" && ${PV} != *_p* ]] && ! has live ${PROPERTIES} ; then - eqawarn "QA Notice: pkg-config files with mismatched Version found!" - eqawarn "At least ${bad_file}'s Version field does not match ${PV}" - eqawarn "Please check all .pc files installed by this package." + bad_file="${f//${D}}" + done + + # Skip result reporting if *_p* because for both _pN and _preN, we + # don't generally expect the versions to be exactly accurate, and + # we want to avoid false positives. + if [[ ${all_bad} == "yes" && ${PV} != *_p* ]] && ! has live ${PROPERTIES} ; then + eqawarn "QA Notice: pkg-config files with mismatched Version found!" + eqawarn "At least ${bad_file}'s Version field does not match ${PV}" + eqawarn "Please check all .pc files installed by this package." + fi fi }