Skip to content

Reduce MinGit's size a little #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions make-file-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ test -n "$BITNESS" ||
die "Need ARCH and BITNESS to be set"

SH_FOR_REBASE=dash
PACKAGE_EXCLUDES="db info heimdal git util-linux curl git-for-windows-keyring
PACKAGE_EXCLUDES="db info heimdal tcl git util-linux curl git-for-windows-keyring
mingw-w64-p11-kit"
EXTRA_FILE_EXCLUDES=
UTIL_PACKAGES="sed awk grep findutils coreutils"
if test -n "$MINIMAL_GIT_WITH_BUSYBOX"
then
PACKAGE_EXCLUDES="$PACKAGE_EXCLUDES bash coreutils mingw-w64-busybox
libiconv libintl libreadline ncurses openssl
mingw-w64-libmetalink mingw-w64-spdylay"
mingw-w64-libmetalink mingw-w64-spdylay diffutils"

EXTRA_FILE_EXCLUDES="/etc/post-install/.* /usr/bin/getfacl.exe
/usr/bin/msys-\(gmp\|ssl\)-.*.dll
Expand Down Expand Up @@ -162,6 +162,7 @@ grep -v -e '\.[acho]$' -e '\.l[ao]$' -e '/aclocal/' \
-e '^/mingw../libexec/git-core/git-cvsexport' \
-e '^/mingw../share/doc/git-doc/git-cvsimport' \
-e '^/mingw../share/git\(k\|-gui\)/lib/msgs/' \
-e '^/mingw../share/gtk-doc/' \
-e '^/mingw../share/nghttp2/' \
-e '^/usr/bin/msys-\(db\|curl\|icu\|gfortran\|stdc++\|quadmath\)[^/]*\.dll$' \
-e '^/usr/bin/msys-\('$(if test i686 = "$ARCH"
Expand All @@ -187,6 +188,7 @@ grep -v -e '\.[acho]$' -e '\.l[ao]$' -e '/aclocal/' \
-e '^/usr/share/perl5/core_perl/CPAN/' \
-e '^/usr/share/perl5/core_perl/TAP/' \
-e '^/usr/share/vim/vim74/lang/' \
-e '^/usr/share/\(bash-completion\|makepkg\|nano\)/' \
-e '^/update-via-pacman.bat$' \
-e '^/etc/profile.d/git-sdk.sh$' |
if test -n "$WITH_L10N" && test -z "$MINIMAL_GIT"
Expand Down
24 changes: 24 additions & 0 deletions mingit/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,30 @@ sort >"$SCRIPT_PATH"/exclude-list &&
LIST="$(comm -23 "$SCRIPT_PATH"/sorted-all "$SCRIPT_PATH"/exclude-list)" ||
die "Could not copy libexec/git-core/*.exe"

# Use git-wrapper.exe as git-remote-http.exe if supported
if cmp "$SCRIPT_PATH/root/$BIN_DIR"/git-remote-http{,s}.exe
then
# verify that the Git wrapper works
cp "/mingw$BITNESS/share/git/git-wrapper.exe" "$SCRIPT_PATH/root/$BIN_DIR"/git-remote-http.exe
usage="$($SCRIPT_PATH/root/$BIN_DIR/git-remote-http.exe 2>&1)"
case "$?,$usage" in
1,*remote-curl*) ;; # okay, let's use the Git wrapper
*) cp "$SCRIPT_PATH/root/$BIN_DIR"/git-remote-https.exe "$SCRIPT_PATH/root/$BIN_DIR"/git-remote-http.exe;;
esac
fi

# Use git-wrapper.exe as ash.exe if supported
if test -f "$SCRIPT_PATH/root/$BIN_DIR"/busybox.exe
then
# verify that the Git wrapper works
cp "/mingw$BITNESS/share/git/git-wrapper.exe" "$SCRIPT_PATH/root/$BIN_DIR"/ash.exe
uname="$($SCRIPT_PATH/root/$BIN_DIR/ash.exe -c uname 2>&1)"
case "$?,$uname" in
0,*BusyBox*) ;; # okay, let's use the Git wrapper
*) rm "$SCRIPT_PATH/root/$BIN_DIR"/ash.exe;;
esac
fi

test ! -f "$TARGET" || rm "$TARGET" || die "Could not remove $TARGET"

echo "Creating .zip archive" &&
Expand Down