1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
Jan Steemann 2015-05-21 17:00:37 +02:00
commit cad7787828
6 changed files with 77 additions and 54 deletions

View File

@ -35,6 +35,7 @@ build-book:
@test -d books/$(NAME) || mkdir books/$(NAME) @test -d books/$(NAME) || mkdir books/$(NAME)
python codeBlockReader.py python codeBlockReader.py
python bot.py python bot.py
cd $(NAME) && gitbook install
cd $(NAME) && gitbook build ./ ./../books/$(NAME) cd $(NAME) && gitbook build ./ ./../books/$(NAME)
cp Users/arangodbLogo.png books/Users/ cp Users/arangodbLogo.png books/Users/
cp Users/cookbookLogo.png books/Users/ cp Users/cookbookLogo.png books/Users/

View File

@ -3,7 +3,7 @@
"title": "ArangoDB Documentation", "title": "ArangoDB Documentation",
"language": "en", "language": "en",
"theme": "./localtheme", "theme": "./localtheme",
"plugins":["-mathjax"], "plugins":["toggle-chapters"],
"pdf": { "pdf": {
"fontSize": 12, "fontSize": 12,
"toc": true, "toc": true,

View File

@ -33,19 +33,8 @@
<div class="book-summary"> <div class="book-summary">
<div class="book-search"> <div class="book-search">
<script> <input type="text" placeholder="{{ __("SEARCH_PLACEHOLDER") }}" class="form-control" />
(function() { </div>
var cx = '002866056653122356950:ju52xx-w-w8';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search></div>
<ul class="summary"> <ul class="summary">
{% set _divider = false %} {% set _divider = false %}
{% if options.links.sidebar %} {% if options.links.sidebar %}
@ -79,27 +68,3 @@
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(function(){
jQuery(".summary>li").each(function(){
var flag = true;
var x = window.location.href.split("/");
x = x[x.length - 2] + '/' + x[x.length - 1];
jQuery('a',this).each(function(){
var str = jQuery(this).attr('href');
if(str.search(x) != -1){
flag = false;
}
});
if(flag){
jQuery('ul',this).hide();
}
else {
jQuery(this).show();
jQuery("ul", this).show();
$(this).get(0).scrollIntoView();
}
});
});
</script>

View File

@ -401,6 +401,14 @@ if (global.FS_MTIME) {
delete global.FS_MTIME; delete global.FS_MTIME;
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief copy one file
////////////////////////////////////////////////////////////////////////////////
if (global.FS_COPY_FILE) {
exports.copyFile = global.FS_COPY_FILE;
delete global.FS_COPY_FILE;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief copy recursive /// @brief copy recursive

View File

@ -475,13 +475,6 @@ function readImportantLogLines(logPath) {
return importantLines; return importantLines;
} }
function copy (src, dst) {
var fs = require("fs");
var buffer = fs.readBuffer(src);
fs.write(dst, buffer);
}
function analyzeCoreDump(instanceInfo, options, storeArangodPath, pid) { function analyzeCoreDump(instanceInfo, options, storeArangodPath, pid) {
var command; var command;
command = '('; command = '(';
@ -523,13 +516,13 @@ function checkInstanceAlive(instanceInfo, options) {
storeArangodPath + " " + options.coreDirectory + storeArangodPath + " " + options.coreDirectory +
"/core*" + instanceInfo.pid.pid + "*'"; "/core*" + instanceInfo.pid.pid + "*'";
if (require("internal").platform.substr(0,3) === 'win') { if (require("internal").platform.substr(0,3) === 'win') {
copy("bin\\arangod.exe", instanceInfo.tmpDataDir + "\\arangod.exe"); fs.copyFile("bin\\arangod.exe", instanceInfo.tmpDataDir + "\\arangod.exe");
copy("bin\\arangod.pdb", instanceInfo.tmpDataDir + "\\arangod.pdb"); fs.copyFile("bin\\arangod.pdb", instanceInfo.tmpDataDir + "\\arangod.pdb");
// Windows: wait for procdump to do its job... // Windows: wait for procdump to do its job...
statusExternal(instanceInfo.monitor, true); statusExternal(instanceInfo.monitor, true);
} }
else { else {
copy("bin/arangod", storeArangodPath); fs.copyFile("bin/arangod", storeArangodPath);
analyzeCoreDump(instanceInfo, options, storeArangodPath, instanceInfo.pid.pid); analyzeCoreDump(instanceInfo, options, storeArangodPath, instanceInfo.pid.pid);
} }
} }
@ -557,13 +550,13 @@ function checkInstanceAlive(instanceInfo, options) {
" /var/tmp/core*" + checkpid.pid + "*'"; " /var/tmp/core*" + checkpid.pid + "*'";
if (require("internal").platform.substr(0,3) === 'win') { if (require("internal").platform.substr(0,3) === 'win') {
copy("bin\\arangod.exe", instanceInfo.tmpDataDir + "\\arangod.exe"); fs.copyFile("bin\\arangod.exe", instanceInfo.tmpDataDir + "\\arangod.exe");
copy("bin\\arangod.pdb", instanceInfo.tmpDataDir + "\\arangod.pdb"); fs.copyFile("bin\\arangod.pdb", instanceInfo.tmpDataDir + "\\arangod.pdb");
// Windows: wait for procdump to do its job... // Windows: wait for procdump to do its job...
statusExternal(instanceInfo.monitor, true); statusExternal(instanceInfo.monitor, true);
} }
else { else {
copy("bin/arangod", storeArangodPath); fs.copyFile("bin/arangod", storeArangodPath);
analyzeCoreDump(instanceInfo, options, storeArangodPath, checkpid.pid); analyzeCoreDump(instanceInfo, options, storeArangodPath, checkpid.pid);
} }
@ -1892,7 +1885,7 @@ function unitTestPrettyPrintResults(r) {
var isSuccess = true; var isSuccess = true;
var oneOutput = ""; var oneOutput = "";
oneOutput = "Testrun: " + testrun + "\n"; oneOutput = "* Testrun: " + testrun + "\n";
var successTests = {}; var successTests = {};
for (test in r[testrun]) { for (test in r[testrun]) {
if (r[testrun].hasOwnProperty(test) && (internalMembers.indexOf(test) === -1)) { if (r[testrun].hasOwnProperty(test) && (internalMembers.indexOf(test) === -1)) {

View File

@ -2168,7 +2168,7 @@ static void JS_MoveFile (const v8::FunctionCallbackInfo<v8::Value>& args) {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief copies a directory structure /// @brief copies a directory structure
/// @startDocuBlock JS_CopyDirectoryRecursive /// @startDocuBlock JS_CopyDirectoryRecursive
/// `fs.xcopy(source, destination)` /// `fs.copyRecursive(source, destination)`
/// ///
/// Copies *source* to destination. Failure to copy the file, or /// Copies *source* to destination. Failure to copy the file, or
/// specifying a directory for destination when source is a file will throw an /// specifying a directory for destination when source is a file will throw an
@ -2183,7 +2183,7 @@ static void JS_CopyRecursive (const v8::FunctionCallbackInfo<v8::Value>& args) {
// extract two arguments // extract two arguments
if (args.Length() != 2) { if (args.Length() != 2) {
TRI_V8_THROW_EXCEPTION_USAGE("xcopy(<source>, <destination>)"); TRI_V8_THROW_EXCEPTION_USAGE("copyRecursive(<source>, <destination>)");
} }
string source = TRI_ObjectToString(args[0]); string source = TRI_ObjectToString(args[0]);
@ -2233,6 +2233,61 @@ static void JS_CopyRecursive (const v8::FunctionCallbackInfo<v8::Value>& args) {
TRI_V8_RETURN_UNDEFINED(); TRI_V8_RETURN_UNDEFINED();
} }
////////////////////////////////////////////////////////////////////////////////
/// @brief copies a file into a target file
/// @startDocuBlock JS_CopyFile
/// `fs.copyRecursive(source, destination)`
///
/// Copies *source* to destination. If Destination is a directory, a file
/// of the same name will be created, else it will be the name of the new file.
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
static void JS_CopyFile (const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
v8::HandleScope scope(isolate);
// extract two arguments
if (args.Length() != 2) {
TRI_V8_THROW_EXCEPTION_USAGE("copyFile(<source>, <destination>)");
}
string source = TRI_ObjectToString(args[0]);
string destination = TRI_ObjectToString(args[1]);
bool const destinationIsDirectory = TRI_IsDirectory(destination.c_str());
if (! TRI_IsRegularFile(source.c_str())) {
TRI_V8_THROW_EXCEPTION_PARAMETER("can only copy regular files.");
}
std::string systemErrorStr;
if (destinationIsDirectory) {
const char* file = strrchr(source.c_str(), TRI_DIR_SEPARATOR_CHAR);
if (file == nullptr) {
if (destination[destination.length()] == TRI_DIR_SEPARATOR_CHAR) {
destination += TRI_DIR_SEPARATOR_CHAR;
}
destination += source;
}
else {
destination += file;
}
}
if (!TRI_CopyFile(source, destination, systemErrorStr)) {
std::string errMsg = "cannot copy file [" +
source +
"] to [" +
destination +
" ] : " +
systemErrorStr;
TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER, errMsg);
}
TRI_V8_RETURN_UNDEFINED();
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -4414,6 +4469,7 @@ void TRI_InitV8Utils (v8::Isolate* isolate,
TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_MAKE_DIRECTORY_RECURSIVE"), JS_MakeDirectoryRecursive); TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_MAKE_DIRECTORY_RECURSIVE"), JS_MakeDirectoryRecursive);
TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_MOVE"), JS_MoveFile); TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_MOVE"), JS_MoveFile);
TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_COPY_RECURSIVE"), JS_CopyRecursive); TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_COPY_RECURSIVE"), JS_CopyRecursive);
TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_COPY_FILE"), JS_CopyFile);
TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_MTIME"), JS_MTime); TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_MTIME"), JS_MTime);
TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_REMOVE"), JS_Remove); TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("FS_REMOVE"), JS_Remove);