app-shells/rc: only update /etc/shells when needed

This commit is contained in:
Mike Frysinger
2016-01-15 08:55:09 -05:00
parent be0c7f7a2d
commit 0d06dbbedd

View File

@@ -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
}