From 5f16cfd60331b011fc0c4b8941827771bbf15935 Mon Sep 17 00:00:00 2001 From: rozel Date: Fri, 22 Jul 2005 21:03:21 +0200 Subject: [PATCH] On indexe maintenant les references afin de permettre des liens vers la descendance de l'article affiche. darcs-hash:20050722190321-061a7-e2e7a623f7ce77a9c8b7ef5aa3840001f4d4dc4a.gz --- index_news.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index_news.sh b/index_news.sh index add61623..d0845989 100755 --- a/index_news.sh +++ b/index_news.sh @@ -28,15 +28,19 @@ for forum in $(find $Rep_News -type d -mindepth 1 -printf '%P \n') ; do if test -f $fichier ; then for article in $(find $Rep_News$forum -type f -maxdepth 1 -newer $fichier -printf '%P \n') ; do mid=$(grep "Message-ID: " $Rep_News$forum/$article | awk '{print $2}') - $(echo $article $mid >> $id ) + ref=$(grep -m 1 -A 9 "References: " $Rep_News$forum/$article | \ + awk 'BEGIN { RS = "" ; FS = ":" } {print $2}' | grep "^ <" | tr -d '\n') + $(echo $article $mid $ref >> $id ) done else # si le dernier message avant le dernier id-xage est annule ou modere - # ou si le fichier des mid n'existe pas : + # ou si le fichier des mid n'existe pas : # on est bourrin : on re-indexe l'ensemble $(echo -n > $id) for article in $(find $Rep_News$forum -type f -maxdepth 1 -printf '%P \n') ; do mid=$(grep "Message-ID: " $Rep_News$forum/$article | awk '{print $2}') - $(echo $article $mid >> $id ) + ref=$(grep -m 1 -A 9 "References: " $Rep_News$forum/$article | \ + awk 'BEGIN { RS = "" ; FS = ":" } {print $2}' | grep "^ <" | tr -d '\n') + $(echo $article $mid $ref >> $id ) done fi fi