git-remote-mediawiki: do not remove installed files in "clean" target
PATCH 1/1 git-remote-mediawiki: do not remove installed files in "clean" target
Running "make clean" after a successful "make install" should not result in a broken mediawiki remote helper.
---
Thanks for the very pleasant mediawiki remote helper.
contrib/mw-to-git/Makefile | 1 - 1 file changed, 1 deletion(-)
contrib/mw-to-git/Makefile +0 -1
@@ -43,7 +43,6 @@ install: install_pm clean: $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \ clean-perl-script - rm $(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM) perlcritic: perlcritic -5 $(SCRIPT_PERL)
Signature · 1 line
1.8.4.1
Quoted 2 lines · Jonathan Nieder
Running "make clean" after a successful "make install" should not result in a broken mediawiki remote helper.
Ideally, there could be a "make uninstall" removing the installed file.
Signature · 2 lines
Matthieu Moy http://www-verimag.imag.fr/~moy/
Quoted 6 lines · Matthieu Moy
Quoted 2 lines · Jonathan Nieder
Running "make clean" after a successful "make install" should not result in a broken mediawiki remote helper.
Acked-by Matthieu Moy <[email protected]>
Thanks for looking it over. Here are a few more makefile tweaks on top of that one.
Jonathan Nieder (3):
git-remote-mediawiki: honor DESTDIR in "make install" git-remote-mediawiki build: make 'install' command configurable git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace
contrib/mw-to-git/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
PATCH 1/3 git-remote-mediawiki: honor DESTDIR in "make install"
So now you can run
DESTDIR=$(pwd)/tmp make -Ccontrib/mw-to-git install
to install the mediawiki remote helper, git-mw tool, and Git::Mediawiki perl module under tmp/ as preparation for zipping it up and extracting on another machine.
While at it, make sure the directory that should contain Git::Mediawiki exists before putting a file there. Without this patch, the makefile uses DESTDIR when installing git-mw and git-remote-mediawiki but not the perl module, resulting in errors from "make install" if the $(INSTLIBDIR)/Git directory does not exist:
install: cannot create regular file \
'/usr/share/perl/5.18.1/Git/Mediawiki.pm': No such file or directory
--- contrib/mw-to-git/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
contrib/mw-to-git/Makefile +3 -1
@@ -30,7 +30,9 @@ test: all check: perlcritic test install_pm: - install $(GIT_MEDIAWIKI_PM) $(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM) + install -d -m 755 $(DESTDIR)$(INSTLIBDIR)/Git + install -m 644 $(GIT_MEDIAWIKI_PM) \ + $(DESTDIR)$(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM) build: $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
Signature · 1 line
1.8.4.1
PATCH 2/3 git-remote-mediawiki build: make 'install' command configurable
In reply to Jonathan NiederOn some machines, the most usable 'install' tool is named 'ginstall'.
--- contrib/mw-to-git/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
contrib/mw-to-git/Makefile +4 -2
@@ -18,6 +18,8 @@ SCRIPT_PERL+=git-mw.perl GIT_ROOT_DIR=../.. HERE=contrib/mw-to-git/ +INSTALL = install + SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL)) INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/perl \ -s --no-print-directory instlibdir)
@@ -30,8 +32,8 @@ test: all check: perlcritic test install_pm: - install -d -m 755 $(DESTDIR)$(INSTLIBDIR)/Git - install -m 644 $(GIT_MEDIAWIKI_PM) \ + $(INSTALL) -d -m 755 $(DESTDIR)$(INSTLIBDIR)/Git + $(INSTALL) -m 644 $(GIT_MEDIAWIKI_PM) \ $(DESTDIR)$(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM) build:
Signature · 1 line
1.8.4.1
PATCH 3/3 git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace
In reply to Jonathan NiederQuote DESTDIR and INSTLIBDIR for the shell in the same way as is done in the toplevel Makefile to avoid confusion in case they contain shell metacharacters.
--- contrib/mw-to-git/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
contrib/mw-to-git/Makefile +4 -2
@@ -23,6 +23,8 @@ INSTALL = install SCRIPT_PERL_FULL=$(patsubst %,$(HERE)/%,$(SCRIPT_PERL)) INSTLIBDIR=$(shell $(MAKE) -C $(GIT_ROOT_DIR)/perl \ -s --no-print-directory instlibdir) +DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) +INSTLIBDIR_SQ = $(subst ','\'',$(INSTLIBDIR)) all: build
@@ -32,9 +34,9 @@ test: all check: perlcritic test install_pm: - $(INSTALL) -d -m 755 $(DESTDIR)$(INSTLIBDIR)/Git + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(INSTLIBDIR_SQ)/Git' $(INSTALL) -m 644 $(GIT_MEDIAWIKI_PM) \ - $(DESTDIR)$(INSTLIBDIR)/$(GIT_MEDIAWIKI_PM) + '$(DESTDIR_SQ)$(INSTLIBDIR_SQ)/$(GIT_MEDIAWIKI_PM)' build: $(MAKE) -C $(GIT_ROOT_DIR) SCRIPT_PERL="$(SCRIPT_PERL_FULL)" \
Signature · 1 line
1.8.4.1
Quoted 10 lines · Jonathan Nieder
Quoted 6 lines · Matthieu Moy
Quoted 2 lines · Jonathan Nieder
Running "make clean" after a successful "make install" should not result in a broken mediawiki remote helper.
Acked-by Matthieu Moy <[email protected]>Thanks for looking it over. Here are a few more makefile tweaks on top of that one.
All look good to me. Is it intentional that you didn't Cc Junio?
Signature · 2 lines
Matthieu Moy http://www-verimag.imag.fr/~moy/