~ubuntu-branches/ubuntu/trusty/recoll/trusty

« back to all changes in this revision

Viewing changes to index/recollindex.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry
  • Date: 2008-11-13 21:18:15 UTC
  • mfrom: (1.1.7 upstream) (4.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20081113211815-2hxp996xj5hyjh08
Tags: 1.11.0-1
* New upstream release:
  + Remebers missing filters in first run (Closes: #500690)
* debian/control:
  + Added libimage-exiftool-perl as Suggests (Closes: #502427)
  + Added Python as recommaded due to filters/rclpython script
    although, its not necessary as it will be installed only
    when Python is present
* debian/patches:
  + Refreshed patch for gcc 4.4 FTBFS (Closes: #505376)
* debian/copyright:
  + Updated for newly added filter and image files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef lint
2
 
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.35 2007/12/13 06:58:21 dockes Exp $ (C) 2004 J.F.Dockes";
 
2
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.38 2008/10/14 06:07:42 dockes Exp $ (C) 2004 J.F.Dockes";
3
3
#endif
4
4
/*
5
5
 *   This program is free software; you can redistribute it and/or modify
39
39
#include "pathut.h"
40
40
#include "rclmon.h"
41
41
#include "x11mon.h"
 
42
#include "rclversion.h"
42
43
 
43
44
// Globals for exit cleanup
44
45
ConfIndexer *confindexer;
249
250
;
250
251
 
251
252
static void
252
 
Usage(void)
 
253
Usage(FILE *where = stderr)
253
254
{
254
255
    FILE *fp = (op_flags & OPT_h) ? stdout : stderr;
255
256
    fprintf(fp, "%s: Usage: %s", thisprog, usage);
 
257
    fprintf(fp, "Recoll version: %s\n", rclversion);
256
258
    exit((op_flags & OPT_h)==0);
257
259
}
258
260
 
265
267
int main(int argc, const char **argv)
266
268
{
267
269
    string a_config;
268
 
#ifdef RCL_MONITOR
269
270
    int sleepsecs = 60;
270
 
#endif
 
271
 
271
272
    thisprog = argv[0];
272
273
    argc--; argv++;
273
274
 
287
288
            case 'h': op_flags |= OPT_h; break;
288
289
            case 'i': op_flags |= OPT_i; break;
289
290
            case 'l': op_flags |= OPT_l; break;
290
 
#ifdef RCL_MONITOR
291
291
            case 'm': op_flags |= OPT_m; break;
292
 
#endif
293
292
            case 's': op_flags |= OPT_s; break;
294
293
#ifdef RCL_USE_ASPELL
295
294
            case 'S': op_flags |= OPT_S; break;
296
295
#endif
297
 
#ifdef RCL_MONITOR
298
296
            case 'w':   op_flags |= OPT_w; if (argc < 2)  Usage();
299
297
                if ((sscanf(*(++argv), "%d", &sleepsecs)) != 1) 
300
298
                    Usage(); 
301
299
                argc--; goto b1;
302
 
#endif
303
300
            case 'x': op_flags |= OPT_x; break;
304
301
            case 'z': op_flags |= OPT_z; break;
305
302
            default: Usage(); break;
307
304
    b1: argc--; argv++;
308
305
    }
309
306
    if (op_flags & OPT_h)
310
 
        Usage();
 
307
        Usage(stdout);
 
308
#ifndef RCL_MONITOR
 
309
    if (op_flags & (OPT_m | OPT_w|OPT_x)) {
 
310
        cerr << "Sorry, -m not available: real-time monitoring was not "
 
311
            "configured in this build\n";
 
312
        exit(1);
 
313
    }
 
314
#endif
 
315
 
311
316
    if ((op_flags & OPT_z) && (op_flags & (OPT_i|OPT_e)))
312
317
        Usage();
313
318
 
398
403
 
399
404
    } else {
400
405
        confindexer = new ConfIndexer(config, &updater);
401
 
        exit(!confindexer->index(rezero));
 
406
        bool status = confindexer->index(rezero);
 
407
        if (!status) 
 
408
            cerr << "Indexing failed" << endl;
 
409
        exit(!status);
402
410
    }
403
411
}