RE: [RFC] Send new ARI warnings to gdb_testers mailing list

Pierre Muller
2009-05-01T09:24:12Z

Thanks for the remarks, Joel,

> However, the way it is implemented right now means that we'll also get
> an email when we fix things. I think that would be too much. What do
> others think?
What about the following patch:
it does copy the old ari.source.bug to ari.source.old
then it removes the line number field from each of the two files
(in order to avoid seeing only line number changes due to code insertion or
deletion),
and compares the two resulting files.
If the generated diff contains a '>' sign, it means that
a new warning has been generated.

The only drawback is that the line number also does not appear
on the generated email...

If someone with good awk knowledge can tell me out to
substitute each line of the diff (without the line number)
by the corresponding line of the files with line numbers,
it would make the email better.

Pierre Muller
Pascal language support maintainer for GDB
... still only fluent in pascal language, getting used to C,
but still ignorant in awk :(

$ cvs diff -u update-web-ari
Index: update-web-ari
===================================================================
RCS file: /cvs/gdbadmin/ss/update-web-ari,v
retrieving revision 1.141
diff -u -r1.141 update-web-ari
--- update-web-ari 6 Apr 2009 21:27:02 -0000 1.141
+++ update-web-ari 1 May 2009 09:19:47 -0000
@@ -157,10 +157,21 @@

if ${check_source_p} && test -d "${srcdir}"
then
+ cp -f ${wwwdir}/ari.source.bug ${wwwdir}/ari.source.old
echo "`date`: Checking source code" 1>&2
( cd "${srcdir}" && /bin/sh $HOME/ss/gdb_find.sh "${project}" | \
xargs /bin/sh $HOME/ss/gdb_ari.sh -Werror -Wall --print-idx
) > ${wwwdir}/ari.source.bug
+ difffile=${wwwdir}/ari.source.diff
+ sed -e "s/\([^:]*\):\([^:]*\):\(.*\)/\1:0:\3/" ${wwwdir}/ari.source.old
> ${wwwdir}/ari.source.old-pruned
+ sed -e "s/\([^:]*\):\([^:]*\):\(.*\)/\1:0:\3/" ${wwwdir}/ari.source.bug
> ${wwwdir}/ari.source.bug-pruned
+ diff ${wwwdir}/ari.source.old-pruned ${wwwdir}/ari.source.bug-pruned >
${difffile}-in
+ sed -n -e "/^>.*/p" ${difffile}-in > ${difffile}
+ if [ -s ${difffile} ]; then
+ # Send an email to gdb-testers@sourceware.org
+ mutt -s "ARI warning list change `date`" -i ${difffile}-in \
+ gdb-testers@sourceware.org
+ fi
fi