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 84676158094 for ; Wed, 10 Aug 2022 04:52:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C4209E0D77; Wed, 10 Aug 2022 04:36:52 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 902BAE0D76 for ; Wed, 10 Aug 2022 04:36:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9808A340E0F for ; Wed, 10 Aug 2022 04:36:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1D3D3559 for ; Wed, 10 Aug 2022 04:36:50 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1660106206.4be2288e5e34cbcf59e92d5ad2d3763a1475a09d.sam@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: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 4be2288e5e34cbcf59e92d5ad2d3763a1475a09d X-VCS-Branch: master Date: Wed, 10 Aug 2022 04:36:50 +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: 51c3b1d2-2e1c-4605-84fe-3b31e99f0a34 X-Archives-Hash: 9f7e057864bbf92dcf2d21a2a59dcc7f commit: 4be2288e5e34cbcf59e92d5ad2d3763a1475a09d Author: Florian Schmaus gentoo org> AuthorDate: Sat Jul 30 08:49:06 2022 +0000 Commit: Sam James gentoo org> CommitDate: Wed Aug 10 04:36:46 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4be2288e install-qa-check.d/60pkgconfig: improve pkg-config version check Make the pkg-config .pc-file version check display the actual found version and hint towards the QA_PKGCONFIG_VERSION variable. Signed-off-by: Florian Schmaus gentoo.org> Signed-off-by: Sam James gentoo.org> bin/install-qa-check.d/60pkgconfig | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/bin/install-qa-check.d/60pkgconfig b/bin/install-qa-check.d/60pkgconfig index 54122fe61..e95746505 100644 --- a/bin/install-qa-check.d/60pkgconfig +++ b/bin/install-qa-check.d/60pkgconfig @@ -104,15 +104,19 @@ pkgconfig_check() { # 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 + local -A bad_files for f in "${files[@]}" ; do - if [[ ${QA_PKGCONFIG_VERSION} == $(pkg-config --modversion "${f}") ]] ; then + local file_version=$(pkg-config --modversion "${f}") + if [[ ${QA_PKGCONFIG_VERSION} == ${file_version} ]] ; then all_bad=no break fi - bad_file="${f//${D}}" + # Record a special value if the .pc file has no version set at all. + if [[ -z ${file_version} ]] ; then + file_version="" + fi + bad_files["${f//${D}}"]="${file_version}" done # Skip result reporting if *_p* because for both _pN and _preN, we @@ -120,8 +124,15 @@ pkgconfig_check() { # 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 "The Version field of the following files does not match ${PV}" + local bad_file + for bad_file in "${!bad_files[@]}"; do + local bad_file_version="${bad_files[${bad_file}]}" + eqawarn "- ${bad_file}: ${bad_file_version}" + done eqawarn "Please check all .pc files installed by this package." + eqawarn "You can use QA_PKGCONFIG_VERSION to set the expected version," + eqawarn "or set to the empty string to disable this QA check." fi fi }