6 if (!pset.
exists(
"SherpaProcess"))
10 if (!pset.
exists(
"SherpackLocation"))
14 if (!pset.
exists(
"SherpackChecksum"))
18 if (!pset.
exists(
"FetchSherpack"))
22 if (!pset.
exists(
"SherpaPath"))
30 std::string constr =
"`cmsGetFnConnect frontier://smallfiles`";
36 std::cout <<
"SherpackFetcher: Trying to fetch the Sherpack " << sherpack << std::endl;
43 <<
"SherpackFetcher: Fetching of Sherpack did not succeed, terminating" << std::endl;
46 std::cout <<
"SherpackFetcher: Fetching successful" << std::endl;
49 std::ifstream my_file(sherpack.c_str());
50 if (!my_file.good()) {
51 throw cms::Exception(
"SherpaInterface") <<
"SherpackFetcher: No Sherpack found" << std::endl;
55 std::cout <<
"SherpackFetcher: Sherpack found" << std::endl;
60 for (
int k = 0;
k < 33;
k++) {
63 <<
"SherpackFetcher: failure, calculated and specified checksums differ!" << std::endl;
67 std::cout <<
"SherpackFetcher: Calculated checksum of the Sherpack is " << md5checksum <<
" and matches"
70 std::cout <<
"SherpackFetcher: Ignoring Checksum" << std::endl;
73 std::cout <<
"SherpackFetcher: Trying to unzip the Sherpack" << std::endl;
76 throw cms::Exception(
"SherpaInterface") <<
"SherpackFetcher: Decompressing failed " << std::endl;
79 std::cout <<
"SherpackFetcher: Decompressing successful " << std::endl;
81 FILE *
file = fopen(const_cast<char *>(sherpackunzip.c_str()),
"r");
83 std::cout <<
"SherpackFetcher: Decompressed Sherpack exists with name " << sherpackunzip
84 <<
" starting to untar it" << std::endl;
87 throw cms::Exception(
"SherpaInterface") <<
"SherpackFetcher: Could not open decompressed Sherpack" << std::endl;
96 if ((pathstring.find(
"slc6_amd64_gcc") == 0) || (pathstring.find(
"slc5_amd64_gcc") == 0)) {
97 throw cms::Exception(
"SherpaInterface") <<
"Old method of sherpack retrieving used, please use /cvmfs to store "
98 "files and specify the full path to the sherpack directory";
100 std::cout <<
"Trying to copy file " << pathstring << std::endl;
102 FILE *
pipe = popen(command.c_str(),
"r");
104 throw cms::Exception(
"SherpaInterface") <<
"failed to copy Sherpack ";
void md5_File(std::string, char *)
std::string SherpackLocation
int CopyFile(std::string pathstring)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::string SherpackChecksum
void Untar(FILE *, const char *)
SherpackFetcher(edm::ParameterSet const &)
T getParameter(std::string const &) const
std::string SherpaProcess
int Unzip(std::string, std::string)