aboutsummaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-09 20:47:36 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-09 20:47:36 +0000
commit6367ccea5397b980a93535cb993fa2b31cd2615a (patch)
tree19fbebd3aed152dcbe7e9d18b5c2aabd36182a52 /hooks
parent1ca05a0e7a21cce9646ba0df61d88f195f87e55f (diff)
downloadpaludis-6367ccea5397b980a93535cb993fa2b31cd2615a.tar.gz
paludis-6367ccea5397b980a93535cb993fa2b31cd2615a.tar.xz
Don't ship news.eselect as part of Paludis. Use 'eselect news count' rather than manually implementing news counting. Fixes: Gentoo\#179064
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/news.hook13
1 files changed, 2 insertions, 11 deletions
diff --git a/hooks/news.hook b/hooks/news.hook
index 9b7d56975..ea5726c08 100755
--- a/hooks/news.hook
+++ b/hooks/news.hook
@@ -19,20 +19,11 @@
check_for_news()
{
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
+ export ROOT="${ROOT}"
source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
-
- mkdir -p ${ROOT}/var/lib/paludis/news/
+ count="$(eselect news count )"
done_echo=
-
- count=0
- for f in "${ROOT}/var/lib/paludis/news/"news-*.unread ; do
- [[ -f "${f}" ]] || continue
- if grep --silent . "${f}" ; then
- count=$(( count + $(grep --count . < "${f}" ) ))
- fi
- done
-
if [[ ${count} -gt 0 ]] ; then
[[ -z "${done_echo}" ]] && echo ; done_echo=yes
ewarn "You have ${count} unread news items (use 'eselect news' to read)"