From da159c7759418bb14af655968dfa7a98bdcb8661 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Thu, 7 May 2009 15:41:27 +0200 Subject: Git.pm: Set GIT_WORK_TREE if we set GIT_DIR Otherwise git will use the current directory as work tree which will lead to unexpected results if we operate in sub directory of the work tree. Signed-off-by: Frank Lichtenheld Acked-by: Petr Baudis Signed-off-by: Junio C Hamano --- perl/Git.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'perl') diff --git a/perl/Git.pm b/perl/Git.pm index 291ff5b53c..4313db75b5 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -1280,6 +1280,8 @@ sub _cmd_exec { my ($self, @args) = @_; if ($self) { $self->repo_path() and $ENV{'GIT_DIR'} = $self->repo_path(); + $self->repo_path() and $self->wc_path() + and $ENV{'GIT_WORK_TREE'} = $self->wc_path(); $self->wc_path() and chdir($self->wc_path()); $self->wc_subdir() and chdir($self->wc_subdir()); } -- cgit v1.2.3 From fe53bbc9bebb853f97f0da3f63f7fca5774e3f95 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Thu, 7 May 2009 15:41:28 +0200 Subject: Git.pm: Always set Repository to absolute path if autodetecting So far we only set it to absolute paths in some cases which lead to problems like wc_chdir not working. Signed-off-by: Frank Lichtenheld Acked-by: Petr Baudis Signed-off-by: Junio C Hamano --- perl/Git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl') diff --git a/perl/Git.pm b/perl/Git.pm index 4313db75b5..e8df55d2f2 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -185,7 +185,7 @@ sub repository { if ($dir) { $dir =~ m#^/# or $dir = $opts{Directory} . '/' . $dir; - $opts{Repository} = $dir; + $opts{Repository} = abs_path($dir); # If --git-dir went ok, this shouldn't die either. my $prefix = $search->command_oneline('rev-parse', '--show-prefix'); -- cgit v1.2.3 From 3696c4ce89d97c34566a4a89720cfdae2a86fa38 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 21 Sep 2009 12:44:05 -0700 Subject: pay attention to DESTDIR when building with NO_PERL_MAKEMAKER Building with prefix=/some/where and temporarily installing it to elsewhere for tar'ing up is done with: make prefix=/some/where make prefix=/some/where DESTDIR=/else/where install Make handcrafted perl/perl.mak without NO_PERL_MAKEMAKER honour DESTDIR. Ancient ExtUtils::MakeMaker (pre 6.11?) has the same issue, but recent versions of Perl ships with at leat 6.17; this patch does not address that issue. Signed-off-by: Junio C Hamano --- perl/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'perl') diff --git a/perl/Makefile b/perl/Makefile index e3dd1a5547..4ab21d61b8 100644 --- a/perl/Makefile +++ b/perl/Makefile @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \ echo ' cp private-Error.pm blib/lib/Error.pm' >> $@ echo install: >> $@ - echo ' mkdir -p "$(instdir_SQ)"' >> $@ - echo ' $(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@ - echo ' $(RM) "$(instdir_SQ)/Error.pm"' >> $@ + echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@ + echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@ + echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@ '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \ - echo ' cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@ + echo ' cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@ echo instlibdir: >> $@ echo ' echo $(instdir_SQ)' >> $@ else -- cgit v1.2.3 From efe47f8f2c7d4e2b7ebedc15dbdd2cc51912b56f Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Thu, 24 Sep 2009 13:21:03 -0500 Subject: perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR It appears that ExtUtils::MakeMaker versions older than 6.11 do not implement the DESTDIR mechanism. So add a test to the generated perl.mak to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and abort with a message suggesting the use of NO_PERL_MAKEMAKER. Signed-off-by: Brandon Casey Signed-off-by: Shawn O. Pearce --- perl/Makefile.PL | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'perl') diff --git a/perl/Makefile.PL b/perl/Makefile.PL index 320253eb8e..0b9deca2cc 100644 --- a/perl/Makefile.PL +++ b/perl/Makefile.PL @@ -5,6 +5,14 @@ sub MY::postamble { instlibdir: @echo '$(INSTALLSITELIB)' +ifneq (,$(DESTDIR)) +ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10)) +$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \ + is likely incompatible with the DESTDIR mechanism. Try setting \ + NO_PERL_MAKEMAKER=1 instead) +endif +endif + MAKE_FRAG } -- cgit v1.2.3 From 9517e6b84357252e1882091343661c34d978771e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 3 Feb 2010 21:23:18 -0800 Subject: Typofixes outside documentation area begining -> beginning canonicalizations -> canonicalization comand -> command dewrapping -> unwrapping dirtyness -> dirtiness DISCLAMER -> DISCLAIMER explicitely -> explicitly feeded -> fed impiled -> implied madatory -> mandatory mimick -> mimic preceeding -> preceding reqeuest -> request substition -> substitution Signed-off-by: Junio C Hamano --- perl/Git.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'perl') diff --git a/perl/Git.pm b/perl/Git.pm index e8df55d2f2..970fe434ed 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -204,14 +204,14 @@ sub repository { $dir = $opts{Directory}; unless (-d "$dir/refs" and -d "$dir/objects" and -e "$dir/HEAD") { - # Mimick git-rev-parse --git-dir error message: + # Mimic git-rev-parse --git-dir error message: throw Error::Simple("fatal: Not a git repository: $dir"); } my $search = Git->repository(Repository => $dir); try { $search->command('symbolic-ref', 'HEAD'); } catch Git::Error::Command with { - # Mimick git-rev-parse --git-dir error message: + # Mimic git-rev-parse --git-dir error message: throw Error::Simple("fatal: Not a git repository: $dir"); } -- cgit v1.2.3