[80264] branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot. tcl

fotanus at macports.org fotanus at macports.org
Thu Jul 7 21:34:08 PDT 2011


Revision: 80264
          http://trac.macports.org/changeset/80264
Author:   fotanus at macports.org
Date:     2011-07-07 21:34:06 -0700 (Thu, 07 Jul 2011)
Log Message:
-----------
Perry code review results

Modified Paths:
--------------
    branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl

Modified: branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl
===================================================================
--- branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl	2011-07-08 03:42:17 UTC (rev 80263)
+++ branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl	2011-07-08 04:34:06 UTC (rev 80264)
@@ -4,6 +4,7 @@
 package provide portcheckdestroot 1.0
 package require portutil 1.0
 
+
 set org.macports.checkdestroot [target_new org.macports.checkdestroot portcheckdestroot::checkdestroot_main]
 target_provides ${org.macports.checkdestroot} checkdestroot
 target_requires ${org.macports.checkdestroot} main destroot
@@ -24,7 +25,7 @@
 proc portcheckdestroot::checkdestroot_start {args} {
     if { [getuid] == 0 && [geteuid] != 0 } {
         # if started with sudo but have dropped the privileges
-        ui_debug "Can't run destroot under sudo without elevated privileges (due to mtree)."
+        ui_debug "Can't run checkdestroot under sudo without elevated privileges (due to mtree)."
         ui_debug "Run destroot without sudo to avoid root privileges."
         ui_debug "Going to escalate privileges back to root."
         setegid $egid
@@ -33,6 +34,10 @@
     }
 }
 
+# List contents for a given port.
+proc portcheckdestroot::get_port_files {portname} {
+}
+
 # Check if a file is binary file
 # TODO: Somewhat probabilistic. Must be a better way.
 proc portcheckdestroot::binary? filename {
@@ -45,7 +50,7 @@
 
 # escape chars in order to be usable as regexp. This function is for internal use.
 proc portcheckdestroot::escape_chars {str} {
-    return [regsub {\+} $str {\+}]
+    return [regsub -all {\W} $str {\\&}]
 }
 
 # List all links on a directory recursively. This function is for internal use.
@@ -68,7 +73,7 @@
     set ret {}
     foreach item [glob -nocomplain -type "d $type" -directory $dir *] {
         if {[file isdirectory $item]} {
-            set ret [concat $ret [types_list $item $type]]
+            set ret [concat $ret [types_list $item $type $bin]]
         } else {
             #is from the correct type
             if { $bin } {
@@ -234,7 +239,7 @@
     #Get dependencies files list.
     set dep_files {}
     foreach dep [get_dependencies] {
-        lappend dep_files [get_files [exec port contents $dep]]
+        lappend dep_files [registry_port_registered $dep]
     }
     set self_files [bin_list $destroot$prefix]
     set dep_files [concat $dep_files $self_files]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110707/219a7ffc/attachment.html>


More information about the macports-changes mailing list