[23899] users/pipping/test.pl

source_changes at macosforge.org source_changes at macosforge.org
Thu Apr 12 09:25:22 PDT 2007


Revision: 23899
          http://trac.macosforge.org/projects/macports/changeset/23899
Author:   pipping at macports.org
Date:     2007-04-12 09:25:21 -0700 (Thu, 12 Apr 2007)

Log Message:
-----------
 * remove obsolete modifiers after embedded regex objects
 * force compile-only-once on regex objects with interpolated variables

Modified Paths:
--------------
    users/pipping/test.pl

Modified: users/pipping/test.pl
===================================================================
--- users/pipping/test.pl	2007-04-12 14:29:20 UTC (rev 23898)
+++ users/pipping/test.pl	2007-04-12 16:25:21 UTC (rev 23899)
@@ -10,13 +10,12 @@
 my $leading_comment       = qr{(?:^|\n)(?>\s*)#(?>.*)};
 my $connecting_backslash  = qr{\s*\\\n\s*};
 
-my $quick_check = qr{:$port}i;
-
+my $quick_check = qr{:$port}io;
 my $dependency  = qr{
                     (?=[plb])(?:port|(?:path|lib|bin):[^:]+)  # kind
                     :                                         # separator
-                    (?i:${port})(?:\s|$)                      # name
-                  }x;
+                    (?i:${port})\b                            # name
+                  }xo;
 
 $/ = ".\n";
 
@@ -26,14 +25,14 @@
   while (<>) {
     # make a quick and dirty check if the port has a remote chance of
     # depending on $port
-    if ($_ =~ m{$quick_check}i) {
+    if ($_ =~ m{$quick_check}) {
 
-      s{$connecting_backslash}{ }g;     # merge backslash-connected lines
-      s{$leading_comment}{}g;           # remove leading comments
-      s{$trailing_comment}{}g;          # remove trailing comments
+      s{$connecting_backslash}{ };    # merge backslash-connected lines
+      s{$leading_comment}{};          # remove leading comments
+      s{$trailing_comment}{};         # remove trailing comments
 
       if ($_ =~ m{$dependency}) {
-        $portfile =~ s{/Portfile$}{};   # remove trailing '/Portfile'
+        $portfile =~ s{/Portfile$}{}; # remove trailing '/Portfile'
         print "$portfile\n";
       }
     }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070412/bbdefcf2/attachment.html


More information about the macports-changes mailing list