Commit 0fa52ae0 authored by Ben Cooksley's avatar Ben Cooksley

To ensure we have a proper mime setup, run update-mime-database as part of the...

To ensure we have a proper mime setup, run update-mime-database as part of the preparation to run tests.
Otherwise we'll end up with an inconsistent mime database which has missing types
parent 9a0fffe6
......@@ -50,25 +50,5 @@ try:
except Exception:
sys.exit(1)
# Do we need to run update-mime-database?
# First let's determine the appropriate prefix...
# This will differ depending on whether we are diverting the install or not
installRoot = arguments.installTo
if arguments.divertTo != None:
installRoot = os.path.join( arguments.divertTo, CommonUtils.makePathRelative(arguments.installTo) )
# Determine what mime directory we will have
# On most platforms this will be $prefix/share/mime
mimeDirectory = os.path.join( installRoot, 'share', 'mime' )
# Except on Windows... where it is bin/data/mime/
if sys.platform == 'win32':
mimeDirectory = os.path.join( installRoot, 'bin', 'data', 'mime' )
# Make sure the mime directory exists - otherwise there is no point to running update-mime-database
if os.path.exists( mimeDirectory ):
# Let's run update-mime-database
commandToRun = BuildSystem.substituteCommandTokens( 'update-mime-database "' + mimeDirectory + '"' )
subprocess.check_call( commandToRun, stdout=sys.stdout, stderr=sys.stderr, shell=True, env=buildEnvironment )
# The project was installed successfully
sys.exit(0)
......@@ -101,6 +101,20 @@ if buildSpecification['launch-dbus-session'] and ( sys.platform != 'win32' and s
splitVars = variable.split('=', 1)
buildEnvironment[ splitVars[0] ] = splitVars[1].strip()
# Do we need to run update-mime-database?
# First we need to determine what mime directory we will have
# On most platforms this will be $prefix/share/mime
mimeDirectory = os.path.join( arguments.usingInstall, 'share', 'mime' )
# Except on Windows... where it is bin/data/mime/
if sys.platform == 'win32':
mimeDirectory = os.path.join( arguments.usingInstall, 'bin', 'data', 'mime' )
# Make sure the mime directory exists - otherwise there is no point to running update-mime-database
if os.path.exists( mimeDirectory ):
# Let's run update-mime-database
commandToRun = BuildSystem.substituteCommandTokens( 'update-mime-database "' + mimeDirectory + '"' )
subprocess.check_call( commandToRun, stdout=sys.stdout, stderr=sys.stderr, shell=True, env=buildEnvironment )
# KDE Tests often need kdeinit running, in order to have klauncher, kded, etc available so let's spawn those now
# This is the case regardless of the platform
commandToRun = 'kdeinit5'
......
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