from 1.18 branch: Adjust things for using the new Firefox plugin: remove visible Beagle references + fix 1.18 web queue indexing bugs

This commit is contained in:
Jean-Francois Dockes
2012-11-01 11:30:39 +01:00
parent 04c19b33d5
commit 5fc8f240fe
25 changed files with 1420 additions and 1167 deletions
+24
View File
@@ -360,6 +360,26 @@ extern string path_canon(const string &is)
return ret;
}
bool makepath(const string& ipath)
{
string path = path_canon(ipath);
vector<string> elems;
stringToTokens(path, elems, "/");
path = "/";
for (vector<string>::const_iterator it = elems.begin();
it != elems.end(); it++){
path += *it;
// Not using path_isdir() here, because this cant grok symlinks
// If we hit an existing file, no worry, mkdir will just fail.
if (access(path.c_str(), 0) != 0) {
if (mkdir(path.c_str(), 0700) != 0) {
return false;
}
}
path += "/";
}
return true;
}
vector<string> path_dirglob(const string &dir, const string pattern)
{
@@ -502,6 +522,10 @@ string fileurltolocalpath(string url)
}
return url;
}
bool urlisfileurl(const string& url)
{
return url.find("file://") == 0;
}
// Printable url: this is used to transcode from the system charset
// into either utf-8 if transcoding succeeds, or url-encoded