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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4BBF61396D0 for ; Tue, 19 Sep 2017 23:39:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A6C181FC06B; Tue, 19 Sep 2017 23:39:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 77E981FC06B for ; Tue, 19 Sep 2017 23:39:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7B79333BEC7 for ; Tue, 19 Sep 2017 23:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 176E89086 for ; Tue, 19 Sep 2017 23:38:58 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1505863592.361f820b88deda2840396d11c8c8a462dfb435a7.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/postinst-qa-check.d/ X-VCS-Repository: proj/portage X-VCS-Files: bin/postinst-qa-check.d/50gnome2-utils bin/postinst-qa-check.d/50xdg-utils X-VCS-Directories: bin/postinst-qa-check.d/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 361f820b88deda2840396d11c8c8a462dfb435a7 X-VCS-Branch: master Date: Tue, 19 Sep 2017 23:38: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-Archives-Salt: f2ad8ae2-f041-4407-866b-8e90eb467803 X-Archives-Hash: de807e93131bcd688516a3a59419c294 commit: 361f820b88deda2840396d11c8c8a462dfb435a7 Author: Zac Medico gentoo org> AuthorDate: Tue Sep 19 23:10:04 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Sep 19 23:26:32 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=361f820b postinst-qa-check.d: fix false positive and expensive eqatag on first run When caches were missing, calls to eqatag could be prohibitively expensive when a large number of files where found. Those files did not necessaryily belong to the current package, so it was also a false positive. Bug: https://bugs.gentoo.org/631454 bin/postinst-qa-check.d/50gnome2-utils | 8 +++++--- bin/postinst-qa-check.d/50xdg-utils | 16 ++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/bin/postinst-qa-check.d/50gnome2-utils b/bin/postinst-qa-check.d/50gnome2-utils index 077a04918..eb045ea78 100644 --- a/bin/postinst-qa-check.d/50gnome2-utils +++ b/bin/postinst-qa-check.d/50gnome2-utils @@ -1,7 +1,7 @@ # check for missing calls to gnome2-utils regen functions gnome2_icon_cache_check() { - local d f all_files=() find_args + local d f all_files=() find_args missing for d in usr/share/icons/*/; do # gnome2_icon_cache_update updates only themes with an index [[ -f ${d}/index.theme ]] || continue @@ -15,7 +15,7 @@ gnome2_icon_cache_check() { # if the cache does not exist at all, we complain for any file # otherwise, we look for files newer than the cache [[ -f ${d}/icon-theme.cache ]] && - find_args+=( -newercm "${d}"/icon-theme.cache ) + find_args+=( -newercm "${d}"/icon-theme.cache ) || missing=1 # (use -mindepth 2 to easily skip the cache files) while read -r -d $'\0' f; do @@ -33,7 +33,9 @@ gnome2_icon_cache_check() { fi done - if [[ ${all_files[@]} ]]; then + # The eqatag call is prohibitively expensive if the cache is + # missing and there are a large number of files. + if [[ -z missing && ${all_files[@]} ]]; then eqawarn "QA Notice: new icons were found installed but GTK+ icon cache" eqawarn "has not been updated:" eqatag -v gnome2-utils.icon-cache "${all_files[@]/#//}" diff --git a/bin/postinst-qa-check.d/50xdg-utils b/bin/postinst-qa-check.d/50xdg-utils index 410aceb88..ca4b49fe4 100644 --- a/bin/postinst-qa-check.d/50xdg-utils +++ b/bin/postinst-qa-check.d/50xdg-utils @@ -1,7 +1,7 @@ # check for missing calls to xdg-utils regen functions xdg_desktop_database_check() { - local d f files=() + local d f files=() missing for d in usr/share/applications; do [[ -d ${d} ]] || continue @@ -9,7 +9,7 @@ xdg_desktop_database_check() { # if the cache does not exist at all, we complain for any file # otherwise, we look for files newer than the cache [[ -f ${d}/mimeinfo.cache ]] && - find_args+=( -newercm "${d}"/mimeinfo.cache ) + find_args+=( -newercm "${d}"/mimeinfo.cache ) || missing=1 # look for any .desktop files that are newer than the cache # and that have any mime types defined @@ -29,7 +29,9 @@ xdg_desktop_database_check() { fi done - if [[ ${all_files[@]} ]]; then + # The eqatag call is prohibitively expensive if the cache is + # missing and there are a large number of files. + if [[ -z ${missing} && ${all_files[@]} ]]; then eqawarn "QA Notice: .desktop files with MimeType= were found installed" eqawarn "but desktop mimeinfo cache has not been updated:" eqatag -v xdg-utils.desktop "${all_files[@]/#//}" @@ -39,7 +41,7 @@ xdg_desktop_database_check() { } xdg_mimeinfo_database_check() { - local d f files=() + local d f files=() missing for d in usr/share/mime; do [[ -d ${d} ]] || continue @@ -47,7 +49,7 @@ xdg_mimeinfo_database_check() { # if the cache does not exist at all, we complain for any file # otherwise, we look for files newer than the cache [[ -f ${d}/mime.cache ]] && - find_args+=( -newercm "${d}"/mime.cache ) + find_args+=( -newercm "${d}"/mime.cache ) || missing=1 while read -r -d $'\0' f; do files+=( "${f}" ) @@ -64,7 +66,9 @@ xdg_mimeinfo_database_check() { fi done - if [[ ${all_files[@]} ]]; then + # The eqatag call is prohibitively expensive if the cache is + # missing and there are a large number of files. + if [[ -z ${missing} && ${all_files[@]} ]]; then eqawarn "QA Notice: mime-info files were found installed but mime-info" eqawarn "cache has not been updated:" eqatag -v xdg-utils.mime-info "${all_files[@]/#//}"