forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow-mods
More file actions
executable file
·61 lines (51 loc) · 2.03 KB
/
Copy pathshow-mods
File metadata and controls
executable file
·61 lines (51 loc) · 2.03 KB
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
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Since it's a pain to manually update the acceptable diffs, this script will pick
# new and modified diffs from the buildbot results, massage them slightly, display
# the difference between the old and new (or the new if no old one) and ask
# whether the diff should be updated.
#
# This script assumes that buildbot log files are available in $bblogdir; this
# will be true only on the buildbot master.
program=${0##*/}
progdir=${0%/*}
bblogdir=/var/lib/buildbot/master/ietfdb/builder1
diffdir=$progdir/diff
function die() { echo "$program: $*"; echo "Terminating"; exit 1; }
sudo chown buildbot:staff -R $bblogdir
sudo chmod g+rw -R $bblogdir
latest=$(ls $bblogdir | egrep "^[0-9]+$" | sort -nr | head -n 1)
modprefix="$bblogdir/$latest-log-django-test-mod_"
if ls $modprefix* > /dev/null; then
for mod in $modprefix*; do
diff="$diffdir/${mod#$modprefix}"
[ -f $diff ] || echo "Missing diff-file: $diff"
temp="/tmp/${mod##*/}"
tail -n +3 $mod | head -n -1 | tr -d "\r" > $temp
echo "========================================================================"
echo " ${diff##*/}"
echo "------------------------------------------------------------------------"
if diff $diff $temp | grep -v "\ No newline at end of file"; then
echo ""
read -p "Update diff [y/N]?" update
if [ "$update" = "Y" -o "$update" = "y" -o "$update" = "yes" ]; then cp $temp $diff; fi
fi
rm $temp
done
fi
modprefix="$bblogdir/$latest-log-django-test-diff_"
if ls $modprefix* > /dev/null; then
for mod in $modprefix*; do
diff="$diffdir/${mod#$modprefix}"
[ -f $diff ] && die "Diff-file $diff exists when it shouldn't..."
temp="/tmp/${mod##*/}"
tail -n +3 $mod | head -n -1 | tr -d "\r" > $temp
echo "========================================================================"
echo " ${diff##*/}"
echo "------------------------------------------------------------------------"
cat $temp
echo ""
read -p "Create diff [y/N]?" update
if [ "$update" = "Y" -o "$update" = "y" -o "$update" = "yes" ]; then cp $temp $diff; fi
rm $temp
done
fi