Fix indentation in %sysusers_create_compat macro (rhbz#2132835)

Automatic unindentation after <<-EOF only works with tabs. Jesus.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-10-09 15:12:53 +02:00
parent b2ad8fb38b
commit 3c5b26ff79

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: true; tab-width: 4; -*-
# This script turns sysuser.d files into scriptlets mandated by Fedora # This script turns sysuser.d files into scriptlets mandated by Fedora
# packaging guidelines. The general idea is to define users using the # packaging guidelines. The general idea is to define users using the
@ -17,21 +18,21 @@ user() {
{ [ "$shell" = '-' ] || [ "$shell" = '' ]; } && shell=/usr/sbin/nologin { [ "$shell" = '-' ] || [ "$shell" = '' ]; } && shell=/usr/sbin/nologin
if [ "$uid" = '-' ] || [ "$uid" = '' ]; then if [ "$uid" = '-' ] || [ "$uid" = '' ]; then
cat <<EOF cat <<-EOF
getent passwd '$user' >/dev/null || \\ getent passwd '$user' >/dev/null || \\
useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || : useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
EOF EOF
else else
cat <<EOF cat <<-EOF
if ! getent passwd '$user' >/dev/null; then if ! getent passwd '$user' >/dev/null; then
if ! getent passwd '$uid' >/dev/null; then if ! getent passwd '$uid' >/dev/null; then
useradd -r -u '$uid' -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || : useradd -r -u '$uid' -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
else else
useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || : useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
fi fi
fi fi
EOF EOF
fi fi
} }
@ -55,9 +56,9 @@ usermod() {
group="$2" group="$2"
cat <<-EOF cat <<-EOF
if getent group '$group' >/dev/null; then if getent group '$group' >/dev/null; then
usermod -a -G '$group' '$user' || : usermod -a -G '$group' '$user' || :
fi fi
EOF EOF
} }