aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-03-27 13:23:30 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-03-27 17:54:16 -0700
commitc814c9b8ac883aa42930e1f48660145fd4234fe6 (patch)
tree64df184079990b497554c697c482de400bbe1008 /toolsrc/src
parent45d31162c25e168c46d9dd0f3f00e49edf625f21 (diff)
downloadvcpkg-c814c9b8ac883aa42930e1f48660145fd4234fe6.tar.gz
vcpkg-c814c9b8ac883aa42930e1f48660145fd4234fe6.zip
[vcpkgTools.xml] Restructre os-specific info
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg/vcpkgpaths.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp
index 9b331d7fc..feacda026 100644
--- a/toolsrc/src/vcpkg/vcpkgpaths.cpp
+++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp
@@ -46,9 +46,9 @@ namespace vcpkg
#if defined(_WIN32)
static constexpr StringLiteral OS_STRING = "";
#elif defined(__APPLE__)
- static constexpr StringLiteral OS_STRING = " os=\"osx\"";
+ static constexpr StringLiteral OS_STRING = R"(os="osx")";
#else // assume linux
- static constexpr StringLiteral OS_STRING = " os=\"linux\"";
+ static constexpr StringLiteral OS_STRING = R"(os="linux")";
#endif
static const fs::path XML_PATH = paths.scripts / "vcpkgTools.xml";
@@ -72,15 +72,15 @@ namespace vcpkg
};
static const std::string XML = paths.get_filesystem().read_contents(XML_PATH).value_or_exit(VCPKG_LINE_INFO);
- static const std::regex VERSION_REGEX{
- Strings::format(R"###(<requiredVersion>([\s\S]*?)</requiredVersion>)###", tool)};
+ static const std::regex VERSION_REGEX{R"###(<requiredVersion>([\s\S]*?)</requiredVersion>)###"};
static const std::regex EXE_RELATIVE_PATH_REGEX{
- Strings::format(R"###(<exeRelativePath%s>([\s\S]*?)</exeRelativePath>)###", OS_STRING)};
+ Strings::format(R"###(<exeRelativePath>([\s\S]*?)</exeRelativePath>)###")};
static const std::regex ARCHIVE_RELATIVE_PATH_REGEX{
- Strings::format(R"###(<archiveRelativePath%s>([\s\S]*?)</archiveRelativePath>)###", OS_STRING)};
- static const std::regex URL_REGEX{Strings::format(R"###(<url%s>([\s\S]*?)</url>)###", OS_STRING)};
+ Strings::format(R"###(<archiveRelativePath>([\s\S]*?)</archiveRelativePath>)###")};
+ static const std::regex URL_REGEX{Strings::format(R"###(<url>([\s\S]*?)</url>)###")};
- const std::regex tool_regex{Strings::format(R"###(<tool[\s]+name="%s">([\s\S]*?)</tool>)###", tool)};
+ const std::regex tool_regex{
+ Strings::format(R"###(<tool[\s]+name="%s"[\s]+%s>([\s\S]*?)</tool>)###", tool, OS_STRING)};
std::smatch match_tool;
const bool has_match_tool = std::regex_search(XML.cbegin(), XML.cend(), match_tool, tool_regex);