New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 81397


Ignore:
Timestamp:
07/29/11 19:31:44 (4 years ago)
Author:
fotanus@…
Message:

Moved whitelist configuration to .conf files

also removed some orphaned functions and fixed a bug, pointed out in the review

Location:
branches/gsoc11-post-destroot/base/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-post-destroot/base/src/macports1.0/macports.tcl

    r78396 r81397  
    5252    variable portinterp_options "\ 
    5353        portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \ 
     54        files_whitelist folders_whitelist \ 
    5455        registry.path registry.format \ 
    5556        portarchivetype archivefetch_pubkeys portautoclean porttrace keeplogs portverbose destroot_umask \ 
     
    526527            } 
    527528            close $fd 
     529        } 
     530    } 
     531 
     532    # Read dynamic libraries whitelist config files 
     533    set whitelist_conf_files {folders_whitelist files_whitelist} 
     534    foreach whitelist $whitelist_conf_files { 
     535        set file "${macports_conf_path}/${whitelist}.conf" 
     536        if { [file exists $file] } { 
     537            set macports::${whitelist} {} 
     538            set fd [open $file] 
     539            while { [gets $fd line] >= 0 } { 
     540                lappend macports::${whitelist} $line 
     541            } 
     542            global macports::${whitelist} 
    528543        } 
    529544    } 
  • branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl

    r81369 r81397  
    3636} 
    3737 
    38 # List contents for a given port. 
    39 proc portcheckdestroot::get_port_files {portname} { 
    40 } 
    4138 
    4239# escape chars in order to be usable as regexp. This function is for internal use. 
     
    7673    } 
    7774    return $ret 
    78 } 
    79  
    80 # Get files from a list. For internal use only 
    81 proc portcheckdestroot::get_files { list } { 
    82     set files {} 
    83     foreach element $list { 
    84         if { [regexp {^/?[A-Za-z0-9\.-]+(/[A-Za-z0-9\.-]+)*$} $element] } { 
    85             if { [file exists $element] } { 
    86                 lappend files $element 
    87             } 
    88         } 
    89     } 
    90     return $files 
    9175} 
    9276 
     
    220204proc portcheckdestroot::checkdestroot_libs {} { 
    221205    global destroot prefix UI_PREFIX subport 
     206    global files_whitelist folders_whitelist 
     207 
    222208    ui_notice "$UI_PREFIX Checking for wrong dynamic links" 
    223  
    224     #Folders that don't need to be alerted if not on dependencies. 
    225     set files_whitelist {libSystem.B.dylib} 
    226     set folders_whitelist {/System/Library} 
    227209 
    228210    #Get dependencies files list. 
     
    259241            if { ! $valid_lib } { 
    260242                foreach dep_folder $folders_whitelist { 
    261                     if { [regexp "^$dep" [regsub $prefix $file_lib ""]] } { 
     243                    if { [regexp "^$dep_folder" [regsub $prefix $file_lib ""]] } { 
    262244                        ui_debug "$file_lib binary dependency folder is on whitelist" 
    263245                        set valid_lib 1 
Note: See TracChangeset for help on using the changeset viewer.