Skip to content

Commit c0b9684

Browse files
authored
env:Improve GNU coreutils Compatibility & Fix env-signal-handler.sh Test (#9465)
* feat(env): add signal handling options and logging - Add default-signal, block-signal, and list-signal-handling options - Support specifying, tracking, and reporting signal handling changes - Update en-US and fr-FR locales to document new signal options * feat: Add `__ALL__` signal option, improve signal argument parsing, and prevent ignoring uncatchable signals. * fix: Preserve inherited SIGPIPE behavior using `RUST_SIGPIPE` environment variable and `uucore`'s new handler. * style: reformat code, reorder imports, and remove trailing blank lines * chore: update spell-checker ignore lists for technical terms Added 'Sigmask' to ignore list in env.rs and 'sighandler' in test_env.rs to suppress false positives from spell-checker on legitimate specialized words. * fix(env): Skip invalid signals instead of failing Previously, the signal handling functions (`apply_default_signal`, `apply_ignore_signal`, and `apply_block_signal`) would return an error if `signal_from_value` got an invalid signal. This change modifies the code to skip invalid signals and continue processing, aligning with GNU env's behavior of ignoring undefined signals on certain platforms where `ALL_SIGNALS` may include invalid values. This improves compatibility and robustness.
1 parent dbfe7c5 commit c0b9684

File tree

6 files changed

+428
-44
lines changed

6 files changed

+428
-44
lines changed

src/uu/env/locales/en-US.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ env-help-debug = print verbose information for each processing step
1212
env-help-split-string = process and split S into separate arguments; used to pass multiple arguments on shebang lines
1313
env-help-argv0 = Override the zeroth argument passed to the command being executed. Without this option a default value of `command` is used.
1414
env-help-ignore-signal = set handling of SIG signal(s) to do nothing
15+
env-help-default-signal = reset handling of SIG signal(s) to the default action
16+
env-help-block-signal = block delivery of SIG signal(s) while running COMMAND
17+
env-help-list-signal-handling = list signal handling changes requested by preceding options
1518
1619
# Error messages
1720
env-error-missing-closing-quote = no terminating quote in -S string at position { $position } for quote '{ $quote }'

src/uu/env/locales/fr-FR.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ env-help-debug = afficher des informations détaillées pour chaque étape de tr
1212
env-help-split-string = traiter et diviser S en arguments séparés ; utilisé pour passer plusieurs arguments sur les lignes shebang
1313
env-help-argv0 = Remplacer le zéroième argument passé à la commande en cours d'exécution. Sans cette option, une valeur par défaut de `command` est utilisée.
1414
env-help-ignore-signal = définir la gestion du/des signal/signaux SIG pour ne rien faire
15+
env-help-default-signal = réinitialiser la gestion du/des signal/signaux SIG à l'action par défaut
16+
env-help-block-signal = bloquer la livraison du/des signal/signaux SIG pendant l'exécution de COMMAND
17+
env-help-list-signal-handling = lister les traitements de signaux modifiés par les options précédentes
1518
1619
# Messages d'erreur
1720
env-error-missing-closing-quote = aucune guillemet de fermeture dans la chaîne -S à la position { $position } pour la guillemet '{ $quote }'

0 commit comments

Comments
 (0)