Ticket #70539: MacPorts-2.10.0.diff

File MacPorts-2.10.0.diff, 2.5 KB (added by nanigashi-uji (Nanigashi Uji), 3 months ago)
  • src/macports1.0/macports.tcl

    diff -rupN MacPorts-2.10.0.orig/src/macports1.0/macports.tcl MacPorts-2.10.0/src/macports1.0/macports.tcl
    old new proc _source_is_obsolete_svn_repo {source_dir} { 
    30283028    return 0
    30293029}
    30303030
     3031proc macports::trim_prefix {fullpath prefix} {
     3032    set fullpath [file normalize $fullpath]
     3033    set prefix   [file normalize $prefix]
     3034    if {[string first $prefix $fullpath] != 0} {
     3035        return $fullpath
     3036    }
     3037    set relative_path [string range $fullpath [string length $prefix] end]
     3038    set relative_path [string trimleft $relative_path "/\\"]
     3039    return $relative_path
     3040}
     3041
    30313042proc macports::getportbuildpath {id {portname {}}} {
    30323043    variable portdbpath
    3033     regsub {://} $id {.} port_path
     3044    set s_id [macports::trim_prefix $id [file join $portdbpath sources]]
     3045    regsub {://} $s_id {.} port_path
    30343046    regsub -all {/} $port_path {_} port_path
    30353047    return [file join $portdbpath build $port_path $portname]
    30363048}
    30373049
    30383050proc macports::getportlogpath {id {portname {}}} {
    30393051    variable portdbpath
    3040     regsub {://} $id {.} port_path
     3052    set s_id [macports::trim_prefix $id [file join $portdbpath sources]]
     3053    regsub {://} $s_id {.} port_path
    30413054    regsub -all {/} $port_path {_} port_path
    30423055    return [file join $portdbpath logs $port_path $portname]
    30433056}
  • src/port1.0/tests/portutil.test

    diff -rupN MacPorts-2.10.0.orig/src/port1.0/tests/portutil.test MacPorts-2.10.0/src/port1.0/tests/portutil.test
    old new proc init_eval_targets {} { 
    5252
    5353    set mport [mportopen file://.]
    5454
     55    proc trim_prefix {fullpath prefix} {
     56        set fullpath [file normalize $fullpath]
     57        set prefix   [file normalize $prefix]
     58        if {[string first $prefix $fullpath] != 0} {
     59            return $fullpath
     60        }
     61        set relative_path [string range $fullpath [string length $prefix] end]
     62        set relative_path [string trimleft $relative_path "/\\"]
     63        return $relative_path
     64    }
     65
    5566    proc getportbuildpath {id {portname ""}} {
    5667        global portdbpath
    57         regsub {://} $id {.} port_path
     68        set s_id [trim_prefix $id [file join $portdbpath sources]]
     69        regsub {://} $s_id {.} port_patha
    5870        regsub -all {/} $port_path {_} port_path
    5971        return [file join $portdbpath build $port_path $portname]
    6072    }