]> git.saurik.com Git - apt.git/commitdiff
More or group patches
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:49 +0000 (16:54 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:49 +0000 (16:54 +0000)
Author: jgg
Date: 1999-10-02 04:14:53 GMT
More or group patches

apt-pkg/algorithms.cc
apt-pkg/contrib/mmap.cc
cmdline/apt-cache.cc
debian/changelog
doc/apt-cache.8.yo
methods/cdrom.cc

index dd0928562ffcbb5b98f86e6d6b71a934b94318ec..51573df54d337a36e9c03e0dbc140bd71b423b8e 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: algorithms.cc,v 1.24 1999/09/30 06:30:34 jgg Exp $
+// $Id: algorithms.cc,v 1.25 1999/10/02 04:14:53 jgg Exp $
 /* ######################################################################
 
    Algorithms - A set of misc algorithms
@@ -524,10 +524,11 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
       pkgCache::DepIterator Start = D;
       pkgCache::DepIterator End = D;
       unsigned char State = 0;
-      for (bool LastOR = true; D.end() == false && LastOR == true; D++)
+      for (bool LastOR = true; D.end() == false && LastOR == true;)
       {
         State |= Cache[D];
         LastOR = (D->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or;
+        D++;
         if (LastOR == true)
            End = D;
       }
@@ -535,52 +536,54 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
       // We only worry about critical deps.
       if (End.IsCritical() != true)
         continue;
-      
-      // Dep is ok
-      if ((Cache[End] & pkgDepCache::DepGInstall) == pkgDepCache::DepGInstall)
-        continue;
-      
-      // Hm, the group is broken.. I have no idea how to handle this
-      if (Start != End)
-      {
-        clog << "Note, a broken or group was found in " << Pkg.Name() << "." << endl;
-        Fail = true;
-        break;
-      }
-
-      // Do not change protected packages
-      PkgIterator P = Start.SmartTargetPkg();
-      if ((Flags[P->ID] & Protected) == Protected)
+            
+      // Iterate over all the members in the or group
+      while (1)
       {
-        if (Debug == true)
-           clog << "    Reinet Failed because of protected " << P.Name() << endl;
-        Fail = true;
-        break;
-      }      
+        // Dep is ok now
+        if ((Cache[End] & pkgDepCache::DepGInstall) == pkgDepCache::DepGInstall)
+           break;
+        
+        // Do not change protected packages
+        PkgIterator P = Start.SmartTargetPkg();
+        if ((Flags[P->ID] & Protected) == Protected)
+        {
+           if (Debug == true)
+              clog << "    Reinet Failed because of protected " << P.Name() << endl;
+           Fail = true;
+           break;
+        }      
       
-      // Upgrade the package if the candidate version will fix the problem.
-      if ((Cache[Start] & pkgDepCache::DepCVer) == pkgDepCache::DepCVer)
-      {
-        if (DoUpgrade(P) == false)
+        // Upgrade the package if the candidate version will fix the problem.
+        if ((Cache[Start] & pkgDepCache::DepCVer) == pkgDepCache::DepCVer)
+        {
+           if (DoUpgrade(P) == false)
+           {
+              if (Debug == true)
+                 clog << "    Reinst Failed because of " << P.Name() << endl;
+              Fail = true;
+              break;
+           }    
+        }
+        else
         {
+           /* We let the algorithm deal with conflicts on its next iteration,
+              it is much smarter than us */
+           if (Start->Type == pkgCache::Dep::Conflicts)
+              continue;
+           
            if (Debug == true)
-              clog << "    Reinst Failed because of " << P.Name() << endl;
+              clog << "    Reinst Failed early because of " << Start.TargetPkg().Name() << endl;
            Fail = true;
            break;
-        }       
-      }
-      else
-      {
-        /* We let the algorithm deal with conflicts on its next iteration,
-           it is much smarter than us */
-        if (End->Type == pkgCache::Dep::Conflicts)
-           continue;
+        }     
         
-        if (Debug == true)
-           clog << "    Reinst Failed early because of " << Start.TargetPkg().Name() << endl;
-        Fail = true;
+        if (Start == End)
+           break;
+        Start++;
+      }
+      if (Fail == true)
         break;
-      }      
    }
    
    // Undo our operations - it might be smart to undo everything this did..
@@ -737,16 +740,6 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
            
            InOr = Start != End;
            
-           // Hm, the group is broken.. I have no idea how to handle this
-/*         if (Start != End)
-           {
-              if (Debug == true)
-                 clog << "Note, a broken or group was found in " << I.Name() << "." << endl;
-              if ((Flags[I->ID] & Protected) != Protected)
-                 Cache.MarkDelete(I);
-              break;
-           }*/
-                   
            if (Debug == true)
               clog << "Package " << I.Name() << " has broken dep on " << Start.TargetPkg().Name() << endl;
 
