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.cc5
-rw-r--r--apt-private/private-list.cc4
-rw-r--r--debian/apt.cron.daily4
-rw-r--r--debian/changelog21
-rw-r--r--debian/control1
-rw-r--r--debian/tests/control2
-rw-r--r--debian/tests/run-tests7
-rwxr-xr-xtest/integration/test-bug-720597-build-dep-purge36
11 files changed, 98 insertions, 11 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 35d61f318..28309af07 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
@@ -222,6 +226,7 @@ bool addArgumentsAPT(std::vector<CommandLine::Args> &Args, char const * const Cm
{
addArg(0,"installed","APT::Cmd::Installed",0);
addArg(0,"upgradable","APT::Cmd::Upgradable",0);
+ addArg('v', "verbose", "APT::Cmd::List-Include-Summary", 0);
addArg('a', "all-versions", "APT::Cmd::All-Versions", 0);
}
else if (addArgumentsAPTGet(Args, Cmd) || addArgumentsAPTCache(Args, Cmd))
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc
index 680a9a535..a02ebf02d 100644
--- a/apt-private/private-list.cc
+++ b/apt-private/private-list.cc
@@ -132,6 +132,8 @@ bool List(CommandLine &Cmd)
std::map<std::string, std::string> output_map;
std::map<std::string, std::string>::const_iterator K;
+ bool includeSummary = _config->FindB("APT::Cmd::List-Include-Summary");
+
PackageNameMatcher matcher(patterns);
LocalitySortedVersionSet bag;
OpTextProgress progress;
@@ -149,7 +151,7 @@ bool List(CommandLine &Cmd)
output_map.insert(std::make_pair<std::string, std::string>(
V.ParentPkg().Name(), outs.str()));
} else {
- ListSingleVersion(CacheFile, records, V, outs, false);
+ ListSingleVersion(CacheFile, records, V, outs, includeSummary);
output_map.insert(std::make_pair<std::string, std::string>(
V.ParentPkg().Name(), outs.str()));
}
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..8359438d1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,24 @@
+apt (0.9.13.1) unstable; 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)
+ * merge mvo/feature/short-list
+
+ -- Michael Vogt <mvo@debian.org> Thu, 28 Nov 2013 20:02:39 +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()
diff --git a/debian/control b/debian/control
index 673fba477..84d6155a6 100644
--- a/debian/control
+++ b/debian/control
@@ -13,6 +13,7 @@ Build-Depends-Indep: doxygen, debiandoc-sgml
Build-Conflicts: autoconf2.13, automake1.4
Vcs-Git: git://anonscm.debian.org/apt/apt.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=apt/apt.git
+XS-Testsuite: autopkgtest
Package: apt
Architecture: any
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 000000000..e38921c7e
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: run-tests
+Depends: @, dpkg-dev, debhelper, libdb-dev, gettext, libcurl4-gnutls-dev, zlib1g-dev, libbz2-dev, xsltproc, docbook-xsl, docbook-xml, po4a, autotools-dev, autoconf, automake, doxygen, debiandoc-sgml, stunnel4 \ No newline at end of file
diff --git a/debian/tests/run-tests b/debian/tests/run-tests
new file mode 100644
index 000000000..6ea503568
--- /dev/null
+++ b/debian/tests/run-tests
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+make
+make test
+test/integration/run-tests
diff --git a/test/integration/test-bug-720597-build-dep-purge b/test/integration/test-bug-720597-build-dep-purge
new file mode 100755
index 000000000..1e24ed5f1
--- /dev/null
+++ b/test/integration/test-bug-720597-build-dep-purge
@@ -0,0 +1,36 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+insertinstalledpackage 'build-essential' 'all' '11.5' 'Multi-Arch: foreign'
+insertinstalledpackage 'pkga' 'all' '1'
+buildsimplenativepackage 'pkgb' 'amd64' '1' 'stable' 'Conflicts: pkga'
+buildsimplenativepackage 'pkgc' 'amd64' '1' 'stable' 'Build-Depends: pkgb'
+
+setupaptarchive
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ pkga
+The following NEW packages will be installed:
+ pkgb
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv pkga [1]
+Inst pkgb (1 stable [amd64])
+Conf pkgb (1 stable [amd64])' aptget build-dep pkgc -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ pkga*
+The following NEW packages will be installed:
+ pkgb
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Purg pkga [1]
+Inst pkgb (1 stable [amd64])
+Conf pkgb (1 stable [amd64])' aptget build-dep pkgc -s --purge