[postgis-devel] Building the extension on Solaris/amd64

Sandro Santilli strk at keybit.net
Sat May 25 10:01:41 PDT 2013


On Sat, May 25, 2013 at 04:49:43PM +0000, Martin Spott wrote:
> Sandro Santilli wrote:
> 
> > This works for me:
> > 
> > perl -e 'while (@ARGV && $ARGV[0] =~ /-/) {
> > print shift(@ARGV),"\n"; }
> > ' -- -a -b -c
> > 
> > doesn't it work there ?
> 
> It does, but the use case is different. A "while" loop runs until it
> hits a terminating condition.  In your example the terminating
> condition is EOF.

The running condition is ( @ARGV && $ARGV[0] =~ /-/)
which means it'll run until the first argument starts with a dash.

Indeed there _was_ a bug in that @ARGV was only shifted
if a supported switch was given. I fixed that with r11499,
please see if it works for you ?

> But the respective while-loop in "postgis_restore.pl" doesn't meet an
> EOF nor any other terminating condition.  After iterating the loop for
> a first time (for example because "-v" was given), the dumpfile name
> gets shifted into $ARGV[0] and the loop continues running endlessly, it
> just doesn't execute the code block.

Note that in the scenario above the next iteration finds
the dumpfile name NOT starting with a dash, which is enough
to stop. But if your filename really starts with a dash you're
indeed doomed. That was also fixed by r11499 by adding support
for the double-dash termination:

 ./postgis_restore.pl -v -- -mysillyfilename

Keep sending bugs this way ! :)

--strk;



More information about the postgis-devel mailing list