aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_update.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/commands_update.cpp')
-rw-r--r--toolsrc/src/commands_update.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp
index 5d531ef39..a42ae5341 100644
--- a/toolsrc/src/commands_update.cpp
+++ b/toolsrc/src/commands_update.cpp
@@ -1,11 +1,14 @@
+#include "pch.h"
#include "vcpkg_Commands.h"
-#include "vcpkg.h"
+#include "vcpkglib.h"
#include "vcpkg_System.h"
#include "vcpkg_Files.h"
+#include "Paragraphs.h"
+#include "vcpkg_info.h"
-namespace vcpkg
+namespace vcpkg::Commands::Update
{
- void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths)
+ void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths)
{
args.check_exact_arg_count(0);
System::println("Using local portfile versions. To update the local portfiles, use `git pull`.");
@@ -21,7 +24,7 @@ namespace vcpkg
const auto& path = begin_it->path();
try
{
- auto pghs = get_paragraphs(path / "CONTROL");
+ auto pghs = Paragraphs::get_paragraphs(path / "CONTROL");
if (pghs.empty())
continue;
auto srcpgh = SourceParagraph(pghs[0]);
@@ -35,7 +38,7 @@ namespace vcpkg
std::string packages_list;
std::vector<std::string> packages_output;
- for (auto&& pgh : database_load_check(paths))
+ for (auto&& pgh : status_db)
{
if (pgh->state == install_state_t::not_installed && pgh->want == want_t::purge)
continue;
@@ -69,20 +72,20 @@ namespace vcpkg
System::println("\nTo update these packages, run\n vcpkg remove --purge <pkgs>...\n vcpkg install <pkgs>...");
}
- auto version_file = Files::get_contents(paths.root / "toolsrc" / "VERSION.txt");
+ auto version_file = Files::read_contents(paths.root / "toolsrc" / "VERSION.txt");
if (auto version_contents = version_file.get())
{
int maj1, min1, rev1;
auto num1 = sscanf_s(version_contents->c_str(), "\"%d.%d.%d\"", &maj1, &min1, &rev1);
int maj2, min2, rev2;
- auto num2 = sscanf_s(version().c_str(), "%d.%d.%d-", &maj2, &min2, &rev2);
+ auto num2 = sscanf_s(Info::version().c_str(), "%d.%d.%d-", &maj2, &min2, &rev2);
if (num1 == 3 && num2 == 3)
{
if (maj1 != maj2 || min1 != min2 || rev1 != rev2)
{
- System::println("Different source is available for vcpkg (%d.%d.%d -> %d.%d.%d). Use scripts\\bootstrap.ps1 to update.",
+ System::println("Different source is available for vcpkg (%d.%d.%d -> %d.%d.%d). Use powershell -exec bypass scripts/bootstrap.ps1 to update.",
maj2, min2, rev2,
maj1, min1, rev1);
}