Merge remote-tracking branch 'mvo/debian/sid' into debian/sid
authorMichael Vogt <mvo@debian.org>
Fri, 29 Nov 2013 12:39:45 +0000 (13:39 +0100)
committerMichael Vogt <mvo@debian.org>
Fri, 29 Nov 2013 12:39:45 +0000 (13:39 +0100)
Conflicts:
apt-private/private-cmndline.cc

apt-pkg/contrib/fileutl.cc
apt-pkg/contrib/fileutl.h
apt-pkg/deb/dpkgpm.cc
apt-private/private-cmndline.cc
apt-private/private-list.cc
debian/apt.cron.daily
debian/changelog
debian/control
debian/tests/control [new file with mode: 0644]
debian/tests/run-tests [new file with mode: 0644]
test/integration/test-bug-720597-build-dep-purge [new file with mode: 0755]

index d2be276c71a6eeaa9969b038e024fab573349fd7..3a6bdfe2ec431b6872ef3a45cb2c5e41c130e2b1 100644 (file)
@@ -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);
 }
 
index 63a999c30abd798e25ca19b091c2ad826954be20..e9a9aab28018b35c792f87e7af0061db4c581d25 100644 (file)
@@ -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
index 26d79dbb11b281ca64aed4c33d87e55b397da781..01c6242dcdfd0afdb900fb6944f25f0252570c92 100644 (file)
@@ -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)
       {
index 35d61f318ed2f0c3405b66de6cdfcb1b62532f78..28309af07304c515250d26ef32902023b5ab73f3 100644 (file)
@@ -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))
index 680a9a53515f38931a62d3e55c45d05f27b1b8b3..a02ebf02d091676e8d5c601a6b5cdc9133c9793c 100644 (file)
@@ -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()));
       }
index 3f9df9d7e4b3056f57c1d82ee6417023d75606e6..2616af1dd17fce4b2d94ca0e0d7e3f27726c8ba1 100644 (file)
@@ -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
index e6bdcb1fa7fefc934aa89dfd48b1de17bd6878b8..8359438d1a25b4fcb198f94098fa18a2d93eb9db 100644 (file)
@@ -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()
index 673fba47732a2512811e0bfd8f3faaa9d19decbb..84d6155a6c0b8de25577203a38219325331d3c81 100644 (file)
@@ -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 (file)
index 0000000..e38921c
--- /dev/null
@@ -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 (file)
index 0000000..6ea5035
--- /dev/null
@@ -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 (executable)
index 0000000..1e24ed5
--- /dev/null
@@ -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