commit:     0d06dbbeddf7f21e46fc072c3024be5f44b69bea
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 15 13:55:09 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Jan 15 14:09:10 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d06dbbe

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 551f043..22f4fd6 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
 }

Reply via email to