Bug#867545: Fails with cryptic message when given non-existing paths

2017-08-20 Thread Tomasz Buchert
On 20/08/17 15:54, Chris Lamb wrote:
> reopen 867545
> found 867545 1.40
> tags 867545 + patch
> thanks
>
> There's something funky with the logic committed in:
>
>   
> https://anonscm.debian.org/git/collab-maint/pristine-tar.git/commit/?id=9265d0c0eea1620370a7261e0a6ee20eb86426fd
>
> ... so that it doesn't actually catch missing files.
>
> I think you want:
>
>sub check_file_exists {
>  my $filename = shift;
>   -  if (!$filename eq "-" and !-f $filename) {
>   +  if ($filename ne "-" and !-f $filename) {
> error "The file $filename does not exist.";
>  }
>}
>
>
> Regards,
>

Logic is hard, especially in Perl. :) Thanks, committed in
https://anonscm.debian.org/cgit/collab-maint/pristine-tar.git/commit/?id=392a80ac9fdea8dbe41c438b9a310549981b3c33.

Tomasz


signature.asc
Description: PGP signature


Bug#867545: Fails with cryptic message when given non-existing paths

2017-08-20 Thread Chris Lamb
reopen 867545 
found 867545 1.40
tags 867545 + patch
thanks

There's something funky with the logic committed in:

  
https://anonscm.debian.org/git/collab-maint/pristine-tar.git/commit/?id=9265d0c0eea1620370a7261e0a6ee20eb86426fd

... so that it doesn't actually catch missing files.

I think you want:

   sub check_file_exists {
 my $filename = shift;
  -  if (!$filename eq "-" and !-f $filename) {
  +  if ($filename ne "-" and !-f $filename) {
error "The file $filename does not exist.";
 }
   }


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-