[52854] branches/gsoc09-logging/base/src
enl at macports.org
enl at macports.org
Wed Jun 24 09:37:37 PDT 2009
Revision: 52854
http://trac.macports.org/changeset/52854
Author: enl at macports.org
Date: 2009-06-24 09:37:35 -0700 (Wed, 24 Jun 2009)
Log Message:
-----------
Changes to provide ui_prefix_stage functions and new logging prefixes
Modified Paths:
--------------
branches/gsoc09-logging/base/src/macports1.0/macports.tcl
branches/gsoc09-logging/base/src/port1.0/portchecksum.tcl
Modified: branches/gsoc09-logging/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc09-logging/base/src/macports1.0/macports.tcl 2009-06-24 15:29:28 UTC (rev 52853)
+++ branches/gsoc09-logging/base/src/macports1.0/macports.tcl 2009-06-24 16:37:35 UTC (rev 52854)
@@ -38,7 +38,7 @@
package require macports_util 1.0
namespace eval macports {
- namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities
+ namespace export bootstrap_options user_options portinterp_options open_mports ui_priorities port_stages
variable bootstrap_options "\
portdbpath libpath binpath auto_path extra_env sources_conf prefix portdbformat \
portinstalltype portarchivemode portarchivepath portarchivetype portautoclean \
@@ -64,6 +64,7 @@
variable open_mports {}
variable ui_priorities "debug info msg error warn"
+ variable port_stages "fetch checksum"
}
# Provided UI instantiations
@@ -128,13 +129,23 @@
}
}
-proc ui_message {priority prefix args} {
- global macports::channels
+proc ui_message {priority prefix stage args} {
+ global macports::channels ::debuglog
foreach chan $macports::channels($priority) {
- if {[lindex $args 0] == "-nonewline"} {
- puts -nonewline $chan "$prefix[lindex $args 1]"
+ if {$chan == $::debuglog} {
+ set strprefix ":$priority:$stage "
+ if {[lindex $args 0] == "-nonewline"} {
+ puts -nonewline $chan "$strprefix[lindex $args 1]"
+ } else {
+ puts $chan "$strprefix[lindex $args 0]"
+ }
+
} else {
- puts $chan "$prefix[lindex $args 0]"
+ if {[lindex $args 0] == "-nonewline"} {
+ puts -nonewline $chan "$prefix[lindex $args 1]"
+ } else {
+ puts $chan "$prefix[lindex $args 0]"
+ }
}
}
}
@@ -158,13 +169,15 @@
} catch * {
set prefix [ui_prefix_default $priority]
}
-
+ set stages {fetch checksum}
try {
eval ::ui_init $priority $prefix $channels($priority) $args
} catch * {
- interp alias {} ui_$priority {} ui_message $priority $prefix
+ interp alias {} ui_$priority {} ui_message $priority $prefix ""
+ foreach stage $stages {
+ interp alias {} ui_${priority}_${stage} {} ui_message $priority $prefix $stage
+ }
}
-
# Call ui_$priority
eval ::ui_$priority $args
@@ -821,6 +834,12 @@
foreach priority ${macports::ui_priorities} {
$workername alias ui_$priority ui_$priority
}
+ foreach priority ${macports::ui_priorities} {
+ foreach stage ${macports::port_stages} {
+ $workername alias ui_${priority}_${stage} ui_${priority}_${stage}
+ }
+ }
+
$workername alias ui_prefix ui_prefix
$workername alias ui_channels ui_channels
Modified: branches/gsoc09-logging/base/src/port1.0/portchecksum.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portchecksum.tcl 2009-06-24 15:29:28 UTC (rev 52853)
+++ branches/gsoc09-logging/base/src/port1.0/portchecksum.tcl 2009-06-24 16:37:35 UTC (rev 52854)
@@ -236,7 +236,7 @@
ui_debug "[format [msgcat::mc "Correct (%s) checksum for %s"] $type $distfile]"
} else {
ui_error "[format [msgcat::mc "Checksum (%s) mismatch for %s"] $type $distfile]"
- ui_info "[format [msgcat::mc "Portfile checksum: %s %s %s"] $distfile $type $sum]"
+ ui_info_fetch "[format [msgcat::mc "Portfile checksum: %s %s %s"] $distfile $type $sum]"
ui_info "[format [msgcat::mc "Distfile checksum: %s %s %s"] $distfile $type $calculated_sum]"
# Raise the failure flag
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090624/ec4154c2/attachment.html>
More information about the macports-changes
mailing list