Skip to content

Commit 50c500f

Browse files
committed
git: make the Perl module handling more robust
The differences between CLANG64's Perl setup and MINGW64's point out some fragile logic I introduced in order to separate the `Git` Perl module's files from the `Git::SVN` ones. Let's move that logic into the Makefile which has all the relevant information to make the logic more robust. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 69f4dd8 commit 50c500f

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

mingw-w64-git/PKGBUILD

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ sha256sums=('d21ed5eb108646012a7f59c354b3dd45f6b6138de6e2b582906517365962b18f'
7070
'db754d6fe6722ad54d43df15ee93b1d9cead406158ed84dcbf35e5b4225469ed'
7171
'cbed8b133eb9eec9972f146be5c3ff49db29b2fff8ab9c87a6d0c646c08a5128'
7272
'027155aa6ca5f11ad7bcb89550a470935a9f22a9d5b3ab80a9eb209983258c1f'
73-
'387cbdb711453a7c41830558c351e448952bb7978158c258df093b1742543dfe'
73+
'386e965e184f657a5373b117c59e9e8711713e09177623a77718358cbc46296e'
7474
'7413506c59d25621e475aa45447993748332c72cfbb4cf94cce6bee6f1218a09'
7575
'6d83e1cb1acdb6eb1f2d5cb9299298e57680f5ca43d43c3e67c9da17f21b9b01')
7676

@@ -184,8 +184,9 @@ package_git () {
184184

185185
# Remove git-svn (packaged separately)
186186
rm -f "$pkgdir/$MINGW_PREFIX/libexec/git-core/git-svn"
187+
187188
# Remove Git.pm and other Perl modules (packaged separately in git-perl & git-svn)
188-
rm -rf "$pkgdir/$MINGW_PREFIX"/share/perl5
189+
make -j1 -f ../mingw-w64-git.mak DESTDIR="$pkgdir" uninstall-perl-modules
189190

190191
# Remove git-archimport (packaged separately)
191192
rm -f "$pkgdir/$MINGW_PREFIX/libexec/git-core/git-archimport"
@@ -332,8 +333,6 @@ package_git-perl () {
332333

333334
# Install Git.pm and related Perl modules (excluding Git::SVN)
334335
make -j1 -f ../mingw-w64-git.mak DESTDIR="$pkgdir" install-perl-module
335-
find "$pkgdir/$MINGW_PREFIX/share/perl5" -type f -path "*/Git/SVN*" -delete
336-
find "$pkgdir/$MINGW_PREFIX/share/perl5" -type d -empty -delete
337336
}
338337

339338
package_git-send-email () {
@@ -390,9 +389,7 @@ package_git-svn () {
390389
install -m755 git-svn "$pkgdir/$MINGW_PREFIX/libexec/git-core/"
391390

392391
# Install Git::SVN Perl modules only
393-
make -j1 DESTDIR="$pkgdir" -f ../mingw-w64-git.mak install-perl-module
394-
find "$pkgdir/$MINGW_PREFIX/share/perl5" -type f ! -path "*/Git/SVN*" -delete
395-
find "$pkgdir/$MINGW_PREFIX/share/perl5" -type d -empty -delete
392+
make -j1 DESTDIR="$pkgdir" -f ../mingw-w64-git.mak install-perl-svn-module
396393

397394
# Install documentation
398395
install -d -m755 "$pkgdir/$MINGW_PREFIX/share/man/man1"

mingw-w64-git/mingw-w64-git.mak

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ install-perl-module:
4848
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'
4949
(cd perl/build/lib && $(TAR) cf - .) | \
5050
(cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)
51+
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type f -path "*/Git/SVN*" -delete
52+
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type d -empty -delete
53+
54+
install-perl-svn-module:
55+
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'
56+
(cd perl/build/lib && $(TAR) cf - .) | \
57+
(cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)
58+
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type f ! -path "*/Git/SVN*" -delete
59+
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type d -empty -delete
60+
61+
uninstall-perl-modules:
62+
rm $(patsubst perl/%.pm,'$(DESTDIR_SQ)$(perllibdir_SQ)/%.pm',$(LIB_CPAN))
63+
rm '$(DESTDIR_SQ)$(perllibdir_SQ)/Git.pm'
64+
rm -r '$(DESTDIR_SQ)$(perllibdir_SQ)/Git'
65+
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type d -empty -delete
5166
endif
5267

5368
install-pdbs:

0 commit comments

Comments
 (0)