From f8064cbc0eaaaf1bab0d12d124e404db2be6a4a909fd38b02627ab06fab6b84a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 22 Nov 2017 10:55:02 +0000 Subject: [PATCH] - Do not suppress errors from useradd OBS-URL: https://build.opensuse.org/package/show/network/libteam?expand=0&rev=10 --- libteam.changes | 5 +++++ libteam.spec | 32 +++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/libteam.changes b/libteam.changes index fc048f8..d4b8eb9 100644 --- a/libteam.changes +++ b/libteam.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Nov 22 10:54:50 UTC 2017 - jengelh@inai.de + +- Do not suppress errors from useradd + ------------------------------------------------------------------- Wed Nov 22 11:26:44 CET 2017 - ndas@suse.de diff --git a/libteam.spec b/libteam.spec index 1785a8c..78c9930 100644 --- a/libteam.spec +++ b/libteam.spec @@ -134,35 +134,37 @@ programs that will manipulate team network devices. # Use CFLAGS= to kill -Werror make %{?_smp_mflags} CFLAGS="%optflags" -pushd binding/python/; -python ./setup.py build; -popd; +pushd binding/python/ +python ./setup.py build +popd %install -b="%buildroot"; -make install DESTDIR="$b"; -pushd binding/python/; -python ./setup.py install --root="$b" --prefix="%_prefix"; -popd; +b="%buildroot" +%make_install +pushd binding/python/ +python ./setup.py install --root="$b" --prefix="%_prefix" +popd rm -f "$b/%_libdir"/*.la %if 0%{?_unitdir:1} -mkdir -p "$b/%_unitdir"; -install -pm0644 teamd/redhat/systemd/*.service "$b/%_unitdir/"; +mkdir -p "$b/%_unitdir" +install -pm0644 teamd/redhat/systemd/*.service "$b/%_unitdir/" %endif %if 0%{?_sysconfdir:1} -mkdir -p "$b/%teamd_dbus_policy_directory/"; -install -pm0644 teamd/dbus/teamd.conf "$b/%teamd_dbus_policy_directory/%teamd_dbus_policy_name"; +mkdir -p "$b/%teamd_dbus_policy_directory/" +install -pm0644 teamd/dbus/teamd.conf "$b/%teamd_dbus_policy_directory/%teamd_dbus_policy_name" %endif %check make check %pre tools -%{_sbindir}/groupadd -r %teamd_group 2> /dev/null || : -%{_sbindir}/useradd -r -g %teamd_group -s /bin/false -c "Teamd daemon user" -d %{_localstatedir}/lib/empty %teamd_user 2> /dev/null || : -%{_sbindir}/usermod -g %teamd_group %teamd_user 2>/dev/null || : +getent group daemon >/dev/null || %_sbindir/groupadd -r %teamd_group +getent passwd %teamd_user >/dev/null || \ + %_sbindir/useradd -r -g %teamd_group -s /bin/false \ + -c "Teamd daemon user" -d %{_localstatedir}/lib/empty %teamd_user +%_sbindir/usermod -g %teamd_group %teamd_user 2>/dev/null test -L %teamd_daemon_directory || rm -rf %teamd_daemon_directory && : %if 0%{?_unitdir:1} %service_add_pre teamd@.service