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} { |
3028 | 3028 | return 0 |
3029 | 3029 | } |
3030 | 3030 | |
| 3031 | proc 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 | |
3031 | 3042 | proc macports::getportbuildpath {id {portname {}}} { |
3032 | 3043 | 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 |
3034 | 3046 | regsub -all {/} $port_path {_} port_path |
3035 | 3047 | return [file join $portdbpath build $port_path $portname] |
3036 | 3048 | } |
3037 | 3049 | |
3038 | 3050 | proc macports::getportlogpath {id {portname {}}} { |
3039 | 3051 | 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 |
3041 | 3054 | regsub -all {/} $port_path {_} port_path |
3042 | 3055 | return [file join $portdbpath logs $port_path $portname] |
3043 | 3056 | } |
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 {} { |
52 | 52 | |
53 | 53 | set mport [mportopen file://.] |
54 | 54 | |
| 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 | |
55 | 66 | proc getportbuildpath {id {portname ""}} { |
56 | 67 | global portdbpath |
57 | | regsub {://} $id {.} port_path |
| 68 | set s_id [trim_prefix $id [file join $portdbpath sources]] |
| 69 | regsub {://} $s_id {.} port_patha |
58 | 70 | regsub -all {/} $port_path {_} port_path |
59 | 71 | return [file join $portdbpath build $port_path $portname] |
60 | 72 | } |