changeset 17371:6959449c25f6

prefix-gnulib-mk: give better diagnostics * build-aux/prefix-gnulib-mk: Don't just "die". Give better diagnostics upon failure.
author Jim Meyering <meyering@fb.com>
date Sun, 27 Jan 2013 09:54:55 -0800
parents 2a9ec0103b3c
children 8c32877a40e6
files ChangeLog build-aux/prefix-gnulib-mk
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-27  Jim Meyering  <jim@meyering.net>
+
+	prefix-gnulib-mk: give better diagnostics
+	* build-aux/prefix-gnulib-mk: Don't just "die".
+	Give better diagnostics upon failure.
+
 2013-03-13  Paul Eggert  <eggert@cs.ucla.edu>
 
 	putenv: port to Solaris 10
--- a/build-aux/prefix-gnulib-mk
+++ b/build-aux/prefix-gnulib-mk
@@ -189,10 +189,11 @@
 {
   my ($file) = @_;
   my ($bak) = "$file.bak";
-  rename ($file, $bak) or die;
+  rename ($file, $bak) or die "$ME: rename $file $bak failed: $!\n";
   my $contents = contents ($bak);
   $contents = prefix ($contents);
-  my $out = new IO::File(">$file") or die;
+  my $out = new IO::File(">$file")
+    or die "$ME: $file: failed to open for writing: $!\n";
   print $out $contents;
 }