From e7b470eefa0499d0edbdda4f466eb77b17c2067b Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:58:07 +0000 Subject: More ignoring of versionless packages Author: jgg Date: 2001-05-27 05:36:04 GMT More ignoring of versionless packages --- apt-pkg/contrib/strutl.cc | 4 ++-- apt-pkg/deb/deblistparser.cc | 8 +++++--- apt-pkg/depcache.cc | 5 ++++- apt-pkg/packagemanager.cc | 6 +++++- apt-pkg/pkgcachegen.cc | 19 +++++++++++-------- apt-pkg/policy.cc | 29 ++++++++++++++++++++++------- 6 files changed, 49 insertions(+), 22 deletions(-) diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 5312a3f4f..5e7031384 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // 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. @@ -877,7 +877,7 @@ void ioprintf(ostream &out,const char *format,...) // sprintf the description char S[400]; vsnprintf(S,sizeof(S),format,args); - // std::ostream::operator <<(out, (const char *)S); + out << S; } /*}}}*/ diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 2b3dfaf6e..267636776 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // 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. @@ -16,6 +16,8 @@ #include #include +#include + #include /*}}}*/ @@ -409,7 +411,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop, if (End == Stop) 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; if (*End++ == ']') { @@ -536,7 +538,7 @@ bool debListParser::Step() if (Section.Find("Architecture",Start,Stop) == false) 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; if (stringcmp(Start,Stop,"all") == 0) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 507416217..814a1fb1b 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // 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. @@ -182,6 +182,9 @@ void pkgDepCache::AddSizes(const PkgIterator &Pkg,signed long Mult) { StateCache &P = PkgState[Pkg->ID]; + if (Pkg->VersionList == 0) + return; + if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure && P.Keep() == true) return; diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index d5b8eafb4..fc5f475a1 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // 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 @@ -138,6 +138,10 @@ bool pkgPackageManager::CreateOrderList() // Generate the list of affected packages and sort it 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 if (((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential || (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) && diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index a245f9fdf..031f9b807 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // 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. @@ -27,13 +27,16 @@ #include #include - + +#include + #include #include #include #include #include /*}}}*/ +typedef vector::iterator FileIterator; // CacheGenerator::pkgCacheGenerator - Constructor /*{{{*/ // --------------------------------------------------------------------- @@ -131,7 +134,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List, int Res = 1; 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())); if (Res >= 0) break; @@ -163,7 +166,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List, { 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())); if (Res != 0) 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, has matching attributes with the cache and the cache does not have 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 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 meter */ -static unsigned long ComputeSize(pkgIndexFile **Start,pkgIndexFile **End) +static unsigned long ComputeSize(FileIterator Start,FileIterator End) { unsigned long TotalSize = 0; for (; Start != End; Start++) @@ -548,7 +551,7 @@ static unsigned long ComputeSize(pkgIndexFile **Start,pkgIndexFile **End) static bool BuildCache(pkgCacheGenerator &Gen, OpProgress &Progress, unsigned long &CurrentSize,unsigned long TotalSize, - pkgIndexFile **Start,pkgIndexFile **End) + FileIterator Start, FileIterator End) { for (; Start != End; Start++) { diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index cde0920e6..a3bb4a38f 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // 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 @@ -34,8 +34,12 @@ #include #include + +#include /*}}}*/ +using namespace std; + // Policy::Init - Startup and bind to a cache /*{{{*/ // --------------------------------------------------------------------- /* 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. signed Max = GetPriority(Pkg); pkgCache::VerIterator Pref = GetMatch(Pkg); - + /* Falling through to the default version.. Setting Max to zero effectively excludes everything <= 0 which are the non-automatic 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; } } - + + if (Pref.end() == true) + return Pkg.VersionList(); return Pref; } /*}}}*/ @@ -181,7 +187,10 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, Pin *P = 0; if (Name.empty() == true) - P = Defaults.insert(Defaults.end()); + // tausq:g++v3 begin + ; + // P = Defaults.insert(Defaults.end()); + // tausq:g++v3 end else { // Get a spot to put the pin @@ -191,10 +200,16 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, for (vector::iterator I = Unmatched.begin(); I != Unmatched.end() && P == 0; I++) if (I->Pkg == Name) - P = I; + // tausq:g++-v3 begin + P = &(*I); + // P = I; + // tausq:g++-v3 end if (P == 0) - P = Unmatched.insert(Unmatched.end()); + // tausq:g++v3 begin + ; + // P = Unmatched.insert(Unmatched.end()); + // tausq:g++v3 end } else { @@ -217,7 +232,7 @@ pkgCache::VerIterator pkgPolicy::GetMatch(pkgCache::PkgIterator Pkg) if (PPkg.Type != pkgVersionMatch::None) { pkgVersionMatch Match(PPkg.Data,PPkg.Type); - return Match.Find(Pkg); + return Match.Find(Pkg); } return pkgCache::VerIterator(*Pkg.Cache()); } -- cgit v1.2.3