From: Nicholas Clark Date: Sun, 19 Apr 2009 11:08:25 +0000 (+0100) Subject: For VMS, generate the delete rules for generated and copied files in buildtoc. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db34a22aed169a6db5effc5e9f0373a3061e53f4;p=p5sagit%2Fp5-mst-13.2.git For VMS, generate the delete rules for generated and copied files in buildtoc. --- diff --git a/pod/buildtoc b/pod/buildtoc index e12bb29..e97c581 100644 --- a/pod/buildtoc +++ b/pod/buildtoc @@ -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; } diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template index ade9c2f..32af468 100644 --- a/vms/descrip_mms.template +++ b/vms/descrip_mms.template @@ -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;*