Re: [HACKERS] getting rid of maintainer-check

2013-10-09 Thread Robert Haas
On Thu, Sep 12, 2013 at 11:21 PM, Peter Eisentraut pete...@gmx.net wrote:
 On Tue, 2013-09-03 at 22:41 -0400, Peter Eisentraut wrote:
 The maintainer-check target never really caught on, I think.  Most
 people don't run it, and that in turn annoys those who do.  Also, it
 doesn't provide much functionality.

 I propose that we get rid of it and roll the functionality into the
 regular build.

 Here is a patch for that.  I also integrated Andrew's Perl version of
 duplicate_oids.

 The MSVC build needs to be updated separately, if they want to have that
 same functionality.

These patches look OK to me, and everyone who has commented has been
in favor of this proposal.  I'll mark this Ready for Committer.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] getting rid of maintainer-check

2013-09-12 Thread Peter Eisentraut
On Tue, 2013-09-03 at 22:41 -0400, Peter Eisentraut wrote:
 The maintainer-check target never really caught on, I think.  Most
 people don't run it, and that in turn annoys those who do.  Also, it
 doesn't provide much functionality.
 
 I propose that we get rid of it and roll the functionality into the
 regular build. 

Here is a patch for that.  I also integrated Andrew's Perl version of
duplicate_oids.

The MSVC build needs to be updated separately, if they want to have that
same functionality.
From 1beea944acf339bc13a8759262a0c8c41fc1760c Mon Sep 17 00:00:00 2001
From: Peter Eisentraut pete...@gmx.net
Date: Wed, 11 Sep 2013 14:47:44 -0400
Subject: [PATCH 1/2] Replace duplicate_oids with Perl implementation

It is more portable, more robust, and more readable.

From: Andrew Dunstan and...@dunslane.net

diff --git a/src/include/catalog/duplicate_oids b/src/include/catalog/duplicate_oids
index 82c12f3..f3d1136 100755
--- a/src/include/catalog/duplicate_oids
+++ b/src/include/catalog/duplicate_oids
@@ -1,30 +1,36 @@
-#!/bin/sh
-#
-# duplicate_oids
-#
-# src/include/catalog/duplicate_oids
-#
-# finds manually-assigned oids that are duplicated in the system tables.
-#
-# run this script in src/include/catalog.
-#
+#!/usr/bin/perl
 
-# note: we exclude BKI_BOOTSTRAP relations since they are expected to have
-# matching DATA lines in pg_class.h and pg_type.h
+use strict;
+use warnings;
 
-cat pg_*.h toasting.h indexing.h | \
-egrep -v -e '^CATALOG\(.*BKI_BOOTSTRAP' | \
-sed -n	-e 's/^DATA(insert *OID *= *\([0-9][0-9]*\).*$/\1/p' \
-	-e 's/^CATALOG([^,]*, *\([0-9][0-9]*\).*BKI_ROWTYPE_OID(\([0-9][0-9]*\)).*$/\1,\2/p' \
-	-e 's/^CATALOG([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
-	-e 's/^DECLARE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
-	-e 's/^DECLARE_UNIQUE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
-	-e 's/^DECLARE_TOAST([^,]*, *\([0-9][0-9]*\), *\([0-9][0-9]*\).*$/\1,\2/p' | \
-tr ',' '\n' | \
-sort -n | \
-uniq -d | \
-grep '.'
+BEGIN
+{
+	@ARGV = (glob(pg_*.h), qw(indexing.h toasting.h));
+}
 
