From 0d06dbbeddf7f21e46fc072c3024be5f44b69bea Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 15 Jan 2016 08:55:09 -0500 Subject: [PATCH] app-shells/rc: only update /etc/shells when needed --- app-shells/rc/rc-1.7.4.ebuild | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app-shells/rc/rc-1.7.4.ebuild b/app-shells/rc/rc-1.7.4.ebuild index 551f043253b4a..22f4fd6d06998 100644 --- a/app-shells/rc/rc-1.7.4.ebuild +++ b/app-shells/rc/rc-1.7.4.ebuild @@ -35,8 +35,9 @@ src_install() { } pkg_postinst() { - ebegin "Updating /etc/shells" - ( grep -v "^/bin/rcsh$" "${ROOT}"etc/shells; echo "/bin/rcsh" ) > "${T}"/shells - mv -f "${T}"/shells "${ROOT}"etc/shells - eend $? + if ! grep -q '^/bin/rcsh$' "${EROOT}"/etc/shells ; then + ebegin "Updating /etc/shells" + echo "/bin/rcsh" >> "${EROOT}"/etc/shells + eend $? + fi }