From 73abda3b2ad0a2053f29a6f0d624ede89531c437 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Fri, 15 Jun 2012 18:02:34 -0500 Subject: [PATCH 1/2] perl/Makefile: move "mkdir -p" to module installation loop for maintainability In the NO_PERL_MAKEMAKER=YesPlease fallback case, make the directory that will contain each module when installing it (simulating "install -D") instead of hardcoding "Git/SVN/Memoize is the deepest level". This should make this codepath which is not used often on development machines a little easier to maintain. Requested-by: Junio C Hamano Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- perl/Makefile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/perl/Makefile b/perl/Makefile index fe7a48646..2e8f9804c 100644 --- a/perl/Makefile +++ b/perl/Makefile @@ -34,22 +34,34 @@ modules += Git/SVN/Ra $(makfile): ../GIT-CFLAGS Makefile echo all: private-Error.pm Git.pm Git/I18N.pm > $@ - echo ' mkdir -p blib/lib/Git/SVN/Memoize' >> $@ set -e; \ for i in $(modules); \ do \ + if test $$i = $${i%/*}; \ + then \ + subdir=; \ + else \ + subdir=/$${i%/*}; \ + fi; \ echo ' $(RM) blib/lib/'$$i'.pm' >> $@; \ + echo ' mkdir -p blib/lib'$$subdir >> $@; \ echo ' cp '$$i'.pm blib/lib/'$$i'.pm' >> $@; \ done echo ' $(RM) blib/lib/Error.pm' >> $@ '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \ echo ' cp private-Error.pm blib/lib/Error.pm' >> $@ echo install: >> $@ - echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)/Git/SVN/Memoize"' >> $@ set -e; \ for i in $(modules); \ do \ + if test $$i = $${i%/*}; \ + then \ + subdir=; \ + else \ + subdir=/$${i%/*}; \ + fi; \ echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \ + echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)'$$subdir >> $@; \ echo ' cp '$$i'.pm "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \ done echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@ From 01a1a4bca6c1a46625ebc7dbfa7249b4029cb297 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Fri, 29 Jun 2012 10:07:44 +0200 Subject: [PATCH 2/2] perl/Makefile: Fix a missing double-quote Signed-off-by: Johannes Sixt Acked-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- perl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl/Makefile b/perl/Makefile index 2e8f9804c..6ca7d472e 100644 --- a/perl/Makefile +++ b/perl/Makefile @@ -61,7 +61,7 @@ $(makfile): ../GIT-CFLAGS Makefile subdir=/$${i%/*}; \ fi; \ echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \ - echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)'$$subdir >> $@; \ + echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)'$$subdir'"' >> $@; \ echo ' cp '$$i'.pm "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \ done echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@