From 64e3414e00906e6eaa72d7b63ca76d1c59ecadf6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 25 Sep 2015 19:58:43 +0200 Subject: allow all dpkg selections to be set via apt-mark and libapt As we have support for 'hold', we need support for undoing a hold which in effect means that we implemented most other states as well, just that they weren't exposed in the interface directly so far. --- apt-private/private-cmndline.cc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'apt-private/private-cmndline.cc') diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 7190fe50b..5d6fd3c2e 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -227,19 +227,31 @@ static bool addArgumentsAPTGet(std::vector &Args, char const static bool addArgumentsAPTMark(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("auto", "manual", "hold", "unhold", "showauto", - "showmanual", "showhold", "showholds", "install", + "showmanual", "showhold", "showholds", "markauto", "unmarkauto")) + { + addArg('f',"file","Dir::State::extended_states",CommandLine::HasArg); + } + else if (CmdMatches("install", "remove", "deinstall", "purge", + "showinstall", "showinstalls", "showremove", "showremoves", + "showdeinstall", "showdeinstalls", "showpurge", "showpurges")) ; else return false; - addArg('v',"verbose","APT::MarkAuto::Verbose",0); - addArg('s',"simulate","APT::Mark::Simulate",0); - addArg('s',"just-print","APT::Mark::Simulate",0); - addArg('s',"recon","APT::Mark::Simulate",0); - addArg('s',"dry-run","APT::Mark::Simulate",0); - addArg('s',"no-act","APT::Mark::Simulate",0); - addArg('f',"file","Dir::State::extended_states",CommandLine::HasArg); + if (CmdMatches("markauto", "unmarkauto")) + { + addArg('v',"verbose","APT::MarkAuto::Verbose",0); + } + + if (strncmp(Cmd, "show", strlen("show")) != 0) + { + addArg('s',"simulate","APT::Mark::Simulate",0); + addArg('s',"just-print","APT::Mark::Simulate",0); + addArg('s',"recon","APT::Mark::Simulate",0); + addArg('s',"dry-run","APT::Mark::Simulate",0); + addArg('s',"no-act","APT::Mark::Simulate",0); + } return true; } -- cgit v1.2.3