about summary refs log tree commit diff
path: root/scripts/install-multi-user.sh
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2018-03-30T15·38-0400
committerGraham Christensen <graham@grahamc.com>2018-03-30T15·38-0400
commitf06f8102bdb7c486d1b4723865988dded5575dad (patch)
treed612bf36bdfab67a96871769d1fad9414f0da1af /scripts/install-multi-user.sh
parent4ba91f5baefb3d6f187a72505a4a763c35db7b96 (diff)
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.
Diffstat (limited to 'scripts/install-multi-user.sh')
-rw-r--r--scripts/install-multi-user.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh
index 411de31f4cde..8a1548a3ce22 100644
--- a/scripts/install-multi-user.sh
+++ b/scripts/install-multi-user.sh
@@ -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"