Commit b1662f0c authored by Salamandar's avatar Salamandar Committed by Bastien Nocera

build: Add script that prints stats on generic icons

Replaces the shell in Makefile.am
parent 515a8db5
......@@ -37,7 +37,8 @@ EXTRA_DIST = \
$(ITS_FILES) \
shared-mime-info.pc.in \
data/freedesktop_generate.sh \
po/check_translations.sh
po/check_translations.sh \
tests/test_generic_icons.sh
CLEANFILES = freedesktop.org.xml po/stamp-it
......@@ -133,8 +134,7 @@ else
echo "*************************************************************" ; \
exit 1 ; \
fi
@echo Number of mime-types that might need generic-icon: `grep "mime-type type=" $(srcdir)/data/freedesktop.org.xml.in | grep -v video/ | grep -v image/ | grep -v text/ | grep -v audio/ | grep -v "octet-stream" | wc -l` ; \
echo Number of mime-types with a generic icon: `grep "generic-icon name=" $(srcdir)/data/freedesktop.org.xml.in | wc -l` ;
@$(srcdir)/tests/test_generic_icons.sh $(srcdir)/data/freedesktop.org.xml.in
endif
check-translations:
......
#!/usr/bin/env bash
xml_db_file="${1}"
generic_icons_required=$(
grep "mime-type type=" "${xml_db_file}" \
| grep -cv 'video/|image/|text/|audio/|octet-stream'
)
generic_icons_present=$(
grep -c "generic-icon name=" "${xml_db_file}"
)
echo "Number of mime-types that might need generic-icon: ${generic_icons_required}"
echo "Number of mime-types with a generic icon: ${generic_icons_present}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment