[134502] trunk/base/src/port1.0/portinstall.tcl

cal at macports.org cal at macports.org
Fri Mar 27 12:42:01 PDT 2015


Revision: 134502
          https://trac.macports.org/changeset/134502
Author:   cal at macports.org
Date:     2015-03-27 12:42:01 -0700 (Fri, 27 Mar 2015)
Log Message:
-----------
base: when all you have is a regex, everything looks like a regular problem

(but that doesn't mean it is, or it is a good idea to use regex)
Follow-up to r134501, see #47283

Revision Links:
--------------
    https://trac.macports.org/changeset/134501

Modified Paths:
--------------
    trunk/base/src/port1.0/portinstall.tcl

Modified: trunk/base/src/port1.0/portinstall.tcl
===================================================================
--- trunk/base/src/port1.0/portinstall.tcl	2015-03-27 19:09:33 UTC (rev 134501)
+++ trunk/base/src/port1.0/portinstall.tcl	2015-03-27 19:42:01 UTC (rev 134502)
@@ -267,12 +267,14 @@
 
     # also save the contents for our own use later
     set installPlist {}
+    set destpathLen [string length $destpath]
     fs-traverse -depth fullpath $destpath {
         if {[file type $fullpath] eq "directory"} {
             continue
         }
-        set relpath [strsed $fullpath "s|^$destpath/||"]
-        if {![regexp {^[+]} $relpath]} {
+
+        set relpath [string range $fullpath $destpathLen+1 end]
+        if {[string index $relpath 0] ne "+"} {
             puts $fd "$relpath"
             lappend installPlist [file join [file separator] $relpath]
             if {[file isfile $fullpath]} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150327/b6d5b40d/attachment.html>


More information about the macports-changes mailing list