On Mon, Jul 8, 2013 at 06:25:44PM -0700, Peter Geoghegan wrote: > When rebasing a patch that I'm working on, I occasionally forget to > update the oid of any pg_proc.h entries I may have created. Of course > this isn't a real problem; when I go to initdb, I immediately > recognize what has happened. All the same, it seems like there is a > case to be made for having this run automatically at build time, and > having the build fail on the basis of there being a duplicate - this > is something that fails reliably, but only when someone has added > another pg_proc.h entry, and only when that other person happened to > choose an oid in a range of free-in-git-tip oids that I myself > fancied. > > Sure, I ought to remember to check this anyway, but it seems > preferable to make this process more mechanical. I can point to commit > 55c1687a as a kind of precedent, where the process of running > check_keywords.pl was made to run automatically any time gram.c is > rebuilt. Granted, that's a more subtle problem than the one I'm > proposing to solve, but I still see this as a modest improvement.
FYI, attached is the pgtest script I always run before I do a commit; it also calls src/tools/pgtest. It has saved me from erroneous commits many times. -- Bruce Momjian <br...@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +
: . traprm [ "$1" = "-d" ] && DOCS="Y" && shift export QUIET=$(($QUIET + 1)) . cd_pgtop chown -R postgres . echo "Checking SGML" cd doc/src/sgml make check > $TMP/0 2>&1 if grep -v 'fully-tagged' < $TMP/0 | egrep -qi 'Error|Warning' then echo "SGML error" cat $TMP/0 exit 1 fi [ $(pwd) != '/pgsql/8.4/doc/src/sgml' ] && make check-tabs # Run only at night to check for HISTORY build problems # in HISTORY.html. if [ ! -t 0 -o "$DOCS" = "Y" ] then make INSTALL.html > $TMP/0 2>&1 if egrep -qi 'Error|Warning' < $TMP/0 then echo "SGML error" cat $TMP/0 exit 1 fi make HISTORY.html > $TMP/0 2>&1 if grep -q 'Error' < $TMP/0 then echo "SGML error" cat $TMP/0 exit 1 fi fi # fails on /bin/sh cd - echo "Checking duplicate oids" cd src/include/catalog duplicate_oids > $TMP/0 if [ -s $TMP/0 ] then echo "Duplicate system oids" cat $TMP/0 exit 1 fi cd - # supress assembler warning (aspg /pg/tools/pgtest "$@"; echo "$?" > $TMP/ret) | # use only one grep so we don't buffer output egrep -v ': Warning: using `%|^SPI.c:.*: warning: |^ppport.h:[[:digit:]][[:digit:]]*: warning: |^/usr/libdata/perl5/5.00503/i386-bsdos/CORE/patchlevel.h|plperl.c:.*: warning: (implicit|passing)|variable .(fast|ptr|cmsg|fe_copy). might be clobbered|warning: unused variable .yyg.|gzwrite'"'"' discards' rm -fr src/test/regress/tmp_check bell exit $(cat $TMP/ret)
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers