|
a/src/internfile/extrameta.cpp |
|
b/src/internfile/extrameta.cpp |
|
... |
|
... |
31 |
|
31 |
|
32 |
static void docfieldfrommeta(RclConfig* cfg, const string& name,
|
32 |
static void docfieldfrommeta(RclConfig* cfg, const string& name,
|
33 |
const string &value, Rcl::Doc& doc)
|
33 |
const string &value, Rcl::Doc& doc)
|
34 |
{
|
34 |
{
|
35 |
string fieldname = cfg->fieldCanon(name);
|
35 |
string fieldname = cfg->fieldCanon(name);
|
36 |
LOGDEB0("Internfile:: setting [" << (fieldname) << "] from cmd/xattr value [" << (value) << "]\n" );
|
36 |
LOGDEB0("Internfile:: setting [" << fieldname <<
|
|
|
37 |
"] from cmd/xattr value [" << value << "]\n");
|
37 |
if (fieldname == cstr_dj_keymd) {
|
38 |
if (fieldname == cstr_dj_keymd) {
|
38 |
doc.dmtime = value;
|
39 |
doc.dmtime = value;
|
39 |
} else {
|
40 |
} else {
|
40 |
doc.meta[fieldname] = value;
|
41 |
doc.meta[fieldname] = value;
|
41 |
}
|
42 |
}
|
42 |
}
|
43 |
}
|
43 |
|
44 |
|
44 |
void reapXAttrs(const RclConfig* cfg, const string& path,
|
45 |
void reapXAttrs(const RclConfig* cfg, const string& path,
|
45 |
map<string, string>& xfields)
|
46 |
map<string, string>& xfields)
|
46 |
{
|
47 |
{
|
47 |
LOGDEB2("reapXAttrs: [" << (path) << "]\n" );
|
48 |
LOGDEB2("reapXAttrs: [" << path << "]\n");
|
48 |
#ifndef _WIN32
|
49 |
#ifndef _WIN32
|
49 |
// Retrieve xattrs names from files and mapping table from config
|
50 |
// Retrieve xattrs names from files and mapping table from config
|
50 |
vector<string> xnames;
|
51 |
vector<string> xnames;
|
51 |
if (!pxattr::list(path, &xnames)) {
|
52 |
if (!pxattr::list(path, &xnames)) {
|
52 |
if (errno == ENOTSUP) {
|
53 |
if (errno == ENOTSUP) {
|
53 |
LOGDEB("FileInterner::reapXattrs: pxattr::list: errno " << (errno) << "\n" );
|
54 |
LOGDEB("FileInterner::reapXattrs: pxattr::list: errno " <<
|
|
|
55 |
errno << "\n");
|
54 |
} else {
|
56 |
} else {
|
55 |
LOGERR("FileInterner::reapXattrs: pxattr::list: errno " << (errno) << "\n" );
|
57 |
LOGERR("FileInterner::reapXattrs: pxattr::list: errno " <<
|
|
|
58 |
errno << "\n");
|
56 |
}
|
59 |
}
|
57 |
return;
|
60 |
return;
|
58 |
}
|
61 |
}
|
59 |
const map<string, string>& xtof = cfg->getXattrToField();
|
62 |
const map<string, string>& xtof = cfg->getXattrToField();
|
60 |
|
63 |
|
|
... |
|
... |
72 |
key = mit->second;
|
75 |
key = mit->second;
|
73 |
}
|
76 |
}
|
74 |
}
|
77 |
}
|
75 |
string value;
|
78 |
string value;
|
76 |
if (!pxattr::get(path, *it, &value, pxattr::PXATTR_NOFOLLOW)) {
|
79 |
if (!pxattr::get(path, *it, &value, pxattr::PXATTR_NOFOLLOW)) {
|
77 |
LOGERR("FileInterner::reapXattrs: pxattr::get failedfor " << ((*it)) << ", errno " << (errno) << "\n" );
|
80 |
LOGERR("FileInterner::reapXattrs: pxattr::get failed for " << *it
|
|
|
81 |
<< ", errno " << errno << "\n");
|
78 |
continue;
|
82 |
continue;
|
79 |
}
|
83 |
}
|
80 |
// Encode should we ?
|
84 |
// Encode should we ?
|
81 |
xfields[key] = value;
|
85 |
xfields[key] = value;
|
82 |
LOGDEB2("reapXAttrs: [" << (key) << "] -> [" << (value) << "]\n" );
|
86 |
LOGDEB2("reapXAttrs: [" << key << "] -> [" << value << "]\n");
|
83 |
}
|
87 |
}
|
84 |
#endif
|
88 |
#endif
|
85 |
}
|
89 |
}
|
86 |
|
90 |
|
87 |
void docFieldsFromXattrs(RclConfig *cfg, const map<string, string>& xfields,
|
91 |
void docFieldsFromXattrs(RclConfig *cfg, const map<string, string>& xfields,
|