[Python-checkins] python/dist/src/Doc/tools node2label.pl,1.12,1.13

fdrake@sourceforge.net fdrake@sourceforge.net
Thu, 02 May 2002 13:42:33 -0700


Update of /cvsroot/python/python/dist/src/Doc/tools
In directory usw-pr-cvs1:/tmp/cvs-serv26821/tools

Modified Files:
	node2label.pl 
Log Message:
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.


Index: node2label.pl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/node2label.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** node2label.pl	23 Jun 2001 04:35:09 -0000	1.12
--- node2label.pl	2 May 2002 20:42:30 -0000	1.13
***************
*** 1,6 ****
  #! /usr/bin/env perl
  
  use English;
! $INPLACE_EDIT = '';
  
  # read the labels, then reverse the mappings
--- 1,11 ----
  #! /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 = '.bak';
  
  # read the labels, then reverse the mappings
***************
*** 60,62 ****
--- 65,71 ----
  foreach $oldname (keys %newnames) {
    rename($oldname, $newnames{$oldname});
+ }
+ 
+ foreach $filename (glob('*.bak')) {
+   unlink($filename);
  }