def METHOD_NAME (dstPath, repository, revision, filename, checksum, cacheDir):
	def writeFile (filename, data):
		f = open(filename, 'wt')
		f.write(data)
		f.close()
	if not os.path.exists(os.path.dirname(dstPath)):
		os.makedirs(os.path.dirname(dstPath))
	print("Fetching %s/%s@%s" % (repository, filename, revision))
	data		= checkoutFile(repository, revision, filename, cacheDir)
	gotChecksum	= computeChecksum(data)
	if checksum != gotChecksum:
		raise Exception("Checksum mismatch, expected %s, got %s" % (checksum, gotChecksum))
	writeFile(dstPath, data)