[projects/cleanbuild] when builder user has standard group (users) groupadd would fail. ignore that

glen glen at pld-linux.org
Sun Mar 16 02:41:19 CET 2014


commit 13fa060620bc9a72e42b39d6fb8a1ab2e9adf17d
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Mar 16 03:12:21 2014 +0200

    when builder user has standard group (users) groupadd would fail. ignore that

 cleanbuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/cleanbuild b/cleanbuild
index b4c05a6..92f0ca0 100755
--- a/cleanbuild
+++ b/cleanbuild
@@ -313,7 +313,8 @@ build_prepare_root()
 		mount -o bind /$DIR $CHDIR/$DIR
 	done
 
-	chroot $CHDIR groupadd $(id $USER -gn) -g$(id $USER -g)
+	# group 'users' may already exist, so ignore errors
+	chroot $CHDIR groupadd $(id $USER -gn) -g$(id $USER -g) || :
 	chroot $CHDIR useradd -m $USER -u$(id $USER -u) -g $(id $USER -gn)
 
 	# replicate files which already belong to $USER
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/cleanbuild.git/commitdiff/13fa060620bc9a72e42b39d6fb8a1ab2e9adf17d



More information about the pld-cvs-commit mailing list