From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23650 invoked by alias); 16 Jun 2011 11:45:21 -0000 Received: (qmail 23632 invoked by uid 22791); 16 Jun 2011 11:45:17 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_20,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jun 2011 11:45:01 +0000 Received: from md1.u-strasbg.fr (md1.u-strasbg.fr [IPv6:2001:660:2402::186]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id p5GBiqgd012481 ; Thu, 16 Jun 2011 13:44:53 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [130.79.204.11]) by md1.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p5GBiqAF076373 ; Thu, 16 Jun 2011 13:44:52 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id p5GBiow9014040 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Thu, 16 Jun 2011 13:44:52 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'gdb'" , "'Phil Muldoon'" References: In-Reply-To: Subject: RE: ARI/Commit rules Date: Thu, 16 Jun 2011 11:45:00 -0000 Message-ID: <000601cc2c1a$d06084e0$71218ea0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-06/txt/msg00114.txt.bz2 Hi all, An important part of the job to generate=20 the ARI post-commit messages to gdb-patches is done in ss/update-web-ari this script is not copied to http://sourceware.org/gdb/current/ari/ The relevant part is listed below. Each day, it copies ari.sources.bug to ari.sources.old ari.sources.lines to ari.sources.lines-old Runs update_ari script, and generates a diff of the two ARI lists and looks for the corresponding source lines to generate the email message. It should be possible to restrict the script to changes files by=20 replacing gdb_find by something that only lists the modified files. After, you would need to restore the original versions to create the CVS reference ARI listing for those files, apply your patch, launch gdb_ari.sh script again and compare the two output as done below... I am not bash expect and my AWK knowledge is rather limited, which means that the modifications that I inserted to generate those emails are probably far from being efficient and clean, but you are of course welcome to propose enhancements, Pierre Muller=20 as ARI maintainer PS: As to adding ARI rules about proper formatting, I have nothing against the principle. I even already have a uncommitted gdb_ari.sh change that adds a "spaces" category that looks for: - spaces at end of lines - tab/spaces mix - 8 or more spaces at line start. > -----Message d'origine----- > De=A0: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] De la p= art > de Alfred M. Szmidt > Envoy=E9=A0: mercredi 15 juin 2011 20:03 > =C0=A0: pmuldoon@redhat.com > Cc=A0: gdb@sourceware.org > Objet=A0: Re: ARI/Commit rules >=20 > This lead me to think, is it possible to distil this post-commit > hook script to a user installable script somewhere? If GDB used > git as the primary repository we could just make it a pre-commit > hook, and a user script would not be needed. But as GDB uses CVS I > do not think this is possible. >=20 > It is possible, just warp the cvs command in a shell script, and > execute the pre-commit hook you wish to do. Relevant part of update-web-ari script: if ${check_source_p} && test -d "${srcdir}" then bugf=3D${wwwdir}/ari.source.bug oldf=3D${wwwdir}/ari.source.old srcf=3D${wwwdir}/ari.source.lines oldsrcf=3D${wwwdir}/ari.source.lines-old diff=3D${wwwdir}/ari.source.diff diffin=3D${diff}-in newf1=3D${bugf}1 oldf1=3D${oldf}1 oldpruned=3D${oldf1}-pruned newpruned=3D${newf1}-pruned cp -f ${bugf} ${oldf} cp -f ${srcf} ${oldsrcf} rm -f ${srcf} node=3D`uname -n` echo "`date`: Using source lines ${srcf}" 1>&2 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 --src=3D${srcf} ) > ${bugf} # Remove things we are not interested in to signal by email # gdbarch changes are not important here # Also convert ` into ' to avoid command substitution in script below sed -e "/.*: gdbarch:.*/d" -e "s:\`:':g" ${oldf} > ${oldf1} sed -e "/.*: gdbarch:.*/d" -e "s:\`:':g" ${bugf} > ${newf1} # Remove line number info so that code inclusion/deletion # has no impact on the result sed -e "s/\([^:]*\):\([^:]*\):\(.*\)/\1:0:\3/" ${oldf1} > ${oldpruned} sed -e "s/\([^:]*\):\([^:]*\):\(.*\)/\1:0:\3/" ${newf1} > ${newpruned} # Use diff without option to get normal diff output that # is reparsed after diff ${oldpruned} ${newpruned} > ${diffin} # Only keep new warnings sed -n -e "/^>.*/p" ${diffin} > ${diff} sedscript=3D${wwwdir}/sedscript script=3D${wwwdir}/script sed -n -e "s|\(^[0-9,]*\)a\(.*\)|echo \1a\2 \n \ sed -n \'\2s:\\\\(.*\\\\):> \\\\1:p\' ${newf1}|p" \ -e "s|\(^[0-9,]*\)d\(.*\)|echo \1d\2\n \ sed -n \'\1s:\\\\(.*\\\\):< \\\\1:p\' ${oldf1}|p" \ -e "s|\(^[0-9,]*\)c\(.*\)|echo \1c\2\n \ sed -n \'\1s:\\\\(.*\\\\):< \\\\1:p\' ${oldf1} \n \ sed -n \"\2s:\\\\(.*\\\\):> \\\\1:p\" ${newf1}|p" \ ${diffin} > ${sedscript} ${SHELL} ${sedscript} > ${wwwdir}/message sed -n \ -e "s;\(.*\);echo \\\"\1\\\";p" \ -e "s;.*< \([^:]*\):\([0-9]*\):.*;grep \"^\1:\2:\" ${oldsrcf};p" \ -e "s;.*> \([^:]*\):\([0-9]*\):.*;grep \"^\1:\2:\" ${srcf};p" \ ${wwwdir}/message > ${script} ${SHELL} ${script} > ${wwwdir}/mail-message if [ "x${branch}" !=3D "x" ]; then email_suffix=3D"`date` in ${branch}" else email_suffix=3D"`date`" fi if [ "${node}" =3D "sourceware.org" ]; then warning_email=3Dgdb-patches@sourceware.org else warning_email=3Dmuller@sourceware.org fi # Check if ${diff} is not empty if [ -s ${diff} ]; then # Send an email to muller@sourceware.org mutt -s "New ARI warning ${email_suffix}" \ ${warning_email} < ${wwwdir}/mail-message else if [ -s ${wwwdir}/${mail-message} ]; then # Send an email to muller@sourceware.org mutt -s "ARI warning list change ${email_suffix}" \ muller@sourceware.org < ${wwwdir}/mail-message fi fi fi >>>>>>>>>>>>>>>>>>>>>>>> Index: gdb_ari.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v retrieving revision 1.110 diff -u -p -r1.110 gdb_ari.sh --- gdb_ari.sh 30 May 2011 19:55:37 -0000 1.110 +++ gdb_ari.sh 16 Jun 2011 11:42:22 -0000 @@ -20,7 +20,7 @@ LC_ALL=3Dc ; export LC_ALL error=3D"regression" warning=3D"regression" ari=3D"regression eol code comment deprecated legacy obsolete gettext" -all=3D"regression eol code comment deprecated legacy obsolete gettext deprecate i nternal gdbarch macro" +all=3D"regression eol code comment deprecated legacy obsolete gettext deprecate i nternal gdbarch macro spaces" print_doc=3D0 print_idx=3D0 @@ -110,6 +110,7 @@ done awk -- ' BEGIN { + DEBUG=3D1 # NOTE, for a per-file begin use "FNR =3D=3D 1". '"${aris}"' '"${errors}"' @@ -118,6 +119,19 @@ BEGIN { print_doc =3D '$print_doc' print_idx =3D '$print_idx' PWD =3D "'`pwd`'" + _old_RS =3D RS + RS=3D"@@" + "cat list-headers" | getline ALL_HEADERS + "cat list-nat" | getline ALL_NAT + "cat list-tdep" | getline ALL_TDEP + "cat list-common" | getline ALL_COMMON + RS=3D_old_RS + if (DEBUG =3D=3D 1) { + print "ALL_HEADERS =3D " ALL_HEADERS + print "ALL_NAT =3D " ALL_NAT + print "ALL_TDEP =3D " ALL_TDEP + print "ALL_COMMON =3D " ALL_COMMON + } } # Print the error message for BUG. Append SUPLEMENT if non-empty. @@ -189,6 +203,14 @@ FNR =3D=3D 1 { else { is_yacc_or_lex =3D 0 } + if ( match (ALL_NAT, FILENAME) ) { + if (DEBUG =3D=3D 1) { + print "File " FILENAME " is native" + } + is_native =3D 1 + } else { + is_native =3D 0 + } } END { if (print_idx) { @@ -254,6 +276,34 @@ Do not use ARGSUSED, unnecessary" fail("ARGSUSED") } +BEGIN { doc["trailing spaces"] =3D "\ +Lines should not have trailing spaces" + category["trailing spaces"] =3D ari_spaces +} +/[[:space:]]+$/ { + fail("trailing spaces") +} + +BEGIN { doc["missing tabs"] =3D "\ +Lines should never have more than 7 spaces" + category["missing tabs"] =3D ari_spaces +} +/^ {8,}/ { + fail("missing tabs") +} + +BEGIN { doc["tab-space mix"] =3D "\ +Tabs and spaces should not be mixed" + category["tab-space mix"] =3D ari_spaces +} +/^ +\t+/ { + fail("tab-space mix") +} +/^\t+ +\t/ { + fail("tab-space mix") +} + + # SNIP - Strip out comments - SNIP