[23703] users/pipping/test.pl

source_changes at macosforge.org source_changes at macosforge.org
Fri Apr 6 21:50:47 PDT 2007


Revision: 23703
          http://trac.macosforge.org/projects/macports/changeset/23703
Author:   pipping at macports.org
Date:     2007-04-06 21:50:46 -0700 (Fri, 06 Apr 2007)

Log Message:
-----------
 * add a quick check at the beginning, to narrow down the list of ports
   that need to be looked at, resulting in an enormous speedup

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

Modified: users/pipping/test.pl
===================================================================
--- users/pipping/test.pl	2007-04-07 03:34:51 UTC (rev 23702)
+++ users/pipping/test.pl	2007-04-07 04:50:46 UTC (rev 23703)
@@ -12,21 +12,28 @@
   @ARGV = $portfile;
 
   while (<>) {
-    # concatenate lines connected through trailing backslashes
-    s{\s*\\\n\s*}{ }mgi;
-    # remove comments with whitespace in front
-    s{(?:^|\n)(?:\s)*#.*}{}g;
-    # remove trailing comments
-    s{;\s+#.*}{}g;
-
+    # make a quick and dirty check if the port has a remote chance of
+    # depending on $port
     if ($_ =~ m{
-      \Wdepends_(?:build|run|lib)(?:-(?:append|delete))?
-      .*
-      (?:port|(?:path|lib|bin):[^:]+):${port}(?:\W|$)}x)
+        :$port
+    }x)
     {
-      # remove trailing '/Portfile' in the path
-      $portfile =~ s{\/Portfile}{};
-      print "$portfile\n";
+      # concatenate lines connected through trailing backslashes
+      s{\s*\\\n\s*}{ }mgi;
+      # remove comments with whitespace in front
+      s{(?:^|\n)(?:\s)*#.*}{}g;
+      # remove trailing comments
+      s{;\s+#.*}{}g;
+
+      if ($_ =~ m{
+        \Wdepends_(?:build|run|lib)(?:-(?:append|delete))?
+        .*
+        (?:port|(?:path|lib|bin):[^:]+):${port}(?:\W|$)}x)
+      {
+        # remove trailing '/Portfile' in the path
+        $portfile =~ s{\/Portfile}{};
+        print "$portfile\n";
+      }
     }
   }
 }

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


More information about the macports-changes mailing list