mirror of
git://git.savannah.gnu.org/config.git
synced 2025-05-28 01:56:38 +12:00

The previous replacement of backticks with POSIX command substitutions was ill-considered and illogical: this script recognizes many archaic machine types that probably never had POSIX shells, therefore it needs to be able to run successfully under pre-POSIX shells. This patch was generated using the included GNU Awk program. * config.guess: Revert POSIX command substitutions to classic form. * patch-6.gawk: Store the tool that produced the automated patch.
22 lines
560 B
Awk
Executable File
22 lines
560 B
Awk
Executable File
#!/usr/bin/gawk -f
|
|
# -*- Awk -*-
|
|
|
|
# Automate reversion of $( ) substitutions to classic `` form.
|
|
|
|
# GPLv3+
|
|
|
|
BEGIN {
|
|
if (ARGC < 2) ARGV[ARGC++] = "config.guess"
|
|
}
|
|
|
|
# fix a special case of forgotten quotes
|
|
/\$\(\$dummy\)/ { sub(/\$\(\$dummy\)/, "$(\"$dummy\")") }
|
|
|
|
/\$\( \(/ { $0 = gensub(/\$\( (\([^()]+\)[^()]*)\)/, "`\\1`", "g") }
|
|
/\$\(/ { $0 = gensub(/\$\(([^()]+)\)/, "`\\1`", "g") }
|
|
|
|
/\$\( \(.*'/ { $0 = gensub(/\$\( (\([^()]+'[^']+'[^()]*\)[^()]*)\)/, "`\\1`", "g") }
|
|
/\$\(.*'/ { $0 = gensub(/\$\(([^()]+'[^']+'[^()]*)\)/, "`\\1`", "g") }
|
|
|
|
{ print }
|