Commit 6b2b415
committed
Fix init_args to convert VAR=VALUE command-line args like CONFIG_SITE does.
Command-line VAR=VALUE arguments (e.g. ./configure ac_cv_file__dev_ptmx=yes)
were stored only in os.environ, but vars.is_set() only checked vars.__dict__.
This caused two bugs when cross-compiling:
1. is_set("ac_cv_file__dev_ptmx") returned False even when the user had
explicitly set it, triggering a spurious CONFIG_SITE error.
2. A "no" value stayed as a string in os.environ; Python truthiness
(if v.ac_cv_file__dev_ptmx:) would evaluate it as True, incorrectly
defining HAVE_DEV_PTMX.
Fix: in init_args(), after storing in os.environ, also convert the value
via _cache_deserialize() (yes→True, no→False) and setattr on vars, matching
exactly what _load_config_site() does. For ac_cv_* vars, also populate
cache[]. This makes command-line VAR=VALUE args behave consistently with
CONFIG_SITE values, matching AWK where VAR=val populates V[].
Also clear vars.__dict__ user attributes in _reset() so test isolation is
complete. Add TestInitArgsVarValue tests to cover is_set() detection and
bool truthiness for command-line ac_cv_* args.
Found during review of conf_filesystem.py (check_device_files cross-compile
path uses is_set()).
Assisted-by: Claude1 parent 15db13f commit 6b2b415
2 files changed
+61
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
294 | 302 | | |
295 | 303 | | |
296 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
1485 | 1489 | | |
1486 | 1490 | | |
1487 | 1491 | | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
1488 | 1541 | | |
1489 | 1542 | | |
1490 | 1543 | | |
| |||
0 commit comments