aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-04-04 13:07:54 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-04-04 13:07:54 -0700
commit44cd8f90b156eab59843e5f1622d578d5918151d (patch)
treee3ad0501abdab2909dfd04aa1cd6592835f4011a
parent2826c04976f6c8796775ff2bf196f88a761868ae (diff)
parenteb27d029f4e72d361134611bdc79d99f6f76b202 (diff)
downloadvcpkg-44cd8f90b156eab59843e5f1622d578d5918151d.tar.gz
vcpkg-44cd8f90b156eab59843e5f1622d578d5918151d.zip
Merge branch 'master' into HEAD
-rw-r--r--docs/example-3-patch-libpng.md4
-rw-r--r--toolsrc/src/commands_help.cpp5
-rw-r--r--toolsrc/src/commands_remove.cpp21
-rw-r--r--toolsrc/src/commands_update.cpp2
4 files changed, 19 insertions, 13 deletions
diff --git a/docs/example-3-patch-libpng.md b/docs/example-3-patch-libpng.md
index cc963cbfc..a47a2626a 100644
--- a/docs/example-3-patch-libpng.md
+++ b/docs/example-3-patch-libpng.md
@@ -160,10 +160,10 @@ vcpkg_configure_cmake(
### Verification
-To be completely sure this works from scratch, we need to purge the package:
+To be completely sure this works from scratch, we need to remove the package and rebuild it:
```
-PS D:\src\vcpkg> vcpkg remove --purge libpng:x86-uwp
+PS D:\src\vcpkg> vcpkg remove libpng:x86-uwp
Package libpng:x86-uwp was successfully removed
```
and delete the building directory: D:\src\vcpkg\buildtrees\libpng
diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/commands_help.cpp
index d73a8e8f6..f79cb0dce 100644
--- a/toolsrc/src/commands_help.cpp
+++ b/toolsrc/src/commands_help.cpp
@@ -19,10 +19,9 @@ namespace vcpkg::Commands::Help
System::println(
"Commands:\n"
" vcpkg search [pat] Search for packages available to be built\n"
- " vcpkg install <pkg> Install a package\n"
- " vcpkg remove <pkg> Uninstall a package. \n"
+ " vcpkg install <pkg>... Install a package\n"
+ " vcpkg remove <pkg>... Uninstall a package\n"
" vcpkg remove --outdated Uninstall all out-of-date packages\n"
- " vcpkg remove --purge <pkg> Uninstall and delete a package. \n"
" vcpkg list List installed packages\n"
" vcpkg update Display list of packages for updating\n"
" vcpkg hash <file> [alg] Hash a file by specific algorithm, default SHA512\n"
diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp
index 417689a15..3d89f6d90 100644
--- a/toolsrc/src/commands_remove.cpp
+++ b/toolsrc/src/commands_remove.cpp
@@ -13,11 +13,6 @@ namespace vcpkg::Commands::Remove
using Dependencies::request_type;
using Update::outdated_package;
- static const std::string OPTION_PURGE = "--purge";
- static const std::string OPTION_RECURSE = "--recurse";
- static const std::string OPTION_DRY_RUN = "--dry-run";
- static const std::string OPTION_OUTDATED = "--outdated";
-
static void delete_directory(const fs::path& directory)
{
std::error_code ec;
@@ -169,8 +164,13 @@ namespace vcpkg::Commands::Remove
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_triplet)
{
+ static const std::string OPTION_PURGE = "--purge";
+ static const std::string OPTION_NO_PURGE = "--no-purge";
+ static const std::string OPTION_RECURSE = "--recurse";
+ static const std::string OPTION_DRY_RUN = "--dry-run";
+ static const std::string OPTION_OUTDATED = "--outdated";
static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost");
- const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({ OPTION_PURGE, OPTION_RECURSE, OPTION_DRY_RUN, OPTION_OUTDATED });
+ const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({ OPTION_PURGE, OPTION_NO_PURGE, OPTION_RECURSE, OPTION_DRY_RUN, OPTION_OUTDATED });
StatusParagraphs status_db = database_load_check(paths);
std::vector<package_spec> specs;
@@ -187,7 +187,14 @@ namespace vcpkg::Commands::Remove
Input::check_triplet(spec.target_triplet(), paths);
}
- const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.cend();
+ const bool alsoRemoveFolderFromPackages = options.find(OPTION_NO_PURGE) == options.end();
+ if (options.find(OPTION_PURGE) != options.end() && !alsoRemoveFolderFromPackages)
+ {
+ // User specified --purge and --no-purge
+ System::println(System::color::error, "Error: cannot specify both --no-purge and --purge.");
+ System::print(example);
+ Checks::exit_fail(VCPKG_LINE_INFO);
+ }
const bool isRecursive = options.find(OPTION_RECURSE) != options.cend();
const bool dryRun = options.find(OPTION_DRY_RUN) != options.cend();
diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp
index 08c3cf1bf..14bfaee98 100644
--- a/toolsrc/src/commands_update.cpp
+++ b/toolsrc/src/commands_update.cpp
@@ -60,7 +60,7 @@ namespace vcpkg::Commands::Update
}
System::println("\n"
"To update these packages, run\n"
- " vcpkg remove --purge --outdated\n"
+ " vcpkg remove --outdated\n"
" vcpkg install <pkgs>...");
}