Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

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

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


jand at activestate

Dec 9, 2009, 3:29 PM

Post #1 of 4 (342 views)
Permalink
RE: [perl.git] branch blead, updated. v5.11.2-135-g13290fc

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 [at] develop-help>
> Date: Tue Dec 8 12:48:59 2009 +0100
>
> [perl #70802] -i'*' refuses to work
>
> Add regression tests
> (the bug was fixed by commit c9930541bfa04399c3b648e83c9b750cee1154fb)
> -----------------------------------------------------------------------
>
> Summary of changes:
> t/io/inplace.t | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 53 insertions(+), 1 deletions(-)
>
> diff --git a/t/io/inplace.t b/t/io/inplace.t
> index a9664dc..ce09314 100644
> --- a/t/io/inplace.t
> +++ b/t/io/inplace.t
> @@ -4,7 +4,7 @@ require './test.pl';
>
> $^I = $^O eq 'VMS' ? '_bak' : '.bak';
>
> -plan( tests => 2 );
> +plan( tests => 6 );
>
> my @tfiles = (tempfile(), tempfile(), tempfile());
> my @tfiles_bak = map "$_$^I", @tfiles;
> @@ -33,3 +33,55 @@ is ( runperl( prog => 'print<>;', args => \@tfiles_bak ),
> "foo\nfoo\nfoo\n",
> "backup file contents stay the same" );
>
> +SKIP:
> +{
> + # based on code, dosish and epoc systems can't do no-backup inplace
> + # edits
> + $^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.

Cheers,
-Jan


tony at develop-help

Dec 9, 2009, 3:42 PM

Post #2 of 4 (319 views)
Permalink
Re: [perl.git] branch blead, updated. v5.11.2-135-g13290fc [In reply to]

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 [at] develop-help>
> > + $^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.

Tony


rurban at x-ray

Dec 10, 2009, 4:46 AM

Post #3 of 4 (307 views)
Permalink
Re: [perl.git] branch blead, updated. v5.11.2-135-g13290fc [In reply to]

2009/12/10 Tony Cook <tony [at] develop-help>:
> 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 [at] develop-help>
>> > +    $^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"

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.

--
Reini Urban
http://phpwiki.org/ http://murbreak.at/


tony at develop-help

Dec 10, 2009, 5:58 AM

Post #4 of 4 (310 views)
Permalink
Re: [perl.git] branch blead, updated. v5.11.2-135-g13290fc [In reply to]

On Thu, Dec 10, 2009 at 01:46:53PM +0100, Reini Urban wrote:
> 2009/12/10 Tony Cook <tony [at] develop-help>:
> > 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 [at] develop-help>
> >> > +    $^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

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.