[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 10/11] quote consistently and make tests pass with new quotin

From: Akim Demaille
Subject: Re: [PATCH 10/11] quote consistently and make tests pass with new quoting from gnulib
Date: Thu, 2 Feb 2012 11:49:23 +0100

Le 30 janv. 2012 à 10:43, Akim Demaille a écrit :

> Here is a patch that does all this.  candidates/quotes is
> updated.
> <0001-use-a-more-consistent-quoting-style.patch>

This does not work:

> --- a/bootstrap.conf
> +++ b/bootstrap.conf
> @@ -22,7 +22,7 @@ gnulib_modules='
>   gettext git-version-gen gitlog-to-changelog
>   gpl-3.0 hash inttypes isnan javacomp-script
>   javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr
> -  mbswidth obstack perror pipe-posix quote quotearg realloc-posix
> +  mbswidth obstack perror pipe-posix quotearg realloc-posix
>   spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp

> --- /dev/null
> +++ b/lib/quote.c
> @@ -0,0 +1,54 @@
> +/* quote.c - quote arguments for output
> +
> +   Copyright (C) 1998-2001, 2003, 2005-2006, 2009-2012 Free Software
> +   Foundation, Inc.

I meant to replace gnulib's quote module by a specific
implementation for Bison.  But some other gnulib module
requires quote, so the next iteration of bootstrap
removes my own quote.[ch] (this is a bug imho, bootstrap
should die refusing to erase files it does not "own") to
install a symlink to gnulib's.

I want to replace gnulib's quote module because it
imposes a quotearg style that I do not want (see all
the previous messages about l10n issues in the test suite
of Bison).  Instead of:

> char const *
> quote_n (int n, char const *name)
> {
>  return quotearg_n_style (n, locale_quoting_style, name);
> }

I want:

> char const *
> quote_n (int n, char const *name)
> {
>  return quotearg_n (n, name);
> }

which uses the default style instead of imposing one.  And
I have:

> void
> quote_init (void)
> {
>  char const *cp = getenv ("LC_CTYPE");
>  if (cp && STREQ (cp, "C", 'C', 0,0,0,0,0,0,0,0))
>    set_custom_quoting (0, "'", "'");
>  else
>    set_quoting_style (0, locale_quoting_style);
> }

which defines this default style.

So my options are, in decreasing order of preference:

- submit changes to gnulib's quote so that the choice of the default
 style is left to the actual user of gnulib, and stick to
 gnulib's quote in Bison.

- submit changes to gnulib's in order to allow a project
 dependent override of modules, so that bootstrap knows that
 there is a quote module that will be handled by the host
 project, so it must not deploy its own.  Maybe this already
 exists, I don't know gnulib well enough.

- rename bison's lib/quote.[ch] into something, including
 the functions, and change every single call in bison, and
 also accept that the gnulib modules that use gnulib's
 quote will not conform to our quotearg style.

What course of action would you recommend?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]