Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CPAN-Reporter CPAN distribution.

Report information
The Basics
Id: 70504
Status: resolved
Priority: 0/
Queue: CPAN-Reporter

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 1.20
  • 1.2001
  • 1.2002
  • 1.2003
  • 1.2004
Fixed in: (no value)



Subject: 03_config_file.t fails with extra "/" in path
t/03_config_file.t ............. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/62 subtests

Show quoted text
#   Failed test 'normalize id_file: ~/other.json'
#   at t/03_config_file.t line 76.
#          got: '/tmp/portage/dev-perl-CPAN-Reporter-1.200.200/temp//other.json'
#     expected: '/tmp/portage/dev-perl-CPAN-Reporter-1.200.200/temp/other.json'
# Looks like you failed 1 test of 62.
t/04_option_parsing.t .......... ok    
t/05_prompting.t ............... ok    

http://www.cpantesters.org/cpan/report/880aaf0a-c4ee-11e0-815d-fd3944cb3d13 # Also has this failure.

 

 

 

Ok, on further inspection, it appears File::Glob is wrong here: 

perl -MFile::Glob -E 'say File::Glob::bsd_glob(q{~/other.json})'

/tmp/portage/dev-perl-CPAN-Reporter-1.200.400/temp//other.json

 

perl -MFile::Glob\ 9999
File::Glob version 9999 required--this is only version 1.13.
 

Problem seems to be that $HOME has a trailing slash, and bsd_glob doesn't normalise that out

 

 HOME=/  perl -MFile::Glob -E 'say File::Glob::bsd_glob(q{~/other.json})'                                                                                                                                                     
//other.json
 

HOME=/foo  perl -MFile::Glob -E 'say File::Glob::bsd_glob(q{~/other.json})'                                                                                                                                                  
/foo/other.json

 

 HOME=/foo/  perl -MFile::Glob -E 'say File::Glob::bsd_glob(q{~/other.json})'                                                                                                                                                 
/foo//other.json

 

Behaves this way on File::Glob 1.07 and 1.17  as well.

 

My suggestion is to possibly pass the result from bsd_glob thorugh canonpath

 

HOME=/foo/  perl -MFile::Spec -MFile::Glob -E 'say File::Spec->canonpath(File::Glob::bsd_glob(q{~/other.json}))'
/foo/other.json
 

# Should solve this.

On 2011-08-26 21:16:55, KENTNL wrote:

Show quoted text
> t/03_config_file.t ............. Dubious, test returned 1 (wstat 256,
> 0x100)
> Failed 1/62 subtests
>
> # Failed test 'normalize id_file: ~/other.json'
> # at t/03_config_file.t line 76.
> # got: '/tmp/portage/dev-perl-CPAN-Reporter-
> 1.200.200/temp//other.json'
> # expected: '/tmp/portage/dev-perl-CPAN-Reporter-
> 1.200.200/temp/other.json'
> # Looks like you failed 1 test of 62.
> t/04_option_parsing.t .......... ok
> t/05_prompting.t ............... ok
>
> http://www.cpantesters.org/cpan/report/880aaf0a-c4ee-11e0-815d-
> fd3944cb3d13 #
> Also has this failure.


https://github.com/dagolden/cpan-reporter/pull/9

From 43e99d71a67a4cc4a0e115f65d16a04ec6a4e0b3 Mon Sep 17 00:00:00 2001
From: Kent Fredric <kentfredric@gmail.com>
Date: Fri, 2 Mar 2012 11:27:53 +1300
Subject: [PATCH] Canonicalise the path returned by bsd_glob as its sometimes got extra slashes in it

---
 lib/CPAN/Reporter/Config.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/CPAN/Reporter/Config.pm b/lib/CPAN/Reporter/Config.pm
index 291c01c..0fe23d9 100644
--- a/lib/CPAN/Reporter/Config.pm
+++ b/lib/CPAN/Reporter/Config.pm
@@ -457,7 +457,7 @@ sub _normalize_id_file {
         $id_file = File::Spec->catdir(File::HomeDir->my_home, $1);
     }
     elsif ( $id_file =~ /~/ ) {
-        $id_file = File::Glob::bsd_glob( $id_file );
+        $id_file = File::Spec->canonpath(File::Glob::bsd_glob( $id_file ));
     }
     unless ( File::Spec->file_name_is_absolute( $id_file ) ) {
         $id_file = File::Spec->catfile(
--
1.7.3.4


thanks. patch applied and released in 1.2005