summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2018-12-11 17:38:27 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2019-01-10 10:38:59 +0100
commitbe7eb047e1202971f84bb4ac27e796d85bebdce9 (patch)
tree7c754a5a0f4cfd4b50352988b97ca09fcb54ce14 /apt-private
parent29626ddaf19284855ba3244cff28612cbc1e2b84 (diff)
apt-mark: Introduce minimize-manual
This visits dependencies of all manually installed metapackages, as determined by APT::Never-MarkAuto-Sections, and marks them as automatically installed. It can be used to clean up autoflags after a d-i install, for example.
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-cmndline.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index 101e0ae40..87deb6bf0 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -287,7 +287,7 @@ static bool addArgumentsAPTMark(std::vector<CommandLine::Args> &Args, char const
{
if (CmdMatches("auto", "manual", "hold", "unhold", "showauto",
"showmanual", "showhold", "showholds",
- "markauto", "unmarkauto"))
+ "markauto", "unmarkauto", "minimize-manual"))
{
addArg('f',"file","Dir::State::extended_states",CommandLine::HasArg);
}
@@ -303,7 +303,14 @@ static bool addArgumentsAPTMark(std::vector<CommandLine::Args> &Args, char const
addArg('v',"verbose","APT::MarkAuto::Verbose",0);
}
- if (Cmd != nullptr && strncmp(Cmd, "show", strlen("show")) != 0)
+ if (CmdMatches("minimize-manual"))
+ {
+ addArg('y',"yes","APT::Get::Assume-Yes",0);
+ addArg('y',"assume-yes","APT::Get::Assume-Yes",0);
+ addArg(0,"assume-no","APT::Get::Assume-No",0);
+ }
+
+ if (CmdMatches("minimize-manual") || (Cmd != nullptr && strncmp(Cmd, "show", strlen("show")) != 0))
{
addArg('s',"simulate","APT::Mark::Simulate",0);
addArg('s',"just-print","APT::Mark::Simulate",0);