]> git.saurik.com Git - apt.git/commitdiff
merged from debian-sid
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 29 Jul 2011 13:45:06 +0000 (15:45 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 29 Jul 2011 13:45:06 +0000 (15:45 +0200)
1  2 
apt-pkg/pkgcachegen.cc
debian/changelog

diff --combined apt-pkg/pkgcachegen.cc
index ebcbfdd25f4f319b16445ed9afd540ef90723284,8f9737e265e9de696b225cd7f6867e47e177d775..efd764b517efd43431b9f98634385ab9ad8bdc0d
@@@ -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
        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<MMap> 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"));
     SPtr<DynamicMMap> 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);
     // 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 a8c7572339ceacffd5cc06e5c744af6f51c8ef5a,8797117a7209dc27bfaaa862af4fc902d208b43a..e17b1abd01b37e6c770c52b3083b2f39b054c06a
@@@ -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 <mvo@debian.org>  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 <mvo@debian.org>  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 <mvo@debian.org>  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 <mvo@debian.org>  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 <mvo@debian.org>  Tue, 12 Jul 2011 11:54:47 +0200
  apt (0.8.15.1) unstable; urgency=low
  
    [ David Kalnischkies ]