git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-remote-mediawiki: do not remove installed files in "clean" target
@ 2013-11-09  2:22 Jonathan Nieder
  2013-11-09 11:32 ` Matthieu Moy
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2013-11-09  2:22 UTC (permalink / raw)
  To: git; +Cc: Matthieu Moy, Thorsten Glaser

Running "make clean" after a successful "make install" should not
result in a broken mediawiki remote helper.

Reported-by: Thorsten Glaser <t.glaser@tarent.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Thanks for the very pleasant mediawiki remote helper.

 contrib/mw-to-git/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile
index f206f96..c5547f9 100644
--- a/contrib/mw-to-git/Makefile
+++ b/contrib/mw-to-git/Makefile
@@ -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)
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] git-remote-mediawiki: do not remove installed files in "clean" target
  2013-11-09  2:22 [PATCH] git-remote-mediawiki: do not remove installed files in "clean" target Jonathan Nieder
@ 2013-11-09 11:32 ` Matthieu Moy
  2013-11-11 20:45   ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Matthieu Moy @ 2013-11-09 11:32 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Thorsten Glaser

Jonathan Nieder <jrnieder@gmail.com> writes:

> Running "make clean" after a successful "make install" should not
> result in a broken mediawiki remote helper.

Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>

Ideally, there could be a "make uninstall" removing the installed file.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] git-remote-mediawiki: do not remove installed files in "clean" target
  2013-11-09 11:32 ` Matthieu Moy
@ 2013-11-11 20:45   ` Jonathan Nieder
  2013-11-11 20:45     ` [PATCH 1/3] git-remote-mediawiki: honor DESTDIR in "make install" Jonathan Nieder
                       ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jonathan Nieder @ 2013-11-11 20:45 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git, Thorsten Glaser

Matthieu Moy wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:

>> Running "make clean" after a successful "make install" should not
>> result in a broken mediawiki remote helper.
>
> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>

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(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] git-remote-mediawiki: honor DESTDIR in "make install"
  2013-11-11 20:45   ` Jonathan Nieder
@ 2013-11-11 20:45     ` Jonathan Nieder
  2013-11-11 20:45     ` [PATCH 2/3] git-remote-mediawiki build: make 'install' command configurable Jonathan Nieder
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Jonathan Nieder @ 2013-11-11 20:45 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git, Thorsten Glaser

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

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 contrib/mw-to-git/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile
index c5547f9..ee78fda 100644
--- a/contrib/mw-to-git/Makefile
+++ b/contrib/mw-to-git/Makefile
@@ -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)" \
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] git-remote-mediawiki build: make 'install' command configurable
  2013-11-11 20:45   ` Jonathan Nieder
  2013-11-11 20:45     ` [PATCH 1/3] git-remote-mediawiki: honor DESTDIR in "make install" Jonathan Nieder
@ 2013-11-11 20:45     ` Jonathan Nieder
  2013-11-11 20:46     ` [PATCH 3/3] git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace Jonathan Nieder
  2013-11-11 21:26     ` [PATCH] git-remote-mediawiki: do not remove installed files in "clean" target Matthieu Moy
  3 siblings, 0 replies; 7+ messages in thread
From: Jonathan Nieder @ 2013-11-11 20:45 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git, Thorsten Glaser

On some machines, the most usable 'install' tool is named
'ginstall'.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 contrib/mw-to-git/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile
index ee78fda..e685dad 100644
--- a/contrib/mw-to-git/Makefile
+++ b/contrib/mw-to-git/Makefile
@@ -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:
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace
  2013-11-11 20:45   ` Jonathan Nieder
  2013-11-11 20:45     ` [PATCH 1/3] git-remote-mediawiki: honor DESTDIR in "make install" Jonathan Nieder
  2013-11-11 20:45     ` [PATCH 2/3] git-remote-mediawiki build: make 'install' command configurable Jonathan Nieder
@ 2013-11-11 20:46     ` Jonathan Nieder
  2013-11-11 21:26     ` [PATCH] git-remote-mediawiki: do not remove installed files in "clean" target Matthieu Moy
  3 siblings, 0 replies; 7+ messages in thread
From: Jonathan Nieder @ 2013-11-11 20:46 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git, Thorsten Glaser

Quote 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.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 contrib/mw-to-git/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/mw-to-git/Makefile b/contrib/mw-to-git/Makefile
index e685dad..a4b6f7a 100644
--- a/contrib/mw-to-git/Makefile
+++ b/contrib/mw-to-git/Makefile
@@ -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)" \
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] git-remote-mediawiki: do not remove installed files in "clean" target
  2013-11-11 20:45   ` Jonathan Nieder
                       ` (2 preceding siblings ...)
  2013-11-11 20:46     ` [PATCH 3/3] git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace Jonathan Nieder
@ 2013-11-11 21:26     ` Matthieu Moy
  3 siblings, 0 replies; 7+ messages in thread
From: Matthieu Moy @ 2013-11-11 21:26 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: git, Thorsten Glaser

Jonathan Nieder <jrnieder@gmail.com> writes:

> Matthieu Moy wrote:
>> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>>> Running "make clean" after a successful "make install" should not
>>> result in a broken mediawiki remote helper.
>>
>> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
>
> 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?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-11-11 21:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-09  2:22 [PATCH] git-remote-mediawiki: do not remove installed files in "clean" target Jonathan Nieder
2013-11-09 11:32 ` Matthieu Moy
2013-11-11 20:45   ` Jonathan Nieder
2013-11-11 20:45     ` [PATCH 1/3] git-remote-mediawiki: honor DESTDIR in "make install" Jonathan Nieder
2013-11-11 20:45     ` [PATCH 2/3] git-remote-mediawiki build: make 'install' command configurable Jonathan Nieder
2013-11-11 20:46     ` [PATCH 3/3] git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace Jonathan Nieder
2013-11-11 21:26     ` [PATCH] git-remote-mediawiki: do not remove installed files in "clean" target Matthieu Moy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).