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] QA: use pngfix to find broken PNG files.
Date: Sat, 26 Jul 2014 06:50:39
Message-Id: 1406357443-12775-1-git-send-email-mgorny@gentoo.org
1 ---
2 bin/misc-functions.sh | 26 ++++++++++++++++++++++++++
3 1 file changed, 26 insertions(+)
4
5 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
6 index f24e78c..0a8ece0 100755
7 --- a/bin/misc-functions.sh
8 +++ b/bin/misc-functions.sh
9 @@ -875,6 +875,32 @@ 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 + fi
35 + eqawarn " ${pngout[@]:7}: ${error}"
36 + fi
37 + done < <(find "${ED}" -name '*.png' -exec "${pngfix}" {} +)
38 + fi
39 }
40
41 install_qa_check_prefix() {
42 --
43 2.0.2

Replies