Fix logic for default XDG_DATA_DIRS value#9312
Conversation
The [POSIX test manpage](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html) as well as the [fish test manpage](https://fishshell.com/docs/current/cmds/test.html#operators-for-text-strings) specify that `-z` will be "True if the length of string string is zero; otherwise, false." The `-n` was likely a mixup and not caught during testing of NixOS#8985 due to a lack of missing conflicting entries in `XDG_DATA_DIRS`.
|
I already tested this change and can confirm that now, after installing the version of Nix from this branch and starting a new terminal session, @Hoverbear can you confirm that after applying the same testing from your original PR, you get the expected results? |
|
Oh no. 😓 It seems I wasn't thinking and copied from the This makes logical sense and I can confirm on my test VM this resolves the issue described. Here is the result from #8985: |
|
I don't really know how the installer tests work, but it would be nice to test this. Can one of you two take a stab at that? |
Hoverbear
left a comment
There was a problem hiding this comment.
I believe this fixes the problem.
|
A test could be added somewhere like nix/tests/installer/default.nix Lines 210 to 219 in fe62cb7 I believe merging this bugfix independently of an added test would cause the existing bug to impact less people. |
|
Maybe we can call it good if we open an issue for the regression test so that it's being tracked? |
@Hoverbear please do! |


Motivation
Fixes an oversight in #8985.
Context
The POSIX test manpage as well as the fish test manpage specify that
-zwill be "True if the length of string string is zero; otherwise, false."The
-nwas likely a mixup and not caught during testing of #8985 due to a lack of missing conflicting entries inXDG_DATA_DIRS.Priorities
Add 👍 to pull requests you find important.