From 273e6fd627d5657c94538c712d809c4c91db7be2 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Tue, 17 Apr 2012 10:04:34 +0530 Subject: [PATCH] "fake Unix" strikes again... The fix is easy enough, but I hate having to code work-arounds for proprietary OSs when the same code works fine on Linux and BSD. /me wisely avoids words like posix in his rant ;-) Thanks to Franck Zoccolo for help in finding what the problem was and when and why it occurred. ---- Someday there will be some issue that requires a fix with significant code change (or worse, a change that is incompatible with Linux), and I will probably refuse. Of course, I will be properly regretful about my inability to fix it.[1] --- src/lib/Gitolite/Common.pm | 2 +- src/lib/Gitolite/Test/Tsh.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Gitolite/Common.pm b/src/lib/Gitolite/Common.pm index 79c905d..5a4b4dc 100644 --- a/src/lib/Gitolite/Common.pm +++ b/src/lib/Gitolite/Common.pm @@ -274,7 +274,7 @@ sub logger_plus_stderr { sub tsh_try { my $cmd = shift; die "try: expects only one argument" if @_; - $text = `( $cmd ) 2>&1; echo -n RC=\$?`; + $text = `( $cmd ) 2>&1; /bin/echo -n RC=\$?`; if ( $text =~ s/RC=(\d+)$// ) { $rc = $1; trace( 3, $text ); diff --git a/src/lib/Gitolite/Test/Tsh.pm b/src/lib/Gitolite/Test/Tsh.pm index 3281a34..581a844 100644 --- a/src/lib/Gitolite/Test/Tsh.pm +++ b/src/lib/Gitolite/Test/Tsh.pm @@ -333,7 +333,7 @@ sub _sh { # TODO: switch to IPC::Open3 or something...? dbg( 4, " running: ( $cmd ) 2>&1" ); - $text = `( $cmd ) 2>&1; echo -n RC=\$?`; + $text = `( $cmd ) 2>&1; /bin/echo -n RC=\$?`; $lec = $cmd; dbg( 4, " results:\n$text" );