From f3bd14cf83ef09945ac096da9faa8c28699abd19 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Sun, 20 Dec 2009 14:10:58 +0000 Subject: [PATCH] + few imp. in the indexer code --- src/indexer/kiwix-index.cpp | 13 ++++++++++--- src/zimlib/src/config.h.in | 6 ++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/indexer/kiwix-index.cpp b/src/indexer/kiwix-index.cpp index b0b8d77..856873d 100644 --- a/src/indexer/kiwix-index.cpp +++ b/src/indexer/kiwix-index.cpp @@ -11,14 +11,21 @@ int main(int argc, char **argv) { /* Init the variables */ char *zimFilePath = argv[1]; char *xapianDirectoryPath = argv[2]; - kiwix::Indexer *indexer = new kiwix::Indexer(zimFilePath, xapianDirectoryPath); + kiwix::Indexer *indexer = NULL; + + /* Try to prepare the indexing */ + try { + indexer = new kiwix::Indexer(zimFilePath, xapianDirectoryPath); + } catch (...) { + cout << "Unable to index '" << zimFilePath << "'." << endl; + exit(1); + } /* Start the indexing */ if (indexer != NULL) { - indexer->startIndexing(); while (indexer->indexNextPercent()) {}; } else { - cout << "Unable to start the indexation process" << endl; + cout << "Unable instanciate the Kiwix indexer." << endl; exit(1); } diff --git a/src/zimlib/src/config.h.in b/src/zimlib/src/config.h.in index 5310a80..6a69a39 100644 --- a/src/zimlib/src/config.h.in +++ b/src/zimlib/src/config.h.in @@ -15,6 +15,9 @@ /* Define to 1 if you have the `bz2' library (-lbz2). */ #undef HAVE_LIBBZ2 +/* Define to 1 if you have the `microhttpd' library (-lmicrohttpd). */ +#undef HAVE_LIBMICROHTTPD + /* Define to 1 if you have the `unac' library (-lunac). */ #undef HAVE_LIBUNAC @@ -67,6 +70,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION