summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/debsystem.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-09-25 11:25:25 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-04 18:04:00 +0100
commitb49068c566d749130e023536d54588c948c16edf (patch)
tree9d4b0921040f2b529eda14c2d2cc209be0815d37 /apt-pkg/deb/debsystem.cc
parent05ef357e575e9c25eb6a35cb693d1eb19bb14d45 (diff)
provide public interface to hold/unhold packages
We had this code lying around in apt-mark for a while now, but other frontends need this (and similar) functionality as well, so its high time that we provide a public interface in libapt for this stuff.
Diffstat (limited to 'apt-pkg/deb/debsystem.cc')
-rw-r--r--apt-pkg/deb/debsystem.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc
index d6ef49a37..dcd115b50 100644
--- a/apt-pkg/deb/debsystem.cc
+++ b/apt-pkg/deb/debsystem.cc
@@ -302,7 +302,7 @@ void debSystem::DpkgChrootDirectory() /*{{{*/
_exit(100);
}
/*}}}*/
-static pid_t ExecDpkg(std::vector<std::string> const &sArgs, int * const inputFd, int * const outputFd, bool const showStderr)/*{{{*/
+pid_t debSystem::ExecDpkg(std::vector<std::string> const &sArgs, int * const inputFd, int * const outputFd, bool const DiscardOutput)/*{{{*/
{
std::vector<const char *> Args(sArgs.size(), NULL);
std::transform(sArgs.begin(), sArgs.end(), Args.begin(), [](std::string const &s) { return s.c_str(); });
@@ -333,7 +333,7 @@ static pid_t ExecDpkg(std::vector<std::string> const &sArgs, int * const inputFd
close(external[0]);
dup2(external[1], STDOUT_FILENO);
}
- if (showStderr == false)
+ if (DiscardOutput == true)
dup2(nullfd, STDERR_FILENO);
debSystem::DpkgChrootDirectory();
execvp(Args[0], (char**) &Args[0]);
@@ -357,7 +357,7 @@ bool debSystem::SupportsMultiArch() /*{{{*/
{
std::vector<std::string> Args = GetDpkgBaseCommand();
Args.push_back("--assert-multi-arch");
- pid_t const dpkgAssertMultiArch = ExecDpkg(Args, nullptr, nullptr, false);
+ pid_t const dpkgAssertMultiArch = ExecDpkg(Args, nullptr, nullptr, true);
if (dpkgAssertMultiArch > 0)
{
int Status = 0;
@@ -386,7 +386,7 @@ std::vector<std::string> debSystem::SupportedArchitectures() /*{{{*/
std::vector<std::string> sArgs = GetDpkgBaseCommand();
sArgs.push_back("--print-foreign-architectures");
int outputFd = -1;
- pid_t const dpkgMultiArch = ExecDpkg(sArgs, nullptr, &outputFd, false);
+ pid_t const dpkgMultiArch = ExecDpkg(sArgs, nullptr, &outputFd, true);
if (dpkgMultiArch == -1)
return archs;