From: Michael Vogt Date: Fri, 29 Jul 2011 13:45:06 +0000 (+0200) Subject: merged from debian-sid X-Git-Tag: 0.8.15.6~5^2~1 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/194fac6be95e698d8eec86ddf19ebc1e7ca6d5c7?ds=inline;hp=-c merged from debian-sid --- 194fac6be95e698d8eec86ddf19ebc1e7ca6d5c7 diff --combined apt-pkg/pkgcachegen.cc index ebcbfdd25,8f9737e26..efd764b51 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@@ -105,9 -105,6 +105,9 @@@ void pkgCacheGenerator::ReMap(void cons if (oldMap == newMap) return; + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "Remaping from " << oldMap << " to " << newMap << std::endl; + Cache.ReMap(false); CurrentFile += (pkgCache::PackageFile*) newMap - (pkgCache::PackageFile*) oldMap; @@@ -687,7 -684,7 +687,7 @@@ bool pkgCacheGenerator::NewDepends(pkgC string const &Version, unsigned int const &Op, unsigned int const &Type, - map_ptrloc *OldDepLast) + map_ptrloc* &OldDepLast) { void const * const oldMap = Map.Data(); // Get a structure @@@ -918,11 -915,8 +918,11 @@@ unsigned long pkgCacheGenerator::WriteU /* This just verifies that each file in the list of index files exists, has matching attributes with the cache and the cache does not have any extra files. */ -static bool CheckValidity(const string &CacheFile, FileIterator Start, - FileIterator End,MMap **OutMap = 0) +static bool CheckValidity(const string &CacheFile, + pkgSourceList &List, + FileIterator Start, + FileIterator End, + MMap **OutMap = 0) { bool const Debug = _config->FindB("Debug::pkgCacheGen", false); // No file, certainly invalid @@@ -933,13 -927,6 +933,13 @@@ return false; } + if (List.GetLastModifiedTime() < GetModificationTime(CacheFile)) + { + if (Debug == true) + std::clog << "sources.list is newer than the cache" << std::endl; + return false; + } + // Map it FileFd CacheF(CacheFile,FileFd::ReadOnly); SPtr Map = new MMap(CacheF,0); @@@ -1165,7 -1152,7 +1165,7 @@@ bool pkgCacheGenerator::MakeStatusCache Progress->OverallProgress(0,1,1,_("Reading package lists")); // Cache is OK, Fin. - if (CheckValidity(CacheFile,Files.begin(),Files.end(),OutMap) == true) + if (CheckValidity(CacheFile, List, Files.begin(),Files.end(),OutMap) == true) { if (Progress != NULL) Progress->OverallProgress(1,1,1,_("Reading package lists")); @@@ -1182,16 -1169,32 +1182,32 @@@ SPtr Map; if (Writeable == true && CacheFile.empty() == false) { + _error->PushToStack(); unlink(CacheFile.c_str()); CacheF = new FileFd(CacheFile,FileFd::WriteAtomic); fchmod(CacheF->Fd(),0644); Map = CreateDynamicMMap(CacheF, MMap::Public); if (_error->PendingError() == true) - return false; - if (Debug == true) + { + delete CacheF.UnGuard(); + delete Map.UnGuard(); + if (Debug == true) + std::clog << "Open filebased MMap FAILED" << std::endl; + Writeable = false; + if (AllowMem == false) + { + _error->MergeWithStack(); + return false; + } + _error->RevertToStack(); + } + else if (Debug == true) + { + _error->MergeWithStack(); std::clog << "Open filebased MMap" << std::endl; + } } - else + if (Writeable == false || CacheFile.empty() == true) { // Just build it in memory.. Map = CreateDynamicMMap(NULL); @@@ -1202,7 -1205,7 +1218,7 @@@ // Lets try the source cache. unsigned long CurrentSize = 0; unsigned long TotalSize = 0; - if (CheckValidity(SrcCacheFile,Files.begin(), + if (CheckValidity(SrcCacheFile, List, Files.begin(), Files.begin()+EndOfSource) == true) { if (Debug == true) diff --combined debian/changelog index a8c757233,8797117a7..e17b1abd0 --- a/debian/changelog +++ b/debian/changelog @@@ -1,29 -1,82 +1,98 @@@ - apt (0.8.15.2) unstable; urgency=high ++apt (0.8.15.6) unstable; urgency=low + - * fix from David Kalnischkies for the InRelease gpg verification - code (LP: #784473) - * cmdline/apt-get.cc: - - fix missing download progress in apt-get download - * apt-pkg/contrib/cdromutl.cc: - - fix escape problem when looking for the mounted devices - * apt-pkg/contrib/strutl.{h,cc}, test/libapt/strutil_test.cc: - - add new DeEscapeString() similar to DeQuoteString but - unescape character escapes like \0XX and \xXX (plus added - test) + * apt-pkg/contrib/fileutl.{cc,h}: + - add GetModificationTime() helper + * apt-pkg/pkgcachegen.cc: + - regenerate the cache if the sources.list changes to ensure + that changes in the ordering there will be honored by apt + * apt-pkg/sourcelist.{cc,h}: + - add pkgSourceList::GetLastModifiedTime() helper + * apt-pkg/pkgcachegen.{cc,h}: + - use ref-to-ptr semantic in NewDepends() to ensure that the + libapt does not segfault if the cache is remapped in between + (LP: #812862) + + -- Michael Vogt Tue, 12 Jul 2011 11:54:47 +0200 + + apt (0.8.15.5) unstable; urgency=low + + [ David Kalnischkies ] + * apt-pkg/deb/deblistparser.cc: + - do not assume that the last char on a line is a \n (Closes: #633350) + + -- Michael Vogt Thu, 28 Jul 2011 16:49:15 +0200 + + apt (0.8.15.4) unstable; urgency=low + + [ David Miller ] + * apt-pkg/contrib/sha1.cc: + - fix illegally casts of on-stack buffer to a type requiring more + alignment than it has resulting in segfaults on sparc (Closes: #634696) + + [ Michael Vogt ] + * apt-pkg/contrib/cdromutl.cc: + - fix escape problem when looking for the mounted devices + * apt-pkg/contrib/strutl.{h,cc}, test/libapt/strutil_test.cc: + - add new DeEscapeString() similar to DeQuoteString but + unescape character escapes like \0XX and \xXX (plus added + test) + * refresh po/* + + -- Michael Vogt Tue, 26 Jul 2011 12:12:27 +0200 + + apt (0.8.15.3) unstable; urgency=low + + [ Michael Vogt ] + * apt-pkg/acquire-item.cc: + - improve error message for a expired Release file + * apt-pkg/algorithms.cc: + - Hold back packages that would enter "policy-broken" state on upgrade + when doing a "apt-get upgrade" + * cmdline/apt-get.cc: + - fix missing download progress in apt-get download + + [ David Kalnischkies ] + * apt-pkg/pkgcachegen.cc: + - fallback to memory if file is not writeable even if access() + told us the opposite before (e.g. in fakeroot 1.16) (Closes: #630591) + * doc/sources.list.5.xml: + - document available [options] for sources.list entries (Closes: 632441) + * doc/apt.conf.5.xml: + - document APT::Architectures list (Closes: #612102) + * cmdline/apt-get.cc: + - restore all important dependencies for garbage packages (LP: #806274) + - do not require unused partial dirs in 'source' (Closes: #633510) + - buildconflicts effect all architectures + - implement MultiarchCross for build-dep and source (Closes: #632221) + * apt-pkg/init.cc: + - use CndSet in pkgInitConfig (Closes: #629617) + * apt-pkg/depcache.cc: + - change default of APT::AutoRemove::SuggestsImportant to true + * cmdline/apt-key: + - use a tmpfile instead of /etc/apt/secring.gpg (Closes: #632596) + * debian/apt.postinst: + - remove /etc/apt/secring.gpg if it is an empty file + * doc/apt-cache.8.xml: + - apply madison typofix from John Feuerstein, thanks! (Closes: #633455) + * apt-pkg/policy.cc: + - emit an error on unknown APT::Default-Release value (Closes: #407511) + * apt-pkg/aptconfiguration.cc: + - ensure that native architecture is if not specified otherwise the + first architecture in the Architectures vector + * apt-pkg/deb/deblistparser.cc: + - Strip only :any and :native if MultiArch should be stripped as it is + save to ignore them in non-MultiArch contexts but if the dependency + is a specific architecture (and not the native) do not strip + + -- Michael Vogt Mon, 25 Jul 2011 15:04:43 +0200 + + apt (0.8.15.2) unstable; urgency=high + + * fix from David Kalnischkies for the InRelease gpg verification + code (LP: #784473) + + -- Michael Vogt Tue, 12 Jul 2011 11:54:47 +0200 + apt (0.8.15.1) unstable; urgency=low [ David Kalnischkies ]