From 98e84ba7b3939f314f61a2e1f4ce756e5cdb4009 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Wed, 9 Apr 2014 13:54:35 +0200 Subject: QA: Use pngfix to find broken PNG files Acked-by: Alexander Berntsen Acked-by: Brian Dolbec Reviewed-by: Justin Lecher Reviewed-by: Sergei Trofimovich --- bin/misc-functions.sh | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'bin/misc-functions.sh') diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 5ccf7c224..4e0f1fcb2 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # # Miscellaneous shell functions that make use of the ebuild env but don't need @@ -860,6 +860,33 @@ install_qa_check() { [[ ${abort} == yes ]] && die "multilib-strict check failed!" fi + + local pngfix=$(type -P pngfix) + if [[ -n ${pngfix} ]] ; then + local pngout=() + local next + + while read -r -a pngout ; do + local error + + case "${pngout[1]}" in + CHK) + error='invalid checksum' + ;; + TFB) + error='broken IDAT window length' + ;; + esac + + if [[ -n ${error} ]] ; then + if [[ -z ${next} ]] ; then + eqawarn "QA Notice: broken .png files found:" + next=1 + fi + eqawarn " ${pngout[@]:7}: ${error}" + fi + done < <(find "${ED}" -type f -name '*.png' -exec "${pngfix}" {} +) + fi } install_qa_check_prefix() { -- cgit v1.2.3-65-gdbad