Skip to content

Commit 8ff6d4e

Browse files
committed
Adjust pgindent script to use pg_bsd_indent 2.0.
Update version-checking code and list of switches. Delete obsolete quasi-support for using GNU indent. Remove a lot of no-longer-needed workarounds for bugs of the old version, and improve comments for the hacks that remain. Update run_build() subroutine to fetch the pg_bsd_indent code from the newly established git repo for it. In passing, fix pgindent to not overwrite files that require no changes; this makes it a bit more friendly to run on a built tree. Adjust relevant documentation. Remove indent.bsd.patch; it's not relevant anymore (and was obsolete long ago anyway). Likewise remove pgcppindent, since we're no longer in the business of shipping C++ code. Piotr Stefaniak is responsible for most of the algorithmic changes to the pgindent script; I did the rest. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
1 parent 9ef2dbe commit 8ff6d4e

File tree

5 files changed

+52
-448
lines changed

5 files changed

+52
-448
lines changed

src/tools/pgindent/README

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ http://adpgtech.blogspot.com/2015/05/running-pgindent-on-non-core-code-or.html
1010

1111
PREREQUISITES:
1212

13-
1) Install pg_bsd_indent in your PATH (see below for details).
13+
1) Install pg_bsd_indent in your PATH. Fetch its source code with
14+
git clone https://git.postgresql.org/git/pg_bsd_indent.git
15+
then follow the directions in README.pg_bsd_indent therein.
1416

1517
2) Install entab (src/tools/entab/).
1618

@@ -57,6 +59,9 @@ VALIDATION:
5759

5860
Your configure switches should include at least --enable-tap-tests
5961
or else much of the Perl code won't get exercised.
62+
The ecpg regression tests may well fail due to pgindent's updates of
63+
header files that get copied into ecpg output; if so, adjust the
64+
expected-files to match.
6065

6166
3) If you have the patience, it's worth eyeballing the "git diff" output
6267
for any egregiously ugly changes. See below for cleanup ideas.
@@ -100,10 +105,10 @@ you're at it.
100105
BSD indent
101106
----------
102107

103-
We have standardized on NetBSD's indent, and renamed it pg_bsd_indent.
104-
We have fixed a few bugs which requre the NetBSD source to be patched
105-
with indent.bsd.patch patch. A fully patched version is available at
106-
https://ftp.postgresql.org/pub/dev.
108+
We have standardized on FreeBSD's indent, and renamed it pg_bsd_indent.
109+
pg_bsd_indent does differ slightly from FreeBSD's version, mostly in
110+
being more easily portable to non-BSD platforms. You can obtain it from
111+
https://git.postgresql.org/git/pg_bsd_indent.git
107112

108113
GNU indent, version 2.2.6, has several problems, and is not recommended.
109114
These bugs become pretty major when you are doing >500k lines of code.
@@ -132,8 +137,10 @@ src/backend/utils/fmgrtab.c is excluded because it confuses pgindent
132137
and it's a derived file anyway.
133138

134139
src/interfaces/ecpg/test/expected/ is excluded to avoid breaking the ecpg
135-
regression tests. Several *.h files are included in regression output so
136-
they must not be changed.
140+
regression tests, since what ecpg generates is not necessarily formatted
141+
as pgindent would do it. (Note that we do not exclude ecpg's header files
142+
from the run; some of them get copied verbatim into ecpg's output, meaning
143+
that the expected files may need to be updated to match.)
137144

138145
src/include/snowball/libstemmer/ and src/backend/snowball/libstemmer/
139146
are excluded because those files are imported from an external project,

src/tools/pgindent/indent.bsd.patch

Lines changed: 0 additions & 288 deletions
This file was deleted.

src/tools/pgindent/pgcppindent

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy