diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2013-05-08 17:48:31 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2013-05-08 17:48:31 +0200 |
commit | 597341fe0f0a87c3888a62ce02631db8b25aeb4b (patch) | |
tree | 6565f0a8cca0cd8fe7be4bb4149edfbfb62c7ce2 | |
parent | b5595da902e62af7c295f1603ae5b43ba4cef281 (diff) | |
parent | dec5b117052b77e4366efd8234e0cec09989b700 (diff) | |
download | apt-597341fe0f0a87c3888a62ce02631db8b25aeb4b.tar.gz |
merged from the debian-wheezy branch
-rw-r--r-- | apt-pkg/acquire-worker.cc | 13 | ||||
-rw-r--r-- | apt-pkg/algorithms.cc | 5 | ||||
-rw-r--r-- | debian/changelog | 16 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | methods/https.cc | 7 |
5 files changed, 34 insertions, 9 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 9d90b08b..44a84216 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -305,7 +305,15 @@ bool pkgAcquire::Worker::RunMessages() OwnerQ->ItemDone(Itm); unsigned long long const ServerSize = strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10); - if (TotalSize != 0 && ServerSize != TotalSize) + bool isHit = StringToBool(LookupTag(Message,"IMS-Hit"),false) || + StringToBool(LookupTag(Message,"Alt-IMS-Hit"),false); + // Using the https method the server might return 200, but the + // If-Modified-Since condition is not satsified, libcurl will + // discard the download. In this case, however, TotalSize will be + // set to the actual size of the file, while ServerSize will be set + // to 0. Therefore, if the item is marked as a hit and the + // downloaded size (ServerSize) is 0, we ignore TotalSize. + if (TotalSize != 0 && (!isHit || ServerSize != 0) && ServerSize != TotalSize) _error->Warning("Size of file %s is not what the server reported %s %llu", Owner->DestFile.c_str(), LookupTag(Message,"Size","0").c_str(),TotalSize); @@ -332,8 +340,7 @@ bool pkgAcquire::Worker::RunMessages() // Log that we are done if (Log != 0) { - if (StringToBool(LookupTag(Message,"IMS-Hit"),false) == true || - StringToBool(LookupTag(Message,"Alt-IMS-Hit"),false) == true) + if (isHit) { /* Hide 'hits' for local only sources - we also manage to hide gets */ diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 7fcd9f0d..6cde4d6c 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -648,7 +648,10 @@ void pkgProblemResolver::MakeScores() D->Type != pkgCache::Dep::Recommends)) continue; - Scores[I->ID] += abs(OldScores[D.ParentPkg()->ID]); + // Do not propagate negative scores otherwise + // an extra (-2) package might score better than an optional (-1) + if (OldScores[D.ParentPkg()->ID] > 0) + Scores[I->ID] += OldScores[D.ParentPkg()->ID]; } } diff --git a/debian/changelog b/debian/changelog index 7944d76e..182596b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,15 @@ -apt (0.9.7.9~exp3) experimental; urgency=low +apt (0.9.8) UNRELEASED; urgency=low + [ Ludovico Cavedon ] + * properly handle if-modfied-since with libcurl/https + (closes: #705648) + + [ Andreas Beckman ] + * apt-pkg/algorithms.cc: + - Do not propagate negative scores from rdepends. Propagating the absolute + value of a negative score may boost obsolete packages and keep them + installed instead of installing their successors. (Closes: #699759) + [ Michael Vogt ] * apt-pkg/sourcelist.cc: - fix segfault when a hostname contains a [, thanks to @@ -39,8 +49,8 @@ apt (0.9.7.9~exp3) experimental; urgency=low [ Manpages translations ] * French translation completed (Christian Perrier) - - -- Michael Vogt <mvo@debian.org> Mon, 08 Apr 2013 17:09:00 +0200 + + -- Michael Vogt <mvo@debian.org> Mon, 08 Apr 2013 08:43:21 +0200 apt (0.9.7.9~exp2) experimental; urgency=low diff --git a/debian/control b/debian/control index 49647340..6507f6d6 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Uploaders: Michael Vogt <mvo@debian.org>, Otavio Salvador <otavio@debian.org>, Julian Andres Klode <jak@debian.org> Standards-Version: 3.9.3 Build-Depends: dpkg-dev (>= 1.15.8), debhelper (>= 8.1.3~), libdb-dev, - gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.0), + gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.4~), zlib1g-dev, libbz2-dev, xsltproc, docbook-xsl, docbook-xml, po4a (>= 0.34-2), autotools-dev, autoconf, automake Build-Depends-Indep: doxygen, debiandoc-sgml diff --git a/methods/https.cc b/methods/https.cc index 11d4ba8a..b44642ab 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -285,6 +285,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm) long curl_servdate; curl_easy_getinfo(curl, CURLINFO_FILETIME, &curl_servdate); + // If the server returns 200 OK but the If-Modified-Since condition is not + // met, CURLINFO_CONDITION_UNMET will be set to 1 + long curl_condition_unmet = 0; + curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &curl_condition_unmet); + File->Close(); // cleanup @@ -312,7 +317,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm) Res.Filename = File->Name(); Res.LastModified = Buf.st_mtime; Res.IMSHit = false; - if (curl_responsecode == 304) + if (curl_responsecode == 304 || curl_condition_unmet) { unlink(File->Name().c_str()); Res.IMSHit = true; |