From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Subject: More OpenBSD portability fun: getopt() fails on --option
Date: Fri, 18 Jan 2019 13:21:40 -0500
Message-ID: <30197.1547835700@sss.pgh.pa.us> (raw)
Continuing the project of getting check-world to pass on OpenBSD 6.4,
I find that the bin/scripts/ tests fall over:
t/090_reindexdb.pl (Wstat: 7424 Tests: 10 Failed: 2)
Failed tests: 9-10
Non-zero exit status: 29
Parse errors: Bad plan. You planned 23 tests but ran 10.
t/091_reindexdb_all.pl (Wstat: 512 Tests: 2 Failed: 2)
Failed tests: 1-2
Non-zero exit status: 2
Investigation shows that the cause of that is that these two scripts
have
$ENV{PGOPTIONS} = '--client-min-messages=WARNING';
which leads to process_postgres_switches() being called with
the argument array [ "postgres", "--client-min-messages=WARNING" ]
and OpenBSD's getopt() fails on that (it returns '?'). I see that
their man page says
A single dash (‘-’) may be specified as a character in optstring,
however it should never have an argument associated with it.
which I take to mean that they broke the case.
configure.in has
# Solaris' getopt() doesn't do what we want for long options, so always use
# our version on that platform.
if test "$PORTNAME" = "solaris"; then
AC_LIBOBJ(getopt)
fi
so I propose that we fix this by doing likewise on OpenBSD.
regards, tom lane
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, pgsql-hackers@lists.postgresql.org
Subject: Re: More OpenBSD portability fun: getopt() fails on --option
In-Reply-To: <30197.1547835700@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