diff options
| author | Maximilian Bosch <maximilian@mbosch.me> | 2018-10-10 13:19:52 +0200 |
|---|---|---|
| committer | Maximilian Bosch <maximilian@mbosch.me> | 2018-10-10 13:19:52 +0200 |
| commit | 76cc15a3640940aa5866a3fc573e8089f6b336c9 (patch) | |
| tree | a8d9b63dc95f48709f32949ed0792b2c3746efa7 /pkgs/development/python-modules/GitPython/hardcode-git-path.patch | |
| parent | fc847785d89255fb34c32fb28212a66044f655f3 (diff) | |
nixos-option: don't abort with shell failures if options are not existant
`nixos-option` basically handles two cases: the given option is either a
valid option defined using `mkOption` or an attribute set which contains
a set of options.
If none of the above cases is valid, `$1` is invalid. Unfortunatley the
script interpreted invalid options as an attribute set which rendered
shell failures when trying to evaluate the arguments.
First of all, `if names=$(attrNames ...)` resulted in `<PRIMOP>` as
`attrNames` simply evaluated `builtins.attrNames $result` which results
in a non-applied function with `$result` being empty. Trying to map over
this string using `nixMap` while applying `escapeQuotes` causes the bash
error as `eval echo "<PRIMOP>"` is invalid syntax.
Explicitly checking if `$result' contains a value (do we have an
attribute set?) and otherwise returning a warning and asking if $option
exists fixes the problem.
Fixes #48060
Diffstat (limited to 'pkgs/development/python-modules/GitPython/hardcode-git-path.patch')
0 files changed, 0 insertions, 0 deletions
