For VMS, generate the delete rules for generated and copied files in buildtoc.
Nicholas Clark [Sun, 19 Apr 2009 11:08:25 +0000 (12:08 +0100)]
pod/buildtoc
vms/descrip_mms.template

index e12bb29..e97c581 100644 (file)
@@ -562,6 +562,11 @@ SNIP
    sort keys %Pods, keys %Readmepods;
 }
 
+sub generate_descrip_mms_3 {
+  map qq{\t- If F\$Search("[.pod]$_").nes."" Then Delete/NoConfirm/Log [.pod]$_;*},
+    sort keys %Generated, keys %Copies;
+}
+
 sub generate_nmake_1 {
   # XXX Fix this with File::Spec
   (map {sprintf "\tcopy ..\\README.%-8s ..\\pod\\perl$_.pod\n", $_}
@@ -678,6 +683,16 @@ sub do_vms {
   die "$0: $name contains $sections discontigous copy rules"
     if $sections > 1;
   $makefile =~ s/\0+/join "\n", '', &generate_descrip_mms_2/se;
+
+# Looking for rules like this:
+#      - If F$Search("[.pod]perldelta.pod").nes."" Then Delete/NoConfirm/Log [.pod]perldelta.pod;*
+  $makefile =~ s!(?:\t- If F\$Search\("\[\.pod\]perl[a-z]+\Q.pod").nes."" Then Delete/NoConfirm/Log [.pod]perl\E[a-z]+\.pod;\*\n)+!\0!sg;
+  $sections = () = $makefile =~ m/\0+/g;
+  die "$0: $name contains no delete rules" if $sections < 1;
+  die "$0: $name contains $sections discontigous delete rules"
+    if $sections > 1;
+  $makefile =~ s/\0+/join "\n", &generate_descrip_mms_3, ''/se;
+
   $makefile;
 }
 
index ade9c2f..32af468 100644 (file)
@@ -1852,9 +1852,9 @@ clean : tidy cleantest cleanup_unpacked_files
        - If F$Search("[.vms.ext...]*.C").nes."" Then Delete/NoConfirm/Log [.vms.ext...]*.C;*
        - If F$Search("[.vms.ext...]*$(O)").nes."" Then Delete/NoConfirm/Log [.vms.ext...]*$(O);*
        - If F$Search("[.pod]*.com").nes."" Then Delete/NoConfirm/Log [.pod]*.com;*
+       - If F$Search("[.pod]perlapi.pod").nes."" Then Delete/NoConfirm/Log [.pod]perlapi.pod;*
        - If F$Search("[.pod]perldelta.pod").nes."" Then Delete/NoConfirm/Log [.pod]perldelta.pod;*
        - If F$Search("[.pod]perlintern.pod").nes."" Then Delete/NoConfirm/Log [.pod]perlintern.pod;*
-       - If F$Search("[.pod]perlapi.pod").nes."" Then Delete/NoConfirm/Log [.pod]perlapi.pod;*
        - @extra_pods CLEAN
        - If F$Search("unpushed.h").nes."" Then Delete/NoConfirm/Log unpushed.h;*
        - If F$Search("[.lib]Config_git.pl").nes."" Then Delete/NoConfirm/Log [.lib]Config_git.pl;*