| 45 | { |
| 46 | |
| 47 | std::string generateTag(Stage *stage, PipelineWriter::TagMap& tags) |
| 48 | { |
| 49 | auto tagExists = [tags](const std::string& tag) |
| 50 | { |
| 51 | for (auto& t : tags) |
| 52 | { |
| 53 | if (t.second == tag) |
| 54 | return true; |
| 55 | } |
| 56 | return false; |
| 57 | }; |
| 58 | |
| 59 | std::string tag = stage->tag(); |
| 60 | if (tag.empty()) |
| 61 | { |
| 62 | for (size_t i = 1; ; ++i) |
| 63 | { |
| 64 | tag = stage->getName() + std::to_string(i); |
| 65 | tag = Utils::replaceAll(tag, ".", "_"); |
| 66 | if (!tagExists(tag)) |
| 67 | break; |
| 68 | } |
| 69 | } |
| 70 | return tag; |
| 71 | } |
| 72 | |
| 73 | void generateTags(Stage *stage, PipelineWriter::TagMap& tags) |
| 74 | { |
no test coverage detected