From: David Kalnischkies Date: Sun, 1 Dec 2013 20:52:36 +0000 (+0100) Subject: query an empty pkgAcqIndexDiffs if index is up-to-date X-Git-Tag: 0.9.14.3.exp1~3^2~2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/5e1ed0889d8aac82ca18add8c6139b153225ae71 query an empty pkgAcqIndexDiffs if index is up-to-date The previous code already did this, this is just being a hell of a lot more obvious, so that it isn't that easy to break in the future. Git-Dch: Ignore --- diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index b76921312..009531c2e 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -426,16 +426,18 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) /*{{{*/ SHA1.AddFD(fd); string const local_sha1 = SHA1.Result(); - if(local_sha1 == ServerSha1) + if(local_sha1 == ServerSha1) { - // we have the same sha1 as the server + // we have the same sha1 as the server so we are done here if(Debug) std::clog << "Package file is up-to-date" << std::endl; - // set found to true, this will queue a pkgAcqIndexDiffs with - // a empty availabe_patches - found = true; - } - else + // list cleanup needs to know that this file as well as the already + // present index is ours, so we create an empty diff to save it for us + new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc, + ExpectedHash, ServerSha1, available_patches); + return true; + } + else { if(Debug) std::clog << "SHA1-Current: " << ServerSha1 << " and we start at "<< fd.Name() << " " << fd.Size() << " " << local_sha1 << std::endl;