From be7eb047e1202971f84bb4ac27e796d85bebdce9 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Dec 2018 17:38:27 +0100 Subject: 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. --- apt-private/private-cmndline.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'apt-private') 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 &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 &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); -- cgit v1.2.3-70-g09d2