aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-11-07 09:06:54 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-11-07 09:10:19 -0800
commitd43676658ac120cb9a0ce3df6a62e9ee0c3c4843 (patch)
tree5425f1dad818c94c857926479473e23b2c60499a /scripts
parent9d2f9739ae42425b25a685f04570590371b6e9bf (diff)
downloadvcpkg-d43676658ac120cb9a0ce3df6a62e9ee0c3c4843.tar.gz
vcpkg-d43676658ac120cb9a0ce3df6a62e9ee0c3c4843.zip
[vcpkg_from_github] Handle '/' in REFs. Fixes #2141.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_from_github.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake
index 1ede43fd8..5730ce39a 100644
--- a/scripts/cmake/vcpkg_from_github.cmake
+++ b/scripts/cmake/vcpkg_from_github.cmake
@@ -101,19 +101,22 @@ function(vcpkg_from_github)
message(FATAL_ERROR "Package does not specify REF. It must built using --head.")
endif()
+ string(REPLACE "/" "-" SANITIZED_REF "${_vdud_REF}")
+
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/${ORG_NAME}/${REPO_NAME}/archive/${_vdud_REF}.tar.gz"
SHA512 "${_vdud_SHA512}"
- FILENAME "${ORG_NAME}-${REPO_NAME}-${_vdud_REF}.tar.gz"
+ FILENAME "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}.tar.gz"
)
vcpkg_extract_source_archive_ex(ARCHIVE "${ARCHIVE}")
- set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src ${_vdud_REF})
+ set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src ${SANITIZED_REF})
return()
endif()
# The following is for --head scenarios
set(URL "https://github.com/${ORG_NAME}/${REPO_NAME}/archive/${_vdud_HEAD_REF}.tar.gz")
- set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${_vdud_HEAD_REF}.tar.gz")
+ string(REPLACE "/" "-" SANITIZED_HEAD_REF "${_vdud_HEAD_REF}")
+ set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_HEAD_REF}.tar.gz")
set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}")
if(_VCPKG_NO_DOWNLOADS)
@@ -161,5 +164,5 @@ function(vcpkg_from_github)
# exports VCPKG_HEAD_VERSION to the caller. This will get picked up by ports.cmake after the build.
set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE)
- set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${_vdud_HEAD_REF})
+ set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${SANITIZED_HEAD_REF})
endfunction()