From ce7f128c020e1347f91c6074238fc5da58c5df71 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 25 Feb 2014 14:26:18 +0100 Subject: support DEB_BUILD_PROFILES and -P for build profiles Inspired by the rest of the patch in 661537, but abstract the parsing of various ways of setting the build profiles more so it can potentially be reused and all apt parts have the same behaviour. Especially config options, cmdline options and environment will not be combined as proposed as this isn't APTs usual behaviour and dpkg doesn't do it either, so one overrides the other as it normally does. --- apt-private/private-cmndline.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apt-private/private-cmndline.cc') diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index ef7d65f3c..b99443210 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -141,6 +141,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const { addArg('b', "compile", "APT::Get::Compile", 0); addArg('b', "build", "APT::Get::Compile", 0); + addArg('P', "build-profiles", "APT::Build-Profiles", CommandLine::HasArg); addArg(0, "diff-only", "APT::Get::Diff-Only", 0); addArg(0, "debian-only", "APT::Get::Diff-Only", 0); addArg(0, "tar-only", "APT::Get::Tar-Only", 0); @@ -149,6 +150,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const else if (CmdMatches("build-dep")) { addArg('a', "host-architecture", "APT::Get::Host-Architecture", CommandLine::HasArg); + addArg('P', "build-profiles", "APT::Build-Profiles", CommandLine::HasArg); addArg(0, "purge", "APT::Get::Purge", 0); addArg(0, "solver", "APT::Solver", CommandLine::HasArg); // this has no effect *but* sbuild is using it (see LP: #1255806) -- cgit v1.2.3 From c3ccac9232c2684b15f75fa8622a9a290aeca123 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 27 Feb 2014 03:11:54 +0100 Subject: warning: no previous declaration for foobar() [-Wmissing-declarations] Git-Dch: Ignore Reported-By: gcc -Wmissing-declarations --- apt-private/private-cmndline.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'apt-private/private-cmndline.cc') diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index b99443210..132da04d5 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -14,7 +14,7 @@ #include /*}}}*/ -bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/ +static bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/ { va_list args; bool found = false; @@ -33,7 +33,7 @@ bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/ /*}}}*/ #define addArg(w,x,y,z) Args.push_back(CommandLine::MakeArgs(w,x,y,z)) #define CmdMatches(...) strcmp_match_in_list(Cmd, __VA_ARGS__, NULL) -bool addArgumentsAPTCache(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTCache(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("depends", "rdepends", "xvcg", "dotty")) { @@ -82,7 +82,7 @@ bool addArgumentsAPTCache(std::vector &Args, char const * con return true; } /*}}}*/ -bool addArgumentsAPTCDROM(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTCDROM(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("add", "ident") == false) return false; @@ -100,7 +100,7 @@ bool addArgumentsAPTCDROM(std::vector &Args, char const * con return true; } /*}}}*/ -bool addArgumentsAPTConfig(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTConfig(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("dump")) { @@ -115,7 +115,7 @@ bool addArgumentsAPTConfig(std::vector &Args, char const * co return true; } /*}}}*/ -bool addArgumentsAPTGet(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTGet(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", "dselect-upgrade", "autoremove")) @@ -202,7 +202,7 @@ bool addArgumentsAPTGet(std::vector &Args, char const * const return true; } /*}}}*/ -bool addArgumentsAPTMark(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPTMark(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("auto", "manual", "hold", "unhold", "showauto", "showmanual", "showhold", "showholds", "install", @@ -222,7 +222,7 @@ bool addArgumentsAPTMark(std::vector &Args, char const * cons return true; } /*}}}*/ -bool addArgumentsAPT(std::vector &Args, char const * const Cmd)/*{{{*/ +static bool addArgumentsAPT(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("list")) { -- cgit v1.2.3 From 453b82a388013e522b3a1b9fcd6ed0810dab1f4f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 5 Mar 2014 22:11:25 +0100 Subject: cleanup headers and especially #includes everywhere Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use) --- apt-private/private-cmndline.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'apt-private/private-cmndline.cc') diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 132da04d5..2b2a35637 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -2,15 +2,13 @@ #include #include -#include -#include +#include +#include #include #include -#include "private-cmndline.h" - #include /*}}}*/ -- cgit v1.2.3 From a02db58fd50ef7fc2f0284852c6b3f98e458a232 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 6 Mar 2014 00:33:10 +0100 Subject: follow method attribute suggestions by gcc Git-Dch: Ignore Reported-By: gcc -Wsuggest-attribute={pure,const,noreturn} --- apt-private/private-cmndline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-private/private-cmndline.cc') diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 2b2a35637..682be0a19 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -12,7 +12,7 @@ #include /*}}}*/ -static bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/ +APT_SENTINEL static bool strcmp_match_in_list(char const * const Cmd, ...) /*{{{*/ { va_list args; bool found = false; -- cgit v1.2.3 From ebe24b7ad56550f21f467b86ceab7f7209a876f6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 16 Apr 2014 22:47:25 +0200 Subject: support dist-upgrade options in full-upgrade dist-upgrade is supposed to be an alias for full-upgrade in apt, but dist-upgrade was the only command recognized of the two in the option and flags recognition code. --- apt-private/private-cmndline.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-private/private-cmndline.cc') diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 682be0a19..a21a9dc8c 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -116,7 +116,7 @@ static bool addArgumentsAPTConfig(std::vector &Args, char con static bool addArgumentsAPTGet(std::vector &Args, char const * const Cmd)/*{{{*/ { if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", - "dselect-upgrade", "autoremove")) + "dselect-upgrade", "autoremove", "full-upgrade")) { addArg(0, "show-progress", "DpkgPM::Progress", 0); addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0); @@ -163,7 +163,7 @@ static bool addArgumentsAPTGet(std::vector &Args, char const if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", "deselect-upgrade", "autoremove", "clean", "autoclean", "check", - "build-dep")) + "build-dep", "full-upgrade")) { addArg('s', "simulate", "APT::Get::Simulate", 0); addArg('s', "just-print", "APT::Get::Simulate", 0); -- cgit v1.2.3