Ticket #45353: patch-src-port1_0-portfetch_tcl.diff

File patch-src-port1_0-portfetch_tcl.diff, 2.1 KB (added by anddam (Andrea D'Amore), 10 years ago)
  • src/port1.0/portfetch.tcl

     
    424424
    425425# Perform a git fetch
    426426proc portfetch::gitfetch {args} {
    427     global worksrcpath patchfiles \
     427    global workpath distname worksrcpath patchfiles \
    428428           git.url git.branch git.sha1 git.cmd
    429429
     430    set default_worksrcpath ${workpath}/${distname}
    430431    set options "-q"
    431432    if {${git.branch} eq ""} {
    432433        # if we're just using HEAD, we can make a shallow repo
    433434        set options "$options --depth=1"
    434435    }
    435     set cmdstring "${git.cmd} clone $options ${git.url} ${worksrcpath} 2>&1"
     436    set cmdstring "${git.cmd} clone $options ${git.url} ${default_worksrcpath} 2>&1"
    436437    ui_debug "Executing: $cmdstring"
    437438    if {[catch {system $cmdstring} result]} {
    438439        return -code error [msgcat::mc "Git clone failed"]
     
    439440    }
    440441
    441442    if {${git.branch} ne ""} {
    442         set env "GIT_DIR=${worksrcpath}/.git GIT_WORK_TREE=${worksrcpath}"
     443        set env "GIT_DIR=${default_worksrcpath}/.git GIT_WORK_TREE=${default_worksrcpath}"
    443444        set cmdstring "$env ${git.cmd} checkout -q ${git.branch} 2>&1"
    444445        ui_debug "Executing $cmdstring"
    445446        if {[catch {system $cmdstring} result]} {
     
    456457
    457458# Perform a mercurial fetch.
    458459proc portfetch::hgfetch {args} {
    459     global worksrcpath prefix_frozen patchfiles hg.url hg.tag hg.cmd \
     460    global workpath distname worksrcpath prefix_frozen patchfiles \
     461           hg.url hg.tag hg.cmd hg.args \
    460462           fetch.ignore_sslcert
    461463
     464    set default_worksrcpath ${workpath}/${distname}
    462465    set insecureflag ""
    463466    if {${fetch.ignore_sslcert}} {
    464467        set insecureflag " --insecure"
    465468    }
    466469
    467     set cmdstring "${hg.cmd} clone${insecureflag} --rev \"${hg.tag}\" ${hg.url} ${worksrcpath} 2>&1"
     470    set cmdstring "${hg.cmd} clone${insecureflag} --rev \"${hg.tag}\" ${hg.url} ${default_worksrcpath} 2>&1"
    468471    ui_debug "Executing: $cmdstring"
    469472    if {[catch {system $cmdstring} result]} {
    470473        return -code error [msgcat::mc "Mercurial clone failed"]