To help people attach logs to trac tickets would port benefit from having a command like one or both of these?
logpath: returns path to log file for given port(s)
openlogpath: opens logpath in Finder for given port(s)
Essence of attached patch for base/src/port/port.tcl:
# logpath basically copied from logfile
logpath {
set logpath [file join [macports::getportlogpath $portdir
$portname]]
if {[file isdirectory $logpath]} {
puts $logpath
} else {
ui_error "Log file path not found for port in $portdir"
}
}
# openlogpath basically copied from gohome
openlogpath {
set logpath [file join [macports::getportlogpath $portdir
$portname]]
if {[file isdirectory $logpath]} {
if {[catch {system "${macports::autoconf::open_path}
'$logpath'"} result]} {
global errorInfo
ui_debug "$errorInfo"
break_softcontinue "unable to open path using
${macports::autoconf::open_path}: $result" 1 status
}
} else {
ui_error "Log file path not found for port in $portdir"
}
}
These port actions could make it easier to explaining to MP users how to attach
logs to trac tickets. This action idea came to mind from reading a MP user say
they couldn't navigate to the logfile with Safari.
1. Click the "Attach file" button.
2. Click the "Choose File" button.
3. In Terminal do:
$ open $(port logpath portname)
or
$ port openlogpath portname
4. From the newly opened Finder window, drag the main.log file into the Safari
"Choose File" sheet(?).
Regards,
Bradley Giesbrecht (pixilla)
patch-base-src-port-port.tcl.diff
Description: Binary data
_______________________________________________ macports-dev mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
