diff --git a/macros.sysusers b/macros.sysusers index 6137da9..12c3e86 100644 --- a/macros.sysusers +++ b/macros.sysusers @@ -13,8 +13,7 @@ # ### -# This is for useradd/usermod/groupadd -%sysusers_requires Requires(pre): useradd_or_adduser_dep sysuser-shadow /usr/bin/cat \ +%sysusers_requires Requires(pre): sysuser-shadow \ Suggests: shadow %sysusers_generate_pre() \ diff --git a/sysuser-tools.changes b/sysuser-tools.changes index bc020b3..65c1050 100644 --- a/sysuser-tools.changes +++ b/sysuser-tools.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Sep 18 10:32:53 UTC 2020 - Fabian Vogt + +- Avoid useless use of cat +- Simplify %sysusers_requires +- Drop shebang, rpm passes it to /bin/sh itself + ------------------------------------------------------------------- Fri Aug 21 15:09:13 UTC 2020 - Thorsten Kukuk diff --git a/sysusers-generate-pre b/sysusers-generate-pre index 3a37819..4cc2620 100644 --- a/sysusers-generate-pre +++ b/sysusers-generate-pre @@ -1,8 +1,6 @@ #!/bin/sh # pass systemd sysusers config paths as argument to this script. -echo '#!/bin/sh' -echo 'cat <<"EOF" |' +echo '/usr/sbin/sysusers2shadow <<"EOF" || [ -f /.buildenv ]' grep -he '^[ugmr]' "$@" echo 'EOF' -echo '/usr/sbin/sysusers2shadow || [ -f /.buildenv ]' diff --git a/sysusers2shadow.sh b/sysusers2shadow.sh index 33db91c..6440475 100644 --- a/sysusers2shadow.sh +++ b/sysusers2shadow.sh @@ -13,6 +13,7 @@ for i in /bin/busybox /usr/bin/busybox; do [ -x "$i" ] && busybox=$i; done while read LINE do + # "eval set" to do proper splitting while respecting quotes eval set -- $LINE case "${1-}" in \#*|"")