Fix issue with change_directory action where the target folder would be appended to the full path twice.

This commit is contained in:
Dave Bouvier
2013-06-25 10:44:27 -04:00
parent 6ee2422648
commit a07cfa6228
@@ -313,9 +313,8 @@ def install_and_build_package( app, tool_dependency, actions_dict ):
extract = action_dict.get( 'extract', False )
common_util.url_download( current_dir, filename, url, extract=extract )
elif action_type == 'change_directory':
target_directory = os.path.realpath( os.path.join( current_dir, dir, action_dict[ 'directory' ] ) )
current_working_dir = os.path.realpath( dir )
if target_directory.startswith( current_working_dir ) and os.path.exists( target_directory ):
target_directory = os.path.realpath( os.path.join( current_dir, action_dict[ 'directory' ] ) )
if target_directory.startswith( os.path.realpath( current_dir ) ) and os.path.exists( target_directory ):
dir = target_directory
else:
log.error( 'Invalid or nonexistent directory %s specified, ignoring change_directory action.', target_directory )