From c033d41504957ed04d64ec72e7f47dfac64218b5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 9 Aug 2011 14:50:20 +0200 Subject: * apt-pkg/acquire.cc: - fix potential divide-by-zero --- apt-pkg/acquire.cc | 4 +++- debian/changelog | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 2064abc50..06b0f11f8 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -849,7 +849,9 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner) char msg[200]; long i = CurrentItems < TotalItems ? CurrentItems + 1 : CurrentItems; - unsigned long long const ETA = (TotalBytes - CurrentBytes) / CurrentCPS; + unsigned long long ETA = 0; + if(CurrentCPS > 0) + ETA = (TotalBytes - CurrentBytes) / CurrentCPS; // only show the ETA if it makes sense if (ETA > 0 && ETA < 172800 /* two days */ ) diff --git a/debian/changelog b/debian/changelog index 8719776e0..db80c14ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ apt (0.8.16~exp5) experimental; urgency=low * apt-pkg/acquire-item.{cc,h}: - do not check for a "Package" tag in optional index targets like the translations index + * apt-pkg/acquire.cc: + - fix potential divide-by-zero -- Michael Vogt Fri, 05 Aug 2011 10:57:08 +0200 -- cgit v1.2.3 From ae54c5356b2d0d9776528d1eeb773c57f5b82ef4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 11 Aug 2011 16:30:17 +0200 Subject: * methods/mirror.cc: - include the architecture(s) in the query string as well so that the server can make better decisions --- debian/changelog | 3 +++ methods/mirror.cc | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index db80c14ef..3d9bdb31f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,9 @@ apt (0.8.16~exp5) experimental; urgency=low like the translations index * apt-pkg/acquire.cc: - fix potential divide-by-zero + * methods/mirror.cc: + - include the architecture(s) in the query string as well so + that the server can make better decisions -- Michael Vogt Fri, 05 Aug 2011 10:57:08 +0200 diff --git a/methods/mirror.cc b/methods/mirror.cc index 713dc211a..7f28c04cb 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -8,6 +8,7 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include #include #include #include @@ -134,9 +135,24 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str) string fetch = BaseUri; fetch.replace(0,strlen("mirror://"),"http://"); +#if 0 // no need for this, the getArchitectures() will also include the main + // arch + // append main architecture + fetch += "?arch=" + _config->Find("Apt::Architecture"); +#endif + + // append all architectures + std::vector vec = APT::Configuration::getArchitectures(); + for (std::vector::const_iterator I = vec.begin(); + I != vec.end(); I++) + if (I == vec.begin()) + fetch += "?arch" + (*I); + else + fetch += "&arch=" + (*I); + // append the dist as a query string if (Dist != "") - fetch += "?dist=" + Dist; + fetch += "&dist=" + Dist; if(Debug) clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'" -- cgit v1.2.3 From abcbf0af368cdda142b5d7cc03f793cfbdf23028 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 12 Aug 2011 09:56:14 +0200 Subject: test/integration/Packages-hashsum-verification: commit the forgotten packages file --- test/integration/Packages-hashsum-verification | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/integration/Packages-hashsum-verification diff --git a/test/integration/Packages-hashsum-verification b/test/integration/Packages-hashsum-verification new file mode 100644 index 000000000..29a385f4f --- /dev/null +++ b/test/integration/Packages-hashsum-verification @@ -0,0 +1,18 @@ +Package: apt +Version: 0.7.25.3 +Architecture: i386 +Maintainer: APT Development Team +Installed-Size: 5244 +Replaces: libapt-pkg-dev (<< 0.3.7), libapt-pkg-doc (<< 0.3.7) +Provides: libapt-pkg-libc6.9-6-4.8 +Suggests: aptitude | synaptic | wajig, dpkg-dev, apt-doc, bzip2, lzma, python-apt +Filename: apt.deb +Size: 0 +MD5sum: d41d8cd98f00b204e9800998ecf8427e +Description: Advanced front-end for dpkg + This is Debian's next generation front-end for the dpkg package manager. + It provides the apt-get utility and APT dselect method that provides a + simpler, safer way to install and upgrade packages. + . + APT features complete installation ordering, multiple source capability + and several other unique features, see the Users Guide in apt-doc. -- cgit v1.2.3