Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions doc/portfile.7
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,16 @@ Whether to ignore the host SSL certificate (for HTTPS).
.Sy Default:
.Em no
.br
.It Ic fetch.user_agent
HTTP User-Agent to use when fetching the resource.
Useful for servers that block requests from the default curl user agent.
.br
.Sy Type:
.Em optional
.br
.Sy Default:
.Em \&""
.br
.El
.Ss FETCHING FROM CVS
As an alternative to fetching distribution files, pulling the sources from a
Expand Down Expand Up @@ -2281,6 +2291,15 @@ md5 sum to use for md5 comparison.
.br
.Sy Type:
.Em optional
.It Ic livecheck.user_agent
HTTP User-Agent to use when fetching the livecheck resource.
Useful for servers that block requests from the default curl user agent.
.br
.Sy Type:
.Em optional
.br
.Sy Default:
.Em \&""
.El
.Sh VARIANT OPTIONS
MacPorts allows for conditional modification to be specified in a
Expand Down
2 changes: 1 addition & 1 deletion src/port1.0/port_test_autoconf.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# 3. Neither the name of Apple Inc. nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down
8 changes: 7 additions & 1 deletion src/port1.0/portlivecheck.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace eval portlivecheck {
}

# define options
options livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.branch livecheck.name livecheck.distname livecheck.version livecheck.ignore_sslcert livecheck.compression livecheck.curloptions
options livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.branch livecheck.name livecheck.distname livecheck.version livecheck.ignore_sslcert livecheck.compression livecheck.curloptions livecheck.user_agent

# defaults
default livecheck.url {$homepage}
Expand All @@ -59,6 +59,7 @@ default livecheck.version {$version}
default livecheck.ignore_sslcert no
default livecheck.compression yes
default livecheck.curloptions [list --append-http-header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"]
default livecheck.user_agent {}

proc portlivecheck::livecheck_async_start {} {
_livecheck_main yes
Expand All @@ -82,6 +83,7 @@ proc portlivecheck::_livecheck_main {{async no}} {
livecheck.ignore_sslcert \
livecheck.compression \
livecheck.curloptions \
livecheck.user_agent \
git.cmd \
homepage portpath \
master_sites name subport
Expand Down Expand Up @@ -141,6 +143,10 @@ proc portlivecheck::_livecheck_main {{async no}} {
if {[tbool livecheck.compression]} {
lappend curl_options "--enable-compression"
}
if {${livecheck.user_agent} ne ""} {
lappend curl_options "--user-agent"
lappend curl_options "${livecheck.user_agent}"
}

# Check _resources/port1.0/livecheck for available types.
set types_dir [getdefaultportresourcepath "port1.0/livecheck"]
Expand Down
Loading
Loading