Skip to content

Commit

Permalink
MinGit: move all core-git .exe files into bin/
Browse files Browse the repository at this point in the history
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 git-for-windows/git#1086

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Mar 9, 2017
1 parent ab5fe7c commit 1c817aa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 21 additions & 1 deletion mingit/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\"."

0 comments on commit 1c817aa

Please sign in to comment.