Re: unused_oids script is broken with bsd sed
Stas Kelvich <s.kelvich@postgrespro.ru>
From: Stas Kelvich <s.kelvich@postgrespro.ru>
To: John Naylor <jcnaylor@gmail.com>
Cc: andreas@proxel.se,
Tom Lane <tgl@sss.pgh.pa.us>,
Andrew Dunstan <andrew.dunstan@2ndquadrant.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
David Fetter <david@fetter.org>
Date: 2018-04-25T17:55:08Z
Lists: pgsql-hackers
Attachments
- 0001-Rewrite-unused_oids-in-perl.patch (application/octet-stream) patch 0001
- (unnamed) (text/plain)
> On 25 Apr 2018, at 17:55, John Naylor <jcnaylor@gmail.com> wrote: > > On 4/25/18, Stas Kelvich <s.kelvich@postgrespro.ru> wrote: >>> On 25 Apr 2018, at 17:18, Tom Lane <tgl@sss.pgh.pa.us> wrote: >>> I think we should rewrite >>> both of them to use the Catalog.pm infrastructure. >> >> Okay, seems reasonable. I'll put shared code in Catalog.pm and >> update patch. > > I don't think you need any new code in Catalog.pm, I believe the > suggestion was just to use that module as a stable interface to the > data. Looking at your patch, I'll mention that we have an idiom for > extracting #define'd OID symbols, e.g.: > > my $FirstBootstrapObjectId = Catalog::FindDefinedSymbol( > 'access/transam.h', \@include_path, 'FirstBootstrapObjectId'); > > This is preferred over using awk, which would have its own portability > issues (Windows for starters). > > While I'm thinking out loud, it might be worthwhile to patch genbki.pl > for the duplicate test, since they're run at the same time anyway (see > catalog/Makefile), and we've already read all the data. > > -John Naylor > New version is attached. I've put iterator into Catalog.pm to avoid copy-pasting it over two scripts. Also instead of greping through *.dat and *.h files I've used parsers provided in Catalog module. That way should be more sustainable to format changes. Anyone who wanted to help with scripts -- feel free to rewrite.
Commits
-
Blindly try to fix MSVC build's use of genbki.pl and Gen_fmgrtab.pl.
- bad51a49a4c0 11.0 landed
-
Avoid overwriting unchanged output files in genbki.pl and Gen_fmgrtab.pl.
- 1f1cd9b5ddc6 11.0 landed
-
Rearrange makefile rules for running Gen_fmgrtab.pl.
- 9bf28f96c7eb 11.0 landed
-
Avoid parsing catalog data twice during BKI file construction.
- a0854f10722b 11.0 landed
-
Fix duplicate_oids and unused_oids so user needn't cd to catalog dir.
- dd4cc9d7069c 11.0 landed
-
Convert unused_oids and duplicate_oids to use Catalog.pm infrastructure.
- 5602265f770f 11.0 landed
-
Make Catalog.pm's representation of toast and index decls more abstract.
- 1eb3a09e93d2 11.0 landed