Skip Menu |

This queue is for tickets about the Archive-Tar CPAN distribution.

Report information
The Basics
Id: 27124
Status: resolved
Priority: 0/
Queue: Archive-Tar

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

Bug Information
Severity: (no value)
Broken in: 1.30
Fixed in: (no value)

Attachments
10_dont_warn_when_only_checking.dpatch



Subject: Unneeded warning sent when checking for file inclusion
Hi, Your module includes a "contains_file" method, quite useful IMHO - But by the way it is implemented, it can lead to unneeded garbage being sent to STDERR. After all, when you call contains_file, it is because you are not certain whether the file is contained or not :) A user filed this bug quite a long time ago on the Debian package: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=318497 Today I closed it by applying the patch I'm attaching here. I tried to steer away from your code as little as possible - Although I'm manipulating the $WARN variable, which you mention is not a thread-safe thing to do. All the other places where _find_entry is called are IMHO fine this way - but this particular function is _expected_ not to find the requested file every now and then. I could have otherwise replaced the function body with something like this: sub contains_file { my $self = shift; my $file = shift; return 1 if grep {$_ eq $file} $self->list_files; return 0; } This would, however, be a bit dangerous when the file list is _really_ large - Of course, looking quickly into _find_entry, it looks similar to what's already being done there. Anyway, by doing it in this fashion, $file could be not only the exact filename, but it could be a regex or something more intelligent. Thanks a lot,
Subject: 10_dont_warn_when_only_checking.dpatch
Download 10_dont_warn_when_only_checking.dpatch
application/octet-stream 732b

Message body not shown because it is not plain text.

On Mon May 14 12:03:50 2007, GWOLF wrote: Show quoted text
> Your module includes a "contains_file" method, quite useful IMHO - But > by the way it is implemented, it can lead to unneeded garbage being sent > to STDERR.
Thanks for reporting; this issue has been addressed. Archive::Tar 1.31 (to be releases shortly) will hold this fix. -- Jos