File: wrapper.sh

package info (click to toggle)
task 2.5.3%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,956 kB
  • sloc: cpp: 43,519; python: 12,288; perl: 8,697; sh: 685; makefile: 21
file content (18 lines) | stat: -rw-r--r-- 547 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

SELF=$(basename $0)
ORIGINALHOOK="$(dirname $0)/original_${SELF}"
IN="${ORIGINALHOOK}.log.in"
OUT="${ORIGINALHOOK}.log.out"

# Let it know that we were executed
echo "% Called at $(python3 -c 'import time; print(time.time())') with '$@'" >> ${IN}

# Log what arrives via stdin to ${IN} and what comes via stdout to ${OUT}
$ORIGINALHOOK "$@" < <(tee -a ${IN}) > >(tee -a ${OUT})
# More on the < <() syntax at: http://tldp.org/LDP/abs/html/process-sub.html

EXITCODE=$?
echo "! Exit code: ${EXITCODE}" >> ${OUT}

exit $EXITCODE