[geos-devel] [GEOS] #1015: Update geos-config tool for consistency

Sandro Santilli strk at kbt.io
Mon Feb 17 23:22:00 PST 2020


On Tue, Feb 18, 2020 at 01:55:19PM +1300, Mike Taves wrote:
> On Tue, 18 Feb 2020 at 13:20, Greg Troxel <gdt at lexort.com> wrote:
> > "GEOS" <geos-trac at osgeo.org> writes:
> > >  **Specify bash, and use printf to escape paths (if needed)**
> > >
> > >  This allows installation with CMake to other directories, such as `/opt/my
> > >  prefix`, since `geos-config --prefix` would return `/opt/my\ prefix`. Also
> > >  `printf` is a bash-only feature.
> >
> > It really seems like a regresssion to require bash, rather than POSIX
> > shell, and it's definitely a regression if the build doesn't find bash
> > and substitute in the path.
> >
> > Is this really necessary?
> 
> As noted above, the printf function is built-in with Bash, and can
> properly escape a path. While I see there is also /usr/bin/printf I'm
> not sure how common or standard this tool is (my tests with /bin/sh
> didn't go well, so I opted to switch to Bash for reliability).

GNU coreutils "printf" works fine here:

  [strk at liz:~] /usr/bin/printf "%q\n" "space 'quote' and \"doublequote\""
  'space '\''quote'\'' and "doublequote"'
  [strk at liz:~] /usr/bin/printf  --version | head -1
  printf (GNU coreutils) 8.28

--strk;


More information about the geos-devel mailing list