]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
CI: Make creation of user idempotent
authorSimon McVittie <smcv@collabora.com>
Fri, 12 May 2023 15:19:38 +0000 (16:19 +0100)
committerSimon McVittie <smcv@collabora.com>
Fri, 12 May 2023 16:47:25 +0000 (17:47 +0100)
Signed-off-by: Simon McVittie <smcv@collabora.com>
tools/ci-install.sh

index c5131c374bd053e321eb3c10d14109446423d5e3..2afcd789bbf73a2334685425444a03108e49087b 100755 (executable)
@@ -286,8 +286,10 @@ case "$ci_distro" in
         if [ "$ci_in_docker" = yes ]; then
             # Add the user that we will use to do the build inside the
             # Docker container, and let them use sudo
-            useradd -m user
-            passwd -ud user
+            if ! getent passwd user >/dev/null; then
+                useradd -m user
+                passwd -ud user
+            fi
             echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopasswd
             chmod 0440 /etc/sudoers.d/nopasswd
         fi