You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2005/08/10 09:08:10 UTC

svn commit: r231181 - in /httpd/mod_mbox/trunk/scripts: catchup-archive create-index create-site-index update-index

Author: jerenkrantz
Date: Wed Aug 10 00:08:06 2005
New Revision: 231181

URL: http://svn.apache.org/viewcvs?rev=231181&view=rev
Log:
First pass at updating mod_mbox scripts to use the new mod-mbox-util program;
various other minor updates.

Modified:
    httpd/mod_mbox/trunk/scripts/catchup-archive
    httpd/mod_mbox/trunk/scripts/create-index
    httpd/mod_mbox/trunk/scripts/create-site-index
    httpd/mod_mbox/trunk/scripts/update-index

Modified: httpd/mod_mbox/trunk/scripts/catchup-archive
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/trunk/scripts/catchup-archive?rev=231181&r1=231180&r2=231181&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/scripts/catchup-archive (original)
+++ httpd/mod_mbox/trunk/scripts/catchup-archive Wed Aug 10 00:08:06 2005
@@ -83,16 +83,23 @@
             ln -s $i $i.mbox
         done
 
-        for i in *.mbox; do
-            echo "Generating index for $i."
+        if [ -x $APACHE_DIR/bin/mod-mbox-util ]; then
+          echo "Generating index for $dirname."
+          $APACHE_DIR/bin/mod-mbox-util -c $MBOX_DIR/$dirname
+        else
+          for i in *.mbox; do
+            echo "Generating index for $i"
             $APACHE_DIR/bin/generate_index $i
             $APACHE_DIR/bin/load_msgid $i > $i.msgid
-        done
+          done
+        fi
 
         popd
     fi
 done
 
-# Create the indexes
-echo "Creating index for $1"
-$SCRIPT_DIR/create-index $1
+if [ ! -x $APACHE_DIR/bin/mod-mbox-util ]; then
+  # Create the indexes
+  echo "Creating index for $1"
+  $SCRIPT_DIR/create-index $1
+fi

Modified: httpd/mod_mbox/trunk/scripts/create-index
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/trunk/scripts/create-index?rev=231181&r1=231180&r2=231181&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/scripts/create-index (original)
+++ httpd/mod_mbox/trunk/scripts/create-index Wed Aug 10 00:08:06 2005
@@ -49,7 +49,7 @@
         yearname=`basename $i .mbox | cut -b1-4`
         moname=`basename $i .mbox | cut -b5-6`
         echo "<tr><td>$moname/$yearname</td><td><a href=\"$i/threads.html\">Threads</a> <a href=\"$i/index.html\">Date</a> <a href=\"$i/authors.html\">Authors</a></td></tr>" >> index.html
-        if [ $moname -eq 12 ]; then
+        if [ -n $moname -a $moname -eq 12 ]; then
           echo "<tr><td colspan="2"><hr/></td></tr>" >> index.html
         fi
     done

Modified: httpd/mod_mbox/trunk/scripts/create-site-index
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/trunk/scripts/create-site-index?rev=231181&r1=231180&r2=231181&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/scripts/create-site-index (original)
+++ httpd/mod_mbox/trunk/scripts/create-site-index Wed Aug 10 00:08:06 2005
@@ -43,7 +43,7 @@
     listname=`echo $dirname | cut -d '-' -f 2-`
     echo Updating $dirname index $listname @ $tlpname
 
-    echo "<li><a href=\"$dirname/\">$listname@$tlpname.apache.org</a> archive</li>" >> $MBOX_DIR/index.html
+    echo "<li><a href=\"$dirname/\">$listname@$tlpname.apache.org</a></li>" >> $MBOX_DIR/index.html
 
     if [ $count -eq $mid_count ]; then
       cat >> $MBOX_DIR/index.html <<EOF

Modified: httpd/mod_mbox/trunk/scripts/update-index
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/trunk/scripts/update-index?rev=231181&r1=231180&r2=231181&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/scripts/update-index (original)
+++ httpd/mod_mbox/trunk/scripts/update-index Wed Aug 10 00:08:06 2005
@@ -14,7 +14,7 @@
 
 source $ARCHIVES_PATH
 
-if [ -n $PRE_SYNC ]; then
+if [ "x$PRE_SYNC" != "x" ]; then
   rsync --delete -az $PRE_SYNC_SOURCE $PRE_SYNC_DEST >/dev/null
 fi
 
@@ -64,10 +64,19 @@
         fi
         ln -sf $mboxfile2 $mboxfile
     fi
-    if [ -f $mboxfile ]; then
+
+    if [ -x $APACHE_DIR/bin/mod-mbox-util ]; then
+      $APACHE_DIR/bin/mod-mbox-util -u $MBOX_DIR/$dirname
+    else
+      if [ -f $mboxfile ]; then
         $APACHE_DIR/bin/generate_index $mboxfile
         $APACHE_DIR/bin/load_msgid $mboxfile > $mboxfile.msgid
+      fi
     fi
 done
 
-$SCRIPT_DIR/create-index-all $ARCHIVES_PATH
+if [ ! -x $APACHE_DIR/bin/mod-mbox-util ]; then
+  $SCRIPT_DIR/create-site-index $ARCHIVES_PATH
+else
+  $SCRIPT_DIR/create-index-all $ARCHIVES_PATH
+fi



Re: svn commit: r231181 - in /httpd/mod_mbox/trunk/scripts: catchup-archive create-index create-site-index update-index

Posted by Maxime Petazzoni <ma...@bulix.org>.
> Actually, I think they do belong in this repository.  We should really
> add the CGI script that does the msgid search too.  Hopefully, once the
> mbox-search project is done, we can replace more of these scripts.

