summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/contrib/fileutl.cc26
-rw-r--r--apt-pkg/contrib/fileutl.h1
-rw-r--r--apt-pkg/deb/dpkgpm.cc2
-rw-r--r--apt-private/private-cmndline.cc4
-rw-r--r--debian/apt.cron.daily4
-rw-r--r--debian/changelog20
6 files changed, 47 insertions, 10 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index d2be276c7..3a6bdfe2e 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -760,16 +760,13 @@ bool WaitFd(int Fd,bool write,unsigned long timeout)
return true;
}
/*}}}*/
-// ExecFork - Magical fork that sanitizes the context before execing /*{{{*/
+// MergeKeepFdsFromConfiguration - Merge APT::Keep-Fds configuration /*{{{*/
// ---------------------------------------------------------------------
-/* This is used if you want to cleanse the environment for the forked
- child, it fixes up the important signals and nukes all of the fds,
- otherwise acts like normal fork. */
-pid_t ExecFork()
+/* This is used to merge the APT::Keep-Fds with the provided KeepFDs
+ * set.
+ */
+void MergeKeepFdsFromConfiguration(std::set<int> &KeepFDs)
{
- set<int> KeepFDs;
-
- // FIXME: remove looking at APT::Keep-Fds eventually, its a hack
Configuration::Item const *Opts = _config->Tree("APT::Keep-Fds");
if (Opts != 0 && Opts->Child != 0)
{
@@ -782,6 +779,19 @@ pid_t ExecFork()
KeepFDs.insert(fd);
}
}
+}
+ /*}}}*/
+// ExecFork - Magical fork that sanitizes the context before execing /*{{{*/
+// ---------------------------------------------------------------------
+/* This is used if you want to cleanse the environment for the forked
+ child, it fixes up the important signals and nukes all of the fds,
+ otherwise acts like normal fork. */
+pid_t ExecFork()
+{
+ set<int> KeepFDs;
+ // we need to merge the Keep-Fds as external tools like
+ // debconf-apt-progress use it
+ MergeKeepFdsFromConfiguration(KeepFDs);
return ExecFork(KeepFDs);
}
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h
index 63a999c30..e9a9aab28 100644
--- a/apt-pkg/contrib/fileutl.h
+++ b/apt-pkg/contrib/fileutl.h
@@ -184,6 +184,7 @@ void SetNonBlock(int Fd,bool Block);
bool WaitFd(int Fd,bool write = false,unsigned long timeout = 0);
pid_t ExecFork();
pid_t ExecFork(std::set<int> keep_fds);
+void MergeKeepFdsFromConfiguration(std::set<int> &keep_fds);
bool ExecWait(pid_t Pid,const char *Name,bool Reap = false);
// File string manipulators
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 26d79dbb1..01c6242dc 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -417,6 +417,7 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
// Create the pipes
std::set<int> KeepFDs;
+ MergeKeepFdsFromConfiguration(KeepFDs);
int Pipes[2];
if (pipe(Pipes) != 0)
return _error->Errno("pipe","Failed to create IPC pipe to subprocess");
@@ -1380,6 +1381,7 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress)
d->progress->StartDpkg();
std::set<int> KeepFDs;
KeepFDs.insert(fd[1]);
+ MergeKeepFdsFromConfiguration(KeepFDs);
pid_t Child = ExecFork(KeepFDs);
if (Child == 0)
{
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index b73227924..f4348c979 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -149,7 +149,11 @@ bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const * const
else if (CmdMatches("build-dep"))
{
addArg('a', "host-architecture", "APT::Get::Host-Architecture", 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)
+ // once sbuild is fixed, this option can be removed
+ addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0);
}
else if (CmdMatches("clean", "autoclean", "check", "download", "changelog") ||
CmdMatches("markauto", "unmarkauto")) // deprecated commands
diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily
index 3f9df9d7e..2616af1dd 100644
--- a/debian/apt.cron.daily
+++ b/debian/apt.cron.daily
@@ -197,11 +197,11 @@ check_size_constraints()
delta=$(($now-$ctime))
fi
if [ $delta -le $MinAge ]; then
- debug_echo "skip remove by archive size: $file, delta=$delta < $MinAgeSec"
+ debug_echo "skip remove by archive size: $file, delta=$delta < $MinAge"
break
else
# delete oldest file
- debug_echo "remove by archive size: $file, delta=$delta >= $MinAgeSec (sec), size=$size >= $MaxSize"
+ debug_echo "remove by archive size: $file, delta=$delta >= $MinAge (sec), size=$size >= $MaxSize"
rm -f $file
fi
fi
diff --git a/debian/changelog b/debian/changelog
index e6bdcb1fa..ca6bb4406 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,23 @@
+apt (0.9.13.1) UNRELEASED; urgency=low
+
+ [ Colin Watson ]
+ * fix "apt-get --purge build-dep" (closes: #720597)
+ * fix regression that APT::Keep-Fds is not honored (closes: #730490)
+
+ [ Michael Vogt ]
+ * add "-f" option to "build-dep" as sbuild is using it to fix
+ regression with cross-building (LP: #1255806)
+
+ -- Michael Vogt <mvo@debian.org> Thu, 28 Nov 2013 16:49:31 +0100
+
+apt (0.9.13) unstable; urgency=low
+
+ [ TJ Guthrie ]
+ * Changed MinAgeSec to MinAge in /etc/cron.daily/apt:200,204
+ LP: #1206047
+
+ -- Michael Vogt <mvo@debian.org> Sun, 24 Nov 2013 10:56:22 +0100
+
apt (0.9.13~exp1) experimental; urgency=low
* Improve the API for APT::Upgrade::Upgrade()