svn commit: r330020 - in head/Mk: . Scripts

Antoine Brodin antoine at FreeBSD.org
Thu Oct 10 17:09:34 UTC 2013


Author: antoine
Date: Thu Oct 10 17:09:33 2013
New Revision: 330020
URL: http://svnweb.freebsd.org/changeset/ports/330020

Log:
  Add two QA tests for staged ports:
  - check for desktop files handling MIME types
  - check for share MIME-Info database
  
  Approved by:	portmgr (bapt)

Modified:
  head/Mk/Scripts/qa.sh
  head/Mk/bsd.stage.mk

Modified: head/Mk/Scripts/qa.sh
==============================================================================
--- head/Mk/Scripts/qa.sh	Thu Oct 10 16:56:42 2013	(r330019)
+++ head/Mk/Scripts/qa.sh	Thu Oct 10 17:09:33 2013	(r330020)
@@ -71,7 +71,27 @@ stripped() {
 	done
 }
 
-checks="shebang symlinks paths stripped"
+desktopfileutils() {
+	if [ -z "${USESDESKTOPFILEUTILS}" ]; then
+		grep -q MimeType= ${STAGEDIR}${PREFIX}/share/applications/*.desktop 2>/dev/null &&
+		warn "you need USES=desktop-file-utils"
+	else
+		grep -q MimeType= ${STAGEDIR}${PREFIX}/share/applications/*.desktop 2>/dev/null ||
+		warn "you may not need USES=desktop-file-utils"
+	fi
+}
+
+sharedmimeinfo() {
+	if [ -z "${USESSHAREDMIMEINFO}" ]; then
+		find ${STAGEDIR}${PREFIX}/share/mime/packages/*.xml ! -name "freedesktop\.org\.xml" -quit 2>/dev/null &&
+		warn "you need USES=shared-mime-info"
+	else
+		find ${STAGEDIR}${PREFIX}/share/mime/packages/*.xml ! -name "freedesktop\.org\.xml" -quit 2>/dev/null ||
+		warn "you may not need USES=shared-mime-info"
+	fi
+}
+
+checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo"
 
 ret=0
 cd ${STAGEDIR}

Modified: head/Mk/bsd.stage.mk
==============================================================================
--- head/Mk/bsd.stage.mk	Thu Oct 10 16:56:42 2013	(r330019)
+++ head/Mk/bsd.stage.mk	Thu Oct 10 17:09:33 2013	(r330020)
@@ -7,7 +7,9 @@ DESTDIRNAME?=	DESTDIR
 
 MAKE_ARGS+=	${DESTDIRNAME}=${STAGEDIR}
 QA_ENV+=		STAGEDIR=${STAGEDIR} PREFIX=${PREFIX} \
-		LOCALBASE=${LOCALBASE}
+		LOCALBASE=${LOCALBASE} \
+		USESDESKTOPFILEUTILS=${USES:Mdesktop-file-utils} \
+		USESSHAREDMIMEINFO=${USES:Mshared-mime-info}
 
 .if !target(stage-dir)
 stage-dir:


More information about the svn-ports-head mailing list