24 std::string constr =
"`cmsGetFnConnect frontier://smallfiles`";
30 std::cout <<
"SherpackFetcher: Trying to fetch the Sherpack " << sherpack << std::endl;
36 throw cms::Exception(
"SherpaInterface") <<
"SherpackFetcher: Fetching of Sherpack did not succeed, terminating" << std::endl;
39 std::cout <<
"SherpackFetcher: Fetching successful" << std::endl;
42 std::ifstream my_file(sherpack.c_str());
45 throw cms::Exception(
"SherpaInterface") <<
"SherpackFetcher: No Sherpack found" << std::endl;
49 std::cout <<
"SherpackFetcher: Sherpack found" << std::endl;
54 for (
int k=0;
k<33;
k++){
56 throw cms::Exception(
"SherpaInterface") <<
"SherpackFetcher: failure, calculated and specified checksums differ!" << std::endl;
60 std::cout <<
"SherpackFetcher: Calculated checksum of the Sherpack is " << md5checksum <<
" and matches" << std::endl;
62 std::cout <<
"SherpackFetcher: Ignoring Checksum" << std::endl;
66 std::cout <<
"SherpackFetcher: Trying to unzip the Sherpack" << std::endl;
69 throw cms::Exception(
"SherpaInterface") <<
"SherpackFetcher: Decompressing failed " << std::endl;
72 std::cout <<
"SherpackFetcher: Decompressing successful " << std::endl;
74 FILE *
file = fopen(const_cast<char*>(sherpackunzip.c_str()),
"r");
76 std::cout <<
"SherpackFetcher: Decompressed Sherpack exists with name " << sherpackunzip <<
" starting to untar it"<<std::endl;
79 throw cms::Exception(
"SherpaInterface") <<
"SherpackFetcher: Could not open decompressed Sherpack" << std::endl;
89 if ( (pathstring.find(
"slc6_amd64_gcc")==0) || (pathstring.find(
"slc5_amd64_gcc")==0) ){
90 throw cms::Exception(
"SherpaInterface") <<
"Old method of sherpack retrieving used, please use /cvmfs to store files and specify the full path to the sherpack directory";
92 std::cout <<
"Trying to copy file " << pathstring << std::endl;
94 FILE *
pipe = popen(command.c_str(),
"r");
96 throw cms::Exception(
"SherpaInterface") <<
"failed to copy Sherpack ";
T getParameter(std::string const &) const
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 &)
std::string SherpaProcess
int Unzip(std::string, std::string)