-# nonzero exit code if lines were produced
-[ $? -eq 1 ]
-exit
+my %oidcounts;
+
+while()
+{
+	next if /^CATALOG\(.*BKI_BOOTSTRAP/;
+	next unless
+		/^DATA\(insert *OID *= *(\d+)/ ||
+		/^CATALOG\([^,]*, *(\d+).*BKI_ROWTYPE_OID\((\d+)\)/ ||
+		/^CATALOG\([^,]*, *(\d+)/ ||
+		/^DECLARE_INDEX\([^,]*, *(\d+)/ ||
+		/^DECLARE_UNIQUE_INDEX\([^,]*, *(\d+)/ ||
+		/^DECLARE_TOAST\([^,]*, *(\d+), *(\d+)/;
+	$oidcounts{$1}++;
+	$oidcounts{$2}++ if $2;
+}
+
+my $found = 0;
+
+foreach my $oid (sort {$a = $b} keys %oidcounts)
+{
+	next unless $oidcounts{$oid}  1;
+	$found = 1;
+	print $oid\n;
+}
+
+exit $found;
-- 
1.8.4.rc3

From 7474945c3f2ae3e0f1ff24654f8557106fa6d526 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut pete...@gmx.net
Date: Wed, 11 Sep 2013 14:34:28 -0400
Subject: [PATCH 2/2] Remove maintainer-check target, fold into normal build

make maintainer-check was obscure and rarely called in practice, and
many breakages were missed.  Fold everything that make maintainer-check
used to do into the normal build.  Specifically:

- Call duplicate_oids when genbki.pl is called.

- Check for tabs in SGML files when the documentation is built.

- Run msgfmt with the -c option during the regular build.  Add an
  additional configure check to see whether we are using the GNU
  version.  (make maintainer-check probably used to fail with non-GNU
  msgfmt.)

Keep maintainer-check as around as phony target for the time being in
case anyone is calling it.  But it won't do anything anymore.

diff --git a/GNUmakefile.in b/GNUmakefile.in
index 17b1b3b..80116a1 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -70,8 +70,6 @@ $(call recurse,check-world,src/test src/pl src/interfaces/ecpg contrib,check)
 
 $(call recurse,installcheck-world,src/test src/pl src/interfaces/ecpg contrib,installcheck)
 
-$(call recurse,maintainer-check,doc src config contrib)
-
 GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
 	./config.status $@
 
diff --git a/config/programs.m4 b/config/programs.m4
index c70a0c2..fd3a9a4 100644
--- a/config/programs.m4
+++ b/config/programs.m4
@@ -197,6 +197,11 @@ AC_DEFUN([PGAC_CHECK_GETTEXT],
   if test -z $MSGFMT; then
 AC_MSG_ERROR([msgfmt is required for NLS])
   fi
+  AC_CACHE_CHECK([for msgfmt flags], pgac_cv_msgfmt_flags,
+[if test x$MSGFMT != x  $MSGFMT --version 21 | grep GNU /dev/null; then
+pgac_cv_msgfmt_flags=-c
+fi])
+  AC_SUBST(MSGFMT_FLAGS, $pgac_cv_msgfmt_flags)
   AC_CHECK_PROGS(MSGMERGE, msgmerge)
   AC_CHECK_PROGS(XGETTEXT, xgettext)
 ])# PGAC_CHECK_GETTEXT
diff --git a/configure b/configure
index c685ca3..db8e006 100755
--- a/configure
+++ b/configure
@@ -659,6 +659,7 @@ TCL_CONFIG_SH
 TCLSH
 XGETTEXT
 MSGMERGE
+MSGFMT_FLAGS
 MSGFMT
 HAVE_POSIX_SIGNALS
 LDAP_LIBS_BE
@@ -29171,6 +29172,19 @@ done
 $as_echo $as_me: error: msgfmt is required for NLS 2;}
{ (exit 1); exit 1; }; }
   fi
+  { $as_echo $as_me:$LINENO: checking for msgfmt flags 5
+$as_echo_n checking for msgfmt flags...  6; }
+if 

Re: [HACKERS] getting rid of maintainer-check

2013-09-10 Thread Peter Eisentraut
On 9/4/13 11:12 AM, Andres Freund wrote:
 Maybe we should also badger cpluspluscheck into a state where it can be
 run as part of a normal build if a c++ compiler was detected?
 
 I think it misses vpath support and it might be dependant on some
 bashims.

That might also be doable.  If we could at the same time stick a usable
C++ compiler configuration into PGXS, that would also help the growing
number of extensions that need that and are currently using variously
bad workarounds.



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] getting rid of maintainer-check

2013-09-10 Thread Euler Taveira
On 03-09-2013 23:41, Peter Eisentraut wrote:
 The maintainer-check target never really caught on, I think.  Most
 people don't run it, and that in turn annoys those who do.  Also, it
 doesn't provide much functionality.
 
It has its use (before each release) but I agree that it isn't used
during minor version updates (because you need to update only one or two
po files).

 I propose that we get rid of it and roll the functionality into the
 regular build.
 
By 'regular build' you mean --enable-nls? If so, +1.

 - Running duplicate_oids during the regular build was already discussed
 elsewhere recently.  There are some details to be resolved there, but
 it's doable.
 
This has been bashing sufficient developers along the years. +1.

 - Checking for tabs in SGML files can be run during the regular
 documentation build without problems.
 
This one too. +1.


-- 
   Euler Taveira   Timbira - http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] getting rid of maintainer-check

2013-09-04 Thread Andres Freund
On 2013-09-03 22:41:17 -0400, Peter Eisentraut wrote:
 The maintainer-check target never really caught on, I think.  Most
 people don't run it, and that in turn annoys those who do.  Also, it
 doesn't provide much functionality.
 
 I propose that we get rid of it and roll the functionality into the
 regular build.
 
 Specifically:
 
 - Running duplicate_oids during the regular build was already discussed
 elsewhere recently.  There are some details to be resolved there, but
 it's doable.

Maybe we should also badger cpluspluscheck into a state where it can be
run as part of a normal build if a c++ compiler was detected?

I think it misses vpath support and it might be dependant on some
bashims.

Greetings,

Andres Freund

-- 
 Andres Freund http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training  Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] getting rid of maintainer-check

2013-09-04 Thread Robert Haas
On Tue, Sep 3, 2013 at 10:41 PM, Peter Eisentraut pete...@gmx.net wrote:
 The maintainer-check target never really caught on, I think.  Most
 people don't run it, and that in turn annoys those who do.  Also, it
 doesn't provide much functionality.

 I propose that we get rid of it and roll the functionality into the
 regular build.

 Specifically:

 - Running duplicate_oids during the regular build was already discussed
 elsewhere recently.  There are some details to be resolved there, but
 it's doable.

 - Checking for tabs in SGML files can be run during the regular
 documentation build without problems.

 - The NLS checks can also be run during the regular NLS-enabled build.

 That's it.  Any concerns?

I can't speak for anyone else, but personally I think that sounds like
a significant improvement.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] getting rid of maintainer-check

2013-09-03 Thread Peter Eisentraut
The maintainer-check target never really caught on, I think.  Most
people don't run it, and that in turn annoys those who do.  Also, it
doesn't provide much functionality.

I propose that we get rid of it and roll the functionality into the
regular build.

Specifically:

- Running duplicate_oids during the regular build was already discussed
elsewhere recently.  There are some details to be resolved there, but
it's doable.

- Checking for tabs in SGML files can be run during the regular
documentation build without problems.

- The NLS checks can also be run during the regular NLS-enabled build.

That's it.  Any concerns?




-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers