develooper Front page | perl.perl5.porters | Postings from December 2009

Re: [perl.git] branch blead, updated. v5.11.2-135-g13290fc

Thread Previous
From:
Tony Cook
Date:
December 10, 2009 05:58
Subject:
Re: [perl.git] branch blead, updated. v5.11.2-135-g13290fc
Message ID:
20091210135845.GB16303@mars.tony.develop-help.com
On Thu, Dec 10, 2009 at 01:46:53PM +0100, Reini Urban wrote:
> 2009/12/10 Tony Cook <tony@develop-help.com>:
> > On Wed, Dec 09, 2009 at 03:29:03PM -0800, Jan Dubois wrote:
> >> On Tue, 08 Dec 2009, Rafael Garcia-Suarez wrote:
> >> >
> >> > In perl.git, the branch blead has been updated
> >> >
> >> > <http://perl5.git.perl.org/perl.git/commitdiff/13290fcd82823e130109fca5199c99fb886e29eb?hp=958e6d4b516d826d7139a8ead
> >> > 2b1054c5f8b9eda>
> >> >
> >> > - Log -----------------------------------------------------------------
> >> > commit 13290fcd82823e130109fca5199c99fb886e29eb
> >> > Author: Tony Cook <tony@develop-help.com>
> >> > +    $^O =~ /^(MSWin32|cygwin|uwin|dos|epoc)$/
> >> > +   and skip("Can't inplace edit without backups on $^O", 4);
> >>
> >> I suspect OS/2 belongs in that list as well.
> >
> > You're right, from hints/os2.sh:
> >
> > aout_ccflags="-DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. $_defemxcrtrev -D__ST_MT_ERRNO__"
> >
> > The DOSISH define is used to decide whether to implement no-backup
> > inplace editing.
> >
> > I"ll make a patch (tonight probably) if someone doesn't beat me to it.
> 
> These test doesn't look right to me, as the first two tests -i
> (without *) pass fine on cygwin.
> mingw and MSVC probably also.
> 
> The messsage says "Can't inplace edit without backups"

perl.c:3050 on cygwin will check for an empty extension and fill one
in.  This doesn't happen for the other dosish platforms, though
perhaps it should.

Strawberry perl (5.10.0) and an old ActiveState build both complain
"Can't do inplace edit without backup." if you try to C< perl -i -ne
"..." files... >.

The tests in t/io/inplace.t actually test the functioning of $^I, not
-i, though given the extra cygwin processing, perhaps

> What it really tests is if -i and -i* works, but it doesn't check
> the intermediate backups files which are created on those platforms for -i.
> -i* doesn't work.
> 
> Tests are needed if
> 1. -i works (dosish ok)
> 2. -i works without backups (dosish nok)
> 3. -i* works (dosish nok)
> 4. -i* works without backups (dosish nok)
> 
> And we need the list of .bak extensions per platform on -i here.
> And in the pod also, as from time to time I here someone saying
> that -i doesn't work on windows. It does fine, just not inplace.

So perhaps there's three issues here:

1) the tests test only $^I, not -i. tests should be added for
-i(nothing) -i*.

2) add similar .bak handling for other platforms

3) should cygwin/other dosish platforms treat -i* as -i.bak ?

I'll look at 1) tomorrow night.

Tony

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About