mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 03:34:26 +08:00
[vcpkg_apply_patches] Work around /etc/gitconfig: Permission denied (#14848)
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
This commit is contained in:
parent
666589a27d
commit
7c08030982
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user