[81446] branches/gsoc11-post-destroot/base
fotanus at macports.org
fotanus at macports.org
Sat Jul 30 17:37:13 PDT 2011
Revision: 81446
http://trac.macports.org/changeset/81446
Author: fotanus at macports.org
Date: 2011-07-30 17:37:13 -0700 (Sat, 30 Jul 2011)
Log Message:
-----------
Fixed some bugs testing agains real ports.
Added whitelist conf files to installation.
Modified Paths:
--------------
branches/gsoc11-post-destroot/base/doc/Makefile
branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl
Added Paths:
-----------
branches/gsoc11-post-destroot/base/doc/files_whitelist.conf
branches/gsoc11-post-destroot/base/doc/folders_whitelist.conf
Modified: branches/gsoc11-post-destroot/base/doc/Makefile
===================================================================
--- branches/gsoc11-post-destroot/base/doc/Makefile 2011-07-30 23:41:50 UTC (rev 81445)
+++ branches/gsoc11-post-destroot/base/doc/Makefile 2011-07-31 00:37:13 UTC (rev 81446)
@@ -1,7 +1,7 @@
MAN1= port.1
MAN5= macports.conf.5
MAN7= portfile.7 portstyle.7 porthier.7 portgroup.7
-CONF= macports.conf pubkeys.conf sources.conf variants.conf
+CONF= macports.conf pubkeys.conf sources.conf variants.conf files_whitelist.conf folders_whitelist.conf
INSTALLDIR= ${DESTDIR}${prefix}
TOPSRCDIR= ..
Added: branches/gsoc11-post-destroot/base/doc/files_whitelist.conf
===================================================================
--- branches/gsoc11-post-destroot/base/doc/files_whitelist.conf (rev 0)
+++ branches/gsoc11-post-destroot/base/doc/files_whitelist.conf 2011-07-31 00:37:13 UTC (rev 81446)
@@ -0,0 +1,4 @@
+libSystem.B.dylib
+libstdc++.6.dylib
+libstdc++.8.dylib
+libutil.dylib
Added: branches/gsoc11-post-destroot/base/doc/folders_whitelist.conf
===================================================================
--- branches/gsoc11-post-destroot/base/doc/folders_whitelist.conf (rev 0)
+++ branches/gsoc11-post-destroot/base/doc/folders_whitelist.conf 2011-07-31 00:37:13 UTC (rev 81446)
@@ -0,0 +1 @@
+/System/Library
Modified: branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl
===================================================================
--- branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl 2011-07-30 23:41:50 UTC (rev 81445)
+++ branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl 2011-07-31 00:37:13 UTC (rev 81446)
@@ -35,6 +35,10 @@
}
}
+# escape chars in order to be usable as regexp. This function is for internal use.
+proc portcheckdestroot::escape_chars {str} {
+ return [regsub -all {\W} $str {\\&}]
+}
# List all links on a directory recursively. This function is for internal use.
proc portcheckdestroot::links_list {dir} {
@@ -205,34 +209,41 @@
#Get dependencies files list.
set dep_files {}
foreach dep [get_dependencies] {
- lappend dep_files [file tail [registry_port_registered $dep]]
+ lappend dep_files [registry_port_registered $dep]
}
+
set self_files [bin_list $destroot$prefix]
set dep_files [concat $dep_files $self_files]
-
#Get package files
foreach file [files_list $destroot] {
foreach file_lib [list_dlibs $file] {
set valid_lib 0
- if { [regexp $file_lib $file] } {
+ # File itself
+ if { [regexp [escape_chars $file_lib] $file] } {
set valid_lib 1
}
+
+ # File from the package or its depended ports
if { ! $valid_lib } {
- if { [lsearch $dep_files $file_lib] != -1 } {
- set valid_lib 1
- ui_debug "$file_lib binary dependency is met"
+ foreach dep_file $dep_files {
+ if { [regexp [escape_chars $file_lib] $dep_file] } {
+ set valid_lib 1
+ ui_debug "$file_lib binary dependency is met"
+ }
}
}
+ # on files whitelist
if { ! $valid_lib } {
foreach dep_file $files_whitelist {
- if { [regexp $dep_file [regsub ".*/" $file_lib ""]] } {
+ if { [regexp [escape_chars $dep_file] [file tail $file_lib]] } {
ui_debug "$file_lib binary dependency folder is on whitelist"
set valid_lib 1
break
}
}
}
+ # on folders whitelist
if { ! $valid_lib } {
foreach dep_folder $folders_whitelist {
if { [regexp "^$dep_folder" [regsub $prefix $file_lib ""]] } {
@@ -243,7 +254,7 @@
}
}
if { ! $valid_lib } {
- return -code error "$file_lib binary dependencies are NOT met"
+ return -code error "$file '$file_lib' binary dependencies are NOT met"
}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110730/3aada82c/attachment.html>
More information about the macports-changes
mailing list