ExternalProject: No svn --username if empty (#11173)

Nor --password. But please do if non-empty. Thank you.
This commit is contained in:
David Cole 2010-10-22 16:09:07 -04:00
parent 91b5bc3efa
commit 6e1282f840
1 changed files with 16 additions and 2 deletions

View File

@ -985,8 +985,15 @@ function(_ep_add_download_command name)
get_filename_component(src_name "${source_dir}" NAME) get_filename_component(src_name "${source_dir}" NAME)
get_filename_component(work_dir "${source_dir}" PATH) get_filename_component(work_dir "${source_dir}" PATH)
set(comment "Performing download step (SVN checkout) for '${name}'") set(comment "Performing download step (SVN checkout) for '${name}'")
set(svn_user_pw_args "")
if(svn_username)
set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}")
endif()
if(svn_password)
set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}")
endif()
set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision} set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision}
--username=${svn_username} --password=${svn_password} ${src_name}) ${svn_user_pw_args} ${src_name})
list(APPEND depends ${stamp_dir}/${name}-svninfo.txt) list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
elseif(git_repository) elseif(git_repository)
find_package(Git) find_package(Git)
@ -1125,8 +1132,15 @@ function(_ep_add_update_command name)
get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION) get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION)
get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME) get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME)
get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD) get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD)
set(svn_user_pw_args "")
if(svn_username)
set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}")
endif()
if(svn_password)
set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}")
endif()
set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision} set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision}
--username=${svn_username} --password=${svn_password}) ${svn_user_pw_args})
set(always 1) set(always 1)
elseif(git_repository) elseif(git_repository)
if(NOT GIT_EXECUTABLE) if(NOT GIT_EXECUTABLE)