From 74776026063942535196e63d8a0bdd10a6fdca2c Mon Sep 17 00:00:00 2001 From: Daniel Hartwig Date: Sat, 30 Jun 2012 02:08:40 +0800 Subject: Use standard apt-xapian-index location, rather than libept Part of the process to drop libept (see bug #677551): In src/generic/apt/matching/match.cc there's already #ifdefs to do everything via libxapian. The only ept-only bit is ept::axi::path_db(). That can be replaced with "/var/lib/apt-xapian-index/index", which is the standard index location which is NOT going to change (that's actually a xapian pointer to the real index location: try "cat /var/lib/apt-xapian-index/index"). Also add configure check for libxapian headers. --- NEWS | 2 ++ configure.ac | 45 +++++++++++++++++---------------------- src/generic/apt/matching/match.cc | 16 ++------------ 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/NEWS b/NEWS index 9af97aa6..aaf1eab3 100644 --- a/NEWS +++ b/NEWS @@ -187,6 +187,8 @@ behaviour is desirable for two reasons: - repeat if package manager result is DoAgain; - report all download errors not just the first; + * Use standard apt-xapian-index location, rather than libept. + - Cosmetic and UI bugs: * [cmdline]: Use arch-qualified names for virtual packages in diff --git a/configure.ac b/configure.ac index e4deb6d5..c148cae2 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,23 @@ AC_CHECK_LIB(pthread, main, HAVE_LIBPTHREAD=1 , [AC_MSG_ERROR([Can't find the POSIX thread libraries])]) +AC_PATH_PROG(XAPIAN_CONFIG, xapian-config) +if test ! -x "$XAPIAN_CONFIG" +then + AC_MSG_ERROR([Can't find xapian-config -- please install libxapian-dev]) +fi +XAPIAN_CXXFLAGS="$($XAPIAN_CONFIG --cxxflags)" +XAPIAN_LIBS="$($XAPIAN_CONFIG --libs)" + +OLD_CXXFLAGS="$CXXFLAGS" +OLD_LIBS="$LIBS" + +CXXFLAGS="$CXXFLAGS $XAPIAN_CXXFLAGS" +LIBS="$LIBS $XAPIAN_LIBS" +AC_CHECK_HEADER([xapian.h], [], + [AC_MSG_ERROR([Can't find the xapian headers -- please install libxapian-dev])]) +CXXFLAGS="$OLD_CXXFLAGS" +LIBS="$OLD_LIBS" ######################################################################## @@ -355,30 +372,6 @@ int main(int argc, char **argv) AC_MSG_FAILURE([Can't figure out how to access the ept debtags database.]) fi - TEXTSEARCH_OK=0 - - AC_MSG_CHECKING([whether ept/axi exists]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([ -#include - -int main(int argc, char **argv) -{ - Xapian::Database db(ept::axi::path_db()); - - return 0; -}])], - [ - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_EPT_AXI], [], [Define if ept/axi/axi.h can provide docids.]) - TEXTSEARCH_OK=1 - ], - [AC_MSG_RESULT([no])]) - - if test x$TEXTSEARCH_OK = x0 - then - AC_MSG_FAILURE([Can't figure out how to access the ept Xapian database.]) - fi - AC_MSG_CHECKING([whether ept::debtags::Vocabulary::tagData exists and returns ept::debtags::voc::TagData *]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([ @@ -472,8 +465,8 @@ then AC_DEFINE([HAVE_GTK], [], [Define if the GTK+ frontend is included in the build.]) fi -CXXFLAGS="$CXXFLAGS $SIGC_CFLAGS $CWIDGET_CFLAGS $ept_CFLAGS $SQLITE3_CFLAGS" -LIBS="$LIBS $SIGC_LIBS $CWIDGET_LIBS $ept_LIBS $SQLITE3_LIBS $BOOST_IOSTREAMS_LIB" +CXXFLAGS="$CXXFLAGS $SIGC_CFLAGS $CWIDGET_CFLAGS $ept_CFLAGS $SQLITE3_CFLAGS $XAPIAN_CXXFLAGS" +LIBS="$LIBS $SIGC_LIBS $CWIDGET_LIBS $ept_LIBS $SQLITE3_LIBS $BOOST_IOSTREAMS_LIB $XAPIAN_LIBS" CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" diff --git a/src/generic/apt/matching/match.cc b/src/generic/apt/matching/match.cc index 8d42fc28..b59d6c74 100644 --- a/src/generic/apt/matching/match.cc +++ b/src/generic/apt/matching/match.cc @@ -35,13 +35,7 @@ #include -#ifdef HAVE_EPT_AXI -#include -#else -#error "Don't know how to use the debtags Xapian database." -#endif - -#include +#include #include @@ -61,7 +55,6 @@ namespace aptitude { namespace { -#ifdef HAVE_EPT_AXI typedef Xapian::Database debtags_db; const Xapian::docid get_docid_by_name(const debtags_db &db, @@ -81,7 +74,6 @@ namespace aptitude { return db; } -#endif /** \brief Evaluate any regular expression-based pattern. * @@ -388,11 +380,7 @@ namespace aptitude { try { -#ifdef HAVE_EPT_AXI - db.reset(new Xapian::Database(ept::axi::path_db())); -#else -#error "Can't figure out how to create the debtags database." -#endif + db.reset(new Xapian::Database("/var/lib/apt-xapian-index/index")); } catch(...) { -- cgit v1.2.3