[120943] trunk/base/src/port1.0/portdistcheck.tcl
cal at macports.org
cal at macports.org
Thu Jun 12 05:54:27 PDT 2014
Revision: 120943
https://trac.macports.org/changeset/120943
Author: cal at macports.org
Date: 2014-06-12 05:54:27 -0700 (Thu, 12 Jun 2014)
Log Message:
-----------
base: port1.0: distcheck: Handle SIGINT, SIGTERM
Modified Paths:
--------------
trunk/base/src/port1.0/portdistcheck.tcl
Modified: trunk/base/src/port1.0/portdistcheck.tcl
===================================================================
--- trunk/base/src/port1.0/portdistcheck.tcl 2014-06-12 12:19:32 UTC (rev 120942)
+++ trunk/base/src/port1.0/portdistcheck.tcl 2014-06-12 12:54:27 UTC (rev 120943)
@@ -85,13 +85,20 @@
foreach site $urlmap($url_var) {
ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
set file_url [portfetch::assemble_url $site $distfile]
- if {[catch {set urlnewer [curl isnewer {*}$curl_options $file_url $port_moddate]} error]} {
- ui_warn "couldn't fetch $file_url for $subport ($error)"
- } else {
+ try {
+ set urlnewer [curl isnewer {*}$curl_options $file_url $port_moddate]
if {$urlnewer} {
ui_warn "port $subport: $file_url is newer than Portfile"
}
incr count
+ } catch {{POSIX SIG SIGINT} eCode eMessage} {
+ ui_debug [msgcat::mc "Aborted due to SIGINT"]
+ throw
+ } catch {{POSIX SIG SIGTERM} eCode eMessage} {
+ ui_debug [msgcat::mc "Aborted due to SIGTERM"]
+ throw
+ } catch {{*} eCode eMessage} {
+ ui_debug [msgcat::mc "couldn't fetch %s for %s (%s)" $file_url $subport $eMessage]
}
}
if {$count == 0} {
@@ -102,15 +109,22 @@
foreach site $urlmap($url_var) {
ui_debug [format [msgcat::mc "Checking %s from %s"] $distfile $site]
set file_url [portfetch::assemble_url $site $distfile]
- if {[catch {set urlsize [curl getsize {*}$curl_options $file_url]} error]} {
- ui_warn "couldn't fetch $file_url for $subport ($error)"
- } else {
+ try {
+ set urlsize [curl getsize {*}$curl_options $file_url]
incr count
if {$urlsize > 0} {
ui_info "port $subport: $distfile $urlsize bytes"
incr totalsize $urlsize
break
}
+ } catch {{POSIX SIG SIGINT} eCode eMessage} {
+ ui_debug [msgcat::mc "Aborted due to SIGINT"]
+ throw
+ } catch {{POSIX SIG SIGTERM} eCode eMessage} {
+ ui_debug [msgcat::mc "Aborted due to SIGTERM"]
+ throw
+ } catch {{*} eCode eMessage} {
+ ui_debug [msgcat::mc "couldn't fetch %s for %s (%s)" $file_url $subport $eMessage]
}
}
if {$count == 0} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140612/e97cc640/attachment.html>
More information about the macports-changes
mailing list