[Tilesathome] Possible inconsistency in handling of double quotes in tilesAtHome.conf on windows.
Rob Reid
rob at robreid.co.nz
Fri Nov 30 11:05:33 GMT 2007
Bjornman wrote the following on 29/11/2007 20:04:
>
> The problem is that the path is quoted in one place (in tilesgen.pl)
> but not in another (tahconfig.pm <http://tahconfig.pm>). To use it
> with spaces, the code needs to be fixed in one of those places.
>
> If you specify it in tilesathome.conf without quotes as
> Inkscape=c:\Program Files\inkscape\inkscape
> you'll need to change one line in tahconfig.pm <http://tahconfig.pm>
> from:
> tahconfig.pm(line157): my $InkscapeV = `$Config->{Inkscape} --version`;
> to
> tahconfig.pm(line157): my $InkscapeV = `"$Config->{Inkscape}" --version`;
>
I see this change was made in r5813 which has fixed things for Inkscape,
thanks.
I can see also that the other config paths were also changed to be
quoted in tahconfig.pm. This unfortunately means we now have the reverse
situation with the Zip config path that it is quoted in tahconfig.pm but
not in compress.pl and with the Pngcrush config path which is quoted in
tahconfig.pm but not in tilesGen.pl
I think what needs to be done is change the 2 sprintfs in compress.pl from :
if ($Config{"7zipWin"})
{
$Command1 = sprintf("%s %s %s %s",
$Config{"Zip"},
"a -tzip",
$Filename,
"$Dir/*.png");
}
else
{
$Command1 = sprintf("%s -r -j %s %s > %s",
$Config{"Zip"},
$Filename,
"$Dir",
$stdOut);
to :
if ($Config{"7zipWin"})
{
$Command1 = sprintf("\"%s\" %s %s %s",
$Config{"Zip"},
"a -tzip",
$Filename,
"$Dir/*.png");
}
else
{
$Command1 = sprintf("\"%s\" -r -j %s %s > %s",
$Config{"Zip"},
$Filename,
"$Dir",
$stdOut);
And change the sprintf in tilesGen.pl from :
my $Cmd = sprintf("%s %s -q %s %s %s",
$Config{Niceness},
$Config{Pngcrush},
$Filename2,
$Filename,
$Redirect);
to:
my $Cmd = sprintf("%s \"%s\" -q %s %s %s",
$Config{Niceness},
$Config{Pngcrush},
$Filename2,
$Filename,
$Redirect);
I've tested that here and it seems to work but since i'm new to perl and
SVN can someone check my suggested change and implement?
This change will mean any windows clients who were using double quotes
in their conf will need to remove them although they may already be
broken after r5813. Are there many of us?
rcr
More information about the Tilesathome
mailing list