Date: Mon, 12 Sep 2022 21:42:45 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 206951] create-users-groups built a script that failed, but the failure was undetected Message-ID: <bug-206951-7788-34Y3AGrfaS@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-206951-7788@https.bugs.freebsd.org/bugzilla/> References: <bug-206951-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206951 --- Comment #3 from John Hein <jcfyecrayz@liamekaens.com> --- I tried adding '|| exit 1' in /Mk/Scripts/do-users-groups.sh : --- a/Mk/Scripts/do-users-groups.sh +++ b/Mk/Scripts/do-users-groups.sh @@ -76,7 +76,7 @@ if [ -n "${GROUPS}" ]; then cat >> "${dp_UG_INSTALL}" <<-eot2 if ! \${PW} groupshow $group >/dev/null 2>&1; then echo "Creating group '$group' with gid '$gid'." - \${PW} groupadd $group -g $gid + \${PW} groupadd $group -g $gid || exit 1 else echo "Using existing group '$group'." fi @@ -129,7 +129,7 @@ if [ -n "${USERS}" ]; then cat >> "${dp_UG_INSTALL}" <<-eot2 if ! \${PW} usershow $login >/dev/null 2>&1; then echo "Creating user '$login' with uid '$uid'." - \${PW} useradd $login -u $uid -g $gid $class -c "$gecos" -d $homedir -s $shell + \${PW} useradd $login -u $uid -g $gid $class -c "$gecos" -d $homedir -s $shell || exit 1 else echo "Using existing user '$login'." fi That makes the pre-install script fail, which makes 'pkg add' fail, which is good. However, 'make install' is not failing. It seems that 'pkg register' does = not care if the PRE-INSTALL script fails, but I have not confirmed that. If so, that could be part two of fixing this bug. I (or someone) will have to look into what 'pkg register' is doing - does it ignore the exit code of the PRE-INSTALL script, and if so, why? --=20 You are receiving this mail because: You are on the CC list for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-206951-7788-34Y3AGrfaS>