[Bug 206951] create-users-groups built a script that failed, but the failure was undetected
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 12 Sep 2022 21:42:45 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206951
--- 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?
--
You are receiving this mail because:
You are on the CC list for the bug.