aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-16 10:44:52 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-16 10:44:52 +0100
commitb78bf6b3526c242bf01a845625935bc96b2e91e8 (patch)
treebfb89b0e2a67dbad435546bac4ebdc0bdf2ff84a
parentcffb768fb6b53bed65469d65e374a3e5572ca122 (diff)
downloadpaludis-b78bf6b3526c242bf01a845625935bc96b2e91e8.tar.gz
paludis-b78bf6b3526c242bf01a845625935bc96b2e91e8.tar.xz
Nicer error if --disable-search-indexes
-rw-r--r--src/clients/cave/search_extras_handle.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/clients/cave/search_extras_handle.cc b/src/clients/cave/search_extras_handle.cc
index a6d3379..9ca5982 100644
--- a/src/clients/cave/search_extras_handle.cc
+++ b/src/clients/cave/search_extras_handle.cc
@@ -20,6 +20,7 @@
#include "search_extras_handle.hh"
#include <paludis/util/singleton-impl.hh>
+#include <paludis/util/exception.hh>
#include <paludis/args/do_help.hh>
@@ -29,6 +30,8 @@
#include <dlfcn.h>
#include <stdint.h>
+#include "config.h"
+
#define STUPID_CAST(type, val) reinterpret_cast<type>(reinterpret_cast<uintptr_t>(val))
using namespace paludis;
@@ -44,6 +47,10 @@ SearchExtrasHandle::SearchExtrasHandle() :
done_adds_function(0),
find_candidates_function(0)
{
+#ifndef ENABLE_SEARCH_INDEX
+ throw NotAvailableError("cave was built without support for search indexes");
+#endif
+
handle = ::dlopen(("libcavesearchextras_" + stringify(PALUDIS_PC_SLOT) + ".so").c_str(), RTLD_NOW | RTLD_GLOBAL);
if (! handle)
throw args::DoHelp("Search index creation not available because dlopen said " + stringify(::dlerror()));