Commit a97e0ee5 authored by Richard Curnow's avatar Richard Curnow

Corresponds to CVS V0.9.2

Original rev  : rc@rc0.org.uk--historical/mairix--history--0--patch-14
parent 46fe0727
These people have contributed useful patches, ideas and suggestions:
Aredridel
Bardur Arantsson
Christopher Rosado
Corrin Lakeland
Dan Egnor
Emil Sit
James Leifer
Jerry Jorgenson
John Arthur Kane
John Keener
Kevin Rosenberg
Mikael Ylikoski
Robert Hofer
Roberto Boati
Satyaki Das
Vladimir V. Kisil
Will Yardley
I apologise to any contributors who have been omitted from this list!
NEW IN VERSION 0.10
===================
* Add 'raw' mode for searching.
* When purging, only print the pass[12] message in verbose mode
* Add an ACKNOWLEDGEMENTS file.
* Hack to handle missing NAME_MAX on various non-Linux systems
* Improve mairix.spec file for RPM building
NEW IN VERSION 0.9
==================
......
......@@ -2,3 +2,16 @@
system("make mairix.txt");
unlink "build_kit";
$version = $ARGV[0] || die "No version on command line";
open (IN, "<mairix.spec.sample");
open (OUT, ">mairix.spec");
while (<IN>) {
s/\@\@VERSION\@\@/$version/;
print OUT;
}
close (IN);
close (OUT);
unlink "mairix.spec.sample";
/*
$Header: /cvs/src/mairix/db.c,v 1.5 2002/12/23 00:04:57 richard Exp $
$Header: /cvs/src/mairix/db.c,v 1.6 2002/12/29 23:43:46 richard Exp $
mairix - message index builder and finder for maildir folders.
......@@ -706,7 +706,10 @@ static void recode_toktable(struct toktable *tbl, int *new_idx)/*{{{*/
for (;;) {
int i;
fprintf(stderr, "Pass %d\n", pass);
if (verbose) {
fprintf(stderr, "Pass %d\n", pass);
}
any_moved = 0;
for (i=0; i<tbl->size; i++) {
......
/*
$Header: /cvs/src/mairix/dirscan.c,v 1.5 2002/12/27 22:46:16 richard Exp $
$Header: /cvs/src/mairix/dirscan.c,v 1.6 2003/01/02 23:27:42 richard Exp $
mairix - message index builder and finder for maildir folders.
......@@ -33,6 +33,14 @@
#include <dirent.h>
#include <assert.h>
/* Lame fix for systems where NAME_MAX isn't defined after including the above
* set of .h files (Solaris, FreeBSD so far). Probably grossly oversized but
* it'll do. */
#if !defined(NAME_MAX)
#define NAME_MAX 4096
#endif
struct msgpath_array *new_msgpath_array(void)/*{{{*/
{
struct msgpath_array *result;
......
/*
$Header: /cvs/src/mairix/mairix.c,v 1.9 2002/11/13 23:47:01 richard Exp $
$Header: /cvs/src/mairix/mairix.c,v 1.10 2002/12/29 23:44:46 richard Exp $
mairix - message index builder and finder for maildir folders.
......@@ -149,7 +149,10 @@ static void parse_rc_file(char *name)/*{{{*/
output_folder_type = FT_MH;
} else if (!strncasecmp(temp, "maildir", 7)) {
output_folder_type = FT_MAILDIR;
} else {
} else if (!strncasecmp(temp, "raw", 3)) {
output_folder_type = FT_RAW;
}
else {
fprintf(stderr, "Unrecognized vfolder_format <%s>\n", temp);
}
free(temp);
......@@ -208,7 +211,7 @@ static int check_message_list_for_duplicates(struct msgpath_array *msgs)/*{{{*/
static char *get_version(void)/*{{{*/
{
static char buffer[256];
static char cvs_version[] = "$Name: V0_7 $";
static char cvs_version[] = "$Name: V0_9_2 $";
char *p, *q;
for (p=cvs_version; *p; p++) {
if (*p == ':') {
......@@ -401,8 +404,11 @@ int main (int argc, char **argv)/*{{{*/
if (do_search) {
if (!vfolder) {
fprintf(stderr, "No vfolder/MAIRIX_VFOLDER set\n");
exit(1);
if (output_folder_type != FT_RAW) {
fprintf(stderr, "No vfolder/MAIRIX_VFOLDER set\n");
exit(1);
}
vfolder = new_string("");
}
search_top(do_threads, do_augment, database_path, folder_base, vfolder, argv, output_folder_type, verbose);
......
/*
$Header: /cvs/src/mairix/mairix.h,v 1.3 2002/09/09 20:45:43 richard Exp $
$Header: /cvs/src/mairix/mairix.h,v 1.4 2002/12/29 23:44:46 richard Exp $
mairix - message index builder and finder for maildir folders.
......@@ -135,7 +135,8 @@ struct database {/*{{{*/
enum folder_type {/*{{{*/
FT_MAILDIR,
FT_MH
FT_MH,
FT_RAW
};
/*}}}*/
......
Summary: A maildir indexer and searcher
Name: mairix
Version: 0.9
Version: @@VERSION@@
Release: 1
Source: mairix-%{version}.tar.gz
Copyright: GPL
Group: Application/Internet
Packager: Richard P. Curnow
BuildRoot: %{_tmpdir}/%{name}-%{version}-root-%(id -u -n)
BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(id -u -n)
Requires: info
%description
mairix is a tool for indexing email messages stored in maildir format folders
......@@ -17,27 +18,27 @@ maildir folder containing symbolic links to the matched messages.
%setup
%build
make CC=gcc CFLAGS=-O2 prefix=/usr
make mairix.txt prefix=/usr
make mairix.info prefix=/usr
make mairix.html prefix=/usr
make CC=gcc CFLAGS=-O2 prefix=%{_prefix}
make mairix.txt prefix=%{_prefix}
make mairix.info prefix=%{_prefix}
make mairix.html prefix=%{_prefix}
%install
rm -rf $RPM_BUILD_ROOT
cd $RPM_BUILD_DIR/mairix-%{version}
make install prefix=$RPM_BUILD_ROOT/usr
mkdir -p $RPM_BUILD_ROOT/usr/share/info
cp mairix.info* $RPM_BUILD_ROOT/usr/share/info
make install prefix=$RPM_BUILD_ROOT%{_prefix}
mkdir -p $RPM_BUILD_ROOT%{_infodir}
cp mairix.info* $RPM_BUILD_ROOT%{_infodir}
cp README mairix.txt mairix.html dotmairixrc.eg ..
%files
/usr/bin/mairix
/usr/share/info/mairix.info*
%{_bindir}/mairix
%{_infodir}/mairix.info*
%doc README
%doc mairix.txt
%doc mairix.html
%doc dotmairixrc.eg
%post
/usr/sbin/install-info
install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir
......@@ -152,16 +152,21 @@ Create a @file{~/.mairixrc} file. An example is included in the file
searching mode runs whenever the command line contains any expressions to
search for. Otherwise, the indexing mode is run.
The output of the search mode is placed in a @emph{virtual folder}. This is
The output of the search mode is usually placed in a @emph{virtual folder}. This is
just a normal maildir directory (i.e. containing @file{new}, @file{tmp} and
@file{cur}) subdirectories, or a MH directory, so you can open it as a normal
folder in your mail program. You configure the path for this virtual folder in
your @file{~/.mairixrc} file. mairix will popululate the virtual folder with
your @file{~/.mairixrc} file. mairix will populate the virtual folder with
symbolic links pointing to the paths of the real messages that were matched by
the search expression.@footnote{Although symlinks use up more inodes than hard
links, I decided they were more useful because it makes it possible to see the
filenames of the original messages via @command{ls -l}.}
If desired, mairix can produce just a list of files that match the
search expression and omit the building of the virtual folder. This
mode of operation may be useful in communicating the results of the
search to other programs.
@node capabilities
@section Indexing strategy and search capabilities
......@@ -268,11 +273,15 @@ been given on a single very long line.
@item vfolder
This defines the name of the @emph{virtual} folder (within the directory
specified by @samp{base}) into which the search mode writes its output.
If the vfolder_format used is @samp{raw}, then this setting is not
used and may be excluded.
@item vfolder_format
This defines the type of folder used for the @emph{virtual folder} where the
search results go. There are two valid settings for this @samp{mh} or
@samp{maildir}. @samp{maildir} is the default if this option is not defined.
The setting is case-insensitive.
search results go. There are three valid settings for this @samp{mh},
@samp{maildir} or @samp{raw}. If the @samp{raw} setting is used then
mairix will just print out the path names of the files that match and
no virtual folder will be created. @samp{maildir} is the default if this
option is not defined. The setting is case-insensitive.
@item database
This defines the path where mairix's index database is kept. You can keep this
file anywhere you like.
......
/*
$Header: /cvs/src/mairix/search.c,v 1.6 2002/09/11 21:21:09 richard Exp $
$Header: /cvs/src/mairix/search.c,v 1.8 2003/01/02 23:27:42 richard Exp $
mairix - message index builder and finder for maildir folders.
......@@ -33,6 +33,14 @@
#include <assert.h>
#include <dirent.h>
/* Lame fix for systems where NAME_MAX isn't defined after including the above
* set of .h files (Solaris, FreeBSD so far). Probably grossly oversized but
* it'll do. */
#if !defined(NAME_MAX)
#define NAME_MAX 4096
#endif
#include "mairix.h"
#include "reader.h"
#include "memmac.h"
......@@ -826,6 +834,18 @@ static void do_search(struct read_db *db, char **args, char *output_dir, int sho
}
}
break;
case FT_RAW:
for (i=0; i<db->n_paths; i++) {
if (hit3[i]) {
if (db->path_offsets[i]) {
/* File is not dead */
++n_hits;
printf("%s\n", db->data + db->path_offsets[i]);
}
}
}
printf("\n");
break;
default:
assert(0);
......@@ -982,6 +1002,8 @@ void search_top(int do_threads, int do_augment, char *database_path, char *folde
case FT_MH:
create_dir(complete_vfolder);
break;
case FT_RAW:
break;
default:
assert(0);
}
......@@ -996,6 +1018,8 @@ void search_top(int do_threads, int do_augment, char *database_path, char *folde
case FT_MH:
clear_mh_folder(complete_vfolder);
break;
case FT_RAW:
break;
default:
assert(0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment