<pre style='margin:0'>
Clemens Lang (neverpanic) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/fdaf0f31d8ea5fdf95ceed15fccde748e19d19f7">https://github.com/macports/macports-base/commit/fdaf0f31d8ea5fdf95ceed15fccde748e19d19f7</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit fdaf0f31d8ea5fdf95ceed15fccde748e19d19f7
</span>Author: Clemens Lang <neverpanic@gmail.com>
AuthorDate: Wed Sep 27 21:21:10 2023 +0200
<span style='display:block; white-space:pre;color:#404040;'> darwintrace: Fix trace mode test
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This test broke because the return code of /usr/bin/crontab changed when
</span><span style='display:block; white-space:pre;color:#404040;'> users do not have a crontab configured. Fix this by checking the output
</span><span style='display:block; white-space:pre;color:#404040;'> of the command if the command fails.
</span>---
src/darwintracelib1.0/tests/proc.test | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/darwintracelib1.0/tests/proc.test b/src/darwintracelib1.0/tests/proc.test
</span><span style='display:block; white-space:pre;color:#808080;'>index 74d889a96..fea007486 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/darwintracelib1.0/tests/proc.test
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/darwintracelib1.0/tests/proc.test
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -235,13 +235,19 @@ test spawn_sip_suid_binary "Test that posix_spawn(2) works on a SIP-protected SU
</span> -cleanup [expect {}] \
-body {
set status 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {exec -ignorestderr -- ./posix_spawn /usr/bin/crontab -l} results options]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- puts $::errorInfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set details [dict get $options -errorcode]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[lindex $details 0] eq "CHILDSTATUS"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set status [lindex $details 2]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {exec -ignorestderr -- ./posix_spawn /usr/bin/crontab -l 2>@1} results options]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[string match "crontab: no crontab for *" $results]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # The current user has no crontab; that will cause crontab -l
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # to fail, but we don't care; hide the error.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set status 0
</span> } else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return -options $options -level 0 $results
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $::errorInfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set details [dict get $options -errorcode]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[lindex $details 0] eq "CHILDSTATUS"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set status [lindex $details 2]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -options $options -level 0 $results
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
}
return $status
</pre><pre style='margin:0'>
</pre>