From 1237e57e6b0c5d643aaca5784ab257f657846e28 Mon Sep 17 00:00:00 2001 From: antoine Date: Tue, 8 Apr 2014 16:50:13 +0000 Subject: Rewrite the sharedmimeinfo qa check so that it doesn't produce a false positive on misc/shared-mime-info With help from: bdrewery With hat: portmgr --- Mk/Scripts/qa.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'Mk') diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh index 5e73c45336a3..172079809439 100644 --- a/Mk/Scripts/qa.sh +++ b/Mk/Scripts/qa.sh @@ -114,11 +114,18 @@ desktopfileutils() { } sharedmimeinfo() { - if [ -z "${USESSHAREDMIMEINFO}" ]; then - find ${STAGEDIR}${PREFIX}/share/mime/packages/*.xml ! -name "freedesktop\.org\.xml" -quit 2>/dev/null && + local f found + + found=0 + for f in ${STAGEDIR}${PREFIX}/share/mime/packages/*.xml; do + [ "${f}" = "${STAGEDIR}${PREFIX}/share/mime/packages/*.xml" ] && break #no matches + [ "${f}" = "${STAGEDIR}${PREFIX}/share/mime/packages/freedesktop.org.xml" ] && continue + found=1 + break + done + if [ -z "${USESSHAREDMIMEINFO}" -a ${found} -eq 1 ]; then warn "you need USES=shared-mime-info" - else - find ${STAGEDIR}${PREFIX}/share/mime/packages/*.xml ! -name "freedesktop\.org\.xml" -quit 2>/dev/null || + elif [ -n "${USESSHAREDMIMEINFO}" -a ${found} -eq 0 ]; then warn "you may not need USES=shared-mime-info" fi return 0 -- cgit