From 1c817aa04ef11fc962a1e29620a30381de21024e Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Mar 2017 17:08:24 +0100 Subject: [PATCH] MinGit: move all core-git .exe files into bin/ Core Git's .exe files may link to .dll files that are already in bin/, and the way Windows works, it is best to have those .exe and .dll files in the same directory lest some enterprisey's installer that installs an incompatible libeay32.dll into %SYSTEMROOT%\system32 interfere with the functionality. Note: we *only* move core Git's .exe files, *not* other .exe files in libexec/git-core/, as they come with their own .dll files that are already in the same directory. This fixes https://github.com/git-for-windows/git/issues/1086 Signed-off-by: Johannes Schindelin --- .gitignore | 5 +++++ mingit/release.sh | 22 +++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1354beb7c6..953a23dcdd 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,12 @@ edit-git-bash.exe /installer/file-list.iss /installer/package-versions.txt /mingit/LICENSE.txt +/mingit/etc/libexec-moved.txt /mingit/etc/package-versions.txt +/mingit/mingw32/bin/git*.exe +/mingit/mingw64/bin/git*.exe +/mingit/sorted-all +/mingit/sorted-libexec-exes /mingw-w64-git-credential-manager/pkg/ /mingw-w64-git-credential-manager/src/ /mingw-w64-git-credential-manager/*.pkg.tar.xz diff --git a/mingit/release.sh b/mingit/release.sh index 486be99d47..edda68f1f9 100644 --- a/mingit/release.sh +++ b/mingit/release.sh @@ -65,9 +65,29 @@ type zip || pacman -Sy --noconfirm zip || die "Could not install Zip" +echo "$LIST" | sort >"$SCRIPT_PATH"/sorted-all && +pacman -Ql mingw-w64-$ARCH-git | +sed 's|^[^ ]* /||' | +grep "^mingw$BITNESS/libexec/git-core/.*\.exe$" | +sort >"$SCRIPT_PATH"/sorted-libexec-exes && +MOVED_FILE=etc/libexec-moved.txt && +comm -12 "$SCRIPT_PATH"/sorted-all "$SCRIPT_PATH"/sorted-libexec-exes \ + >"$SCRIPT_PATH"/$MOVED_FILE && +if test ! -s "$SCRIPT_PATH"/$MOVED_FILE +then + die "Could not find any .exe files in libexec/git-core/" +fi && +BIN_DIR=mingw$BITNESS/bin && +rm -rf "$SCRIPT_PATH"/$BIN_DIR && +mkdir -p "$SCRIPT_PATH"/$BIN_DIR && +(cd / && cp $(cat "$SCRIPT_PATH"/$MOVED_FILE) "$SCRIPT_PATH"/$BIN_DIR/) && +LIST="$(comm -23 "$SCRIPT_PATH"/sorted-all "$SCRIPT_PATH"/$MOVED_FILE)" || +die "Could not copy libexec/git-core/*.exe" + test ! -f "$TARGET" || rm "$TARGET" || die "Could not remove $TARGET" echo "Creating .zip archive" && -(cd "$SCRIPT_PATH" && zip -9r "$TARGET" LICENSE.txt etc/package-versions.txt) && +(cd "$SCRIPT_PATH" && + zip -9r "$TARGET" LICENSE.txt etc/package-versions.txt $MOVED_FILE $BIN_DIR/) && (cd / && zip -9r "$TARGET" $LIST) && echo "Success! You will find the new MinGit at \"$TARGET\"."