{"thread":{"id":"26421","subject":"[PATCH] more portable absolute dir check in Git.pm","startedAt":"2011-02-05T16:19:28Z","lastAt":"2011-02-06T22:32:55Z","messageCount":2,"participants":["Rafael Kitover","Erik Faye-Lund"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"160449","messageId":"4D4D7890.3020906@io.com","threadId":"26421","inReplyTo":null,"subject":"[PATCH] more portable absolute dir check in Git.pm","fromName":"Rafael Kitover","fromEmail":"rkitover@io.com","sentAt":"2011-02-05T16:19:28Z","receivedAt":"2011-02-05T16:19:28Z","isPatch":true,"sender":{"key":"rkitover@io.com","avatar":null},"body":"I was trying to get msysGit to work with activeperl. I'm not sure how \nfar I got, I will revisit this problem in the future, but here is a patch.\n\nIt removes a problematic make fragment that doesn't work on nmake (and \nprobably dmake as well.) As well as a better absolute dir check in Git.pm .\n\n\n>From 49f6d63f760d8b0b6988ce8cf4ed175965c3bf4b Mon Sep 17 00:00:00 2001\nFrom: Rafael Kitover <rkitover@cpan.org>\nDate: Sat, 5 Feb 2011 11:13:31 -0500\nSubject: [PATCH] more portable absolute dir check in Git.pm\n\n---\n perl/Git.pm      |    4 +++-\n perl/Makefile.PL |    7 ++++++-\n 2 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/perl/Git.pm b/perl/Git.pm\nindex 6cb0dd1..dee06e1 100644\n--- a/perl/Git.pm\n+++ b/perl/Git.pm\n@@ -101,6 +101,7 @@ use Error qw(:try);\n use Cwd qw(abs_path);\n use IPC::Open2 qw(open2);\n use Fcntl qw(SEEK_SET SEEK_CUR);\n+use File::Spec ();\n }\n \n \n@@ -184,7 +185,8 @@ sub repository {\n \t\t};\n \n \t\tif ($dir) {\n-\t\t\t$dir =~ m#^/# or $dir = $opts{Directory} . '/' . $dir;\n+                        File::Spec->file_name_is_absolute($dir)\n+\t\t\t\tor $dir = $opts{Directory} . '/' . $dir;\n \t\t\t$opts{Repository} = abs_path($dir);\n \n \t\t\t# If --git-dir went ok, this shouldn't die either.\ndiff --git a/perl/Makefile.PL b/perl/Makefile.PL\nindex 0b9deca..7ceec50 100644\n--- a/perl/Makefile.PL\n+++ b/perl/Makefile.PL\n@@ -1,10 +1,13 @@\n use ExtUtils::MakeMaker;\n \n sub MY::postamble {\n-\treturn <<'MAKE_FRAG';\n+\tmy $make_frag = <<'MAKE_FRAG';\n instlibdir:\n \t@echo '$(INSTALLSITELIB)'\n \n+MAKE_FRAG\n+\n+\t$make_frag .= <<'MAKE_FRAG' if $^O ne 'MSWin32';\n ifneq (,$(DESTDIR))\n ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))\n $(error ExtUtils::MakeMaker version \"$(MM_VERSION)\" is older than 6.11 and so \\\n@@ -14,6 +17,8 @@ endif\n endif\n \n MAKE_FRAG\n+\n+\treturn $make_frag;\n }\n \n my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');\n-- \n1.7.3.1\n\n"},{"id":"160556","messageId":"AANLkTimLCnYYv74NMumXHOdWuNBt3ontLo4v-Ey_0kay@mail.gmail.com","threadId":"26421","inReplyTo":"4D4D7890.3020906@io.com","subject":"Re: [PATCH] more portable absolute dir check in Git.pm","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-02-06T22:32:55Z","receivedAt":"2011-02-06T22:32:55Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sat, Feb 5, 2011 at 5:19 PM, Rafael Kitover <rkitover@io.com> wrote:\n> I was trying to get msysGit to work with activeperl. I'm not sure how far I\n> got, I will revisit this problem in the future, but here is a patch.\n>\n> It removes a problematic make fragment that doesn't work on nmake (and\n> probably dmake as well.) As well as a better absolute dir check in Git.pm .\n>\n\nPlease read Documentation/SubmittingPatches. In particlar:\n- We use inline patches on the mailing-list. git send-email can send\nthese for you.\n- Your patch lacks a sign-off.\n\nOther than that, interesting. But I think the make_frag-changes needs\nan explanation.\n"}]}