pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Karlsson <andreas@proxel.se>
Cc: John Naylor <jcnaylor@gmail.com>
Cc: Stas Kelvich <s.kelvich@postgrespro.ru>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: David Fetter <david@fetter.org>
Subject: Re: unused_oids script is broken with bsd sed
Date: Thu, 26 Apr 2018 10:27:50 -0400
Message-ID: <22909.1524752870@sss.pgh.pa.us> (raw)
In-Reply-To: <9319.1524749946@sss.pgh.pa.us>
References: <37D774E4-FE1F-437E-B3D2-593F314B7505@postgrespro.ru>
	<34a54c54-9132-1254-2bc3-d3489fb79728@2ndQuadrant.com>
	<4473.1524665917@sss.pgh.pa.us>
	<4DE444D1-DDE9-460F-AC2F-EB1B73D94A2D@postgrespro.ru>
	<CAJVSVGU2w6rvTXghDe7-Y3x9Ca0833VmnC3HpaYKGLw4xznpJA@mail.gmail.com>
	<26728623-7783-4103-9BED-08D443C1729F@postgrespro.ru>
	<CAJVSVGU0cPPwMhCfVz5PvpTDrjZzeT=0QHUhMbg=MjaMO_Gr+A@mail.gmail.com>
	<19973.1524686883@sss.pgh.pa.us>
	<CAJVSVGVrzzxzVkqYb-=UyqAJRVn1rCx8a2pAYXPLw+6JBg4EZA@mail.gmail.com>
	<88a5215f-61c4-0182-7f89-0f0851b0be18@proxel.se>
	<9319.1524749946@sss.pgh.pa.us>

I wrote:
> Andreas Karlsson <andreas@proxel.se> writes:
>> What about using FindBin (http://perldoc.perl.org/FindBin.html)?

> A quick check suggests that that's present in the core perl
> distribution pretty far back, so I think it'll work.
> Question is, is it any better than John's "dirname(__FILE__)"
> solution?

I experimented a bit, and found that actually what we seem to
need is FindBin::RealBin.  That's the only one of these solutions
that gives the right answer if someone's put a symlink to
unused_oids or duplicate_oids into their PATH --- the other ones
give you the directory containing the symlink.  Now, maybe that
would be an uncommon usage, but it hardly seems out of the question.

			regards, tom lane




view thread (27+ messages)  latest in thread

Message-ID: <22909.1524752870@sss.pgh.pa.us>
Permalink:  ../22909.1524752870@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22909.1524752870@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andreas@proxel.se, jcnaylor@gmail.com, s.kelvich@postgrespro.ru, andrew.dunstan@2ndquadrant.com, david@fetter.org
  Subject: Re: unused_oids script is broken with bsd sed
  In-Reply-To: <22909.1524752870@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox