diff -Nru xapian-omega-1.2.7/cgiparam.cc xapian-omega-1.2.8/cgiparam.cc --- xapian-omega-1.2.7/cgiparam.cc 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/cgiparam.cc 2011-12-14 05:28:00.000000000 +0000 @@ -3,7 +3,7 @@ * Copyright 1999,2000,2001 BrightStation PLC * Copyright 2001 James Aylett * Copyright 2001 Ananova Ltd - * Copyright 2002,2003,2009 Olly Betts + * Copyright 2002,2003,2009,2011 Olly Betts * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -25,6 +25,9 @@ #include "cgiparam.h" +#include "urldecode.h" +#include "urlencode.h" + #include #include #include @@ -79,6 +82,12 @@ } void +CGIParameterHandler::operator()(const string& var, const string& val) const +{ + add_param(var, val); +} + +void decode_argv(char **argv) { cgi_params.clear(); @@ -122,86 +131,22 @@ decode_post() { char *content_length; - unsigned int cl = INT_MAX; + size_t cl = INT_MAX; content_length = getenv("CONTENT_LENGTH"); /* Netscape Fasttrack server for NT doesn't give CONTENT_LENGTH */ if (content_length) cl = atoi(content_length); cgi_params.clear(); - while (cl && (!feof(stdin))) { - string name, val; - bool had_equals = false; - while (1) { - int ch = EOF; - if (cl) { - ch = getchar(); - cl--; - } - if (ch == EOF || ch == '&') { - if (!name.empty()) add_param(name, val); - break; - } - char orig_ch = ch; - if (ch == '+') - ch = ' '; - else if (ch == '%') { - if (cl >= 2) { - cl -= 2; - int c = getchar(); - ch = (c & 0xf) + ((c & 64) ? 9 : 0); - if (c != EOF) c = getchar(); - ch = ch << 4; - ch |= (c & 0xf) + ((c & 64) ? 9 : 0); - } - } - if (had_equals) { - val += char(ch); - } else if (orig_ch == '=') { - had_equals = true; - } else { - name += char(ch); - } - } - } + url_decode(CGIParameterHandler(), StdinItor(cl), StdinItor()); } void decode_get() { - const char *q_str = getenv("QUERY_STRING"); - if (!q_str) q_str = ""; // Hmm, sounds like a broken web server - cgi_params.clear(); - char ch; - do { - string name, val; - bool had_equals = false; - while (1) { - ch = *q_str++; - if (ch == '\0' || ch == '&') { - if (name.empty()) return; // end on blank line - add_param(name, val); - break; - } - char orig_ch = ch; - if (ch == '+') - ch = ' '; - else if (ch == '%') { - int c = *q_str++; - ch = (c & 0xf) + ((c & 64) ? 9 : 0); - if (c) c = *q_str++; - ch = ch << 4; - ch |= (c & 0xf) + ((c & 64) ? 9 : 0); - if (!c) return; // unfinished % code - } - if (had_equals) { - val += char(ch); - } else if (orig_ch == '=') { - had_equals = true; - } else { - name += char(ch); - } - } - } while (ch); + const char *q_str = getenv("QUERY_STRING"); + // If QUERY_STRING isn't set, that's pretty broken, but don't segfault. + if (q_str) + url_decode(CGIParameterHandler(), CStringItor(q_str), CStringItor()); } diff -Nru xapian-omega-1.2.7/ChangeLog xapian-omega-1.2.8/ChangeLog --- xapian-omega-1.2.7/ChangeLog 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/ChangeLog 2011-12-14 05:28:00.000000000 +0000 @@ -1,3 +1,101 @@ +Tue Dec 13 12:42:10 GMT 2011 Olly Betts + + * NEWS: Final update for 1.2.8. + +Tue Dec 13 12:38:04 GMT 2011 Olly Betts + + * Backport change from trunk: + * docs/omegascript.rst,query.cc,templates/emptydocs,templates/godmode, + templates/query,urldecode.h,urlenctest.cc: Add new $prettyurl{} + command which undoes RFC3986 URL escaping which doesn't affect + semantics in practice. Partly addresses ticket#550. + +Tue Dec 13 11:19:56 GMT 2011 Olly Betts + + * NEWS,configure.ac: Update for 1.2.8. + +Thu Dec 08 08:27:28 GMT 2011 Olly Betts + + * Backport change from trunk: + * omindex.cc: Improve --help output (and man page which is generated + from it). Closes bug#572. + +Thu Dec 08 04:53:40 GMT 2011 Olly Betts + + * Backport change from trunk: + * Makefile.am: Ship new header urldecode.h. + +Thu Dec 08 04:46:18 GMT 2011 Olly Betts + + * Backport change from trunk: + * Makefile.am,cgiparam.cc,urldecode.h,urlenctest.cc: Add new + implementation of URL decoding - the old one didn't handle + various corner cases well, and had two cut and pasted variants + for handling a input from a C string (GET) or from stdin (POST). + Also add a new unit test program to test URL encoding and decoding. + Fixes bug#578. + +Tue Dec 06 13:30:58 GMT 2011 Olly Betts + + * Backport change from trunk: + * scriptindex.cc: If no rules are found in the index script, report an + error and give up - this is inevitably the result of a mistake, and + adding empty documents to the database isn't helpful. + +Tue Dec 06 13:28:32 GMT 2011 Olly Betts + + * Backport change from trunk: + * docs/omegascript.rst: Add note to discourage use of percentage + scores. + * templates/query: Don't show the percentage score in the default + template. + +Tue Dec 06 13:26:30 GMT 2011 Olly Betts + + * Backport change from trunk: + * configure.ac,runfilter.cc: If we don't get any data from a filter + for 5 minutes, give up - it has probably ended up blocked + indefinitely. + +Tue Dec 06 12:51:24 GMT 2011 Olly Betts + + * Backport changes from trunk: + * templates/query: HTML escape topterms. + * templates/godmode: HTML escape the contents of document values. + +Tue Dec 06 12:48:24 GMT 2011 Olly Betts + + * Backport change from trunk: + * scriptindex.cc: MyHtmlParser::parse_html() no longer throws bool to + stop parsing early, so we no longer need to catch it. + +Tue Dec 06 12:45:48 GMT 2011 Olly Betts + + * Backport change from trunk: + * configure.ac: Sync changes from xapian-core: Don't pass -Wshadow for + GCC < 4.1; don't pass -Wstrict-null-sentinel for GCC 4.0.x; only + enable symbol visibility on platforms where it is supported; remove + now superfluous check for GCC >= 3. Also, add FIXME for enabling + -Woverloaded-virtual. + +Tue Dec 06 11:57:58 GMT 2011 Olly Betts + + * Backport change from trunk: + * scriptindex.cc: Add link to + http://xapian.org/docs/omega/scriptindex.html to --help output (and + so also to the man page which is generated from this). + +Tue Dec 06 11:30:42 GMT 2011 Olly Betts + + * Backport change from trunk: + * omega.cc: If P had trailing spaces, we would remove all but one - + fixed to remove all of them! + +Thu Sep 01 12:31:59 GMT 2011 Olly Betts + + * Backport change from trunk: + * xapian-omega.spec.in: Package outlookmsg2html helper. + Wed Aug 10 06:13:41 GMT 2011 Olly Betts * NEWS: Finalise 1.2.7. diff -Nru xapian-omega-1.2.7/config.h.in xapian-omega-1.2.8/config.h.in --- xapian-omega-1.2.7/config.h.in 2011-08-10 06:55:10.000000000 +0000 +++ xapian-omega-1.2.8/config.h.in 2011-12-14 05:34:47.000000000 +0000 @@ -87,6 +87,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H @@ -178,9 +181,6 @@ # endif #endif -/* Define to disable use of visibility attributes */ -#undef XAPIAN_DISABLE_VISIBILITY - /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS @@ -217,7 +217,7 @@ * we can use __builtin_expect to give the compiler hints about branch * prediction. See HACKING for how to use these. */ -#if defined __GNUC__ && __GNUC__ >= 3 +#if defined __GNUC__ /* The arguments of __builtin_expect() are both long, so use !! to ensure that * the first argument is always an integer expression, and always 0 or 1, but * still has the same truth value for the if or while it is used in. diff -Nru xapian-omega-1.2.7/configure xapian-omega-1.2.8/configure --- xapian-omega-1.2.7/configure 2011-08-10 06:55:09.000000000 +0000 +++ xapian-omega-1.2.8/configure 2011-12-14 05:34:46.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for xapian-omega 1.2.7. +# Generated by GNU Autoconf 2.68 for xapian-omega 1.2.8. # # Report bugs to . # @@ -570,8 +570,8 @@ # Identity of this package. PACKAGE_NAME='xapian-omega' PACKAGE_TARNAME='xapian-omega' -PACKAGE_VERSION='1.2.7' -PACKAGE_STRING='xapian-omega 1.2.7' +PACKAGE_VERSION='1.2.8' +PACKAGE_STRING='xapian-omega 1.2.8' PACKAGE_BUGREPORT='http://xapian.org/bugs' PACKAGE_URL='' @@ -1329,7 +1329,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xapian-omega 1.2.7 to adapt to many kinds of systems. +\`configure' configures xapian-omega 1.2.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1399,7 +1399,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xapian-omega 1.2.7:";; + short | recursive ) echo "Configuration of xapian-omega 1.2.8:";; esac cat <<\_ACEOF @@ -1514,7 +1514,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xapian-omega configure 1.2.7 +xapian-omega configure 1.2.8 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2198,7 +2198,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xapian-omega $as_me 1.2.7, which was +It was created by xapian-omega $as_me 1.2.8, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3014,7 +3014,7 @@ # Define the identity of the package. PACKAGE='xapian-omega' - VERSION='1.2.7' + VERSION='1.2.8' cat >>confdefs.h <<_ACEOF @@ -15423,13 +15423,14 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -for ac_header in strings.h +for ac_header in strings.h sys/select.h do : - ac_fn_cxx_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" " + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " " -if test "x$ac_cv_header_strings_h" = xyes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRINGS_H 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -16544,7 +16545,7 @@ else - AM_CXXFLAGS="$AM_CXXFLAGS -Wall -W -Wredundant-decls -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wformat-security -fno-gnu-keywords -Wundef -Wshadow" + AM_CXXFLAGS="$AM_CXXFLAGS -Wall -W -Wredundant-decls -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wformat-security -fno-gnu-keywords -Wundef" gxx_major_version=`echo __GNUC__|$CXX -E -|sed '/^#/d;s/ //g'` gxx_minor_version=`echo __GNUC_MINOR__|$CXX -E -|sed '/^#/d;s/ //g'` @@ -16555,27 +16556,38 @@ as_fn_error $? "Xapian requires GCC 3.1 or later (you appear to have $gxx_version)" "$LINENO" 5 ;; 3.*) ;; - *) AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-null-sentinel" - - case $gxx_version in - 4.[01]) ;; + *) case $gxx_version in + 4.0) ;; + 4.1) + AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-null-sentinel -Wshadow" ;; 4.2) - AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-overflow=1" ;; + AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-null-sentinel -Wshadow -Wstrict-overflow=1" ;; *) - AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-overflow=1 -Winit-self -Wlogical-op -Wmissing-declarations" ;; + AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-null-sentinel -Wshadow -Wstrict-overflow=1 -Winit-self -Wlogical-op -Wmissing-declarations" ;; esac - if test no = "$enable_visibility"; then - -$as_echo "#define XAPIAN_DISABLE_VISIBILITY 1" >>confdefs.h - - else - AM_CXXFLAGS="$AM_CXXFLAGS -fvisibility=hidden" + if test no != "$enable_visibility"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX -fvisibility=hidden works" >&5 +$as_echo_n "checking if $CXX -fvisibility=hidden works... " >&6; } + if echo 'int foo() {return 42;}'|$CXX -Werror -fvisibility=hidden -c -oconftest.o -xc++ - >&5 2>&5 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + AM_CXXFLAGS="$AM_CXXFLAGS -fvisibility=hidden" + dash_d_visibility=-DXAPIAN_ENABLE_VISIBILITY + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi fi if test x$USE_MAINTAINER_MODE = xyes; then - AM_CXXFLAGS="$AM_CXXFLAGS -Werror" + case $gxx_version in + 4.0) + ;; + *) + AM_CXXFLAGS="$AM_CXXFLAGS -Werror" ;; + esac fi ;; esac @@ -17370,7 +17382,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xapian-omega $as_me 1.2.7, which was +This file was extended by xapian-omega $as_me 1.2.8, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17436,7 +17448,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xapian-omega config.status 1.2.7 +xapian-omega config.status 1.2.8 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -Nru xapian-omega-1.2.7/configure.ac xapian-omega-1.2.8/configure.ac --- xapian-omega-1.2.7/configure.ac 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/configure.ac 2011-12-14 05:28:00.000000000 +0000 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([xapian-omega], [1.2.7], [http://xapian.org/bugs]) +AC_INIT([xapian-omega], [1.2.8], [http://xapian.org/bugs]) AC_PREREQ([2.63]) AM_INIT_AUTOMAKE([1.10.1 -Wportability tar-ustar]) @@ -71,7 +71,7 @@ AC_DEFINE(HAVE_WORKING_STDINT_H, 1, [Define to 1 if you have the header file and it can be used in C++ code.])) dnl Check for headers. -AC_CHECK_HEADERS([strings.h], [], [], [ ]) +AC_CHECK_HEADERS([strings.h sys/select.h], [], [], [ ]) AC_CHECK_HEADERS([netinet/in.h arpa/inet.h sys/time.h]dnl [sys/resource.h sys/socket.h sys/sysctl.h vm/vm_param.h]dnl [sys/vmmeter.h sys/sysmp.h sys/sysinfo.h sys/pstat.h], @@ -368,12 +368,13 @@ [ dnl GCC: dnl - dnl -Wundef and -Wshadow were supported by g++ 3.0 (though -Wshadow was - dnl buggy there). We now require GCC >= 3.1, so can rely on them. - dnl All the other options were supported by g++ 2.95 and there's little - dnl likelihood Xapian will build with any earlier version, so there's - dnl not much point worrying about whether older versions had them or not. - AM_CXXFLAGS="$AM_CXXFLAGS -Wall -W -Wredundant-decls -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wformat-security -fno-gnu-keywords -Wundef -Wshadow" + dnl -Wundef was supported by g++ 3.0 and since we now require GCC >= 3.1, + dnl we can rely on it. + dnl + dnl All the other options were supported by g++ 2.95. + dnl + dnl FIXME: Fix the warnings from -Woverloaded-virtual and add it here too. + AM_CXXFLAGS="$AM_CXXFLAGS -Wall -W -Wredundant-decls -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wformat-security -fno-gnu-keywords -Wundef" dnl The output of g++ --version seems to change with almost every minor dnl release so use the preprocessor macros which should be more robust. @@ -387,15 +388,21 @@ ;; 3.*) ;; *) dnl GCC >= 4.0 - dnl -Wstrict-null-sentinel was new 4.0. - AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-null-sentinel" - case $gxx_version in - 4.[[01]]) ;; + 4.0) ;; + 4.1) + dnl -Wstrict-null-sentinel was new in 4.0.1, but for simplicity we + dnl only enable it for GCC >= 4.1. + dnl + dnl -Wshadow was supported by g++ 3.0 (though buggy then). But it's + dnl also buggy in 4.0 (at least on Mac OS X) and warns if a parameter + dnl in a static method is the same as a member variable, so only + dnl enable it for GCC >= 4.1. + AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-null-sentinel -Wshadow" ;; 4.2) dnl -Wstrict-overflow was new in GCC 4.2. Higher settings than 1 dnl have proved too noisy. - AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-overflow=1" ;; + AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-null-sentinel -Wshadow -Wstrict-overflow=1" ;; *) dnl -Wlogical-op and -Wmissing-declarations (for C++) were added in dnl GCC 4.3. @@ -406,7 +413,7 @@ dnl http://gcc.gnu.org/PR34772) may get fixed so we pass this option dnl anyway - we don't intend to use this idiom, so any instances are dnl bugs we'd like to know about. - AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-overflow=1 -Winit-self -Wlogical-op -Wmissing-declarations" ;; + AM_CXXFLAGS="$AM_CXXFLAGS -Wstrict-null-sentinel -Wshadow -Wstrict-overflow=1 -Winit-self -Wlogical-op -Wmissing-declarations" ;; esac dnl FIXME: @@ -419,18 +426,30 @@ dnl -Wold-style-cast is interesting, but triggers for macros from dnl system headers (e.g. FD_SET) (tested with GCC 4.4). - if test no = "$enable_visibility"; then - AC_DEFINE(XAPIAN_DISABLE_VISIBILITY, 1, [Define to disable use of visibility attributes]) - else - dnl Turn on visibility support for GCC >= 4.0. - AM_CXXFLAGS="$AM_CXXFLAGS -fvisibility=hidden" + if test no != "$enable_visibility"; then + dnl GCC doesn't support symbol visibility on all platforms (notably + dnl not Mac OS X or mingw). Currently it seems to be ELF-only. + AC_MSG_CHECKING([if $CXX -fvisibility=hidden works]) + if echo 'int foo() {return 42;}'|$CXX -Werror -fvisibility=hidden -c -oconftest.o -xc++ - >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then + AC_MSG_RESULT([yes]) + AM_CXXFLAGS="$AM_CXXFLAGS -fvisibility=hidden" + dash_d_visibility=-DXAPIAN_ENABLE_VISIBILITY + else + AC_MSG_RESULT([no]) + fi fi dnl Automatically add -Werror if maintainer mode is enabled and we're dnl using GCC4 or newer. We don't do this for older GCCs as GCC 2.95 dnl and some GCC 3.x compilers issue spurious warnings. if test x$USE_MAINTAINER_MODE = xyes; then - AM_CXXFLAGS="$AM_CXXFLAGS -Werror" + case $gxx_version in + 4.0) + dnl Apple's GCC 4.0 issues spurious uninitialised warnings. + ;; + *) + AM_CXXFLAGS="$AM_CXXFLAGS -Werror" ;; + esac fi ;; esac @@ -461,7 +480,7 @@ * we can use __builtin_expect to give the compiler hints about branch * prediction. See HACKING for how to use these. */ -#if defined __GNUC__ && __GNUC__ >= 3 +#if defined __GNUC__ /* The arguments of __builtin_expect() are both long, so use !! to ensure that * the first argument is always an integer expression, and always 0 or 1, but * still has the same truth value for the if or while it is used in. diff -Nru xapian-omega-1.2.7/debian/changelog xapian-omega-1.2.8/debian/changelog --- xapian-omega-1.2.7/debian/changelog 2011-08-12 01:40:33.000000000 +0000 +++ xapian-omega-1.2.8/debian/changelog 2011-12-17 11:16:24.000000000 +0000 @@ -1,3 +1,11 @@ +xapian-omega (1.2.8-1) unstable; urgency=low + + * New upstream release. + * debian/rules: Add "-g" to CFLAGS and CXXFLAGS so that "nostrip" builds are + more useful. + + -- Olly Betts Sat, 17 Dec 2011 11:12:18 +0000 + xapian-omega (1.2.7-1) unstable; urgency=low * New upstream release. diff -Nru xapian-omega-1.2.7/debian/control xapian-omega-1.2.8/debian/control --- xapian-omega-1.2.7/debian/control 2011-08-12 02:15:26.000000000 +0000 +++ xapian-omega-1.2.8/debian/control 2011-12-17 11:18:54.000000000 +0000 @@ -2,7 +2,7 @@ Section: web Priority: optional Maintainer: Olly Betts -Build-Depends: libxapian-dev (>= 1.2.7), libxapian-dev (<< 1.3.0), debhelper (>= 7), autotools-dev, libpcre3-dev, +Build-Depends: libxapian-dev (>= 1.2.8), libxapian-dev (<< 1.3.0), debhelper (>= 7), autotools-dev, libpcre3-dev, libmagic-dev, libxapian-dev (>= 1.2.0-2~) Standards-Version: 3.9.2 diff -Nru xapian-omega-1.2.7/debian/rules xapian-omega-1.2.8/debian/rules --- xapian-omega-1.2.7/debian/rules 2011-08-12 01:40:33.000000000 +0000 +++ xapian-omega-1.2.8/debian/rules 2011-12-17 11:10:54.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/make -f # # Copyright (C) 2004,2005,2006 Lemur Consulting Ltd -# Copyright (C) 2006,2007,2008,2009,2010 Olly Betts +# Copyright (C) 2006,2007,2008,2009,2010,2011 Olly Betts # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to @@ -48,9 +48,9 @@ # Handle DEB_BUILD_OPTIONS. Note that dh_strip handles nostrip for us. ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) - confflags += CFLAGS=-O0 CXXFLAGS=-O0 + confflags += CFLAGS='-O0 -g' CXXFLAGS='-O0 -g' else - confflags += CFLAGS=-O2 CXXFLAGS=-O2 + confflags += CFLAGS='-O2 -g' CXXFLAGS='-O2 -g' endif ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) diff -Nru xapian-omega-1.2.7/docs/omegascript.html xapian-omega-1.2.8/docs/omegascript.html --- xapian-omega-1.2.7/docs/omegascript.html 2011-08-10 07:07:28.000000000 +0000 +++ xapian-omega-1.2.8/docs/omegascript.html 2011-12-14 05:38:34.000000000 +0000 @@ -543,13 +543,23 @@
$pack{NUMBER}
converts a number to a 4 byte big-endian binary string
$percentage
-
percentage score of current hit (in range 1-100).
+

