Skip to content

Commit

Permalink
Correct the path for Script Repository Download
Browse files Browse the repository at this point in the history
  • Loading branch information
gesnerpassos committed Apr 23, 2013
1 parent 5ce9886 commit 6ca4d80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,6 @@ UploaderWebServer =
# Local system path for the script repository.
ScriptLocalRepository =
# Url for the remote script repository.
ScriptRepository = http://download.mantidproject.org/master_builds/
ScriptRepository = http://download.mantidproject.org/scriptrepository/
# Pattern given to ScriptRepository that is used to hide entries from repository to the users. It is a csv string separated with ';'
ScriptRepositoryIgnore = *pyc;
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ using Mantid::Kernel::ConfigServiceImpl;

using boost::property_tree::ptree;

const std::string SCRIPTREPPATH = "scripts_repo/";

namespace Mantid
{
namespace API
Expand Down Expand Up @@ -265,7 +263,7 @@ namespace API
// install the two files inside the given folder

// download the repository json
doDownloadFile(std::string(remote_url).append("/repository.json"),
doDownloadFile(std::string(remote_url).append("repository.json"),
rep_json_file);
g_log.debug() << "ScriptRepository downloaded repository information" << std::endl;
// creation of the instance of local_json file
Expand Down Expand Up @@ -616,7 +614,7 @@ namespace API
return;

// download the file
std::string url_path = std::string(remote_url).append(SCRIPTREPPATH).append(file_path);
std::string url_path = std::string(remote_url).append(file_path);
Poco::TemporaryFile tmpFile;
doDownloadFile(url_path, tmpFile.path());

Expand Down Expand Up @@ -733,7 +731,7 @@ namespace API
f.moveTo(backup);
}
try{
doDownloadFile(std::string(remote_url).append("/repository.json"),
doDownloadFile(std::string(remote_url).append("repository.json"),
rep_json_file);
}catch(...){
// restore file
Expand Down Expand Up @@ -851,7 +849,7 @@ namespace API
Poco::URI uri(url_file);
std::string path(uri.getPathAndQuery());
if (path.empty()) path = "/";
std::string given_path = std::string(path.begin()+28, path.end());// remove the "/master_builds/scripts_repo/" from the path
std::string given_path = std::string(path.begin()+18, path.end());// remove the "/scriptrepository/" from the path
//Configure Poco HTTP Client Session
try{
Poco::Net::HTTPClientSession session(uri.getHost(), uri.getPort());
Expand Down

0 comments on commit 6ca4d80

Please sign in to comment.