8000 copy enterprise files too when starting with `--javascript.copy-insta… by jsteemann · Pull Request #7818 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

copy enterprise files too when starting with `--javascript.copy-insta… #7818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion arangod/V8Server/V8DealerFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void V8DealerFeature::copyInstallationFiles() {

// get base path from DatabasePathFeature
auto dbPathFeature = application_features::ApplicationServer::getFeature<DatabasePathFeature>();
const std::string copyJSPath = FileUtils::buildFilename(dbPathFeature->directory(), "js");
std::string const copyJSPath = FileUtils::buildFilename(dbPathFeature->directory(), "js");
if (copyJSPath == _startupDirectory) {
LOG_TOPIC(FATAL, arangodb::Logger::V8)
<< "'javascript.startup-directory' cannot be inside 'database.directory'";
Expand Down Expand Up @@ -489,6 +489,17 @@ void V8DealerFeature::copyInstallationFiles() {
<< "': " << error;
FATAL_ERROR_EXIT();
}

// attempt to copy enterprise JS files too.
// only required for developer installations, not packages
std::string const enterpriseJs = basics::FileUtils::buildFilename(_startupDirectory, "..", "enterprise", "js");

if (FileUtils::isDirectory(enterpriseJs)) {
std::function<bool(std::string const&)> const passAllFilter = [](std::string const&) { return false; };
if (!FileUtils::copyRecursive(enterpriseJs, copyJSPath, passAllFilter, error)) {
LOG_TOPIC(WARN, Logger::V8) << "Error copying enterprise JS installation files to '" << copyJSPath << "': " << error;
}
}
}
_startupDirectory = copyJSPath;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Basics/FileResultString.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
namespace arangodb {
class FileResultString : public FileResult {
public:
FileResultString(std::string result) : FileResult(), _result(result) {}
FileResultString(std::string const& result) : FileResult(), _result(result) {}

FileResultString(int sysErrorNumber, std::string result)
FileResultString(int sysErrorNumber, std::string const& result)
: FileResult(sysErrorNumber), _result(result) {}

FileResultString(int sysErrorNumber)
Expand Down
2 changes: 1 addition & 1 deletion lib/Basics/FileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ bool copyDirectoryRecursive(std::string const& source,
if (isSubDirectory(src)) {
long systemError;
int rc = TRI_CreateDirectory(dst.c_str(), systemError, error);
if (rc != TRI_ERROR_NO_ERROR) {
if (rc != TRI_ERROR_NO_ERROR && rc != TRI_ERROR_FILE_EXISTS) {
break;
}
if (!copyDirectoryRecursive(src, dst, filter, error)) {
Expand Down
0