New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 82094


Ignore:
Timestamp:
08/07/11 19:33:51 (4 years ago)
Author:
fotanus@…
Message:

Code changes thanks to Perry review

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc11-post-destroot/base/src/port1.0/portcheckdestroot.tcl

    r81446 r82094  
    3838# escape chars in order to be usable as regexp. This function is for internal use.  
    3939proc portcheckdestroot::escape_chars {str} { 
    40         return [regsub -all {\W} $str {\\&}] 
     40    return [regsub -all {\W} $str {\\&}] 
    4141} 
    4242 
     
    7979    set deps {} 
    8080    if {[info exists depends_lib]} { 
    81         foreach dep [set depends_lib] { 
     81        foreach dep $depends_lib { 
    8282            set dep_portname [_get_dep_port $dep] 
    83             if {$dep_portname != ""} { 
    84                 set dep_portname [_get_dep_port $dep] 
    85                 lappend deps $dep_portname 
    86             } 
     83            lappend deps $dep_portname 
    8784        } 
    8885    } 
     
    9188 
    9289# Check for errors on port symlinks 
    93 proc portcheckdestroot::checkdestroot_symlink {} { 
     90proc portcheckdestroot::checkdestroot_symlinks {} { 
    9491    global UI_PREFIX destroot prefix 
    95     ui_notice "$UI_PREFIX Checking for links" 
     92    ui_notice "$UI_PREFIX Checking symlinks" 
    9693    foreach link [links_list $destroot] { 
    9794        set points_to [file link $link] 
     
    9996            #This might be changed for RegExp support 
    10097            if {[regexp $destroot$prefix $points_to]} { 
    101                 ui_debug "$link is an absolute link to a path inside destroot" 
    10298                return -code error "$link is an absolute link to a path inside destroot" 
    10399            } else { 
    104100                ui_debug "$link is an absolute link to a path outside destroot" 
    105101            } 
    106                 ui_debug "Relative link path pointing to inside of destroot" 
    107102        } elseif {[file pathtype $points_to] eq {relative}} { 
    108103            if {[regexp $destroot$prefix [file normalize [file join [file dirname $link] $points_to]]]} { 
    109104                ui_debug "$link is a relative link to a path inside destroot" 
    110105            } else { 
    111                 ui_debug "$link is a relative link to a path outside destroot" 
    112106                return -code error "$link is a relative link to a path outside destroot" 
    113107            } 
     
    266260    ui_notice "$UI_PREFIX Checking for archs" 
    267261    set archs [get_canonical_archs] 
    268     if { "archs" != "noarch" } { 
     262    if { [expr {$archs ne "noarch"}] } { 
    269263        foreach file [files_list $destroot] { 
    270264            set file_archs [list_archs $file] 
    271             foreach arch $file_archs { 
    272                 if { [lsearch $arch $archs] == -1 } { 
    273                     return -code error "$file supports the arch $arch, and should not" 
     265            if { [expr {$file_archs ne {}}] } { 
     266                foreach arch $file_archs { 
     267                    if { [lsearch $arch $archs] == -1 } { 
     268                        return -code error "$file supports the arch $arch, and should not" 
     269                    } 
     270                } 
     271                foreach arch $archs { 
     272                    if { [lsearch $arch $file_archs] == -1 } { 
     273                        return -code error "$file does not suport the arch $arch, and it should" 
     274                    } 
    274275                } 
    275276            } 
     
    282283    ui_notice "$UI_PREFIX Executing check-destroot phase" 
    283284 
    284     checkdestroot_symlink 
     285    checkdestroot_symlinks 
    285286    checkdestroot_mtree 
    286287    checkdestroot_libs 
Note: See TracChangeset for help on using the changeset viewer.