Commit 25979e78 authored by Ben Cooksley's avatar Ben Cooksley

Add tooling to run update-mime-database

parent 7d29ee17
......@@ -50,5 +50,25 @@ 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.divertedTo, CommonUtils.makePathRelative(arguments.installedTo) )
# 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.call( shlex.split(command), stdout=sys.stdout, stderr=sys.stderr, env=buildEnvironment )
# The project was installed successfully
sys.exit(0)
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