Browse Source

- debug output

master
Andreas Romeyke 2 years ago
parent
commit
6e0c174b47
3 changed files with 11 additions and 6 deletions
  1. +4
    -2
      src/lib/manifest.cpp
  2. +3
    -2
      src/lib/payloadmanifest.cpp
  3. +4
    -2
      src/lib/tagmanifest.cpp

+ 4
- 2
src/lib/manifest.cpp View File

@ -94,14 +94,16 @@ bool Manifest::store( string basedir, list<string>& files ) {
checksum_algorithms alg = it->first;
// test if file exists
string algfilename = basedir + it->second;
cout << "DEBUG manifest::store, file='"<<algfilename << "' (newbase='" << basedir << "', filename='" << it->second << "'" <<endl;
ofstream alg_txt_file;
alg_txt_file.open( algfilename );
if (alg_txt_file.is_open()) {
list<string>::iterator ch;
for (ch=files.begin(); ch!=files.end(); ++ch) {
string filename = *ch;
string filename = basedir + *ch;
cout << "\tfilename='"<<filename<<"'"<<endl;
string checksum_string = checksum.checksum_of_file( filename, alg);
alg_txt_file << checksum_string << " " << filename << endl;
alg_txt_file << checksum_string << " " << *ch << endl;
}
alg_txt_file.close();
}


+ 3
- 2
src/lib/payloadmanifest.cpp View File

@ -21,8 +21,9 @@ Payloadmanifest::Payloadmanifest( string basedir ) {
for (map<checksum_algorithms, string>::iterator it=possible_manifest_files.begin(); it!=possible_manifest_files.end(); ++it) {
checksum_algorithms alg = it->first;
// test if file exists
string filename = basedir + it->second;
fs::path p{ filename };
//string filename = basedir + it->second;
string filename = it->second;
fs::path p{ basedir + filename };
fs::file_status s = fs::status( p );
if (fs::is_regular_file( s)) {
Payloadmanifest::manifest_algorithm_files[alg] = filename;


+ 4
- 2
src/lib/tagmanifest.cpp View File

@ -22,13 +22,15 @@ Tagmanifest::Tagmanifest( string basedir ) {
// debug
// cout << it->first << " => " << it->second << endl;
// test if file exists
string filename = basedir + it->second;
//string filename = basedir + it->second;
string filename = it->second;
checksum_algorithms alg = it->first;
fs::path p{ filename };
fs::file_status s = fs::status( p );
//cout << "path "<< p.string() << endl;
//cout << "is file: "<< fs::is_regular_file( s) << endl;
if (fs::is_regular_file( s)) {
Tagmanifest::manifest_algorithm_files[it->first] = filename;
Tagmanifest::manifest_algorithm_files[alg] = filename;
// debug
//cout << "TAGMANIFEST: alg="<< it->first << " => filename=" << it->second << endl;
//cout << "TAGMANIFEST2: alg="<< it->first << " => filename=" << filename << endl;


Loading…
Cancel
Save