|
a/src/internfile/internfile.cpp |
|
b/src/internfile/internfile.cpp |
|
... |
|
... |
78 |
}
|
78 |
}
|
79 |
|
79 |
|
80 |
#ifdef RCL_USE_XATTR
|
80 |
#ifdef RCL_USE_XATTR
|
81 |
void FileInterner::reapXAttrs(const string& path)
|
81 |
void FileInterner::reapXAttrs(const string& path)
|
82 |
{
|
82 |
{
|
|
|
83 |
LOGDEB2(("FileInterner::reapXAttrs: [%s]\n", path.c_str()));
|
83 |
vector<string> xnames;
|
84 |
vector<string> xnames;
|
84 |
if (!pxattr::list(path, &xnames)) {
|
85 |
if (!pxattr::list(path, &xnames)) {
|
85 |
LOGERR(("FileInterner::reapXattrs: pxattr::list: errno %d\n", errno));
|
86 |
LOGERR(("FileInterner::reapXattrs: pxattr::list: errno %d\n", errno));
|
86 |
return;
|
87 |
return;
|
87 |
}
|
88 |
}
|
|
... |
|
... |
96 |
"for %s, errno %d\n", (*it).c_str(), errno));
|
97 |
"for %s, errno %d\n", (*it).c_str(), errno));
|
97 |
continue;
|
98 |
continue;
|
98 |
}
|
99 |
}
|
99 |
// Encode should we ?
|
100 |
// Encode should we ?
|
100 |
m_XAttrsFields[mit->second] = value;
|
101 |
m_XAttrsFields[mit->second] = value;
|
|
|
102 |
LOGDEB2(("FileInterner::reapXAttrs: got [%s] -> [%s]\n",
|
|
|
103 |
mit->second.c_str(), value.c_str()));
|
101 |
}
|
104 |
}
|
102 |
}
|
105 |
}
|
103 |
}
|
106 |
}
|
104 |
#endif // RCL_USE_XATTR
|
107 |
#endif // RCL_USE_XATTR
|
105 |
|
108 |
|
|
... |
|
... |
624 |
doc.meta[Rcl::Doc::keyfn] = it->second;
|
627 |
doc.meta[Rcl::Doc::keyfn] = it->second;
|
625 |
} else if (it->first == cstr_dj_keymt ||
|
628 |
} else if (it->first == cstr_dj_keymt ||
|
626 |
it->first == cstr_dj_keycharset) {
|
629 |
it->first == cstr_dj_keycharset) {
|
627 |
// don't need/want these.
|
630 |
// don't need/want these.
|
628 |
} else {
|
631 |
} else {
|
629 |
doc.meta[it->first] = it->second;
|
632 |
doc.addmeta(m_cfg->fieldCanon(it->first), it->second);
|
630 |
}
|
633 |
}
|
631 |
}
|
634 |
}
|
632 |
if (doc.meta[Rcl::Doc::keyabs].empty() &&
|
635 |
if (doc.meta[Rcl::Doc::keyabs].empty() &&
|
633 |
!doc.meta[cstr_dj_keyds].empty()) {
|
636 |
!doc.meta[cstr_dj_keyds].empty()) {
|
634 |
doc.meta[Rcl::Doc::keyabs] = doc.meta[cstr_dj_keyds];
|
637 |
doc.meta[Rcl::Doc::keyabs] = doc.meta[cstr_dj_keyds];
|
|
... |
|
... |
657 |
LOGDEB2(("FileInterner::collectIpathAndMT\n"));
|
660 |
LOGDEB2(("FileInterner::collectIpathAndMT\n"));
|
658 |
bool hasipath = false;
|
661 |
bool hasipath = false;
|
659 |
|
662 |
|
660 |
#ifdef RCL_USE_XATTR
|
663 |
#ifdef RCL_USE_XATTR
|
661 |
// Set fields from extended file attributes.
|
664 |
// Set fields from extended file attributes.
|
662 |
// These can be overriden by values from inside the file
|
665 |
// These can be later augmented by values from inside the file
|
663 |
for (map<string,string>::const_iterator it = m_XAttrsFields.begin();
|
666 |
for (map<string,string>::const_iterator it = m_XAttrsFields.begin();
|
664 |
it != m_XAttrsFields.end(); it++) {
|
667 |
it != m_XAttrsFields.end(); it++) {
|
|
|
668 |
LOGDEB1(("Internfile:: setting [%s] from xattrs value [%s]\n",
|
|
|
669 |
m_cfg->fieldCanon(it->first).c_str(), it->second.c_str()));
|
665 |
doc.meta[it->first] = it->second;
|
670 |
doc.meta[m_cfg->fieldCanon(it->first)] = it->second;
|
666 |
}
|
671 |
}
|
667 |
#endif //RCL_USE_XATTR
|
672 |
#endif //RCL_USE_XATTR
|
668 |
|
673 |
|
669 |
// If there is no ipath stack, the mimetype is the one from the file
|
674 |
// If there is no ipath stack, the mimetype is the one from the file
|
670 |
doc.mimetype = m_mimetype;
|
675 |
doc.mimetype = m_mimetype;
|