"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "index_file.cc" between
xapian-omega-1.4.19.tar.xz and xapian-omega-1.4.20.tar.xz

About: Xapian Omega is an application built on Xapian, consisting of indexers and a CGI search frontend.

index_file.cc  (xapian-omega-1.4.19.tar.xz):index_file.cc  (xapian-omega-1.4.20.tar.xz)
skipping to change at line 263 skipping to change at line 263
db = Xapian::WritableDatabase(dbpath, Xapian::DB_CREATE_OR_OPEN); db = Xapian::WritableDatabase(dbpath, Xapian::DB_CREATE_OR_OPEN);
old_docs_not_seen = db.get_doccount(); old_docs_not_seen = db.get_doccount();
// Handle an initially empty database exactly the same way as when // Handle an initially empty database exactly the same way as when
// overwrite is true. // overwrite is true.
if (old_docs_not_seen != 0) { if (old_docs_not_seen != 0) {
old_lastdocid = db.get_lastdocid(); old_lastdocid = db.get_lastdocid();
if (delete_removed_documents) { if (delete_removed_documents) {
// + 1 so that old_lastdocid is a valid subscript. // + 1 so that old_lastdocid is a valid subscript.
updated.resize(old_lastdocid + 1); updated.resize(old_lastdocid + 1);
} }
try { Xapian::valueno slot = use_ctime ? VALUE_CTIME : VALUE_LASTMOD;
Xapian::valueno slot = use_ctime ? VALUE_CTIME : VALUE_LASTMOD; string ubound = db.get_value_upper_bound(slot);
string ubound = db.get_value_upper_bound(slot); if (!ubound.empty())
if (!ubound.empty()) last_altered_max = binary_string_to_int(ubound);
last_altered_max = binary_string_to_int(ubound);
} catch (const Xapian::UnimplementedError &) {
numeric_limits<time_t> n;
last_altered_max = n.max();
}
} }
} else { } else {
db = Xapian::WritableDatabase(dbpath, Xapian::DB_CREATE_OR_OVERWRITE); db = Xapian::WritableDatabase(dbpath, Xapian::DB_CREATE_OR_OVERWRITE);
} }
if (spelling) { if (spelling) {
indexer.set_database(db); indexer.set_database(db);
indexer.set_flags(indexer.FLAG_SPELLING); indexer.set_flags(indexer.FLAG_SPELLING);
} }
indexer.set_stemmer(stemmer); indexer.set_stemmer(stemmer);
skipping to change at line 957 skipping to change at line 952
try { try {
XpsXmlParser xpsparser; XpsXmlParser xpsparser;
run_filter(cmd, false, &dump); run_filter(cmd, false, &dump);
xpsparser.parse(dump); xpsparser.parse(dump);
dump = xpsparser.dump; dump = xpsparser.dump;
} catch (const ReadError&) { } catch (const ReadError&) {
skip_cmd_failed(urlterm, context, cmd, skip_cmd_failed(urlterm, context, cmd,
d.get_size(), d.get_mtime()); d.get_size(), d.get_mtime());
return; return;
} }
cmd = "unzip -p";
append_filename_argument(cmd, file);
cmd += " docProps/core.xml";
try {
MetaXmlParser metaparser;
metaparser.parse(stdout_to_string(cmd, false));
title = metaparser.title;
keywords = metaparser.keywords;
// FIXME: topic = metaparser.topic;
sample = metaparser.sample;
author = metaparser.author;
} catch (const ReadError&) {
// Ignore errors as not all XPS files contain this file.
}
} else if (mimetype == "text/csv") { } else if (mimetype == "text/csv") {
// Currently we assume that text files are UTF-8 unless they have a // Currently we assume that text files are UTF-8 unless they have a
// byte-order mark. // byte-order mark.
dump = d.file_to_string(); dump = d.file_to_string();
md5_string(dump, md5); md5_string(dump, md5);
// Look for Byte-Order Mark (BOM). // Look for Byte-Order Mark (BOM).
if (startswith(dump, "\xfe\xff") || startswith(dump, "\xff\xfe")) { if (startswith(dump, "\xfe\xff") || startswith(dump, "\xff\xfe")) {
// UTF-16 in big-endian/little-endian order - we just convert // UTF-16 in big-endian/little-endian order - we just convert
// it as "UTF-16" and let the conversion handle the BOM as that // it as "UTF-16" and let the conversion handle the BOM as that
 End of changes. 2 change blocks. 
9 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)