diff Doc/tools/node2label.pl @ 23366:3b323df945bb legacy-trunk

Work around limitation of Cygwin Perl: To avoid a permission denial, we need to do the inplace-edit with a backup file. A quick test leads me to believe this is sufficient to allow building the documentation on Cygwin; a full test is in progress.
author Fred Drake <fdrake@acm.org>
date Thu, 02 May 2002 20:42:30 +0000
parents fe4071beff41
children 4702921297d1
line wrap: on
line diff
--- a/Doc/tools/node2label.pl	Thu May 02 20:34:12 2002 +0000
+++ b/Doc/tools/node2label.pl	Thu May 02 20:42:30 2002 +0000
@@ -1,7 +1,12 @@
 #! /usr/bin/env perl
 
+# On Cygwin, we actually have to generate a temporary file when doing
+# the inplace edit, or we'll get permission errors.  Not sure who's
+# bug this is, except that it isn't ours.  To deal with this, we
+# generate backups during the edit phase and remove them at the end.
+#
 use English;
-$INPLACE_EDIT = '';
+$INPLACE_EDIT = '.bak';
 
 # read the labels, then reverse the mappings
 require "labels.pl";
@@ -60,3 +65,7 @@
 foreach $oldname (keys %newnames) {
   rename($oldname, $newnames{$oldname});
 }
+
+foreach $filename (glob('*.bak')) {
+  unlink($filename);
+}