diff options
author | 2014-09-03 23:01:34 +0200 | |
---|---|---|
committer | 2014-09-25 18:22:13 -0700 | |
commit | 9d507ee28c526662fc6ad3895a808df1814bfe01 (patch) | |
tree | cdef77a7df05acfe1aec485a92b07fc5cc0fb947 /bin/install-qa-check.d/60pngfix | |
parent | Re-apply "Rewrite default ebuild phase setting code" (bug 523182)" (diff) | |
download | portage-9d507ee28c526662fc6ad3895a808df1814bfe01.tar.gz portage-9d507ee28c526662fc6ad3895a808df1814bfe01.tar.bz2 portage-9d507ee28c526662fc6ad3895a808df1814bfe01.zip |
Split install_qa_check() into install-qa-check.d scripts
Convert the horrendous install_qa_check() function into a plug-in system
that calls separate QA checking scripts from install-qa-check.d.
Diffstat (limited to 'bin/install-qa-check.d/60pngfix')
-rw-r--r-- | bin/install-qa-check.d/60pngfix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/bin/install-qa-check.d/60pngfix b/bin/install-qa-check.d/60pngfix new file mode 100644 index 000000000..8d53040b6 --- /dev/null +++ b/bin/install-qa-check.d/60pngfix @@ -0,0 +1,35 @@ +# Check for issues with PNG files + +pngfix_check() { + 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 +} + +pngfix_check +: # guarantee successful exit + +# vim:ft=sh |