Changeset 1174 for rpmbuild-bot
- Timestamp:
- Jun 7, 2017, 6:12:37 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rpmbuild-bot/rpmbuild-bot.sh
r1159 r1174 254 254 rm -f "$log" 255 255 if [ -n "$log_to_console" ] ; then 256 "$@" 2>&1 | tee "$log" 256 # Do some magic redirection to preserve original error code 257 # (https://stackoverflow.com/questions/1221833/pipe-output-and-capture-exit-status-in-bash) 258 exec 4>&1 259 local rc=`{ { "$@" 2>&1 3>&-; printf $? 1>&3; } 4>&- | tee "$log" 1>&4; } 3>&1` 260 exec 4>&- 257 261 else 258 262 "$@" >"$log" 2>&1 259 fi260 local rc=$?263 local rc=$? 264 fi 261 265 if [ $rc != 0 ] ; then 262 266 log "ERROR: The following command failed with error code $rc:"
Note:
See TracChangeset
for help on using the changeset viewer.