1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 15:02:42 +01:00

Use a looser comparison for the 'user note' check

We use grep instead of an equality check because it is difficult
to extract _just_ the user's note, instead it is prefixed with
some plist junk. This was causing the user note to always be set,
even if there was no reason for it.

(cherry picked from commit f06f8102bd)
This commit is contained in:
Graham Christensen 2018-03-30 11:38:08 -04:00
parent 1b493df892
commit 985f0dafe8
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C

View file

@ -483,7 +483,11 @@ EOF
row " Home Directory" "/var/empty"
fi
if [ "$(poly_user_note_get "$username")" = "Nix build user $coreid" ]; then
# We use grep instead of an equality check because it is difficult
# to extract _just_ the user's note, instead it is prefixed with
# some plist junk. This was causing the user note to always be set,
# even if there was no reason for it.
if ! poly_user_note_get "$username" | grep -q "Nix build user $coreid"; then
row " Note" "Nix build user $coreid"
else
poly_user_note_set "$username" "Nix build user $coreid"