Skip to content

Commit d456ceb

Browse files
committed
For AWK version, seed vars from env.
Also, fix arg order for pyconf_fnmatch().
1 parent 8e86c98 commit d456ceb

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

Tools/configure/transpiler/pyconf.awk

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,14 @@
2828
# ---------------------------------------------------------------------------
2929

3030
function pyconf_init( k) {
31-
# Shadow ENVIRON into ENV[]
32-
for (k in ENVIRON)
31+
# Shadow ENVIRON into ENV[] and seed V[] so that environment
32+
# variables are accessible as V["name"], mirroring both shell
33+
# (where $VAR inherits from the environment) and Python's
34+
# Vars.__getattr__ fallback to os.environ.
35+
for (k in ENVIRON) {
3336
ENV[k] = ENVIRON[k]
37+
V[k] = ENVIRON[k]
38+
}
3439
_pyconf_tmpdir = ""
3540
_pyconf_verbose = 0
3641
_pyconf_srcdir = "."
@@ -1149,7 +1154,7 @@ function pyconf_find_mkdir_p( result, ver, dirs, n, i, p, prog, progs, cmd) {
11491154
# String / path utilities
11501155
# ---------------------------------------------------------------------------
11511156

1152-
function pyconf_fnmatch(pattern, string) {
1157+
function pyconf_fnmatch(string, pattern) {
11531158
# Simple glob match using case
11541159
# For exact match patterns, use == comparison
11551160
# For patterns with *, use ~ with converted regex

configure-new

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,14 @@ exec "$_awk" -f "$_tmpf" -- "$@"
6363
# ---------------------------------------------------------------------------
6464

6565
function pyconf_init( k) {
66-
# Shadow ENVIRON into ENV[]
67-
for (k in ENVIRON)
66+
# Shadow ENVIRON into ENV[] and seed V[] so that environment
67+
# variables are accessible as V["name"], mirroring both shell
68+
# (where $VAR inherits from the environment) and Python's
69+
# Vars.__getattr__ fallback to os.environ.
70+
for (k in ENVIRON) {
6871
ENV[k] = ENVIRON[k]
72+
V[k] = ENVIRON[k]
73+
}
6974
_pyconf_tmpdir = ""
7075
_pyconf_verbose = 0
7176
_pyconf_srcdir = "."
@@ -1184,7 +1189,7 @@ function pyconf_find_mkdir_p( result, ver, dirs, n, i, p, prog, progs, cmd) {
11841189
# String / path utilities
11851190
# ---------------------------------------------------------------------------
11861191

1187-
function pyconf_fnmatch(pattern, string) {
1192+
function pyconf_fnmatch(string, pattern) {
11881193
# Simple glob match using case
11891194
# For exact match patterns, use == comparison
11901195
# For patterns with *, use ~ with converted regex

0 commit comments

Comments
 (0)