Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [perl #37876] Bug with Parrot::IO test

0 views
Skip to first unread message

Alberto Simões

unread,
Dec 10, 2005, 4:02:40 PM12/10/05
to parrotbug...@parrotcode.org
We can depend on 3.13 instead of 3.14.
From File::Spec Changelog:

3.13 Tue Nov 15 23:50:37 CST 2005

[...]

- abs2rel() used to return the empty string when its two arguments
were identical, which made no sense. Now it returns
curdir(). [Spotted by David Golden]

So, maybe we should replace '.' by File::Spec->curdir() but I'm not sure.

Alberto

Parrot Assembler via RT wrote:
> Greetings,
>
> This message has been automatically generated in response to the
> creation of a parrotbug regarding:
> "Bug with Parrot::IO test"
>
> There is no need to reply to this message right now. Your ticket has been
> assigned an ID of [perl #37876].
>
> Please include the string:
> [perl #37876]
> In the subject line of all future correspondence about this issue. To do so,
> you may reply to this message.
>
> Thank you,
> parrotbug
>
> https://rt.perl.org/rt3/Ticket/Display.html?id=37876
> -------------------------------------------------------------------------
> Received: (qmail 21338 invoked by alias); 10 Dec 2005 20:37:58 -0000
> Received: (qmail 21334 invoked from network); 10 Dec 2005 20:37:58 -0000
> Received: from localhost (HELO la.mx.develooper.com) (127.0.0.1) by localhost with SMTP; 10 Dec 2005 20:37:58 -0000
> Received: (qmail 21330 invoked by alias); 10 Dec 2005 20:37:58 -0000
> Received: from la.mx.develooper.com (HELO x1.develooper.com) (63.251.223.176) by la.mx.develooper.com (qpsmtpd/0.28) with SMTP; Sat, 10 Dec 2005 12:37:51 -0800
> Received: (qmail 21290 invoked by uid 225); 10 Dec 2005 20:37:48 -0000
> Received: (qmail 21286 invoked by alias); 10 Dec 2005 20:37:47 -0000
> Received: from eremita.di.uminho.pt (HELO eremita.di.uminho.pt) (193.136.19.131) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sat, 10 Dec 2005 12:37:40 -0800
> Received: by eremita.di.uminho.pt (Postfix, from userid 1000) id BEC9015704B; Sat, 10 Dec 2005 20:38:45 +0000 (WET)
> Delivered-To: rt-p...@x1.develooper.com
> Delivered-To: bugs-...@netlabs.develooper.com
> Delivered-To: parr...@parrotcode.org
> User-Agent: Mutt/1.4.2.1i
> MIME-Version: 1.0
> Subject: Bug with Parrot::IO test
> X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
> Return-Path: <am...@eremita.di.uminho.pt>
> X-Spam-Check-BY: la.mx.develooper.com
> X-Old-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
> Content-Disposition: inline
> Date: Sat, 10 Dec 2005 20:38:45 +0000
> Received-SPF: neutral (x1.develooper.com: local policy)
> Received-SPF: pass (x1.develooper.com: local policy)
> X-Old-Spam-Check-BY: la.mx.develooper.com
> content-type: text/plain; charset="utf-8"
> Message-ID: <20051210203...@eremita.di.uminho.pt>
> To: parr...@parrotcode.org
> Content-Transfer-Encoding: 8bit
> From: Alberto Manuel Brandao Simoes <am...@eremita.di.uminho.pt>
> X-RT-Original-Encoding: iso-8859-1
>
>
>
> ---
> osname= darwin
> osvers= 8.0
> arch= darwin-thread-multi-2level
> cc= cc
> ---
> Flags:
> category=core
> severity=medium
> ack=no
> ---
> New File::Spec returns '.' if the directory is the same, instead of the old ''.
> This diff should be in attach, I know, but I still need to learn how to do it, but the diff is very small :-)
>
> By the way, if there is a list of dependencies somewhere, File::Spec should
> be added with version 3.14
>
>
> Index: t/perl/Parrot_IO.t
> ===================================================================
> --- t/perl/Parrot_IO.t (revision 10433)
> +++ t/perl/Parrot_IO.t (working copy)
> @@ -97,7 +97,7 @@
> ok($f1 && $f2, 'file_with_name');
>
> # Relative paths.
> -is($d->relative_path($d->path), '', 'relative_path same dir');
> +is($d->relative_path($d->path), '.', 'relative_path same dir');
> is($d1->relative_path($f1->path), 'file1.txt', 'relative_path same file');
> is($d->relative_path($d1->path), 'one', 'relative_path down to dir');
> is($d->relative_path($f1->path), catfile(qw(one file1.txt)),
>
> ---
> Summary of my parrot 0.4.0 (r10432) configuration:
> configdate='Sat Dec 10 19:56:11 2005'
> Platform:
> osname=darwin, archname=darwin-thread-multi-2level
> jitcapable=1, jitarchname=ppc-darwin,
> jitosname=DARWIN, jitcpuarch=ppc
> execcapable=1
> perl=perl
> Compiler:
> cc='gcc -L/sw/lib -I/sw/include', ccflags='-g -pipe -fno-common -no-cpp-precomp -I/usr/local/include -pipe -fno-common -Wno-long-double ',
> Linker and Libraries:
> ld='gcc -L/sw/lib -I/sw/include', ldflags='-L/usr/local/lib -flat_namespace ',
> cc_ldflags='',
> libs='-lm -lgmp'
> Dynamic Linking:
> share_ext='.dylib', ld_share_flags='-dynamiclib',
> load_ext='.bundle', ld_load_flags='-bundle -undefined suppress'
> Types:
> iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
> ptrsize=4, ptr_alignment=1 byteorder=4321,
> nv=double, numvalsize=8, doublesize=8
>
> ---
> Environment:
> DYLD_LIBRARY_PATH HOME LANG LANGUAGE LD_LIBRARY_PATH LOGDIR PATH PERL5LIB PERL5_CPANPLUS_CONFIG SHELL

--
Alberto Simões - Departamento de Informática - Universidade do Minho
Campus de Gualtar - 4710-057 Braga - Portugal

Alberto Simões

unread,
Dec 10, 2005, 4:07:50 PM12/10/05
to parrotbug...@parrotcode.org, am...@eremita.di.uminho.pt

Alberto Simoes via RT wrote:
> We can depend on 3.13 instead of 3.14.
> From File::Spec Changelog:
>
> 3.13 Tue Nov 15 23:50:37 CST 2005
>
> [...]
>
> - abs2rel() used to return the empty string when its two arguments
> were identical, which made no sense. Now it returns
> curdir(). [Spotted by David Golden]
>
> So, maybe we should replace '.' by File::Spec->curdir() but I'm not sure.

Yep, I think the attached patch makes more sense.

Alberto Manuel Brandao Simoes

unread,
Dec 10, 2005, 3:38:07 PM12/10/05
to bugs-bi...@rt.perl.org
# New Ticket Created by Alberto Manuel Brandao Simoes
# Please include the string: [perl #37876]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37876 >

Joshua Hoblitt

unread,
Dec 10, 2005, 5:52:48 PM12/10/05
to Alberto Sim??es, parrotbug...@parrotcode.org, am...@eremita.di.uminho.pt
On Sat, Dec 10, 2005 at 09:07:50PM +0000, Alberto Sim??es wrote:
>
>
> Alberto Simoes via RT wrote:
> >We can depend on 3.13 instead of 3.14.
> > From File::Spec Changelog:
> >
> >3.13 Tue Nov 15 23:50:37 CST 2005
> >
> >[...]
> >
> > - abs2rel() used to return the empty string when its two arguments
> > were identical, which made no sense. Now it returns
> > curdir(). [Spotted by David Golden]
> >
> >So, maybe we should replace '.' by File::Spec->curdir() but I'm not sure.
>
> Yep, I think the attached patch makes more sense.

I think we need to also change Parrot::IO::Directory->relative_path() to
filter out '' and replace it with '.' or else we'll have to bundle a
recent version of File::Spec with Parrot, which I'm not too enthusiastic
about.

A revised patch is attached. I'll commit it in this form unless there
is an objection.

Cheers,

-J

--

parrot-r10434-abs2rel_cwd_fix.patch

Chromatic

unread,
Dec 10, 2005, 6:04:09 PM12/10/05
to Joshua Hoblitt, parrotbug...@parrotcode.org
On Sat, 2005-12-10 at 12:52 -1000, Joshua Hoblitt wrote:

> I think we need to also change Parrot::IO::Directory->relative_path() to
> filter out '' and replace it with '.' or else we'll have to bundle a
> recent version of File::Spec with Parrot, which I'm not too enthusiastic
> about.
>
> A revised patch is attached. I'll commit it in this form unless there
> is an objection.

Seems reasonable to me, unless curdir() can ever return 0 or undef, and
also fixes my bug #37875.

-- c

Joshua Hoblitt

unread,
Dec 10, 2005, 6:21:27 PM12/10/05
to chromatic, parrotbug...@parrotcode.org

We could explicitly test if the return eq '' which would let 0 through
but it would still filter out undef. I supposed it's possible that the
current dir might be named 0. ;)

Revised patch is attached.

Cheers,

-J

--

parrot-r10434-abs2rel_cwd_fix.patch

Joshua Hoblitt

unread,
Dec 10, 2005, 7:48:25 PM12/10/05
to chromatic, parrotbug...@parrotcode.org
On Sat, Dec 10, 2005 at 03:04:09PM -0800, chromatic wrote:
> Seems reasonable to me, unless curdir() can ever return 0 or undef, and
> also fixes my bug #37875.

It there something 'magical' about 37875? RT won't let me view it.

--
RT Error
No permission to view ticket
--

-J

--

Joshua Hoblitt

unread,
Dec 10, 2005, 7:52:03 PM12/10/05
to chromatic, parrotbug...@parrotcode.org
Awww, I bet you meant bug #37865. #37876 is clearly a duplicate so I'm
going to merge #37876 into #37865.

-J

--

Joshua Hoblitt

unread,
Dec 10, 2005, 10:43:03 PM12/10/05
to chromatic, parrotbug...@parrotcode.org

I decided to allow undef to pass through as well in case File::Spec's
behavior changes in the future.

--
return (defined $rel_path and $rel_path eq '') ? '.' : $rel_path;
--

Committed as r10438.

Cheers,

-J

--

0 new messages