Hello community,
here is the log from the commit of package strigi for openSUSE:Factory
checked in at Tue Feb 1 18:41:29 CET 2011.
--------
--- strigi/strigi.changes 2010-12-14 18:01:51.000000000 +0100
+++ /mounts/work_src_done/STABLE/strigi/strigi.changes 2011-01-28 11:47:56.000000000 +0100
@@ -1,0 +2,12 @@
+Fri Jan 28 10:46:39 UTC 2011 - remur@gmx.net
+
+- Check file size of ole compound documents (bko#251701)
+ * Dolphin crashes when hovering a MSI file
+
+-------------------------------------------------------------------
+Tue Jan 18 22:09:11 UTC 2011 - wstephenson@novell.com
+
+- Update to newer snapshot
+ * Fix double delete in libstreamindexer (bko#257944)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
strigi-0.7.3.tar.bz2
New:
----
bko_251701.v3.patch
strigi-0.7.3.99.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ strigi.spec ++++++
--- /var/tmp/diff_new_pack.dvCEtD/_old 2011-02-01 18:40:34.000000000 +0100
+++ /var/tmp/diff_new_pack.dvCEtD/_new 2011-02-01 18:40:34.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package strigi (Version 0.7.3)
+# spec file for package strigi
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -28,10 +28,11 @@
Summary: Lightweight and fast desktop search engine
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: http://www.vandenoever.info/software/strigi/
-Version: 0.7.3
-Release: 3
+Version: 0.7.3.99
+Release: 1
Source: strigi-%{version}.tar.bz2
Source2: baselibs.conf
+Patch0: bko_251701.v3.patch
Provides: strigi-ui = 0.5.7
Obsoletes: strigi-ui <= 0.5.7
Requires: libstrigi0 = %version
@@ -86,9 +87,11 @@
%prep
%setup -q -n strigi-%{version}
+%patch0 -p1
%build
%cmake_kde4
+
make %{?jobs:-j %jobs}
%install
++++++ bko_251701.v3.patch ++++++
diff --git a/lib/oleinputstream.cpp b/lib/oleinputstream.cpp
index c66e200..7286573 100644
--- a/libstreams/lib/oleinputstream.cpp
+++ b/libstreams/lib/oleinputstream.cpp
@@ -173,33 +173,39 @@ OleInputStream::Private::Private(OleInputStream* s, InputStream* input)
stream->m_error = "Invalid OLE file.";
return;
}
- int32_t max = 0;
batIndex.reserve(nBat);
data += 76;
for (int i = 0; i < ::min(109, nBat); ++i) {
int32_t p = readLittleEndianInt32(data+4*i);
batIndex.push_back(p);
- if (p > max) max = p;
}
- if (ptOffset > max) max = ptOffset;
- if (128*(nBat-1) > max) max = 128*(nBat-1);
- int32_t toread = (max+2)*512;
- if (input->size() >= 0 && input->size() < toread) {
+ // this looks wrong? what's with input->size() < 0
+ // toread = 10000000 later on, why not bail out here?
+/* if (input->size() >= 0 && input->size() < toread) {
stream->m_status = Error;
stream->m_error = "File is incomplete.";
return;
- }
- toread = (input->size() > 0) ?(int32_t)input->size() :10000000;
- size = input->read(data, toread, toread);
- input->reset(0);
- if (size != input->size()) {
+ }*/
+
+ // stop the max block number guessing
+ // check for (nBat - 1) * 128 * 512 <= input-size() < nbat * 128 * 512
+ // can there be a totally empty bat? (only -1), what happens with file size
+ int32_t minSize = (nBat - 1) * 128 * 512;
+ int32_t maxSize = nBat * 128 * 512; // +64k
+
+ // we still have a 64k possible error window
+ size = input->read(data, maxSize, maxSize);
+ if (size < minSize) {
+ fprintf(stderr, "minSize: %d vs. size %d \n", minSize, size);
stream->m_status = Error;
stream->m_error
= string("File cannot be read completely: ")+input->error();
return;
}
- maxindex = size/512-2;
+ input->reset(0);
+
+ maxindex = size/512-2; // -1 -> header; -2 -> ?
// read any remaining BAT entries from XBAT blocks
xBatOffset = 512 + 512 * xBatOffset;
@@ -211,6 +217,7 @@ OleInputStream::Private::Private(OleInputStream* s, InputStream* input)
xBatOffset = 512+512*readLittleEndianInt32(data + 508 + xBatOffset);
}
+// check last sector for no of remaining secIDS
// print all bat blocks
/* for (size_t i = 0; i strigi-0.7.3.99.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/.gitmodules new/strigi-0.7.3.99/.gitmodules
--- old/strigi-0.7.3/.gitmodules 1970-01-01 01:00:00.000000000 +0100
+++ new/strigi-0.7.3.99/.gitmodules 2011-01-18 22:01:10.000000000 +0100
@@ -0,0 +1,19 @@
+[submodule "strigiutils"]
+ path = strigiutils
+ url = http://anongit.kde.org/strigiutils
+
+[submodule "strigidaemon"]
+ path = strigidaemon
+ url = http://anongit.kde.org/strigidaemon
+
+[submodule "libstreams"]
+ path = libstreams
+ url = http://anongit.kde.org/libstreams
+
+[submodule "libstreamanalyzer"]
+ path = libstreamanalyzer
+ url = http://anongit.kde.org/libstreamanalyzer
+
+[submodule "strigiclient"]
+ path = strigiclient
+ url = http://anongit.kde.org/strigiclient
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/CMakeLists.txt new/strigi-0.7.3.99/CMakeLists.txt
--- old/strigi-0.7.3/CMakeLists.txt 2010-03-22 07:11:53.000000000 +0100
+++ new/strigi-0.7.3.99/CMakeLists.txt 2011-01-18 22:01:10.000000000 +0100
@@ -8,15 +8,62 @@
# for testing to work in cmake, this command must be called in the root src dir
enable_testing()
+option(STRIGI_SYNC_SUBMODULES "Try to update the Strigi submodules automatically. Note that the update may fail if you have pending changes in one of the submodules." FALSE)
+
+if(STRIGI_SYNC_SUBMODULES)
+ find_program(GIT_EXECUTABLE NAMES git)
+ if(NOT GIT_EXECUTABLE)
+ message(FATAL_ERROR "Could not find git. Aborting.")
+ endif()
+endif()
+
+macro(check_subdir _subDirectory)
+ message(STATUS "Checking: ${strigi_SOURCE_DIR}/${_subDirectory}/CMakeLists.txt")
+ if(NOT EXISTS "${strigi_SOURCE_DIR}/${_subDirectory}/CMakeLists.txt")
+ message(STATUS "No CMakeLists.txt found in ${_subDirectory}")
+ if(STRIGI_SYNC_SUBMODULES)
+ message(STATUS "Trying to download the ${_subDirectory} submodule")
+ execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init -- ${_subDirectory}
+ WORKING_DIRECTORY ${strigi_SOURCE_DIR})
+ endif()
+ else()
+ if(STRIGI_SYNC_SUBMODULES)
+ message(STATUS "Trying to update the ${_subDirectory} submodule")
+ execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --rebase -- ${_subDirectory}
+ WORKING_DIRECTORY ${strigi_SOURCE_DIR})
+ endif()
+ else()
+ set(showError 1)
+ endif()
+endmacro()
+
+check_subdir(libstreams)
+check_subdir(libstreamanalyzer)
+check_subdir(strigiutils)
+check_subdir(strigidaemon)
+check_subdir(strigiclient)
+
if(MSVC)
add_definitions(-wd4251)
add_definitions(-wd4355)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
+ add_definitions(-D_USE_MATH_DEFINES)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zc:wchar_t-")
endif(MSVC)
-add_subdirectory(libstreams)
-add_subdirectory(libstreamanalyzer)
-add_subdirectory(strigiutils)
-add_subdirectory(strigidaemon)
-add_subdirectory(strigiclient)
+if(showError)
+ message(FATAL_ERROR "No CMakeLists.txt was found in one of your sources subdirectory\n"
+ "Make sure you downloaded the sub-modules files using:\n"
+ " git submodule update --init"
+ )
+else()
+ add_subdirectory(libstreams)
+ add_subdirectory(libstreamanalyzer)
+ add_subdirectory(strigiutils)
+ if(NOT MSVC)
+ add_subdirectory(strigidaemon)
+ add_subdirectory(strigiclient)
+ endif(NOT MSVC)
+endif()
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/CMakeLists.txt new/strigi-0.7.3.99/libstreamanalyzer/CMakeLists.txt
--- old/strigi-0.7.3/libstreamanalyzer/CMakeLists.txt 2010-11-02 10:41:31.000000000 +0100
+++ new/strigi-0.7.3.99/libstreamanalyzer/CMakeLists.txt 2011-01-18 22:01:29.000000000 +0100
@@ -25,7 +25,7 @@
set(CMAKE_INSTALL_RPATH ${LIB_DESTINATION} )
set(LIBSTREAMANALYZER_VERSION 0.7.3)
-set(LIBSTREAMANALYZER_SOVERSION 0.7)
+set(LIBSTREAMANALYZER_SOVERSION 0)
option(BUILD_UTILS "build luceneindexer, xmlindexer, rdfindexer, ontoprint utilities" ON)
option(BUILD_DEEPTOOLS "build deep find and deepgrep tools" ON)
option(ENABLE_XINE
@@ -53,6 +53,7 @@
# on FreeBSD dlopen is in libc, on GNU/Linux it's in libdl
if(NOT WIN32)
include(CheckFunctionExists)
+ include(CheckLibraryExists)
check_library_exists(dl dlopen "" DLOPEN_IN_LIBDL)
check_function_exists(dlopen DLOPEN_IN_LIBC)
set(LIBDL)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/lib/CMakeLists.txt new/strigi-0.7.3.99/libstreamanalyzer/lib/CMakeLists.txt
--- old/strigi-0.7.3/libstreamanalyzer/lib/CMakeLists.txt 2010-10-26 16:15:54.000000000 +0200
+++ new/strigi-0.7.3.99/libstreamanalyzer/lib/CMakeLists.txt 2011-01-18 22:01:29.000000000 +0100
@@ -31,7 +31,6 @@
endanalyzers/cpioendanalyzer.cpp
endanalyzers/flacendanalyzer.cpp
endanalyzers/gzipendanalyzer.cpp
- endanalyzers/helperendanalyzer.cpp
endanalyzers/id3endanalyzer.cpp
endanalyzers/lzmaendanalyzer.cpp
endanalyzers/mailendanalyzer.cpp
@@ -58,6 +57,17 @@
xesamparser.cpp
)
+if(MSVC)
+ list(APPEND streamanalyzer_SRCS
+ stgdirent.cpp
+ stgdirent.h
+ )
+else(MSVC)
+ list(APPEND streamanalyzer_SRCS
+ endanalyzers/helperendanalyzer.cpp
+ )
+endif(MSVC)
+
add_library(streamanalyzerstatic STATIC ${streamanalyzer_SRCS})
set(streamanalyzer_libs ${LIBSTREAMS_LIBRARIES} ${LIBXML2_LIBRARIES} )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/lib/analyzerloader.cpp new/strigi-0.7.3.99/libstreamanalyzer/lib/analyzerloader.cpp
--- old/strigi-0.7.3/libstreamanalyzer/lib/analyzerloader.cpp 2010-04-17 16:15:08.000000000 +0200
+++ new/strigi-0.7.3.99/libstreamanalyzer/lib/analyzerloader.cpp 2011-01-18 22:01:29.000000000 +0100
@@ -21,6 +21,7 @@
#include
#include <string>
#include <iostream>
+#include <iterator>
#include <cstdio>
#include <cstring>
#include
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/lib/diranalyzer.cpp new/strigi-0.7.3.99/libstreamanalyzer/lib/diranalyzer.cpp
--- old/strigi-0.7.3/libstreamanalyzer/lib/diranalyzer.cpp 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/libstreamanalyzer/lib/diranalyzer.cpp 2011-01-18 22:01:29.000000000 +0100
@@ -33,6 +33,16 @@
using namespace Strigi;
using namespace std;
+// MSVC doesn't define them
+#ifdef _MSC_VER
+# define _IFMT 0170000 // type of file
+# define _IFDIR 0040000 // directory
+# define _IFREG 0100000 // regular
+# define S_ISDIR(m) (((m)&_IFMT) == _IFDIR)
+# define S_ISREG(m) (((m)&_IFMT) == _IFREG)
+#endif
+
+
class DirAnalyzer::Private {
public:
DirLister dirlister;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/lib/fieldpropertiesdb.cpp new/strigi-0.7.3.99/libstreamanalyzer/lib/fieldpropertiesdb.cpp
--- old/strigi-0.7.3/libstreamanalyzer/lib/fieldpropertiesdb.cpp 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/libstreamanalyzer/lib/fieldpropertiesdb.cpp 2011-01-18 22:01:29.000000000 +0100
@@ -24,6 +24,7 @@
#include <vector>
#include <map>
#include <iostream>
+#include <iterator>
#include <set>
#include <cstdlib>
#include <cstring>
@@ -40,6 +41,10 @@
#include
#include
+#ifdef _MSC_VER
+# define strcasecmp stricmp
+#endif
+
using namespace Strigi;
using namespace std;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/lib/lineanalyzers/m3ustreamanalyzer.cpp new/strigi-0.7.3.99/libstreamanalyzer/lib/lineanalyzers/m3ustreamanalyzer.cpp
--- old/strigi-0.7.3/libstreamanalyzer/lib/lineanalyzers/m3ustreamanalyzer.cpp 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/libstreamanalyzer/lib/lineanalyzers/m3ustreamanalyzer.cpp 2011-01-18 22:01:29.000000000 +0100
@@ -16,7 +16,7 @@
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
- * $Id: m3ustreamanalyzer.cpp 1104187 2010-03-16 23:47:37Z vandenoever $
+ * $Id$
*/
#include "m3ustreamanalyzer.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/lib/lineanalyzers/m3ustreamanalyzer.h new/strigi-0.7.3.99/libstreamanalyzer/lib/lineanalyzers/m3ustreamanalyzer.h
--- old/strigi-0.7.3/libstreamanalyzer/lib/lineanalyzers/m3ustreamanalyzer.h 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/libstreamanalyzer/lib/lineanalyzers/m3ustreamanalyzer.h 2011-01-18 22:01:29.000000000 +0100
@@ -16,7 +16,7 @@
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
- * $Id: m3ustreamanalyzer.h 1104187 2010-03-16 23:47:37Z vandenoever $
+ * $Id$
*/
#ifndef M3USTREAMANALYZER_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/lib/pdf/pdfparser.cpp new/strigi-0.7.3.99/libstreamanalyzer/lib/pdf/pdfparser.cpp
--- old/strigi-0.7.3/libstreamanalyzer/lib/pdf/pdfparser.cpp 2010-08-12 12:41:40.000000000 +0200
+++ new/strigi-0.7.3.99/libstreamanalyzer/lib/pdf/pdfparser.cpp 2011-01-18 22:01:29.000000000 +0100
@@ -34,10 +34,10 @@
StreamStatus
PdfParser::read(int32_t min, int32_t max) {
int32_t off = (int32_t)(pos-start);
- int32_t d = (int32_t)(stream->position() - objdefstart);
+ int32_t d = (int32_t)(stream->position() - bufferStart);
min += d;
if (max > 0) max += d;
- stream->reset(objdefstart);
+ stream->reset(bufferStart);
int32_t n = stream->read(start, min, max);
// printf("objstart %i %i\n", d, n);
if (n < min) return stream->status();
@@ -46,19 +46,10 @@
return Ok;
}
StreamStatus
-PdfParser::read2(int32_t min, int32_t max) {
-// printf("pos %lli\n", stream->position());
- int32_t n = stream->read(start, min, max);
- if (n < min) return stream->status();
- pos = start;
- end = pos + n;
- return Ok;
-}
-StreamStatus
PdfParser::checkForData(int32_t m) {
- StreamStatus n = Eof;
+ StreamStatus n = Ok;
if (end - pos < m) {
- n = read(m, 0);
+ n = read(m - (int32_t) (end-pos), 0);
}
// fprintf(stderr, "checkForData %i\n", n);
return n;
@@ -369,7 +360,7 @@
pos++;
// read stream until 'endstream'
- int64_t p = pos-start;
+ int64_t p = bufferStart + pos-start;
if (p != stream->reset(p)) return Error;
// fprintf(stderr, "filter: %s\n", filter.c_str());
// fprintf(stderr, "type: %s %i\n", type.c_str(), streamcount);
@@ -380,20 +371,18 @@
filter) != Eof) {
return Error;
}
- p += sub.size();
} else {
SubInputStream sub(stream, length);
if (handleSubStream(&sub, type, offset, numberofobjects, hasfilter,
filter) != Eof) {
return Error;
}
- p += sub.size();
}
- if (p != stream->reset(p)) return Error;
- if (read(1, 0) != Ok) return Error;
- pos = start + p;
- //pos = start + (stream->position()-objdefstart);
-// printf("hi %i\n", off+(pos-start));
+ // After reading the substream the pointers to the buffer are invalid.
+ // Reset the buffer to the current stream position
+ start = pos = end = 0;
+ bufferStart = stream->position();
+ //if (read(1, 0) != Ok) return Error;
//printf("hi %i\n", *pos);
if (skipWhitespaceOrComment() != Ok) return Error;
// printf("hi %i %.*s\n", pos-start, 10, pos);
@@ -490,7 +479,7 @@
PdfParser::parseObjectStream(StreamBase<char>* s, int32_t offset, int32_t n) {
stream = s;
end = pos = start = 0;
- objdefstart = 0;
+ bufferStart = 0;
stream->skip(offset);
StreamStatus r = Ok;
@@ -510,7 +499,7 @@
PdfParser::parseContentStream(StreamBase<char>* s) {
stream = s;
end = pos = start = 0;
- objdefstart = 0;
+ bufferStart = 0;
StreamStatus r = skipWhitespaceOrComment();
// fprintf(stderr, "eh %i %i\n", r, Eof);
if (r != Ok) return r;
@@ -557,7 +546,6 @@
}
StreamStatus
PdfParser::parseObjectStreamObjectDef() {
-// objdefstart = pos-start;
if (*pos == 'x') return skipXRef();
if (*pos == 't') return skipTrailer();
if (*pos == 's') return skipStartXRef();
@@ -576,16 +564,13 @@
}
StreamStatus
PdfParser::parse(StreamBase<char>* stream) {
- // for now we need to load the entire stream in memory :(
- // this is due to a sneaky bug somewhere, not a design issue
- forwardStream(stream);
stream->reset(0);
StreamStatus r;
// initialize the stream status
this->stream = stream;
end = pos = start = 0;
- objdefstart = 0;
+ bufferStart = 0;
// initialize the parsed field containers
lastNumber = -1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/lib/pdf/pdfparser.h new/strigi-0.7.3.99/libstreamanalyzer/lib/pdf/pdfparser.h
--- old/strigi-0.7.3/libstreamanalyzer/lib/pdf/pdfparser.h 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/libstreamanalyzer/lib/pdf/pdfparser.h 2011-01-18 22:01:29.000000000 +0100
@@ -45,7 +45,7 @@
const char* start;
const char* end;
const char* pos;
- int64_t objdefstart;
+ int64_t bufferStart;
Strigi::StreamBase<char>* stream;
std::string m_error;
@@ -62,7 +62,6 @@
Strigi::StreamStatus read(int32_t min, int32_t max);
void forwardStream(Strigi::StreamBase<char>* s);
- Strigi::StreamStatus read2(int32_t min, int32_t max);
Strigi::StreamStatus checkForData(int32_t m);
bool isInString(char c, const char* s, int32_t n);
Strigi::StreamStatus skipFromString(const char*str, int32_t n);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/lib/streamanalyzer.cpp new/strigi-0.7.3.99/libstreamanalyzer/lib/streamanalyzer.cpp
--- old/strigi-0.7.3/libstreamanalyzer/lib/streamanalyzer.cpp 2010-04-17 16:15:08.000000000 +0200
+++ new/strigi-0.7.3.99/libstreamanalyzer/lib/streamanalyzer.cpp 2011-01-18 22:01:29.000000000 +0100
@@ -331,13 +331,9 @@
addFactory(new PdfEndAnalyzerFactory());
addFactory(new SdfEndAnalyzerFactory());
addFactory(new LzmaEndAnalyzerFactory());
-#ifdef WIN32
-#ifdef __GNUC__
-#warning FIXME - IFilterEndAnalyzerFactory is pure virtual!
-// addFactory(new IFilterEndAnalyzerFactory());
-#endif
-#endif
+#ifndef _MSC_VER
addFactory(new HelperEndAnalyzerFactory());
+#endif
addFactory(new TextEndAnalyzerFactory());
}
void
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp new/strigi-0.7.3.99/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp
--- old/strigi-0.7.3/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp 2010-10-31 16:15:35.000000000 +0100
+++ new/strigi-0.7.3.99/libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp 2011-01-18 22:01:29.000000000 +0100
@@ -314,7 +314,7 @@
AVProbeData pd;
const char *buf;
pd.filename ="";
- pd.buf_size = in->read(buf,262144,262144);
+ pd.buf_size = in->read(buf,262144,262144) - AVPROBE_PADDING_SIZE;
pd.buf = (unsigned char*)buf;
in->reset(0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/plugins/indexers/cluceneindexer/cluceneindexreader.cpp new/strigi-0.7.3.99/libstreamanalyzer/plugins/indexers/cluceneindexer/cluceneindexreader.cpp
--- old/strigi-0.7.3/libstreamanalyzer/plugins/indexers/cluceneindexer/cluceneindexreader.cpp 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/libstreamanalyzer/plugins/indexers/cluceneindexer/cluceneindexreader.cpp 2011-01-18 22:01:29.000000000 +0100
@@ -309,6 +309,15 @@
t = createKeywordTerm(fieldname.c_str(), query.term().string());
q = _CLNEW TermQuery(t);
break;
+ case Strigi::Query::Contains:
+ t = createWildCardTerm(fieldname.c_str(), "*" + val + "*");
+ q = _CLNEW WildcardQuery(t);
+ break;
+ case Strigi::Query::StartsWith:
+ t = createWildCardTerm(fieldname.c_str(), val + "*");
+ q = _CLNEW WildcardQuery(t);
+ break;
+ case Strigi::Query::Equals:
default:
if (strpbrk(val.c_str(), "*?")) {
t = createWildCardTerm(fieldname.c_str(), val);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreamanalyzer/plugins/indexers/cluceneindexer/luceneindexer.cpp new/strigi-0.7.3.99/libstreamanalyzer/plugins/indexers/cluceneindexer/luceneindexer.cpp
--- old/strigi-0.7.3/libstreamanalyzer/plugins/indexers/cluceneindexer/luceneindexer.cpp 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/libstreamanalyzer/plugins/indexers/cluceneindexer/luceneindexer.cpp 2011-01-18 22:01:29.000000000 +0100
@@ -27,7 +27,11 @@
#include <iostream>
#include
#include
-#include
+#ifdef _MSC_VER
+# include
+#else
+# include
+#endif
using namespace std;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreams/StrigiConfig.cmake.in new/strigi-0.7.3.99/libstreams/StrigiConfig.cmake.in
--- old/strigi-0.7.3/libstreams/StrigiConfig.cmake.in 2010-05-20 18:09:25.000000000 +0200
+++ new/strigi-0.7.3.99/libstreams/StrigiConfig.cmake.in 2011-01-18 22:01:34.000000000 +0100
@@ -20,7 +20,6 @@
# No need to test for it, since here we know exactly what we have.
set(STRIGI_NEEDS_SIGNED_CHAR TRUE)
set(STRIGI_NEEDS_CHAR FALSE)
-message(STATUS "Strigi API needs 'signed char'")
# get path of this file and go three levels up (this is equivalent to
# the CMAKE_INSTALL_PREFIX if LIB_DESTINATION is not set)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreams/lib/CMakeLists.txt new/strigi-0.7.3.99/libstreams/lib/CMakeLists.txt
--- old/strigi-0.7.3/libstreams/lib/CMakeLists.txt 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/libstreams/lib/CMakeLists.txt 2011-01-18 22:01:34.000000000 +0100
@@ -47,6 +47,7 @@
add_library(streamsstatic STATIC ${streams_SRCS})
set_target_properties(streamsstatic PROPERTIES DEFINE_SYMBOL MAKE_STREAMS_LIB)
+target_link_libraries(streamsstatic ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${ICONV_LIBRARIES})
add_library(streams SHARED ${streams_SRCS})
set_target_properties(streams PROPERTIES
@@ -54,7 +55,7 @@
SOVERSION ${STRIGI_VERSION_MAJOR}
DEFINE_SYMBOL MAKE_STREAMS_LIB
)
-target_link_libraries(streams streamsstatic)
+target_link_libraries(streams ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${ICONV_LIBRARIES})
install(TARGETS streams
LIBRARY DESTINATION ${LIB_DESTINATION}
RUNTIME DESTINATION bin
@@ -62,7 +63,6 @@
)
-target_link_libraries(streamsstatic ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${ICONV_LIBRARIES})
if(NOT WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libstreams.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libstreams.pc)
endif(NOT WIN32)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/libstreams/lib/mailinputstream.cpp new/strigi-0.7.3.99/libstreams/lib/mailinputstream.cpp
--- old/strigi-0.7.3/libstreams/lib/mailinputstream.cpp 2010-08-22 01:47:56.000000000 +0200
+++ new/strigi-0.7.3.99/libstreams/lib/mailinputstream.cpp 2011-01-18 22:01:34.000000000 +0100
@@ -201,16 +201,6 @@
}
return decoded;
}
-bool
-checkHeaderKey(const char* data, int32_t left) {
- if (left >= 9 && strncasecmp("Received:", data, 9) == 0) {
- return true;
- }
- if (left >= 5 && strncasecmp("From:", data, 5) == 0) {
- return true;
- }
- return false;
-}
/**
* Validate a mail header. The header format is checked, but not the presence
@@ -219,59 +209,105 @@
**/
bool
MailInputStream::checkHeader(const char* data, int32_t datasize) {
- // the fileheader should contain a required header and have at least 5
- // header lines
- // 'Received' or 'From' (case insensitive)
- int linecount = 1;
- bool key = true;
- bool slashr = false;
- int32_t pos = 0;
- bool reqheader = checkHeaderKey(data, datasize);
- char prevc = 0;
+
+ /**
+ * Describes the possible states the parser can be in.
+ */
+ enum MessageParserState {
+ InHeaderNameField, ///< The header name is parsed
+ InHeaderValueField, ///< The header value is parsed
+ MaybeOnNewLine, ///< A \r has been discovered while InHeaderValueField
+ PossibleHeaderNameField, ///< After a \r\n check if it is a new line or a folded line
+ MaybeEndOfHeaders, ///< A \r has been discovered while in PossibleHeaderNameField
+ InBody ///< The body part is parsed
+ };
+
+ /**
+ * The state machine of the parser has the following structure:
+ *
+ * @dot
+ * digraph MessageParser {
+ * InHeaderNameField -> InHeaderValueField [label=":"]
+ * InHeaderValueField -> MaybeNewLine [label="\\r"]
+ * MaybeOnNewLine -> PossibleHeaderNameField [label="\\n"]
+ * MaybeOnNewLine -> InHeaderValueField
+ * PossibleHeaderNameField -> InHeaderValueField [label="<SPACE>"]
+ * PossibleHeaderNameField -> MaybeEndOfHeaders [label="\\r"]
+ * PossibleHeaderNameField -> InHeaderNameField
+ * MaybeEndOfHeaders -> InBody [label="\\n"]
+ * }
+ * @enddot
+ */
+
+ MessageParserState currentState = InHeaderNameField;
+
+ int pos = 0;
while (pos < datasize) {
- unsigned char c = data[pos++];
- if (slashr) {
- slashr = false;
- if (c == '\n') {
- if (!reqheader) {
- reqheader = checkHeaderKey(data+pos, datasize-pos);
- }
- continue;
+ char currentChar = data[pos];
+
+ switch(currentState) {
+ case InHeaderNameField:
+ if (currentChar == ':') {
+ currentState = InHeaderValueField;
+ } else if (currentChar == ' ' || currentChar == '\t') {
+ // is SPACE
+ return false;
+ } else if (currentChar < 0 || currentChar >= 128) {
+ // is not CHAR
+ return false;
+ } else if ((currentChar >= 0 && currentChar <= 31) || currentChar == 127) {
+ // is CTRL
+ return false;
}
- }
- if (key) {
- if (c == ':' || (isblank(c) && isspace(prevc))) {
- // ':' signals the end of the key, a line starting with space
- // is a continuation of the previous line's value
- key = false;
- } else if ((c == '\n' || c == '\r') && reqheader && linecount >= 5
- && (prevc == '\n' || prevc == '\r')) {
- // if at least 5 header lines were read and an empty line is
- // encountered, the mail header is valid
- return true;
- } else if (c != '-' && c != '.' && c != '_' && !isalnum(c)
- && c != '#') {
- // an invalid character in the key
- return false;
- }
- } else {
- // check that the text is 7-bit
- if (c == '\n' || c == '\r') {
- // a new line starts, so a new key
- key = true;
- linecount++;
- // enable reading of \r\n line endings
- if (c == '\r') {
- slashr = true;
- } else if (!reqheader) {
- reqheader = checkHeaderKey(data+pos, datasize-pos);
- }
+ break;
+ case InHeaderValueField:
+ if (currentChar == '\r') {
+ currentState = MaybeOnNewLine;
+ } else if (currentChar < 0 || currentChar >= 128) {
+ // is not CHAR
+ return false;
+ }
+ break;
+ case MaybeOnNewLine:
+ if (currentChar == '\n') {
+ currentState = PossibleHeaderNameField;
+ } else {
+ currentState = InHeaderValueField;
+ continue; // re-evaluate this character in InHeaderValueField state
+ }
+ break;
+ case PossibleHeaderNameField:
+ if (currentChar == ' ' || currentChar == '\t') {
+ currentState = InHeaderValueField;
+ } else if (currentChar == '\r') {
+ currentState = MaybeEndOfHeaders;
+ } else {
+ currentState = InHeaderNameField;
+ continue; // re-evaluate this character in InHeaderNameField state
+ }
+ break;
+ case MaybeEndOfHeaders:
+ if (currentChar == '\n') {
+ currentState = InBody;
+ } else {
+ // the only alternative follow state would be InHeaderNameField, but this doesn't allow \r
+ return false;
}
+ break;
+ case InBody:
+ if (currentChar < 0 || currentChar >= 128) {
+ // is not CHAR
+ return false;
+ }
+ break;
}
- prevc = c;
+
+ pos++;
}
- return reqheader && linecount >= 5;
+
+ return true;
}
+
class MailInputStream::Private {
public:
MailInputStream* const m;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/strigidaemon/bin/combinedindex/combinedindexmanager.cpp new/strigi-0.7.3.99/strigidaemon/bin/combinedindex/combinedindexmanager.cpp
--- old/strigi-0.7.3/strigidaemon/bin/combinedindex/combinedindexmanager.cpp 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/strigidaemon/bin/combinedindex/combinedindexmanager.cpp 2011-01-18 22:01:44.000000000 +0100
@@ -45,6 +45,7 @@
#include <string>
#include <set>
#include <map>
+#include <iterator>
using namespace std;
using namespace Strigi;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/strigidaemon/bin/daemon/dbus/CMakeLists.txt new/strigi-0.7.3.99/strigidaemon/bin/daemon/dbus/CMakeLists.txt
--- old/strigi-0.7.3/strigidaemon/bin/daemon/dbus/CMakeLists.txt 2010-03-17 00:47:37.000000000 +0100
+++ new/strigi-0.7.3.99/strigidaemon/bin/daemon/dbus/CMakeLists.txt 2011-01-18 22:01:44.000000000 +0100
@@ -3,6 +3,7 @@
# if available, use Perl for generating the dbus interfaces.
# otherwise, just copy them into the build directory
find_package(Perl)
+find_package(LibDBus)
MACRO(CreateDBusBinding HEADERFILE INAME INTERFACE EXTRAINCLUDE)
IF (PERL_FOUND)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/strigidaemon/cmake/FindLibDBus.cmake new/strigi-0.7.3.99/strigidaemon/cmake/FindLibDBus.cmake
--- old/strigi-0.7.3/strigidaemon/cmake/FindLibDBus.cmake 2010-04-17 16:12:15.000000000 +0200
+++ new/strigi-0.7.3.99/strigidaemon/cmake/FindLibDBus.cmake 2011-01-18 22:01:44.000000000 +0100
@@ -8,7 +8,6 @@
# DBUSLAUNCH_EXECUTABLE - the path to the dbus-launch executable for testing
if(WIN32)
-
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
find_path(DBUS_INCLUDE_DIRS dbus/dbus.h
${_program_FILES_DIR}/dbus/include
@@ -16,7 +15,7 @@
${CMAKE_INCLUDE_PATH}
)
set(DBUS_LIBRARY_DIRS ${_program_FILES_DIR}/dbus/lib)
- find_library(DBUS_LIBRARIES NAMES dbus dbus-1
+ find_library(DBUS_LIBRARIES NAMES dbus dbus-1 dbus-1d
PATHS
${DBUS_LIBRARY_DIRS}
${CMAKE_INSTALL_PREFIX}/lib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/strigiutils/CMakeLists.txt new/strigi-0.7.3.99/strigiutils/CMakeLists.txt
--- old/strigi-0.7.3/strigiutils/CMakeLists.txt 2010-03-19 12:36:56.000000000 +0100
+++ new/strigi-0.7.3.99/strigiutils/CMakeLists.txt 2011-01-18 22:01:49.000000000 +0100
@@ -49,15 +49,19 @@
##### installing #####
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "")
-add_executable(deepfind dummy.cpp)
-target_link_libraries(deepfind libdeepfind)
-install(TARGETS deepfind RUNTIME DESTINATION bin)
-add_executable(deepgrep dummy.cpp)
-target_link_libraries(deepgrep libdeepgrep)
-install(TARGETS deepgrep RUNTIME DESTINATION bin)
-add_executable(xmlindexer dummy.cpp)
-target_link_libraries(xmlindexer libxmlindexer)
-install(TARGETS xmlindexer RUNTIME DESTINATION bin)
-add_executable(rdfindexer dummy.cpp)
-target_link_libraries(rdfindexer librdfindexer)
-install(TARGETS rdfindexer RUNTIME DESTINATION bin)
+if(HAVE_REGEX_H)
+ add_executable(deepfind dummy.cpp)
+ target_link_libraries(deepfind libdeepfind)
+ install(TARGETS deepfind RUNTIME DESTINATION bin)
+ add_executable(deepgrep dummy.cpp)
+ target_link_libraries(deepgrep libdeepgrep)
+ install(TARGETS deepgrep RUNTIME DESTINATION bin)
+endif(HAVE_REGEX_H)
+if(NOT MSVC)
+ add_executable(xmlindexer dummy.cpp)
+ target_link_libraries(xmlindexer libxmlindexer)
+ install(TARGETS xmlindexer RUNTIME DESTINATION bin)
+ add_executable(rdfindexer dummy.cpp)
+ target_link_libraries(rdfindexer librdfindexer)
+ install(TARGETS rdfindexer RUNTIME DESTINATION bin)
+endif(NOT MSVC)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/strigi-0.7.3/strigiutils/bin/CMakeLists.txt new/strigi-0.7.3.99/strigiutils/bin/CMakeLists.txt
--- old/strigi-0.7.3/strigiutils/bin/CMakeLists.txt 2010-03-22 07:11:53.000000000 +0100
+++ new/strigi-0.7.3.99/strigiutils/bin/CMakeLists.txt 2011-01-18 22:01:49.000000000 +0100
@@ -2,4 +2,6 @@
if(HAVE_REGEX_H)
add_subdirectory(deepfind)
endif(HAVE_REGEX_H)
-add_subdirectory(xmlindexer)
+if(NOT MSVC)
+ add_subdirectory(xmlindexer)
+endif(NOT MSVC)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org