diff --git a/sysuser-tools.changes b/sysuser-tools.changes index 1c3f2ad..5435114 100644 --- a/sysuser-tools.changes +++ b/sysuser-tools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Mar 17 10:12:15 UTC 2020 - Fabian Vogt + +- Drop use of tail from the generated %pre scriptlets + ------------------------------------------------------------------- Sun Dec 29 19:16:13 UTC 2019 - kukuk@suse.de diff --git a/sysuser-tools.spec b/sysuser-tools.spec index e687589..e77250c 100644 --- a/sysuser-tools.spec +++ b/sysuser-tools.spec @@ -1,7 +1,7 @@ # # spec file for package sysuser-tools # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/sysusers-generate-pre b/sysusers-generate-pre index c79114a..ff32446 100644 --- a/sysusers-generate-pre +++ b/sysusers-generate-pre @@ -1,26 +1,8 @@ #!/bin/bash # pass systemd sysusers config files a as argument to this script. -# It will output a shell script that creates those users by -# appending the data to itself. - -tmpfile=`mktemp -q -t sysusers.XXXXXX` -cleanup() -{ - rm -f "$tmpfile" -} - -trap cleanup EXIT - -for i in "$@"; do - grep -e '^[ugmr]' "$i" >> "$tmpfile" -done - -lines=`wc -l < "$tmpfile"` echo '#!/bin/bash' -echo "tail -n $lines \$0 | /usr/sbin/sysusers2shadow" -echo 'RET=$?' -echo 'test -f /.buildenv && exit 0' -echo 'exit $RET' -echo '######## data below ########' -cat "$tmpfile" +echo 'cat <<"EOF" |' +grep -he '^[ugmr]' "$@" +echo 'EOF' +echo '/usr/sbin/sysusers2shadow || [[ -f /.buildenv ]]' \ No newline at end of file