Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 67918
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: Roger.Lucas [...] ubiquisys.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Issue with Makefile.PL and paramter strings including "=" signs
Date: Tue, 3 May 2011 11:18:47 +0100
To: <bug-Template-Toolkit [...] rt.cpan.org>
From: "Roger Lucas" <Roger.Lucas [...] ubiquisys.com>
Dear Template-Toolkit developers, When installing Template-Toolkit v2.22 on my x86-64 system running Centos 5, the default "OPTIMIZE" parameter for the compiler is "-O2 -g -m64 -mtune=generic". Unfortunately, the Makefile.PL parameter parsing code uses "split(/=/)" to separate the parameter name from the parameter value. This code fails to correctly parse the parameter and you get a Makefile with: # OPTIMIZE => q[-O2 -g -m64 -mtune] rather than # OPTIMIZE => q[-O2 -g -m64 -mtune=generic] This in turn causes the compiler to throw an error as "-mtune" requires a parameter. A simple fix would be to change the "split(=/)" command for a regex match. A patch with this code change is: --- Template-Toolkit-2.22.orig/Makefile.PL 2009-05-21 13:16:48.000000000 +0100 +++ Template-Toolkit-2.22/Makefile.PL 2011-04-29 10:09:16.000000000 +0100 @@ -43,7 +43,7 @@ my (%config, %ttconfig); while ($_ = shift) { - my ($k, $v) = split(/=/); + my ($k, $v) = ($_ =~ /^([^=]+)=(.*)/); if ($k =~ /^TT/) { $ttconfig{ $k } = $v || 0; } Thanks and best regards, Roger Lucas
This might be a more straight forward patch since we continue to use split.
Subject: mtune.patch.txt
diff --git a/Makefile.PL b/Makefile.PL index 8207500..60b90b5 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -42,8 +42,8 @@ $MAKE=$Config{'make'}; # goes into $config my (%config, %ttconfig); -while ($_ = shift) { - my ($k, $v) = split(/=/); +while (shift @ARGV) { + my ($k, $v) = split(/=/, $_, 2); if ($k =~ /^TT/) { $ttconfig{ $k } = $v || 0; }
pull request sent via github: https://github.com/abw/Template2/pull/2
On Tue Jan 24 14:19:03 2012, TODDR wrote: Show quoted text
> pull request sent via github: https://github.com/abw/Template2/pull/2
Merged. Thanks Todd. I'll give it a couple of days in case any other bugs appear then I'll push out a new release.