Ticket #27881: patch-src-port1.0-portfetch.tcl.diff

File patch-src-port1.0-portfetch.tcl.diff, 1.7 KB (added by pixilla (Bradley Giesbrecht), 13 years ago)
  • src/port1.0/portfetch.tcl

     
    4848
    4949# define options: distname master_sites
    5050options master_sites patch_sites extract.suffix distfiles patchfiles use_bzip2 use_lzma use_xz use_zip use_7z use_dmg dist_subdir \
    51     fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert \
     51    fetch.type fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert fetch.user_agent \
    5252    master_sites.mirror_subdir patch_sites.mirror_subdir \
    5353    bzr.url bzr.revision \
    5454    cvs.module cvs.root cvs.password cvs.date cvs.tag cvs.method \
     
    116116default fetch.ignore_sslcert "no"
    117117# Use remote timestamps
    118118default fetch.remote_time "no"
     119# Set user agent
     120default fetch.user_agent ""
    119121
    120122default fallback_mirror_site "macports"
    121123default global_mirror_site "macports_distfiles"
     
    421423# the listed url variable and associated distfile
    422424proc portfetch::fetchfiles {args} {
    423425    global distpath all_dist_files UI_PREFIX
    424     global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert fetch.remote_time
     426    global fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert fetch.remote_time fetch.user_agent
    425427    global fallback_mirror_site portverbose usealtworkpath altprefix
    426428    variable fetch_urls
    427429    variable urlmap
     
    443445    if {$portverbose == "yes"} {
    444446        lappend fetch_options "-v"
    445447    }
     448    if {[string length ${fetch.user_agent}]} {
     449        lappend fetch_options "--user-agent"
     450        lappend fetch_options "'${fetch.user_agent}'"
     451    }
    446452    set sorted no
    447453
    448454    foreach {url_var distfile} $fetch_urls {