index 42777a8acc3491885ae360695008dd4ef6e35266..230e133a55cbbb7c75d436e20ae45106147f302c 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: mmap.cc,v 1.19 1999/08/30 04:20:26 jgg Exp $
+// $Id: mmap.cc,v 1.20 1999/10/02 04:14:54 jgg Exp $
 /* ######################################################################
    
    MMap Class - Provides 'real' mmap or a faked mmap using read().
@@ -117,7 +117,7 @@ bool MMap::Sync()
 #ifdef _POSIX_SYNCHRONIZED_IO   
    if ((Flags & ReadOnly) != ReadOnly)
       if (msync((char *)Base,iSize,MS_SYNC) != 0)
-        return _error->Error("msync","Unable to write mmap");
+        return _error->Errno("msync","Unable to write mmap");
 #endif   
    return true;
 }
@@ -134,7 +134,7 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop)
    unsigned long PSize = sysconf(_SC_PAGESIZE);
    if ((Flags & ReadOnly) != ReadOnly)
       if (msync((char *)Base+(int)(Start/PSize)*PSize,Stop - Start,MS_SYNC) != 0)
-        return _error->Error("msync","Unable to write mmap");
+        return _error->Errno("msync","Unable to write mmap");
 #endif   
    return true;
 }
index 12d306fc1b6dc7375f7f268d52adbd94d1d84344..b825bd4f9e875c229b40ad984b0392b73009041c 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-cache.cc,v 1.37 1999/07/15 03:15:49 jgg Exp $
+// $Id: apt-cache.cc,v 1.38 1999/10/02 04:14:54 jgg Exp $
 /* ######################################################################
    
    apt-cache - Manages the cache files
@@ -379,7 +379,7 @@ bool DumpAvail(CommandLine &Cmd)
    return true;
 }
                                                                        /*}}}*/
-// Depends - Print out a dependency tree                                       /*{{{*/
+// Depends - Print out a dependency tree                               /*{{{*/
 // ---------------------------------------------------------------------
 /* */
 bool Depends(CommandLine &CmdL)
@@ -672,6 +672,7 @@ int main(int argc,const char *argv[])
       {'q',"quiet","quiet",CommandLine::IntLevel},
       {'i',"important","APT::Cache::Important",0},
       {'f',"full","APT::Cache::ShowFull",0},
+      {'g',"no-generate","APT::Cache::NoGenerate",0},
       {0,"names-only","APT::Cache::NamesOnly",0},
       {'c',"config-file",0,CommandLine::ConfigFile},
       {'o',"option",0,CommandLine::ArbItem},
@@ -712,14 +713,24 @@ int main(int argc,const char *argv[])
       _config->Set("quiet","1");
 
    if (CmdL.DispatchArg(CmdsA,false) == false && _error->PendingError() == false)
-   {      
-      // Open the cache file
-      pkgSourceList List;
-      List.ReadMainList();
-
-      // Generate it and map it
-      OpProgress Prog;
-      MMap *Map = pkgMakeStatusCacheMem(List,Prog);
+   { 
+      MMap *Map;
+      if (_config->FindB("APT::Cache::NoGenerate",false) == true)
+      {
+        Map = new MMap(*new FileFd(_config->FindFile("Dir::Cache::pkgcache"),
+                                   FileFd::ReadOnly),MMap::Public|MMap::ReadOnly);
+      }
+      else
+      {
+        // Open the cache file
+        pkgSourceList List;
+        List.ReadMainList();
+        
+        // Generate it and map it
+        OpProgress Prog;
+        Map = pkgMakeStatusCacheMem(List,Prog);
+      }
+      
       if (_error->PendingError() == false)
       {
         pkgCache Cache(*Map);   
index 25beaa8bf6c4e8c0600476109ad2396e5b2fc8f7..2ac81132c47d88c0098a1acc2398a684099f1772 100644 (file)
@@ -1,9 +1,12 @@
 apt (0.3.13.1) unstable; urgency=low
 
-  * Fix Perl or group pre-depends thing Closes: #46091, #46096, #46233
+  * Fix Perl or group pre-depends thing Closes: #46091, #46096, #46233, #45901
   * Fix handling of dpkg's conversions from < -> <= Closes: #46094
-  * Make unparsable priorities non-fatal Closes: #46266, #46267  
+  * Make unparsable priorities non-fatal Closes: #46266, #46267, #46293, #46298  
   * Fix handling of '/' for the dist name. Closes: #43830, #45640, #45692
+  * Fixed 'Method gave a blank filename' error from IMS queries onto CDs.
+    Closes: #45034, #45695
+  * Made OR group handling in the problem resolver more elaborate. Closes: #45646
   
  -- Jason Gunthorpe <jgg@debian.org>  Fri,  3 Sep 1999 09:04:28 -0700
  
index 9b6861f3de3524d94d1513f7fa78946c95913b54..e03e4cbf44c3a69b3776a145ca6f47191a93c1d0 100644 (file)
@@ -199,6 +199,10 @@ See bf(APT::Cache::Important).
 dit(bf(-f --full))
 Print full package records when searching. See bf(APT::Cache::ShowFull).
 
+dit(bf(-g --no-generate))
+Do not perform automatic package cache regeneration, use the cache as it is.
+See bf(APT::Cache::NoGenerate).
+
 dit(bf(--names-only))
 Only search on the package names, not the long description. See
 bf(APT::Cache::Names-Only).
index c53c3ddebd37c0e7e33dbe1e4ddfe12be98fc031..befd531a657e6529f9a5ac6275d7f2769f0808aa 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: cdrom.cc,v 1.14 1999/08/08 03:34:08 jgg Exp $
+// $Id: cdrom.cc,v 1.15 1999/10/02 04:14:54 jgg Exp $
 /* ######################################################################
 
    CDROM URI method for APT
@@ -77,6 +77,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
    {
       Res.LastModified = Itm->LastModified;
       Res.IMSHit = true;
+      Res.Filename = File;
       URIDone(Res);
       return true;
    }