Loading
gradle: fix usage of update-deps script without bwrap
The gradle build hook exposes an update-deps script that can, supposedly, run without bwrap if the USE_BWRAP environment is set to 0. Unfortunately the test on the variable was checking if it had an non-empty value (using -n), but just above the variable is given a default value in cases when it is empty. This meant the variable could never be empty and therefore bwrap is always used (assuming the Nix parameter useBwrap is true). By changing the test into an inequality check against zero, we can disable bwrap by setting `USE_BWRAP=0`. Any other value will leave bwrap enabled. Unfortunately the lack of boolean values in bash make it non-obvious what the best representation and test for this should be. We could also check for equality against 1 for example, or some more complicated test that handles the string "false" as well. Using 0 as the false value seems common place enough in scripts though. The conversion of `useBwrap` to a string needs to be adjusted, as `builtins.toString` actually returns an empty string for a false value.