Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH v2] QA: use pngfix to find broken PNG files.
Date: Wed, 06 Aug 2014 21:05:12
Message-Id: 1407359137-18741-1-git-send-email-mgorny@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] QA: use pngfix to find broken PNG files. by Sergei Trofimovich
1 ---
2 bin/misc-functions.sh | 27 +++++++++++++++++++++++++++
3 1 file changed, 27 insertions(+)
4
5 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
6 index f24e78c..5477e9c 100755
7 --- a/bin/misc-functions.sh
8 +++ b/bin/misc-functions.sh
9 @@ -875,6 +875,33 @@ install_qa_check() {
10
11 [[ ${abort} == yes ]] && die "multilib-strict check failed!"
12 fi
13 +
14 + local pngfix=$(type -P pngfix)
15 + if [[ -n ${pngfix} ]] ; then
16 + local pngout=()
17 + local next
18 +
19 + while read -r -a pngout ; do
20 + local error
21 +
22 + case "${pngout[1]}" in
23 + CHK)
24 + error='invalid checksum'
25 + ;;
26 + TFB)
27 + error='broken IDAT window length'
28 + ;;
29 + esac
30 +
31 + if [[ -n ${error} ]] ; then
32 + if [[ -z ${next} ]] ; then
33 + eqawarn "QA Notice: broken .png files found:"
34 + next=1
35 + fi
36 + eqawarn " ${pngout[@]:7}: ${error}"
37 + fi
38 + done < <(find "${ED}" -name '*.png' -exec "${pngfix}" {} +)
39 + fi
40 }
41
42 install_qa_check_prefix() {
43 --
44 2.0.4