From aede7c5eb19817e78ec16eaff835e24da20d8d69 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 16 Mar 2016 12:30:09 +0100 Subject: [PATCH 1/3] removed arangod from document path --- scripts/generateExamples.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/generateExamples.js b/scripts/generateExamples.js index 285a16bdf1..2531d75833 100644 --- a/scripts/generateExamples.js +++ b/scripts/generateExamples.js @@ -18,17 +18,12 @@ var PortFinder = require("@arangodb/cluster").PortFinder; var documentationSourceDirs = [ fs.join(fs.makeAbsolute(''), "Documentation/Examples/setup-arangosh.js"), + fs.join(fs.makeAbsolute(''), "Documentation/Books/Users"), fs.join(fs.makeAbsolute(''), "js/actions"), fs.join(fs.makeAbsolute(''), "js/client"), fs.join(fs.makeAbsolute(''), "js/common"), fs.join(fs.makeAbsolute(''), "js/server"), - fs.join(fs.makeAbsolute(''), "js/apps/system/_api/gharial/APP"), - fs.join(fs.makeAbsolute(''), "Documentation/Books/Users"), - fs.join(fs.makeAbsolute(''), "arangod/RestHandler"), - fs.join(fs.makeAbsolute(''), "arangod/V8Server")]; - - - + fs.join(fs.makeAbsolute(''), "js/apps/system/_api/gharial/APP")]; var theScript = 'Documentation/Scripts/generateExamples.py'; From d9f9b8b65d336cd2d8e85580e0a9f9a2d66fa2bc Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 16 Mar 2016 13:01:18 +0100 Subject: [PATCH 2/3] fixed server version --- js/client/modules/@arangodb/index.js | 29 ++++++++++++-------------- js/server/modules/@arangodb/index.js | 23 ++++++++++---------- {scripts => utils}/generateExamples | 0 {scripts => utils}/generateExamples.js | 0 4 files changed, 24 insertions(+), 28 deletions(-) rename {scripts => utils}/generateExamples (100%) rename {scripts => utils}/generateExamples.js (100%) diff --git a/js/client/modules/@arangodb/index.js b/js/client/modules/@arangodb/index.js index 578abe55d6..8f9fa2516f 100644 --- a/js/client/modules/@arangodb/index.js +++ b/js/client/modules/@arangodb/index.js @@ -1,12 +1,9 @@ 'use strict'; //////////////////////////////////////////////////////////////////////////////// -/// @brief JavaScript base module -/// -/// @file -/// /// DISCLAIMER /// +/// Copyright 2016 ArangoDB GmbH, Cologne, Germany /// Copyright 2012 triagens GmbH, Cologne, Germany /// /// Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,20 +18,18 @@ /// See the License for the specific language governing permissions and /// limitations under the License. /// -/// Copyright holder is triAGENS GmbH, Cologne, Germany +/// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Dr. Frank Celler -/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// var internal = require("internal"); var common = require("@arangodb/common"); -Object.keys(common).forEach(function (key) { +Object.keys(common).forEach(function(key) { exports[key] = common[key]; }); - //////////////////////////////////////////////////////////////////////////////// /// @brief isServer //////////////////////////////////////////////////////////////////////////////// @@ -90,8 +85,7 @@ if (typeof internal.arango !== 'undefined') { exports.arango = internal.arango; exports.db = new exports.ArangoDatabase(internal.arango); internal.db = exports.db; // TODO remove - } - catch (err) { + } catch (err) { internal.print("cannot connect to server: " + String(err)); } } @@ -103,17 +97,20 @@ if (typeof internal.arango !== 'undefined') { exports.plainServerVersion = function() { if (internal.arango) { let version = internal.arango.getVersion(); - let devel = version.match(/(.*)-((alpha|beta|devel|rc)[0-9]*)$/); + let devel = version.match(/(.*)\.x-devel/); if (devel !== null) { - version = devel[1]; + version = devel[1] + ".0"; + } else { + devel = version.match(/(.*)-((alpha|beta|devel|rc)[0-9]*)$/); + + if (devel !== null) { + version = devel[1]; + } } return version; - } - else { + } else { return undefined; } }; - - diff --git a/js/server/modules/@arangodb/index.js b/js/server/modules/@arangodb/index.js index bd460c14a1..e5159b43d1 100644 --- a/js/server/modules/@arangodb/index.js +++ b/js/server/modules/@arangodb/index.js @@ -1,12 +1,9 @@ 'use strict'; //////////////////////////////////////////////////////////////////////////////// -/// @brief JavaScript base module -/// -/// @file -/// /// DISCLAIMER /// +/// Copyright 2016 ArangoDB GmbH, Cologne, Germany /// Copyright 2012 triagens GmbH, Cologne, Germany /// /// Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,17 +18,16 @@ /// See the License for the specific language governing permissions and /// limitations under the License. /// -/// Copyright holder is triAGENS GmbH, Cologne, Germany +/// Copyright holder is ArangoDB GmbH, Cologne, Germany /// /// @author Dr. Frank Celler -/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// module.isSystem = true; var common = require("@arangodb/common"); -Object.keys(common).forEach(function (key) { +Object.keys(common).forEach(function(key) { exports[key] = common[key]; }); @@ -39,7 +35,6 @@ var internal = require("internal"); // OK: db var ShapedJson = require("@arangodb/shaped-json").ShapedJson; - //////////////////////////////////////////////////////////////////////////////// /// @brief isServer //////////////////////////////////////////////////////////////////////////////// @@ -91,13 +86,17 @@ exports.db = internal.db; exports.plainServerVersion = function() { let version = internal.version; - let devel = version.match(/(.*)-((alpha|beta|devel|rc)[0-9]*)$/); + let devel = version.match(/(.*)\.x-devel/); if (devel !== null) { - version = devel[1]; + version = devel[1] + ".0"; + } else { + devel = version.match(/(.*)-((alpha|beta|devel|rc)[0-9]*)$/); + + if (devel !== null) { + version = devel[1]; + } } return version; }; - - diff --git a/scripts/generateExamples b/utils/generateExamples similarity index 100% rename from scripts/generateExamples rename to utils/generateExamples diff --git a/scripts/generateExamples.js b/utils/generateExamples.js similarity index 100% rename from scripts/generateExamples.js rename to utils/generateExamples.js From cd1b2b6fc36a3ad9b1efb351bb0bc66d016b4dda Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 16 Mar 2016 13:01:41 +0100 Subject: [PATCH 3/3] moved script --- js/server/modules/@arangodb/foxx/manager.js | 2 - utils/generateExamples | 61 ++++++++++++++++++++- 2 files changed, 60 insertions(+), 3 deletions(-) mode change 120000 => 100755 utils/generateExamples diff --git a/js/server/modules/@arangodb/foxx/manager.js b/js/server/modules/@arangodb/foxx/manager.js index 1d207b1d66..7bc88acfa0 100644 --- a/js/server/modules/@arangodb/foxx/manager.js +++ b/js/server/modules/@arangodb/foxx/manager.js @@ -30,8 +30,6 @@ /// @author Copyright 2013, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// - - const _ = require('lodash'); const fs = require('fs'); const joi = require('joi'); diff --git a/utils/generateExamples b/utils/generateExamples deleted file mode 120000 index e5224d533e..0000000000 --- a/utils/generateExamples +++ /dev/null @@ -1 +0,0 @@ -run \ No newline at end of file diff --git a/utils/generateExamples b/utils/generateExamples new file mode 100755 index 0000000000..fe0aa414b1 --- /dev/null +++ b/utils/generateExamples @@ -0,0 +1,60 @@ +#!/bin/bash +export PID=$$ + +if test -n "$ORIGINAL_PATH"; then + # running in cygwin... + PS='\' + export EXT=".exe" +else + export EXT="" + PS='/' +fi; + +SCRIPT="utils${PS}generateExamples.js" +LOGFILE="out${PS}log-$PID" +DBDIR="out${PS}data-$PID" + +mkdir -p ${DBDIR} + +echo Database has its data in ${DBDIR} +echo Logfile is in ${LOGFILE} + +if [ -z "${ARANGOD}" ]; then + if [ -x build/bin/arangod ]; then + ARANGOD=build/bin/arangod + elif [ -x bin/arangosh ]; then + ARANGOD=bin/arangod + else + echo "$0: cannot locate arangod" + fi +fi + +${ARANGOD} \ + --configuration none \ + --cluster.agent-path bin${PS}etcd-arango${EXT} \ + --cluster.arangod-path bin${PS}arangod \ + --cluster.coordinator-config etc${PS}relative${PS}arangod-coordinator.conf \ + --cluster.dbserver-config etc${PS}relative${PS}arangod-dbserver.conf \ + --cluster.disable-dispatcher-frontend false \ + --cluster.disable-dispatcher-kickstarter false \ + --cluster.data-path cluster \ + --cluster.log-path cluster \ + --database.directory ${DBDIR} \ + --log.file ${LOGFILE} \ + --server.endpoint tcp://127.0.0.1:$PORT \ + --javascript.startup-directory js \ + --javascript.app-path js${PS}apps \ + --javascript.script $SCRIPT \ + --no-server \ + --temp-path ${PS}var${PS}tmp \ + "${ARGS[@]}" \ + +if test $? -eq 0; then + echo "removing ${LOGFILE} ${DBDIR}" + rm -rf ${LOGFILE} ${DBDIR} +else + echo "failed - don't remove ${LOGFILE} ${DBDIR} - here's the logfile:" + cat ${LOGFILE} +fi + +echo Server has terminated.