Thread

Commits

  1. Use our own getopt() on OpenBSD.

  1. More OpenBSD portability fun: getopt() fails on --option

    Tom Lane <tgl@sss.pgh.pa.us> — 2019-01-18T18:21:40Z

    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