Re: Initial refactoring of plperl.c - updated

From: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Initial refactoring of plperl.c - updated
Date: 2010-01-10 00:03:33
Message-ID: 20100110000333.GF2481@timac.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 09, 2010 at 11:49:22PM +0000, Tim Bunce wrote:
> On Sat, Jan 09, 2010 at 11:16:18PM +0200, Peter Eisentraut wrote:
> > On fre, 2010-01-08 at 12:46 +0000, Tim Bunce wrote:
> > > *** 45,50 ****
> > > --- 45,55 ----
> > >
> > > include $(top_srcdir)/src/Makefile.shlib
> > >
> > > + plperl.o: perlchunks.h
> > > +
> > > + perlchunks.h: plc_*.pl
> > > + $(PERL) text2macro.pl --strip='^(\#.*|\s*)$$' plc_*.pl >
> > > perlchunks.htmp
> > > + mv perlchunks.htmp perlchunks.h
> > >
> > > all: all-lib
> >
> > What's the reason for the temp file here?
>
> Defensive. If the text2macro.pl program fails/dies then you'd be left
> with a broken output file with a newer timestamp, so the next make
> wouldn't rerun text2macro.pl.

An alternative would be for text2macro.pl to write to a temp file and
rename at the end.

Tim.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-01-10 00:14:12 Re: Feature patch 1 for plperl [PATCH]
Previous Message Tim Bunce 2010-01-09 23:49:22 Re: Initial refactoring of plperl.c - updated