From cca4b1f6db55f9ca5ec06dbc1487aa49f21e4ed8 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 29 Feb 2016 12:29:43 +0100 Subject: [PATCH 1/3] sdk-installer: configure the MSYS2 runtime correctly ... even before git-extra was installed. This trick is performed simply by bundling the /etc/nsswitch.conf file that tells MSYS2's runtime e.g. to use the fast route to determining the home directory. This makes a huge difference, say, when running on a domain-joined machine that temporarily cannot reach its domain controller. A >60 second kind of difference. Signed-off-by: Johannes Schindelin --- sdk-installer/release.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk-installer/release.sh b/sdk-installer/release.sh index 3a5e92dfbb..fb4a8dfb5a 100755 --- a/sdk-installer/release.sh +++ b/sdk-installer/release.sh @@ -70,7 +70,8 @@ dlls_for_exes () { echo "$dlls" } -fileList="etc/pacman.conf \ +fileList="etc/nsswitch.conf \ + etc/pacman.conf \ etc/pacman.d \ usr/bin/pacman.exe \ usr/bin/curl.exe \ From 79fc67684955a59f3ce26197bb2813cfbcc124e6 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 29 Feb 2016 09:57:34 +0100 Subject: [PATCH 2/3] sdk-installer: install bash first, then info, and finally pacman Both bash and info are actually dependencies of pacman, but we need the Bash before installing pacman because several of pacman's dependencies require the Bash in their post-install scripts. Likewise, `makeinfo` is required for several of pacman's dependencies' post-install scripts (e.g. gettext), therefore we install that one next. Signed-off-by: Johannes Schindelin --- sdk-installer/setup-git-sdk.bat | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/sdk-installer/setup-git-sdk.bat b/sdk-installer/setup-git-sdk.bat index 0cd2805337..17fd213b5d 100755 --- a/sdk-installer/setup-git-sdk.bat +++ b/sdk-installer/setup-git-sdk.bat @@ -71,6 +71,32 @@ @IF ERRORLEVEL 1 GOTO INSTALL_RUNTIME +@SET /A counter=0 +:INSTALL_BASH +@SET /A counter+=1 +@IF %counter% GEQ 5 @( + @ECHO Could not install bash + @PAUSE + @EXIT 1 +) + +@REM next, force update bash +@"%cwd%"\usr\bin\pacman -S --needed --force --noconfirm bash + +@SET /A counter=0 +:INSTALL_INFO +@SET /A counter+=1 +@IF %counter% GEQ 5 @( + @ECHO Could not install info + @PAUSE + @EXIT 1 +) + +@REM next, force update info +@"%cwd%"\usr\bin\pacman -S --needed --force --noconfirm info + +@IF ERRORLEVEL 1 GOTO INSTALL_INFO + @SET /A counter=0 :INSTALL_PACMAN @SET /A counter+=1 @@ -80,8 +106,9 @@ @EXIT 1 ) -@REM next, force update pacman, but first we need bash and info for that. -@"%cwd%"\usr\bin\pacman -S --needed --force --noconfirm bash info pacman + +@REM next, force update pacman +@"%cwd%"\usr\bin\pacman -S --needed --force --noconfirm pacman @IF ERRORLEVEL 1 GOTO INSTALL_PACMAN From e071e678ea5fc9eb1f9e0976dff8629cbcbac273 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 29 Feb 2016 09:57:34 +0100 Subject: [PATCH 3/3] sdk-installer: initialize pacman's keyring before calling pacman A recent change in pacman invalidated the approach taken by Git for Windows' SDK where we simply bundle the keyring as per Git for Windows' maintainer's SDK. Instead, we now have to initialize the keyring explicitly. Reported by Lars Schneider. This fixes https://github.com/git-for-windows/git/issues/670 Signed-off-by: Johannes Schindelin --- sdk-installer/release.sh | 2 ++ sdk-installer/setup-git-sdk.bat | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sdk-installer/release.sh b/sdk-installer/release.sh index fb4a8dfb5a..8e85d2a43b 100755 --- a/sdk-installer/release.sh +++ b/sdk-installer/release.sh @@ -73,6 +73,8 @@ dlls_for_exes () { fileList="etc/nsswitch.conf \ etc/pacman.conf \ etc/pacman.d \ + usr/bin/pacman-key \ + usr/bin/tput.exe \ usr/bin/pacman.exe \ usr/bin/curl.exe \ usr/bin/gpg.exe \ diff --git a/sdk-installer/setup-git-sdk.bat b/sdk-installer/setup-git-sdk.bat index 17fd213b5d..99133f3a21 100755 --- a/sdk-installer/setup-git-sdk.bat +++ b/sdk-installer/setup-git-sdk.bat @@ -92,6 +92,13 @@ @EXIT 1 ) +@REM we need a /tmp directory, just for the time being +@MKDIR "%cwd%"\tmp + +@REM next, initialize pacman's keyring +@"%cwd%"\usr\bin\bash.exe -l -c '/usr/bin/bash /usr/bin/pacman-key --init' +@IF ERRORLEVEL 1 PAUSE + @REM next, force update info @"%cwd%"\usr\bin\pacman -S --needed --force --noconfirm info @@ -106,7 +113,6 @@ @EXIT 1 ) - @REM next, force update pacman @"%cwd%"\usr\bin\pacman -S --needed --force --noconfirm pacman