blob: 8ce5b4b8ba81ccc888ad28d0e28425bd70774973 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#!/bin/bash
set -e
. #ETCDIR#/check-versions.conf
print() {
echo -n "$1 ("
grep '^real' "${tmpDir}/$1.time" | \
awk '{print $2"):"}'
cat "${tmpDir}/${dist}.out"
echo
}
if [ $# -eq 0 ]; then
tmpDir="$(mktemp -d)"
echo "${!cmds[@]}" | \
tr ' ' '\n' | \
parallel "$0" "${tmpDir}" "{}" || \
echo "parallel exited with code $?"
gefunden=false
for dist in "${!cmds[@]}"; do
if [ -s "${tmpDir}/${dist}.out" ]; then
gefunden=true
print "${dist}"
fi
done
if ! ${gefunden}; then
for dist in "${!cmds[@]}"; do
print "${dist}"
done
fi
rm -rf "${tmpDir}"
else
time (
:;
(
${cmds["$2"]}
) &> "$1/$2.out"
) 2> "$1/$2.time"
fi
|