Make perl.{req,prov} warn about unreadable files.
authorVille Skyttä <ville.skytta@iki.fi>
Thu, 25 Feb 2010 17:37:55 +0000 (19:37 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 1 Mar 2010 09:50:29 +0000 (11:50 +0200)
scripts/perl.prov
scripts/perl.req

index deb8fc0..9886dd9 100755 (executable)
@@ -82,7 +82,10 @@ sub process_file {
   my ($file) = @_;
   chomp $file;
 
-  open(FILE, "<$file") || return;
+  if (!open(FILE, $file)) {
+    warn("$0: Warning: Could not open file '$file' for reading: $!\n");
+    return;
+  }
 
   my ($package, $version, $incomment, $inover) = ();
 
index 587b3a5..a52596b 100755 (executable)
@@ -79,7 +79,10 @@ sub process_file {
   my ($file) = @_;
   chomp $file;
 
-  open(FILE, "<$file") || return;
+  if (!open(FILE, $file)) {
+    warn("$0: Warning: Could not open file '$file' for reading: $!\n");
+    return;
+  }
 
   while (<FILE>) {