]> git.donarmstrong.com Git - perltidy.git/commitdiff
build turns off any DEBUG flags on VERSION update
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 17 Oct 2020 23:04:43 +0000 (16:04 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 17 Oct 2020 23:04:43 +0000 (16:04 -0700)
dev-bin/build.pl

index 2e64741d158c623fe5120a7bfa57531880508c56..078bb8689d8f4ccd75dbd6d27120df4d6f26e298 100755 (executable)
@@ -628,11 +628,14 @@ sub update_VERSION {
     my $is_pod_file = !$is_md_file && $source_file !~ /\.pm/;
     while ( my $line = <$fh> ) {
 
-        # Look for and turn off any DEVEL_MODE constants
-        if ( $line =~ /^\s*use constant DEVEL_MODE\s*=>\s*(\d);/ ) {
-            if ( $1 != 0 ) {
+        # Look for and turn off any DEVEL_MODE or DEBUG_XXX constants
+        if ( $line =~
+            /^(\s*use\s+constant\s+(?:DEBUG|DEVEL)_[A-Z]+\s*)=>\s*(-?\d*);(.*)$/
+          )
+        {
+            if ( $2 != 0 ) {
                 $line = <<EOM;
-use constant DEVEL_MODE => 0;
+$1 => 0;$3
 EOM
             }
         }