avoid leaving the old perldelta as a symlink
authorTony Cook <tony@develop-help.com>
Thu, 20 Feb 2014 05:02:57 +0000 (16:02 +1100)
committerTony Cook <tony@develop-help.com>
Thu, 20 Feb 2014 05:02:57 +0000 (16:02 +1100)
In a built tree, the name we copy perldelta.pod to is a symlink to
perldelta.pod, and if you blindly follow the git adds, you end up
adding a symlink to the commit.

unlink() the name we're about to overwrite before we overwrite it to
prevent that.

Porting/new-perldelta.pl

index 7aa605e..bc11e59 100644 (file)
@@ -61,6 +61,9 @@ $olddelta =~ s{^(perl)(delta - what is new for perl v5.$old_major.$old_minor)$}
     or die "Can't find expected NAME contents in $olddelta";
 
 my $olddeltaname = "pod/perl5$old_major${old_minor}delta.pod";
+# in a built tree, $olddeltaname is a symlink to perldelta.pod, make sure
+# we don't write through it
+unlink($olddeltaname);
 write_or_die($olddeltaname, $olddelta);
 git_add_new($olddeltaname);