[51957] trunk/base/src/port1.0/portdestroot.tcl

jmr at macports.org jmr at macports.org
Sun Jun 7 03:54:08 PDT 2009


Revision: 51957
          http://trac.macports.org/changeset/51957
Author:   jmr at macports.org
Date:     2009-06-07 03:54:08 -0700 (Sun, 07 Jun 2009)
Log Message:
-----------
fix checking for destroot (non-)violations in paths outside the prefix

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

Modified: trunk/base/src/port1.0/portdestroot.tcl
===================================================================
--- trunk/base/src/port1.0/portdestroot.tcl	2009-06-07 10:54:01 UTC (rev 51956)
+++ trunk/base/src/port1.0/portdestroot.tcl	2009-06-07 10:54:08 UTC (rev 51957)
@@ -299,15 +299,31 @@
                     # we've found a subpath of our prefix
                     lpush pathsToCheck $dfile
                 } else {
-                    # these files are outside of the prefix
-                    switch $dfile {
-                        $applications_dir -
-                        $developer_dir { ui_debug "port installs files in $dfile" }
-                        default {
-                            ui_warn "violation by $dfile"
-                            set mtree_violation "yes"
+                    set dir_allowed no
+                    # these files are (at least potentially) outside of the prefix
+                    foreach dir "$applications_dir $frameworks_dir /Library/LaunchAgents /Library/LaunchDaemons /Library/StartupItems" {
+                        if {[string equal -length [expr [string length $dfile] + 1] $dfile/ $dir]} {
+                            # it's a prefix of one of the allowed paths
+                            set dir_allowed yes
+                            break
                         }
                     }
+                    if {$dir_allowed} {
+                        lpush pathsToCheck $dfile
+                    } else {
+                        # not a prefix of an allowed path, so it's either the path itself or a violation
+                        switch $dfile {
+                            $applications_dir -
+                            $frameworks_dir -
+                            /Library/LaunchAgents -
+                            /Library/LaunchDaemons -
+                            /Library/StartupItems { ui_debug "port installs files in $dfile" }
+                            default {
+                                ui_warn "violation by $dfile"
+                                set mtree_violation "yes"
+                            }
+                        }
+                    }
                 }
             }
         }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090607/546ff427/attachment.html>


More information about the macports-changes mailing list