summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire.cc4
-rw-r--r--debian/changelog7
-rw-r--r--methods/mirror.cc18
3 files changed, 26 insertions, 3 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 34e2f5aac..8c00748b2 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 000459c5c..3c40d13c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-apt (0.8.16~exp5) experimental; urgency=low
+apt (0.8.16~exp5) UNRELEASEDexperimental; urgency=low
* merged the latest debian-sid fixes
* apt-pkg/makefile:
@@ -11,6 +11,11 @@ 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
+ * methods/mirror.cc:
+ - include the architecture(s) in the query string as well so
+ that the server can make better decisions
-- Michael Vogt <mvo@debian.org> Fri, 05 Aug 2011 10:57:08 +0200
diff --git a/methods/mirror.cc b/methods/mirror.cc
index cb24a06cf..a3e60ab15 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -8,6 +8,7 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/acquire-item.h>
@@ -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<std::string> vec = APT::Configuration::getArchitectures();
+ for (std::vector<std::string>::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 << "'"