Changeset View
Changeset View
Standalone View
Standalone View
s/describes-icbm.sh
#!/bin/sh -e | #!/bin/sh -e | ||||
# No user-serviceable parts | # No user-serviceable parts | ||||
if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then | if [ -z "$PORTSNAP_BUILD_CONF_READ" ]; then | ||||
echo "Do not run $0 manually" | echo "Do not run $0 manually" | ||||
exit 1 | exit 1 | ||||
fi | fi | ||||
# usage: sh -e describes-icbm.sh GOODREV BADREV ERRFILE | # usage: sh -e describes-icbm.sh GOODHASH BADHASH ERRFILE | ||||
GOODREV="$1" | GOODHASH="$1" | ||||
BADREV="$2" | BADHASH="$2" | ||||
ERRFILE="$3" | ERRFILE="$3" | ||||
# The first potentially faulty commit is GOODREV+1 | # The first potentially faulty commit is GOODHASH+1 | ||||
BADSTART=`expr "$GOODREV" + 1` | BADSTART=`expr "$GOODHASH" + 1` | ||||
# Standard From/To/Subject lines | # Standard From/To/Subject lines | ||||
cat <<EOF | cat <<EOF | ||||
From: ${INDEXMAIL_FROM} | From: ${INDEXMAIL_FROM} | ||||
To: ${INDEXMAIL_TO} | To: ${INDEXMAIL_TO} | ||||
Subject: INDEX build breakage | Subject: INDEX build breakage | ||||
EOF | EOF | ||||
# CC people who might have broken the INDEX | # CC people who might have broken the INDEX | ||||
jot - ${BADSTART} ${BADREV} | | git --git-dir=${STATEDIR}/repodir log --format=%aE ${GOODHASH}..${BADHASH} | | ||||
while read REV; do | sed 's/^/CC: /' | ||||
svn log -c ${REV} ${REPO} | | |||||
tail +2 | | |||||
head -1; | |||||
done | | |||||
cut -f 2 -d '|' | | |||||
sort -u | | |||||
tr -d ' ' | | |||||
lam -s 'CC: ' - -s '@freebsd.org' | |||||
# Blank line and build failure output | # Blank line and build failure output | ||||
echo | echo | ||||
cat ${ERRFILE} | cat ${ERRFILE} | ||||
# List potentially at-fault committers (again) and SVN history | # List potentially at-fault committers (again) and SVN history | ||||
echo | echo | ||||
echo "Committers on the hook (CCed):" | echo "Committers on the hook (CCed):" | ||||
jot - ${BADSTART} ${BADREV} | | echo $(git --git-dir=${STATEDIR}/repodir log --format=%aE ${GOODHASH}..${BADHASH}) | ||||
while read REV; do | |||||
svn log -c ${REV} ${REPO} | | echo "Latest commits:" | ||||
tail +2 | | git --git-dir=${STATEDIR}/repodir log --oneline ${GOODHASH}..${BADHASH} | ||||
head -1; | |||||
done | | |||||
cut -f 2 -d '|' | | |||||
sort -u | | |||||
tr -d ' ' | |||||
echo | |||||
echo "Latest SVN commits:" | |||||
svn log -r ${BADSTART}:${BADREV} ${REPO} | |||||
# Final message about when emails are sent | # Final message about when emails are sent | ||||
cat <<EOF | cat <<EOF | ||||
There may be different errors exposed by INDEX builds on other | There may be different errors exposed by INDEX builds on other | ||||
branches, but no further emails will be sent until after the | branches, but no further emails will be sent until after the | ||||
INDEX next builds successfully on all branches. | INDEX next builds successfully on all branches. | ||||
EOF | EOF |