Commit 5f53aafe authored by Ben Cooksley's avatar Ben Cooksley

Copy all the files to the install directory instead.

This is some-what convoluted as Python doesn't have any methods for recursively copying into directories that already exist.

One unfortunate side affect of this is that if our Craft installation has a file it will always mask the one from the currently installed project.
Depending on how things go we may also need to copy over the contents of the dependency install prefix as well.

CCMAIL: kde-frameworks-devel@kde.org
parent 1f0836a6
import os
import sys
import shutil
import hashlib
import paramiko
......@@ -90,3 +91,23 @@ def establishSSHConnection( hostname, username, keyFile ):
client.connect( hostname, username=username, pkey = serverAccessKey )
# All done
return client
def recursiveDirectoryCopy(sourceDirectory, destinationDirectory):
# Copy a directory structure overwriting existing files
for root, dirs, files in os.walk(sourceDirectory):
# Ensure we have a relative path for root as we'll need it quite a bit shortly
currentDirectory = os.path.relpath( root, sourceDirectory )
# Make sure the directory exists in our destination
currentDestination = os.path.join( destinationDirectory, currentDirectory )
if not os.path.isdir(currentDestination):
os.makedirs(currentDestination)
# Now we can copy the various files within in turn
for fileToCopy in files:
# Determine the full path to the source file
fileSource = os.path.join(root, fileToCopy)
# Determine where to copy the file to
fileDestination = os.path.join(currentDestination, fileToCopy)
# Copy it!
shutil.copyfile( fileSource, fileDestination )
......@@ -49,17 +49,6 @@ dependenciesFile = os.path.join( CommonUtils.scriptsBaseDirectory(), 'local-meta
if os.path.exists( dependenciesFile ):
resolver.loadDependenciesFromFile( dependenciesFile )
# On Windows, we need to pull bin\data\ over from the Craft prefix to ensure resources in it can be found by QStandardPaths
# This has to be done first, as copytree requires the directory to not exist already
if sys.platform == 'win32' and 'CRAFT_ROOT' in os.environ:
# Determine where Craft is...
craftRoot = os.path.realpath(os.environ['CRAFT_ROOT'])
sourceDirectory = os.path.join( craftRoot, 'bin\data' )
# Determine where we want to deploy these files to
destinationDirectory = os.path.join( arguments.installTo, 'bin\data' )
# Do the copy!
shutil.copytree( sourceDirectory, destinationDirectory )
# Now that we are all initialised, we can ask the resolver for the project we represent, then resolve it's dependencies
resolverProject = resolver.retrieveProject( arguments.project )
projectDependencies = resolver.forProject( resolverProject, arguments.platform )
......
......@@ -38,6 +38,17 @@ if sys.platform == 'freebsd11':
# Then don't continue any further
sys.exit(0)
# On Windows, we need to pull bin\data\ over from the Craft prefix to ensure resources in it can be found by QStandardPaths
# This is a bit of a hack, but there isn't much we can do here as Qt doesn't give us any means of telling it to look elsewhere
if sys.platform == 'win32' and 'CRAFT_ROOT' in os.environ:
# Determine where Craft is...
craftRoot = os.path.realpath( os.environ['CRAFT_ROOT'] )
sourceDirectory = os.path.join( craftRoot, 'bin\data' )
# Determine where we want to deploy these files to
destinationDirectory = os.path.join( buildLocation, 'bin\data' )
# Do the copy!
CommonUtils.recursiveDirectoryCopy( sourceDirectory, destinationDirectory )
# Get a count of the number of available tests
# This relies on the command "ctest -N" producing at least one line that matches "Total Tests: x" where x is the number of tests
process = subprocess.Popen( "ctest -N", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, env=buildEnvironment, cwd=buildLocation)
......
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