Kaynağa Gözat

More ignoring of versionless packages
Author: jgg
Date: 2001-05-27 05:36:04 GMT
More ignoring of versionless packages

Arch Librarian 22 yıl önce
ebeveyn
işleme
e7b470eefa

+ 2 - 2
apt-pkg/contrib/strutl.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: strutl.cc,v 1.39 2001/05/27 05:19:30 jgg Exp $
+// $Id: strutl.cc,v 1.40 2001/05/27 05:36:04 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    String Util - Some useful string functions.
    String Util - Some useful string functions.
@@ -877,7 +877,7 @@ void ioprintf(ostream &out,const char *format,...)
    // sprintf the description
    // sprintf the description
    char S[400];
    char S[400];
    vsnprintf(S,sizeof(S),format,args);
    vsnprintf(S,sizeof(S),format,args);
-   // std::ostream::operator <<(out, (const char *)S);
+   out << S;
 }
 }
 									/*}}}*/
 									/*}}}*/
 
 

+ 5 - 3
apt-pkg/deb/deblistparser.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: deblistparser.cc,v 1.24 2001/02/20 07:03:17 jgg Exp $
+// $Id: deblistparser.cc,v 1.25 2001/05/27 05:36:04 jgg Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    Package Cache Generator - Generator for the cache structure.
    Package Cache Generator - Generator for the cache structure.
@@ -16,6 +16,8 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/crc-16.h>
 #include <apt-pkg/crc-16.h>
 
 
+#include <ctype.h>
+
 #include <system.h>
 #include <system.h>
 									/*}}}*/
 									/*}}}*/
 
 
@@ -409,7 +411,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
 	    if (End == Stop) 
 	    if (End == Stop) 
 	       return 0;
 	       return 0;
 	    
 	    
