config-patches
[Top][All Lists]
Advanced

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

[PATCH 0/6] restore compatibility with pre-POSIX shells in config.guess


From: Jacob Bachmeyer
Subject: [PATCH 0/6] restore compatibility with pre-POSIX shells in config.guess
Date: Sat, 22 May 2021 20:33:04 -0400

This patch series tidies config.guess and reverts to classic backtick
command substitutions.

No shell splits the WORD in "case WORD in ... esac", so instances
where WORD was quoted were changed.

Quotes while forming the output are pointless, since no valid GNU
configuration tuple contains whitespace, therefore no variables
interpolated will be candidates for word splitting.  However, there
are places in the script where unquoted variables could cause
legitimate problems, so the script was reworked to store the
uname-based guess in a GUESS variable instead of suppressing the
shellcheck complaint.  Since no shell splits the right hand side of a
variable assignment, this form avoids the need to quote variables.

Next, the command substitutions used while producing a result in
several cases were factored out into separate variables, removing the
need for quoting the substitutions and the use of classic backticks
restored and the shellcheck complaint silenced.

Lastly, a few places that did not match the patterns used for most of
the editing were fixed up manually after being found while reverting
back to backticks.

Logically, config.guess should remain compatible with pre-POSIX
shells; this is not difficult and the script purports to identify a
variety of older systems that probably never had POSIX shells.

DejaGnu 1.6.3 is expected to ship config.guess with these patches
applied, and release candidate 5 for DejaGnu 1.6.3 will include them.
DejaGnu 1.6.3 will not have Autoconf's "find a good shell" logic and
DejaGnu installs config.guess and uses it at runtime, so config.guess
needs to "just work".

While DejaGnu can rely on Autoconf's "find a good shell" logic for
config.sub, I will prepare similar patches for config.sub if there is
interest.

Jacob Bachmeyer (6):
  config.guess: remove unneeded quotes in case constructs
  config.guess: use intermediate variable with uname results
  config.guess: remove unneeded variable quotes
  config.guess: factor out command substitutions setting GUESS
  config.guess: replace POSIX $( ) with classic ` ` throughout
  config.guess: minor cleanups noticed during previous pass

 config.guess | 1214 ++++++++++++++++++++++++++------------------------
 1 file changed, 631 insertions(+), 583 deletions(-)

-- 
2.17.1




reply via email to

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