percentage score of current hit (in range 1-100).

+

You probably don't want to show these percentage scores to end +users in new applications - they're not really a percentage of +anything meaningful, and research seems to suggest that users +don't find numeric scores in search results useful.

+
$prettyterm{TERM}
convert a term to "user form", as it might be entered in a query. If a matching term was entered in the query, just use that (the first occurrence if a term was generated multiple times from a query). Otherwise term prefixes are converted back to user forms as specified by $setmap{prefix,...} and $setmap{boolprefix,...}.
+
$prettyurl{URL}
+
Prettify URL. This command undoes RFC3986 URL escaping which doesn't +affect semantics in practice, in order to make a prettier version of a +URL for displaying to the user (rather than in links), but which should +still work if copied and pasted.
$query
query string (built from CGI P variable(s) plus possible added terms from ADD and X).
diff -Nru xapian-omega-1.2.7/docs/omegascript.rst xapian-omega-1.2.8/docs/omegascript.rst --- xapian-omega-1.2.7/docs/omegascript.rst 2011-08-10 06:49:11.000000000 +0000 +++ xapian-omega-1.2.8/docs/omegascript.rst 2011-12-14 05:27:59.000000000 +0000 @@ -305,6 +305,11 @@ $percentage percentage score of current hit (in range 1-100). + You probably don't want to show these percentage scores to end + users in new applications - they're not really a percentage of + anything meaningful, and research seems to suggest that users + don't find numeric scores in search results useful. + $prettyterm{TERM} convert a term to "user form", as it might be entered in a query. If a matching term was entered in the query, just use that (the first @@ -312,6 +317,12 @@ Otherwise term prefixes are converted back to user forms as specified by ``$setmap{prefix,...}`` and ``$setmap{boolprefix,...}``. +$prettyurl{URL} + Prettify URL. This command undoes RFC3986 URL escaping which doesn't + affect semantics in practice, in order to make a prettier version of a + URL for displaying to the user (rather than in links), but which should + still work if copied and pasted. + $query query string (built from CGI ``P`` variable(s) plus possible added terms from ``ADD`` and ``X``). diff -Nru xapian-omega-1.2.7/extra/omegascript.vim xapian-omega-1.2.8/extra/omegascript.vim --- xapian-omega-1.2.7/extra/omegascript.vim 2011-08-10 07:06:46.000000000 +0000 +++ xapian-omega-1.2.8/extra/omegascript.vim 2011-12-14 05:38:23.000000000 +0000 @@ -2,7 +2,7 @@ " Language: OmegaScript " Maintainer: Xapian developers " URL: http://xapian.org/ -" Version: 1.2.7 +" Version: 1.2.8 " To install: place this file in ~/.vim/syntax/omegascript.vim " and then create or add the following lines, without the "'s commenting @@ -52,7 +52,7 @@ syn region omegaScriptComment matchgroup=omegaScriptCommentStart start="${" end="}" contains=omegaScriptCommentBracePair,omegaScriptComment keepend extend " All keywords which can take parameters -syn keyword omegaScriptKW contained add addfilter allterms and cgi cgilist date def div emptydocs env eq field filesize filterterms find freq ge gt highlight hitlist hostname html htmlstrip httpheader if include le length list log lookup lower lt map max min mod mul muldiv ne nice not opt or pack prettyterm range record relevant set setmap setrelevant slice split sub substr topterms transform uniq unpack unstem upper url value +syn keyword omegaScriptKW contained add addfilter allterms and cgi cgilist date def div emptydocs env eq field filesize filterterms find freq ge gt highlight hitlist hostname html htmlstrip httpheader if include le length list log lookup lower lt map max min mod mul muldiv ne nice not opt or pack prettyterm prettyurl range record relevant set setmap setrelevant slice split sub substr topterms transform uniq unpack unstem upper url value " All keywords which can take no parameters syn keyword omegaScriptCommandKW contained add allterms collapsed dbname dbsize defaultop emptydocs error filters fmt hit hitsperpage id last lastpage msize msizeexact now percentage query querydescription queryterms record relevant relevants score setrelevant stoplist suggestion terms thispage time topdoc topterms version weight diff -Nru xapian-omega-1.2.7/INSTALL xapian-omega-1.2.8/INSTALL --- xapian-omega-1.2.7/INSTALL 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/INSTALL 2011-12-14 05:28:00.000000000 +0000 @@ -1,6 +1,19 @@ Omega Installation ================== +Originally based on automake's generic "Installation Instructions" which are: + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Prerequisites +============= + You'll need to ensure that PCRE is installed before building Omega. If you install PCRE from a package, make sure you install the corresponding -dev or -devel package as well. @@ -9,29 +22,32 @@ ). If you install libmagic from a package, make sure you install the corresponding -dev or -devel package as well. +Quick Installation Guide +======================== + The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. + `./configure' to configure the package for your system. You need to make sure that xapian-config from xapian-core is on your path, or else pass its full path to omega's configure script: ./configure XAPIAN_CONFIG=/path/to/xapian-config - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. 2. Type `make' to compile the package. - 3. Optionally, type `make check' to run any self-tests that come with - the package. + 3. Optionally, type `make check' to run the self-tests that come with + the package, using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and - documentation. + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the @@ -42,10 +58,13 @@ all sorts of other programs in order to regenerate files that came with the distribution. + 6. You can also type `make uninstall' to remove the installed files + again. + Compilers and Options ===================== - Some systems require unusual options for compilation or linking that + Some systems may require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. @@ -53,10 +72,15 @@ by setting variables in the command line or in the environment. Here is an example: - ./configure CXX=g++-3.4 CFLAGS=-O2 LIBS=-lposix + ./configure CXX=g++-4.3 CFLAGS=-O2 LIBS=-lposix -Multi-Arch -========== + If your system requires special flags, do let us know. Where possible +we'd prefer configure to determine such flags by itself, but if we can't +then at least we can document the special flags to help other users of +systems like yours. + +Compiling For Multiple Architectures +==================================== When using GCC on platforms which support multiple architecture, the simplest way to select a non-default architecture is to pass a CXX setting to configure @@ -65,6 +89,16 @@ ./configure CXX='g++ -m32' +On Mac OS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + Building in a separate directory ================================ @@ -82,19 +116,20 @@ Installation Names ================== - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular +options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. @@ -113,7 +148,8 @@ where SYSTEM can have one of these forms: - OS KERNEL-OS + OS + KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't @@ -146,18 +182,18 @@ ./configure CXX=/usr/local2/bin/g++ -will cause the specified g++ to be used as the C++ compiler (unless it is +causes the specified `g++' to be used as the C++ compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== - `configure' recognizes the following options to control how it -operates. +`configure' recognizes the following standard options to control how it +operates: `--help' `-h' - Print a summary of the options to `configure', and exit. + Print a summary of all of the options to `configure', and exit. `--version' `-V' diff -Nru xapian-omega-1.2.7/Makefile.am xapian-omega-1.2.8/Makefile.am --- xapian-omega-1.2.7/Makefile.am 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/Makefile.am 2011-12-14 05:28:00.000000000 +0000 @@ -80,8 +80,11 @@ bin_PROGRAMS = omindex scriptindex dist_bin_SCRIPTS = dbi2omega htdig2omega mbox2omega -check_PROGRAMS = htmlparsetest md5test utf8converttest -TESTS = htmlparsetest$(EXEEXT) md5test$(EXEEXT) utf8converttest$(EXEEXT) +check_PROGRAMS = htmlparsetest md5test urlenctest utf8converttest +TESTS = htmlparsetest$(EXEEXT)\ + md5test$(EXEEXT)\ + urlenctest$(EXEEXT)\ + utf8converttest$(EXEEXT) omegadatadir = $(datadir)/omega dist_omegadata_DATA = htdig2omega.script mbox2omega.script @@ -94,7 +97,7 @@ md5.h md5wrap.h xmlparse.h metaxmlparse.h values.h utf8convert.h\ namedentities.h pkglibbindir.h datematchdecider.h sample.h strcasecmp.h\ utf8truncate.h diritor.h runfilter.h freemem.h xpsxmlparse.h transform.h\ - weight.h svgparse.h urlencode.h unixperm.h + weight.h svgparse.h urldecode.h urlencode.h unixperm.h # headers maintained in xapian-core noinst_HEADERS +=\ @@ -155,6 +158,8 @@ utf8converttest_SOURCES = utf8converttest.cc utf8convert.cc utf8converttest_LDADD = $(XAPIAN_LIBS) +urlenctest_SOURCES = urlenctest.cc urlencode.cc + if !MAINTAINER_NO_DOCS dist_man_MANS = omindex.1 scriptindex.1 MAINTAINERCLEANFILES = $(dist_man_MANS) diff -Nru xapian-omega-1.2.7/Makefile.in xapian-omega-1.2.8/Makefile.in --- xapian-omega-1.2.7/Makefile.in 2011-08-10 06:55:11.000000000 +0000 +++ xapian-omega-1.2.8/Makefile.in 2011-12-14 05:34:48.000000000 +0000 @@ -41,7 +41,7 @@ pkglibbin_PROGRAMS = omega$(EXEEXT) bin_PROGRAMS = omindex$(EXEEXT) scriptindex$(EXEEXT) check_PROGRAMS = htmlparsetest$(EXEEXT) md5test$(EXEEXT) \ - utf8converttest$(EXEEXT) + urlenctest$(EXEEXT) utf8converttest$(EXEEXT) @NEED_MKDTEMP_TRUE@am__append_1 = portability/mkdtemp.cc subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_bin_SCRIPTS) \ @@ -118,6 +118,9 @@ utf8truncate.$(OBJEXT) scriptindex_OBJECTS = $(am_scriptindex_OBJECTS) scriptindex_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_urlenctest_OBJECTS = urlenctest.$(OBJEXT) urlencode.$(OBJEXT) +urlenctest_OBJECTS = $(am_urlenctest_OBJECTS) +urlenctest_LDADD = $(LDADD) am_utf8converttest_OBJECTS = utf8converttest.$(OBJEXT) \ utf8convert.$(OBJEXT) utf8converttest_OBJECTS = $(am_utf8converttest_OBJECTS) @@ -159,11 +162,12 @@ $(LDFLAGS) -o $@ SOURCES = $(libtransform_la_SOURCES) $(htmlparsetest_SOURCES) \ $(md5test_SOURCES) $(omega_SOURCES) $(omindex_SOURCES) \ - $(scriptindex_SOURCES) $(utf8converttest_SOURCES) + $(scriptindex_SOURCES) $(urlenctest_SOURCES) \ + $(utf8converttest_SOURCES) DIST_SOURCES = $(libtransform_la_SOURCES) $(htmlparsetest_SOURCES) \ $(md5test_SOURCES) $(omega_SOURCES) \ $(am__omindex_SOURCES_DIST) $(scriptindex_SOURCES) \ - $(utf8converttest_SOURCES) + $(urlenctest_SOURCES) $(utf8converttest_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ @@ -422,7 +426,11 @@ pkglibbindir = $(pkglibdir)/bin dist_pkglibbin_SCRIPTS = outlookmsg2html dist_bin_SCRIPTS = dbi2omega htdig2omega mbox2omega -TESTS = htmlparsetest$(EXEEXT) md5test$(EXEEXT) utf8converttest$(EXEEXT) +TESTS = htmlparsetest$(EXEEXT)\ + md5test$(EXEEXT)\ + urlenctest$(EXEEXT)\ + utf8converttest$(EXEEXT) + omegadatadir = $(datadir)/omega dist_omegadata_DATA = htdig2omega.script mbox2omega.script dist_sysconf_DATA = omega.conf @@ -434,12 +442,13 @@ metaxmlparse.h values.h utf8convert.h namedentities.h \ pkglibbindir.h datematchdecider.h sample.h strcasecmp.h \ utf8truncate.h diritor.h runfilter.h freemem.h xpsxmlparse.h \ - transform.h weight.h svgparse.h urlencode.h unixperm.h \ - common/gnu_getopt.h common/msvc_dirent.h common/noreturn.h \ - common/omassert.h common/realtime.h common/safedirent.h \ - common/safeerrno.h common/safefcntl.h common/safesysselect.h \ - common/safesysstat.h common/safesyswait.h common/safeunistd.h \ - common/safewindows.h common/str.h common/stringutils.h + transform.h weight.h svgparse.h urldecode.h urlencode.h \ + unixperm.h common/gnu_getopt.h common/msvc_dirent.h \ + common/noreturn.h common/omassert.h common/realtime.h \ + common/safedirent.h common/safeerrno.h common/safefcntl.h \ + common/safesysselect.h common/safesysstat.h \ + common/safesyswait.h common/safeunistd.h common/safewindows.h \ + common/str.h common/stringutils.h AM_LDFLAGS = $(NO_UNDEFINED) $(ICONV_LDFLAGS) # We want to compile transform.cc with PCRE_CFLAGS, but if this adds a -I for @@ -475,6 +484,7 @@ md5test_SOURCES = md5test.cc md5wrap.cc md5.cc utf8converttest_SOURCES = utf8converttest.cc utf8convert.cc utf8converttest_LDADD = $(XAPIAN_LIBS) +urlenctest_SOURCES = urlenctest.cc urlencode.cc @MAINTAINER_NO_DOCS_FALSE@dist_man_MANS = omindex.1 scriptindex.1 @MAINTAINER_NO_DOCS_FALSE@MAINTAINERCLEANFILES = $(dist_man_MANS) DISTCHECK_CONFIGURE_FLAGS = "XAPIAN_CONFIG=$(XAPIAN_CONFIG)" @@ -661,6 +671,9 @@ scriptindex$(EXEEXT): $(scriptindex_OBJECTS) $(scriptindex_DEPENDENCIES) @rm -f scriptindex$(EXEEXT) $(CXXLINK) $(scriptindex_OBJECTS) $(scriptindex_LDADD) $(LIBS) +urlenctest$(EXEEXT): $(urlenctest_OBJECTS) $(urlenctest_DEPENDENCIES) + @rm -f urlenctest$(EXEEXT) + $(CXXLINK) $(urlenctest_OBJECTS) $(urlenctest_LDADD) $(LIBS) utf8converttest$(EXEEXT): $(utf8converttest_OBJECTS) $(utf8converttest_DEPENDENCIES) @rm -f utf8converttest$(EXEEXT) $(CXXLINK) $(utf8converttest_OBJECTS) $(utf8converttest_LDADD) $(LIBS) @@ -776,6 +789,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svgparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unixperm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/urlencode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/urlenctest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8convert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8converttest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8truncate.Po@am__quote@ diff -Nru xapian-omega-1.2.7/NEWS xapian-omega-1.2.8/NEWS --- xapian-omega-1.2.7/NEWS 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/NEWS 2011-12-14 05:28:00.000000000 +0000 @@ -1,3 +1,61 @@ +Omega 1.2.8 (2011-12-13): + +documentation: + +* scriptindex.cc: Add link to http://xapian.org/docs/omega/scriptindex.html to + --help output (and so also to the man page which is generated from this). + +* omegascript.html: Add note to discourage use of percentage scores. + +indexers: + +* omindex: + + + If we don't get any data from an external filter for 5 minutes, give up - + it has probably ended up blocked indefinitely. + + + Improve --help output (and man page which is generated from it). Closes + bug#572. + +* scriptindex: + + + If no rules are found in the index script, report an error and give up - + this is inevitably the result of a mistake, and adding empty documents to + the database isn't helpful. + +omega: + + + Add new $prettyurl{} command which undoes RFC3986 URL escaping which + doesn't affect semantics in practice. Partly addresses ticket#550. + + + Replace URL decoder with new implementation which handles various corner + cases better. Fixes bug#578. + + + If CGI parameter P has trailing spaces, we now remove them all rather than + leaving one. + +templates: + +* templates/query: HTML escape topterms. + +* templates/godmode: HTML escape the contents of document values. + +* templates/query: Don't show the percentage score in the default template. + +testsuite: + +* Add new urlenctest unit test of URL encoding and decoding. + +portability: + +* configure: Sync changes from xapian-core: Don't pass -Wshadow for GCC < 4.1; + don't pass -Wstrict-null-sentinel for GCC 4.0.x; only enable symbol + visibility on platforms where it is supported. + +packaging: + +* xapian-omega.spec: Package outlookmsg2html helper. + Omega 1.2.7 (2011-08-10): documentation: diff -Nru xapian-omega-1.2.7/omega.cc xapian-omega-1.2.8/omega.cc --- xapian-omega-1.2.7/omega.cc 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/omega.cc 2011-12-14 05:28:00.000000000 +0000 @@ -245,7 +245,7 @@ assert(len != string::npos); if (first_nonspace > 0 || len <= query_string.length() - 1) { len = len + 1 - first_nonspace; - query_string = query_string.substr(first_nonspace, len + 1); + query_string = query_string.substr(first_nonspace, len); } } diff -Nru xapian-omega-1.2.7/omindex.1 xapian-omega-1.2.8/omindex.1 --- xapian-omega-1.2.7/omindex.1 2011-08-10 07:07:27.000000000 +0000 +++ xapian-omega-1.2.8/omindex.1 2011-12-14 05:38:32.000000000 +0000 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH OMINDEX "1" "August 2011" "xapian-omega 1.2.7" "User Commands" +.TH OMINDEX "1" "December 2011" "xapian-omega 1.2.8" "User Commands" .SH NAME omindex \- Index static website data via the filesystem .SH SYNOPSIS @@ -7,6 +7,10 @@ [\fIOPTIONS\fR] \fI--db DATABASE \fR[\fIBASEDIR\fR] \fIDIRECTORY\fR .SH DESCRIPTION omindex \- Index static website data via the filesystem +.PP +DIRECTORY is the directory to start indexing from. +.PP +BASEDIR is the directory corresponding to URL (default: DIRECTORY). .SH OPTIONS .TP \fB\-d\fR, \fB\-\-duplicates\fR @@ -22,11 +26,11 @@ ARG can be index, warn (issue a diagnostic and index), or skip. (default: warn) .TP -\fB\-D\fR, \fB\-\-db\fR +\fB\-D\fR, \fB\-\-db\fR=\fIDATABASE\fR path to database to use .TP -\fB\-U\fR, \fB\-\-url\fR -base url DIRECTORY represents (default: /) +\fB\-U\fR, \fB\-\-url\fR=\fIURL\fR +base url BASEDIR corresponds to (default: /) .TP \fB\-M\fR, \fB\-\-mime\-type\fR=\fIEXT\fR:TYPE map file extension EXT to MIME Content\-Type TYPE (empty TYPE removes any MIME mapping for EXT) diff -Nru xapian-omega-1.2.7/omindex.cc xapian-omega-1.2.8/omindex.cc --- xapian-omega-1.2.7/omindex.cc 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/omindex.cc 2011-12-14 05:28:00.000000000 +0000 @@ -1197,7 +1197,12 @@ switch (getopt_ret) { case 'h': { cout << PROG_NAME" - "PROG_DESC"\n\n" -"Usage: "PROG_NAME" [OPTIONS] --db DATABASE [BASEDIR] DIRECTORY\n\n" +"Usage: "PROG_NAME" [OPTIONS] --db DATABASE [BASEDIR] DIRECTORY\n" +"\n" +"DIRECTORY is the directory to start indexing from.\n" +"\n" +"BASEDIR is the directory corresponding to URL (default: DIRECTORY).\n" +"\n" "Options:\n" " -d, --duplicates set duplicate handling ('ignore' or 'replace')\n" " -p, --no-delete skip the deletion of documents corresponding to\n" @@ -1206,8 +1211,8 @@ " -e, --empty-docs=ARG how to handle documents we extract no text from:\n" " ARG can be index, warn (issue a diagnostic and\n" " index), or skip. (default: warn)\n" -" -D, --db path to database to use\n" -" -U, --url base url DIRECTORY represents (default: /)\n" +" -D, --db=DATABASE path to database to use\n" +" -U, --url=URL base url BASEDIR corresponds to (default: /)\n" " -M, --mime-type=EXT:TYPE map file extension EXT to MIME Content-Type TYPE\n" " (empty TYPE removes any MIME mapping for EXT)\n" " -F, --filter=TYPE:CMD process files with MIME Content-Type TYPE using\n" diff -Nru xapian-omega-1.2.7/query.cc xapian-omega-1.2.8/query.cc --- xapian-omega-1.2.7/query.cc 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/query.cc 2011-12-14 05:28:00.000000000 +0000 @@ -59,6 +59,7 @@ #include "str.h" #include "stringutils.h" #include "transform.h" +#include "urldecode.h" #include "urlencode.h" #include "unixperm.h" #include "values.h" @@ -846,6 +847,7 @@ CMD_pack, CMD_percentage, CMD_prettyterm, +CMD_prettyurl, CMD_query, CMD_querydescription, CMD_queryterms, @@ -965,6 +967,7 @@ T(pack, 1, 1, N, 0), // convert a number to a 4 byte big endian binary string T(percentage, 0, 0, N, 0), // percentage score of current hit T(prettyterm, 1, 1, N, Q), // pretty print term name +T(prettyurl, 1, 1, N, 0), // pretty version of URL T(query, 0, 0, N, Q), // query T(querydescription,0, 0, N, Q), // query.get_description() T(queryterms, 0, 0, N, Q), // list of query terms @@ -1699,6 +1702,10 @@ case CMD_prettyterm: value = pretty_term(args[0]); break; + case CMD_prettyurl: + value = args[0]; + url_prettify(value); + break; case CMD_query: value = query_string; break; diff -Nru xapian-omega-1.2.7/runfilter.cc xapian-omega-1.2.8/runfilter.cc --- xapian-omega-1.2.7/runfilter.cc 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/runfilter.cc 2011-12-14 05:28:00.000000000 +0000 @@ -1,7 +1,7 @@ /** @file runfilter.cc * @brief Run an external filter and capture its output in a std::string. * - * Copyright (C) 2003,2006,2007,2009,2010 Olly Betts + * Copyright (C) 2003,2006,2007,2009,2010,2011 Olly Betts * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ #ifdef HAVE_SYS_RESOURCE_H # include #endif +#include "safesysselect.h" #ifdef HAVE_SYS_SOCKET_H # include #endif @@ -116,7 +117,35 @@ int fd = fds[0]; + fd_set readfds; + FD_ZERO(&readfds); while (true) { + // If we wait 300 seconds (5 minutes) without getting data from the + // filter, then give up to avoid waiting forever for a filter which + // has ended up blocked waiting for something which will never happen. + struct timeval tv; + tv.tv_sec = 300; + tv.tv_usec = 0; + FD_SET(fd, &readfds); + int r = select(fd + 1, &readfds, NULL, NULL, &tv); + if (r <= 0) { + if (r < 0) { + if (errno == EINTR) { + // select() interrupted by a signal, so retry. + continue; + } + cerr << "Reading from filter failed (" << strerror(errno) << ")" + << endl; + } else { + cerr << "Filter inactive for too long" << endl; + } + kill(child, SIGKILL); + close(fd); + int status; + (void)waitpid(child, &status, 0); + throw ReadError(); + } + char buf[4096]; ssize_t res = read(fd, buf, sizeof(buf)); if (res == 0) break; diff -Nru xapian-omega-1.2.7/scriptindex.1 xapian-omega-1.2.8/scriptindex.1 --- xapian-omega-1.2.7/scriptindex.1 2011-08-10 07:07:27.000000000 +0000 +++ xapian-omega-1.2.8/scriptindex.1 2011-12-14 05:38:32.000000000 +0000 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH SCRIPTINDEX "1" "August 2011" "xapian-omega 1.2.7" "User Commands" +.TH SCRIPTINDEX "1" "December 2011" "xapian-omega 1.2.8" "User Commands" .SH NAME scriptindex \- index arbitrary data as described by an index script .SH SYNOPSIS @@ -10,6 +10,9 @@ .PP Creates or updates a Xapian database with the data from the input files listed on the command line. If no files are specified, data is read from stdin. +.PP +See http://xapian.org/docs/omega/scriptindex.html for documentation of the +format for INDEXER_SCRIPT. .SH OPTIONS .TP \fB\-v\fR, \fB\-\-verbose\fR diff -Nru xapian-omega-1.2.7/scriptindex.cc xapian-omega-1.2.8/scriptindex.cc --- xapian-omega-1.2.7/scriptindex.cc 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/scriptindex.cc 2011-12-14 05:28:00.000000000 +0000 @@ -423,6 +423,11 @@ } } } + + if (index_spec.empty()) { + cout << filename << ": No rules found in index script" << endl; + exit(1); + } } static bool @@ -558,16 +563,7 @@ p.parse_html(value, "iso-8859-1", false); } catch (const string & newcharset) { p.reset(); - try { - p.parse_html(value, newcharset, true); - } catch (bool) { - // MyHtmlParser throws a bool to abandon - // parsing at or when indexing is - // disallowed. - } - } catch (bool) { - // MyHtmlParser throws a bool to abandon parsing at - // or when indexing is disallowed. + p.parse_html(value, newcharset, true); } if (p.indexing_allowed) value = p.dump; @@ -770,9 +766,14 @@ argc -= optind; if (show_help || argc < 2) { cout << PROG_NAME" - "PROG_DESC"\n" -"Usage: "PROG_NAME" [OPTIONS] DATABASE INDEXER_SCRIPT [INPUT_FILE]...\n\n" +"Usage: "PROG_NAME" [OPTIONS] DATABASE INDEXER_SCRIPT [INPUT_FILE]...\n" +"\n" "Creates or updates a Xapian database with the data from the input files listed\n" -"on the command line. If no files are specified, data is read from stdin.\n\n" +"on the command line. If no files are specified, data is read from stdin.\n" +"\n" +"See http://xapian.org/docs/omega/scriptindex.html for documentation of the\n" +"format for INDEXER_SCRIPT.\n" +"\n" "Options:\n" " -v, --verbose display additional messages to aid debugging\n" " --overwrite create the database anew (the default is to update if\n" diff -Nru xapian-omega-1.2.7/templates/godmode xapian-omega-1.2.8/templates/godmode --- xapian-omega-1.2.7/templates/godmode 2011-08-10 06:49:11.000000000 +0000 +++ xapian-omega-1.2.8/templates/godmode 2011-12-14 05:28:00.000000000 +0000 @@ -31,7 +31,7 @@

