Ticket #144: 0002-Make-perl.-req-prov-warn-about-unreadable-files.patch

File 0002-Make-perl.-req-prov-warn-about-unreadable-files.patch, 1.1 kB (added by scop, 2 years ago)
  • a/scripts/perl.prov

    old new  
    8282  my ($file) = @_; 
    8383  chomp $file; 
    8484 
    85   open(FILE, "<$file") || return; 
     85  if (!open(FILE, $file)) { 
     86    warn("$0: Warning: Could not open file '$file' for reading: $!\n"); 
     87    return; 
     88  } 
    8689 
    8790  my ($package, $version, $incomment, $inover) = (); 
    8891 
  • a/scripts/perl.req

    old new  
    7979  my ($file) = @_; 
    8080  chomp $file; 
    8181 
    82   open(FILE, "<$file") || return; 
     82  if (!open(FILE, $file)) { 
     83    warn("$0: Warning: Could not open file '$file' for reading: $!\n"); 
     84    return; 
     85  } 
    8386 
    8487  while (<FILE>) { 
    8588