diff options
| author | ras0219 <533828+ras0219@users.noreply.github.com> | 2020-11-30 09:50:42 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-30 09:50:42 -0800 |
| commit | 7c080309821ddd58e72e2f669fb61c0863d5736b (patch) | |
| tree | ea8ad92166ff1f6c93faad040b4404547ea25416 /scripts | |
| parent | 666589a27d486240f72527754e133e0e2989e31d (diff) | |
| download | vcpkg-7c080309821ddd58e72e2f669fb61c0863d5736b.tar.gz vcpkg-7c080309821ddd58e72e2f669fb61c0863d5736b.zip | |
[vcpkg_apply_patches] Work around /etc/gitconfig: Permission denied (#14848)
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/cmake/vcpkg_apply_patches.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index 0ca33bc0d..5ca7dbca0 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -37,6 +37,12 @@ function(vcpkg_apply_patches) cmake_parse_arguments(PARSE_ARGV 0 _ap "QUIET" "SOURCE_PATH" "PATCHES") find_program(GIT NAMES git git.cmd) + if(DEFINED ENV{GIT_CONFIG_NOSYSTEM}) + set(GIT_CONFIG_NOSYSTEM_BACKUP "$ENV{GIT_CONFIG_NOSYSTEM}") + else() + unset(GIT_CONFIG_NOSYSTEM_BACKUP) + endif() + set(ENV{GIT_CONFIG_NOSYSTEM} 1) set(PATCHNUM 0) foreach(PATCH ${_ap_PATCHES}) get_filename_component(ABSOLUTE_PATCH "${PATCH}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}") @@ -57,4 +63,9 @@ function(vcpkg_apply_patches) math(EXPR PATCHNUM "${PATCHNUM}+1") endforeach() + if(DEFINED GIT_CONFIG_NOSYSTEM_BACKUP) + set(ENV{GIT_CONFIG_NOSYSTEM} "${GIT_CONFIG_NOSYSTEM_BACKUP}") + else() + unset(ENV{GIT_CONFIG_NOSYSTEM}) + endif() endfunction() |
