diff options
author | Chris Johns <chrisj@rtems.org> | 2012-11-21 17:40:44 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2012-11-21 17:40:44 +1100 |
commit | 81a8394daa9995b9c8f2ce6b4e3918d79bc1f630 (patch) | |
tree | 8644abdb3495dbfbf33d9f1cfd86ffb1cdb1c3cf /rld-outputter.cpp | |
parent | c2aeedef54dd8c72fa8de06ed1784696ba8823d4 (diff) |
Clean archive names for every output format other than scripts.
Diffstat (limited to 'rld-outputter.cpp')
-rw-r--r-- | rld-outputter.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/rld-outputter.cpp b/rld-outputter.cpp index 96876b7..c91b03a 100644 --- a/rld-outputter.cpp +++ b/rld-outputter.cpp @@ -43,7 +43,8 @@ namespace rld const std::string script_text (const std::string& entry, const files::object_list& dependents, - const files::cache& cache) + const files::cache& cache, + bool not_in_archive) { std::ostringstream out; files::object_list objects; @@ -63,11 +64,22 @@ namespace rld ++oi) { files::object& obj = *(*oi); + std::string name = obj.name ().basename (); + + if (not_in_archive) + { + size_t pos = name.find (':'); + if (pos != std::string::npos) + name[pos] = '_'; + pos = name.find ('@'); + if (pos != std::string::npos) + name = name.substr (0, pos); + } if (rld::verbose () >= RLD_VERBOSE_INFO) - std::cout << " o: " << obj.name ().full () << std::endl; + std::cout << " o: " << name << std::endl; - out << "o:" << obj.name ().basename () << std::endl; + out << "o:" << name << std::endl; symbols::table& unresolved = obj.unresolved_symbols (); @@ -99,7 +111,7 @@ namespace rld if (rld::verbose () >= RLD_VERBOSE_INFO) std::cout << "metadata: " << metadata.name ().full () << std::endl; - const std::string script = script_text (entry, dependents, cache); + const std::string script = script_text (entry, dependents, cache, true); metadata.open (true); metadata.begin (); @@ -182,7 +194,7 @@ namespace rld try { - out << script_text (entry, dependents, cache); + out << script_text (entry, dependents, cache, false); } catch (...) { @@ -265,7 +277,7 @@ namespace rld header = "RAP,00000000,01.00.00,LZ77,00000000\n"; header += '\0'; - script = script_text (entry, dependents, cache); + script = script_text (entry, dependents, cache, true); cache.get_objects (objects); objects.merge (dep_copy); |