Document Values

$set{values,$list{$map{$range{0,255},$if{$value{$_,$cgi{ID}}, -$_$value{$_,$cgi{ID}} +$_$html{$value{$_,$cgi{ID}}} }},}} $if{$opt{values}, @@ -52,9 +52,9 @@ $hitlist{}
Value#Value
#$id  $html{$date{$field{modtime},%Y-%m-%d %H:%M}} -$html{$or{$field{caption},$field{title},$field{url},Untitled}}
+$html{$or{$field{caption},$field{title},$prettyurl{$field{url}},Untitled}}
$highlight{$field{sample},$terms}$if{$field{sample},...}
-$html{$field{url}}
+$prettyurl{$html{$field{url}}}

${suppress next, prev, and page links if there's only one page} diff -Nru xapian-omega-1.2.7/templates/query xapian-omega-1.2.8/templates/query --- xapian-omega-1.2.7/templates/query 2011-08-10 06:49:11.000000000 +0000 +++ xapian-omega-1.2.8/templates/query 2011-12-14 05:28:00.000000000 +0000 @@ -59,7 +59,7 @@ $if{$opt{topterms},
- $map{$topterms,$prettyterm{$_} } + $map{$topterms,$html{$prettyterm{$_}} }
} @@ -101,11 +101,11 @@ -$html{$or{$field{caption},$field{title},$field{url},Untitled}}
+$html{$or{$field{caption},$field{title},$prettyurl{$field{url}},Untitled}}
$highlight{$field{sample},$terms}$if{$field{sample},...}
$html{$field{url}}
-$percentage% relevant$. matching: +matching: $list{$map{$terms,$html{$prettyterm{$_}}},$. , and }${for lynx:}

} diff -Nru xapian-omega-1.2.7/urldecode.h xapian-omega-1.2.8/urldecode.h --- xapian-omega-1.2.7/urldecode.h 1970-01-01 00:00:00.000000000 +0000 +++ xapian-omega-1.2.8/urldecode.h 2011-12-14 05:28:00.000000000 +0000 @@ -0,0 +1,235 @@ +/* @file urldecode.h + * @brief URL decoding as described by RFC3986. + */ +/* Copyright (C) 2011 Olly Betts + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef OMEGA_INCLUDED_URLDECODE_H +#define OMEGA_INCLUDED_URLDECODE_H + +#include +#include +#include + +struct CGIParameterHandler { + void operator()(const std::string&, const std::string&) const; +}; + +inline unsigned char hex_decode_(unsigned char hex) { + return (hex & 0x0f) + (hex >> 6) * 9; +} + +template +inline void +url_decode(const CGIParameterHandler & handle_parameter, I begin, I end) +{ + bool seen_equals = false; + std::string var, val; + while (begin != end) { + unsigned char ch = *begin; + ++begin; +process_ch: + if (ch == '&') { + if (!seen_equals) + swap(var, val); + if (!var.empty()) + handle_parameter(var, val); + var.resize(0); + val.resize(0); + seen_equals = false; + continue; + } + + switch (ch) { + case '%': { + if (begin == end) + break; + unsigned char hex1 = *begin; + ++begin; + if (begin == end || !isxdigit(hex1)) { + val += ch; + ch = hex1; + if (begin == end) + break; + goto process_ch; + } + unsigned char hex2 = *begin; + ++begin; + if (begin == end || !isxdigit(hex2)) { + val += ch; + val += hex1; + ch = hex2; + if (begin == end) + break; + goto process_ch; + } + ch = (hex_decode_(hex1) << 4) | hex_decode_(hex2); + break; + } + case '+': + ch = ' '; + break; + case '=': + if (seen_equals) + break; + seen_equals = true; + swap(var, val); + continue; + } + val += ch; + } + if (!seen_equals) + swap(var, val); + if (!var.empty()) + handle_parameter(var, val); +} + +class CStringItor { + const char * p; + + void operator++(int); + + public: + CStringItor() : p(NULL) { } + + explicit CStringItor(const char * p_) : p(p_) { + if (!*p) p = NULL; + } + + unsigned char operator *() const { return *p; } + + CStringItor & operator++() { + if (!*++p) p = NULL; + return *this; + } + + friend bool operator==(const CStringItor& a, const CStringItor& b); + friend bool operator!=(const CStringItor& a, const CStringItor& b); +}; + +inline bool +operator==(const CStringItor& a, const CStringItor& b) +{ + return a.p == b.p; +} + +inline bool +operator!=(const CStringItor& a, const CStringItor& b) +{ + return !(a == b); +} + +class StdinItor { + size_t count; + + mutable int current; + + void operator++(int); + + public: + StdinItor() : current(EOF) { } + + explicit StdinItor(size_t count_) : count(count_), current(256) { } + + unsigned char operator *() const { + if (current == 256) + current = std::getchar(); + return current; + } + + StdinItor & operator++() { + if (count--) + current = std::getchar(); + else + current = EOF; + return *this; + } + + friend bool operator==(const StdinItor& a, const StdinItor& b); + friend bool operator!=(const StdinItor& a, const StdinItor& b); +}; + +inline bool +operator==(const StdinItor& a, const StdinItor& b) +{ + return a.current == b.current; +} + +inline bool +operator!=(const StdinItor& a, const StdinItor& b) +{ + return !(a == b); +} + +// First group is RFC3986 reserved "gen-delims", second reserved "sub-delims". +// We also need to leave an encoded "%" alone! +// +// We may not need to honour all of these in practice, but let's start +// cautious. Some are only reserved in particular contexts, which may +// depend on the scheme. +#define URL_PRESERVE ":/?#[]@" "!$&'()*+,;=" "%" + +/** Prettify a URL. + * + * Undo RFC3986 escaping which doesn't affect semantics in practice, to make + * a prettier version of a URL to show the user, but which should still work + * if copied and pasted. + */ +inline void +url_prettify(std::string & url) +{ + size_t pcent = url.find('%'); + // Fast path for URLs without a % in. + if (pcent == std::string::npos || pcent + 2 >= url.size()) + return; + + size_t start = 0; + std::string in; + swap(in, url); + url.reserve(in.size()); + while (true) { + // We've checked there are at least two bytes after the '%' already. + if (isxdigit(in[pcent + 1]) && isxdigit(in[pcent + 2])) { + int ch = (hex_decode_(in[pcent + 1]) << 4); + ch |= hex_decode_(in[pcent + 2]); + // FIXME: It would be nice to unescape top bit set bytes, at least + // when they form valid UTF-8 sequences. + if (0x20 <= ch && ch < 0x7f && !strchr(URL_PRESERVE, ch)) { + url.append(in, start, pcent - start); + url += char(ch); + pcent += 3; + start = pcent; + } else { + pcent += 3; + } + } else { + ++pcent; + } + pcent = in.find('%', pcent); + + if (pcent == std::string::npos || pcent + 2 >= in.size()) { + url.append(in, start, std::string::npos); + return; + } + } +} + +#endif // OMEGA_INCLUDED_URLDECODE_H diff -Nru xapian-omega-1.2.7/urlenctest.cc xapian-omega-1.2.8/urlenctest.cc --- xapian-omega-1.2.7/urlenctest.cc 1970-01-01 00:00:00.000000000 +0000 +++ xapian-omega-1.2.8/urlenctest.cc 2011-12-14 05:28:00.000000000 +0000 @@ -0,0 +1,184 @@ +/** @file enctest.cc + * @brief Test URL encoding and decoding functions + */ +/* Copyright (C) 2011 Olly Betts + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include + +#include +#include +#include +#include + +#include "urldecode.h" +#include "urlencode.h" + +using namespace std; + +struct enc_testcase { + const char * input; + const char * result; +}; + +static enc_testcase urlenc_testcases[] = { + { "", "" }, + { "foo", "foo" }, + { "%", "%25" }, + { "%xyz", "%25xyz" }, + { "xyz%", "xyz%25" }, + { "xyz%25", "xyz%2525" }, + { "~olly/hello-world_2.txt", "~olly%2Fhello-world_2.txt" }, + // Test every possible character (except '\0') encodes as it should: + { "\x01\x02\x03\x04\x05\x06\x07", "%01%02%03%04%05%06%07" }, + { "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", "%08%09%0A%0B%0C%0D%0E%0F" }, + { "\x10\x11\x12\x13\x14\x15\x16\x17", "%10%11%12%13%14%15%16%17" }, + { "\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F", "%18%19%1A%1B%1C%1D%1E%1F" }, + { " !\"#$%&'()*+,-./", "%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F" }, + { "0123456789:;<=>?", "0123456789%3A%3B%3C%3D%3E%3F" }, + { "@ABCDEFGHIJKLMNO", "%40ABCDEFGHIJKLMNO" }, + { "PQRSTUVWXYZ[\\]^_", "PQRSTUVWXYZ%5B%5C%5D%5E_" }, + { "`abcdefghijklmno", "%60abcdefghijklmno" }, + { "pqrstuvwxyz{|}~\x7F", "pqrstuvwxyz%7B%7C%7D~%7F" }, + { "\x80\x81\x82\x83\x84\x85\x86\x87", "%80%81%82%83%84%85%86%87" }, + { "\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F", "%88%89%8A%8B%8C%8D%8E%8F" }, + { "\x90\x91\x92\x93\x94\x95\x96\x97", "%90%91%92%93%94%95%96%97" }, + { "\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F", "%98%99%9A%9B%9C%9D%9E%9F" }, + { "\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7", "%A0%A1%A2%A3%A4%A5%A6%A7" }, + { "\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF", "%A8%A9%AA%AB%AC%AD%AE%AF" }, + { "\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7", "%B0%B1%B2%B3%B4%B5%B6%B7" }, + { "\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF", "%B8%B9%BA%BB%BC%BD%BE%BF" }, + { "\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7", "%C0%C1%C2%C3%C4%C5%C6%C7" }, + { "\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF", "%C8%C9%CA%CB%CC%CD%CE%CF" }, + { "\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7", "%D0%D1%D2%D3%D4%D5%D6%D7" }, + { "\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF", "%D8%D9%DA%DB%DC%DD%DE%DF" }, + { "\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7", "%E0%E1%E2%E3%E4%E5%E6%E7" }, + { "\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF", "%E8%E9%EA%EB%EC%ED%EE%EF" }, + { "\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7", "%F0%F1%F2%F3%F4%F5%F6%F7" }, + { "\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF", "%F8%F9%FA%FB%FC%FD%FE%FF" }, + { NULL, NULL } +}; + +struct dec_testcase { + const char * input; + const char * result[7]; +}; + +static dec_testcase urldec_testcases[] = { + { "", { 0 } }, + { "foo=bar", { "foo", "bar", 0 } }, + { "foo=a%20b&", { "foo", "a b", 0 } }, + { "&foo=hello+world", { "foo", "hello world", 0 } }, + { "&foo=1&", { "foo", "1", 0 } }, + { "foo=1&&bar=2", { "bar", "2", "foo", "1", 0 } }, + { "a+1=bar%", { "a 1", "bar%", 0 } }, + { "a%201=bar%0", { "a 1", "bar%0", 0 } }, + { "a%2x1=bar%x", { "a%2x1", "bar%x", 0 } }, + { "a%2x1%%40=bar%x", { "a%2x1%@", "bar%x", 0 } }, + { "a%01%1f%2A%30%4d%5a%9A%9f%Aa%bF%C0%De%E2%FF=bar%0%", + { "a\x01\x1f*0MZ\x9a\x9f\xaa\xbf\xc0\xde\xe2\xff", "bar%0%", 0 } }, + { "a=1&b=2&a=1", { "a", "1", "a", "1", "b", "2", 0 } }, + { NULL, { 0 } } +}; + +struct pretty_testcase { + const char * input; + const char * result; +}; + +// 0 for result means "same as input" here. +struct pretty_testcase pretty_testcases[] = { + { "", 0 }, + { "http://localhost/", 0 }, + { "%", 0 }, + { "%x", 0 }, + { "%xy", 0 }, + { "%xyz", 0 }, + { "%25", 0 }, + { "%20", " " }, + { "%20hello", " hello" }, + { "http://example.com/%7ehello%20world/", + "http://example.com/~hello world/" }, + { "http://example.com/%25/a%20b%80/100%", + "http://example.com/%25/a b%80/100%" }, + { NULL, NULL } +}; + +static multimap params; + +void +CGIParameterHandler::operator()(const string& var, const string& val) const +{ + params.insert(multimap::value_type(var, val)); +} + +int main() { + for (enc_testcase * e = urlenc_testcases; e->input; ++e) { + string result; + url_encode(result, e->input); + if (result != e->result) { + cerr << "urlencode of " << e->input << " should be " << e->result + << "\", got \"" << result << "\"" << endl; + exit(1); + } + } + + for (dec_testcase * d = urldec_testcases; d->input; ++d) { + params.clear(); + const char * input = d->input; + url_decode(CGIParameterHandler(), CStringItor(input), CStringItor()); + const char ** p = d->result; + bool ok = true; + for (multimap::const_iterator i = params.begin(); + i != params.end(); ++i) { + if (!*p || i->first.compare(*p) != 0 || + i->second.compare(p[1]) != 0) { + // Variable and/or value doesn't match. + ok = false; + break; + } + p += 2; + } + if (!ok || *p) { + cerr << "Expected these parameters:\n"; + for (p = d->result; *p; p += 2) { + cerr << " " << p[0] << " = " << p[1] << endl; + } + cerr << "Got these parameters:\n"; + for (multimap::const_iterator j = params.begin(); + j != params.end(); ++j) { + cerr << " " << j->first << " = " << j->second << endl; + } + exit(1); + } + } + + for (pretty_testcase * e = pretty_testcases; e->input; ++e) { + string url = e->input; + url_prettify(url); + const char * result = (e->result ? e->result : e->input); + if (url != result) { + cerr << "url_prettify of " << e->input << " should be " << result + << "\", got \"" << url << "\"" << endl; + exit(1); + } + } +} diff -Nru xapian-omega-1.2.7/xapian-omega.spec xapian-omega-1.2.8/xapian-omega.spec --- xapian-omega-1.2.7/xapian-omega.spec 2011-08-10 06:55:55.000000000 +0000 +++ xapian-omega-1.2.8/xapian-omega.spec 2011-12-14 05:35:32.000000000 +0000 @@ -5,7 +5,7 @@ Summary: A CGI search frontend and indexers built on Xapian Name: xapian-omega -Version: 1.2.7 +Version: 1.2.8 Release: 1 License: GPL Vendor: xapian.org @@ -71,6 +71,10 @@ %{_bindir}/scriptindex %{_bindir}/htdig2omega %{_bindir}/mbox2omega +# On 64-bit, this goes to /usr/lib64/... +# FIXME: Sort this out: +# http://thread.gmane.org/gmane.comp.search.xapian.general/8678 +%{_libdir}/xapian-omega/bin/outlookmsg2html %{contentdir}/omega %{logdir}/omega /var/www/cgi-bin/omega diff -Nru xapian-omega-1.2.7/xapian-omega.spec.in xapian-omega-1.2.8/xapian-omega.spec.in --- xapian-omega-1.2.7/xapian-omega.spec.in 2011-08-10 06:49:12.000000000 +0000 +++ xapian-omega-1.2.8/xapian-omega.spec.in 2011-12-14 05:28:00.000000000 +0000 @@ -71,6 +71,10 @@ %{_bindir}/scriptindex %{_bindir}/htdig2omega %{_bindir}/mbox2omega +# On 64-bit, this goes to /usr/lib64/... +# FIXME: Sort this out: +# http://thread.gmane.org/gmane.comp.search.xapian.general/8678 +%{_libdir}/xapian-omega/bin/outlookmsg2html %{contentdir}/omega %{logdir}/omega /var/www/cgi-bin/omega