As I said, they are related exclusively to the ASF mailing lists. I did
not even used these scripts to setup my development setup of mod_mbox, a
proof they're not as needed as you claim they are.

I don't really think the current trunk/ directory structure is really
clean. In module-2.0/ you can find, all messed up, mod-mbox-util -which
is all but an Apache HTTPd module-, the libmbox library, and the module
itself. Not to mention these scripts, of course.

Something like :

lib/                  -- libmbox code (mbox_* files)
util/                 -- utilities directory
util/mod-mbox-util/   -- mod-mbox-util code
util/scripts/         -- the scripts, if you really want them here
module-2.0/           -- module source code (mod_mbox_* files)

sounds a lot clearer, and understable at first look.

> > For non-ASF mod_mbox users (maybe they'll be some, one day), a simple
> > README with the setup steps and how to use mod-mbox-util is enough.
> 
> In general, any new documentation would be awesome.

Extract from repos/asf/httpd/mod_mbox/branches/httpd-mbox-if/STATUS,
updated by me during July :

[...]
Other known issues / ToDo:

    * Documentation
      - For developpers : internals
      - For admins      : setup and update
      - For users       : usage, interface description, ...

Just wait. This will come :)

- Sam

-- 
Maxime Petazzoni (http://www.bulix.org)
 -- gone crazy, back soon. leave message.

Re: svn commit: r231181 - in /httpd/mod_mbox/trunk/scripts: catchup-archive create-index create-site-index update-index

Posted by Maxime Petazzoni <ma...@bulix.org>.
> Certainly for simpler setups, you might not want to use these scripts. 
> But, if you're doing a large setup, it'd greatly easy the difficulty in 
> setting the archives up if you can build upon a set of scripts that others 
> have used.

I believe this is why we have package mainteners : to gather all needed
material allowing users to build any setup they want. Ideally, we should
have a separate repository for this kind of things (same goes for the
Css, images and javascript file I recently added), along with svn
externals. But AFAIK the ASF repos were not set up in this way.

In the light of this argument, I agree that these scripts should stay
around here, but maybe with a different directory structure (see my last
post and/or what have been done for apreq).

- Sam

-- 
Maxime Petazzoni (http://www.bulix.org)
 -- gone crazy, back soon. leave message.

Re: svn commit: r231181 - in /httpd/mod_mbox/trunk/scripts: catchup-archive create-index create-site-index update-index

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On August 10, 2005 7:26:44 AM -0700 Paul Querna <ch...@force-elite.com> 
wrote:

>> Since most of these scripts (create-site-index in particular) are
>> dedicated to mail-archives.a.org, I don't believe they belong to the
>> mod_mbox repository (more in something like the infra repos for
>> example).
>>
> Actually, I think they do belong in this repository.  We should really
> add the CGI script that does the msgid search too.  Hopefully, once the
> mbox-search project is done, we can replace more of these scripts.

Obviously, I agree.

Part of what makes mod_mbox is having the utilities and 'framework' to set 
up a web-based mail archive.

Here's an analogy: you could make a case that you don't need htpasswd in 
httpd - but without it, it makes it difficult to set up.

Certainly for simpler setups, you might not want to use these scripts. 
But, if you're doing a large setup, it'd greatly easy the difficulty in 
setting the archives up if you can build upon a set of scripts that others 
have used.

> In general, any new documentation would be awesome.

After I finish updating the mail-archives.apache.org site, I'll try to add 
a quick README that describes the new configuration.  -- justin

Re: svn commit: r231181 - in /httpd/mod_mbox/trunk/scripts: catchup-archive create-index create-site-index update-index

Posted by Paul Querna <ch...@force-elite.com>.
Maxime Petazzoni wrote:
> Hi,
> 
> 
>>First pass at updating mod_mbox scripts to use the new mod-mbox-util program;
>>various other minor updates.
>>
>>Modified:
>>    httpd/mod_mbox/trunk/scripts/catchup-archive
>>    httpd/mod_mbox/trunk/scripts/create-index
>>    httpd/mod_mbox/trunk/scripts/create-site-index
>>    httpd/mod_mbox/trunk/scripts/update-index
> 
> 
> Since most of these scripts (create-site-index in particular) are
> dedicated to mail-archives.a.org, I don't believe they belong to the
> mod_mbox repository (more in something like the infra repos for
> example).
> 
Actually, I think they do belong in this repository.  We should really
add the CGI script that does the msgid search too.  Hopefully, once the
mbox-search project is done, we can replace more of these scripts.

> For non-ASF mod_mbox users (maybe they'll be some, one day), a simple
> README with the setup steps and how to use mod-mbox-util is enough.

In general, any new documentation would be awesome.

-Paul


Re: svn commit: r231181 - in /httpd/mod_mbox/trunk/scripts: catchup-archive create-index create-site-index update-index

Posted by Maxime Petazzoni <ma...@bulix.org>.
Hi,

> First pass at updating mod_mbox scripts to use the new mod-mbox-util program;
> various other minor updates.
> 
> Modified:
>     httpd/mod_mbox/trunk/scripts/catchup-archive
>     httpd/mod_mbox/trunk/scripts/create-index
>     httpd/mod_mbox/trunk/scripts/create-site-index
>     httpd/mod_mbox/trunk/scripts/update-index

Since most of these scripts (create-site-index in particular) are
dedicated to mail-archives.a.org, I don't believe they belong to the
mod_mbox repository (more in something like the infra repos for
example).

For non-ASF mod_mbox users (maybe they'll be some, one day), a simple
README with the setup steps and how to use mod-mbox-util is enough.

- Sam

-- 
Maxime Petazzoni (http://www.bulix.org)
 -- gone crazy, back soon. leave message.