-	    if (stringcmp(I,End,arch.begin(),arch.end()) == 0)
+	    if (stringcmp(arch.c_str(),arch.c_str()+arch.length(),I,End) == 0)
 	       Found = true;
 	       Found = true;
 	    
 	    
 	    if (*End++ == ']') {
 	    if (*End++ == ']') {
@@ -536,7 +538,7 @@ bool debListParser::Step()
       if (Section.Find("Architecture",Start,Stop) == false)
       if (Section.Find("Architecture",Start,Stop) == false)
 	 return true;
 	 return true;
 
 
-      if (stringcmp(Start,Stop,Arch.begin(),Arch.end()) == 0)
+      if (stringcmp(Arch.c_str(),Arch.c_str()+Arch.length(),Start,Stop) == 0)
 	 return true;
 	 return true;
 
 
       if (stringcmp(Start,Stop,"all") == 0)
       if (stringcmp(Start,Stop,"all") == 0)

+ 4 - 1
apt-pkg/depcache.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: depcache.cc,v 1.24 2001/04/25 06:17:00 jgg Exp $
+// $Id: depcache.cc,v 1.25 2001/05/27 05:36:04 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Dependency Cache - Caches Dependency information.
    Dependency Cache - Caches Dependency information.
@@ -182,6 +182,9 @@ void pkgDepCache::AddSizes(const PkgIterator &Pkg,signed long Mult)
 {
 {
    StateCache &P = PkgState[Pkg->ID];
    StateCache &P = PkgState[Pkg->ID];
    
    
+   if (Pkg->VersionList == 0)
+      return;
+   
    if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure && 
    if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure && 
        P.Keep() == true)
        P.Keep() == true)
       return;
       return;

+ 5 - 1
apt-pkg/packagemanager.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: packagemanager.cc,v 1.27 2001/05/07 05:49:43 jgg Exp $
+// $Id: packagemanager.cc,v 1.28 2001/05/27 05:36:04 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Package Manager - Abstacts the package manager
    Package Manager - Abstacts the package manager
@@ -138,6 +138,10 @@ bool pkgPackageManager::CreateOrderList()
    // Generate the list of affected packages and sort it
    // Generate the list of affected packages and sort it
    for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
    for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
    {
    {
+      // Ignore no-version packages
+      if (I->VersionList == 0)
+	 continue;
+      
       // Mark the package and its dependends for immediate configuration
       // Mark the package and its dependends for immediate configuration
       if (((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential ||
       if (((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential ||
 	   (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) &&
 	   (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) &&

+ 11 - 8
apt-pkg/pkgcachegen.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: pkgcachegen.cc,v 1.47 2001/03/04 00:12:41 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.48 2001/05/27 05:36:04 jgg Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    Package Cache Generator - Generator for the cache structure.
    Package Cache Generator - Generator for the cache structure.
@@ -27,13 +27,16 @@
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/pkgsystem.h>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
-    
+
+#include <vector>
+
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <errno.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <system.h>
 #include <system.h>
 									/*}}}*/
 									/*}}}*/
+typedef vector<pkgIndexFile *>::iterator FileIterator;
 
 
 // CacheGenerator::pkgCacheGenerator - Constructor			/*{{{*/
 // CacheGenerator::pkgCacheGenerator - Constructor			/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
@@ -131,7 +134,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
       int Res = 1;
       int Res = 1;
       for (; Ver.end() == false; Last = &Ver->NextVer, Ver++)
       for (; Ver.end() == false; Last = &Ver->NextVer, Ver++)
       {
       {
-	 Res = Cache.VS->DoCmpVersion(Version.begin(),Version.end(),Ver.VerStr(),
+	 Res = Cache.VS->DoCmpVersion(Version.c_str(),Version.c_str()+Version.length(),Ver.VerStr(),
 				 Ver.VerStr() + strlen(Ver.VerStr()));
 				 Ver.VerStr() + strlen(Ver.VerStr()));
 	 if (Res >= 0)
 	 if (Res >= 0)
 	    break;
 	    break;
@@ -163,7 +166,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
       {
       {
 	 for (; Ver.end() == false; Last = &Ver->NextVer, Ver++)
 	 for (; Ver.end() == false; Last = &Ver->NextVer, Ver++)
 	 {
 	 {
-	    Res = Cache.VS->DoCmpVersion(Version.begin(),Version.end(),Ver.VerStr(),
+	    Res = Cache.VS->DoCmpVersion(Version.c_str(),Version.c_str()+Version.length(),Ver.VerStr(),
 				    Ver.VerStr() + strlen(Ver.VerStr()));
 				    Ver.VerStr() + strlen(Ver.VerStr()));
 	    if (Res != 0)
 	    if (Res != 0)
 	       break;
 	       break;
@@ -470,8 +473,8 @@ unsigned long pkgCacheGenerator::WriteUniqString(const char *S,
 /* This just verifies that each file in the list of index files exists,
 /* 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
    has matching attributes with the cache and the cache does not have
    any extra files. */
    any extra files. */
-static bool CheckValidity(string CacheFile,pkgIndexFile **Start,
-			  pkgIndexFile **End,MMap **OutMap = 0)
+static bool CheckValidity(string CacheFile, FileIterator Start, 
+                          FileIterator End,MMap **OutMap = 0)
 {
 {
    // No file, certainly invalid
    // No file, certainly invalid
    if (CacheFile.empty() == true || FileExists(CacheFile) == false)
    if (CacheFile.empty() == true || FileExists(CacheFile) == false)
@@ -530,7 +533,7 @@ static bool CheckValidity(string CacheFile,pkgIndexFile **Start,
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* Size is kind of an abstract notion that is only used for the progress
 /* Size is kind of an abstract notion that is only used for the progress
    meter */
    meter */
-static unsigned long ComputeSize(pkgIndexFile **Start,pkgIndexFile **End)
+static unsigned long ComputeSize(FileIterator Start,FileIterator End)
 {
 {
    unsigned long TotalSize = 0;
    unsigned long TotalSize = 0;
    for (; Start != End; Start++)
    for (; Start != End; Start++)
@@ -548,7 +551,7 @@ static unsigned long ComputeSize(pkgIndexFile **Start,pkgIndexFile **End)
 static bool BuildCache(pkgCacheGenerator &Gen,
 static bool BuildCache(pkgCacheGenerator &Gen,
 		       OpProgress &Progress,
 		       OpProgress &Progress,
 		       unsigned long &CurrentSize,unsigned long TotalSize,
 		       unsigned long &CurrentSize,unsigned long TotalSize,
-		       pkgIndexFile **Start,pkgIndexFile **End)
+		       FileIterator Start, FileIterator End)
 {
 {
    for (; Start != End; Start++)
    for (; Start != End; Start++)
    {
    {

+ 22 - 7
apt-pkg/policy.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: policy.cc,v 1.6 2001/04/29 05:13:51 jgg Exp $
+// $Id: policy.cc,v 1.7 2001/05/27 05:36:04 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Package Version Policy implementation
    Package Version Policy implementation
@@ -34,8 +34,12 @@
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/sptr.h>
     
     
 #include <apti18n.h>
 #include <apti18n.h>
+
+#include <iostream>
 									/*}}}*/
 									/*}}}*/
 
 
+using namespace std;
+
 // Policy::Init - Startup and bind to a cache				/*{{{*/
 // Policy::Init - Startup and bind to a cache				/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* Set the defaults for operation. The default mode with no loaded policy
 /* Set the defaults for operation. The default mode with no loaded policy
@@ -117,7 +121,7 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator Pkg)
    // Look for a package pin and evaluate it.
    // Look for a package pin and evaluate it.
    signed Max = GetPriority(Pkg);
    signed Max = GetPriority(Pkg);
    pkgCache::VerIterator Pref = GetMatch(Pkg);
    pkgCache::VerIterator Pref = GetMatch(Pkg);
-      
+
    /* Falling through to the default version.. Setting Max to zero
    /* Falling through to the default version.. Setting Max to zero
       effectively excludes everything <= 0 which are the non-automatic
       effectively excludes everything <= 0 which are the non-automatic
       priorities.. The status file is given a prio of 100 which will exclude
       priorities.. The status file is given a prio of 100 which will exclude
@@ -164,7 +168,9 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator Pkg)
 	    break;
 	    break;
       }            
       }            
    }
    }
-   
+
+   if (Pref.end() == true)
+      return Pkg.VersionList();
    return Pref;
    return Pref;
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -181,7 +187,10 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name,
    Pin *P = 0;
    Pin *P = 0;
    
    
    if (Name.empty() == true)
    if (Name.empty() == true)
-      P = Defaults.insert(Defaults.end());
+      // tausq:g++v3 begin
+	;
+      // P = Defaults.insert(Defaults.end());
+      // tausq:g++v3 end
    else
    else
    {
    {
       // Get a spot to put the pin
       // Get a spot to put the pin
@@ -191,10 +200,16 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name,
 	 for (vector<PkgPin>::iterator I = Unmatched.begin(); 
 	 for (vector<PkgPin>::iterator I = Unmatched.begin(); 
 	      I != Unmatched.end() && P == 0; I++)
 	      I != Unmatched.end() && P == 0; I++)
 	    if (I->Pkg == Name)
 	    if (I->Pkg == Name)
-	       P = I;
+               // tausq:g++-v3 begin
+	       P = &(*I);
+	       // P = I;
+               // tausq:g++-v3 end
 	 
 	 
 	 if (P == 0)
 	 if (P == 0)
-	    P = Unmatched.insert(Unmatched.end());      
+            // tausq:g++v3 begin
+            ;
+	    // P = Unmatched.insert(Unmatched.end());      
+            // tausq:g++v3 end
       }
       }
       else
       else
       {
       {
@@ -217,7 +232,7 @@ pkgCache::VerIterator pkgPolicy::GetMatch(pkgCache::PkgIterator Pkg)
    if (PPkg.Type != pkgVersionMatch::None)
    if (PPkg.Type != pkgVersionMatch::None)
    {
    {
       pkgVersionMatch Match(PPkg.Data,PPkg.Type);
       pkgVersionMatch Match(PPkg.Data,PPkg.Type);
-	 return Match.Find(Pkg);
+      return Match.Find(Pkg);
    }
    }
    return pkgCache::VerIterator(*Pkg.Cache());
    return pkgCache::VerIterator(*Pkg.Cache());
 }
 }