diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire-item.cc | 15 | ||||
-rw-r--r-- | apt-pkg/acquire-item.h | 5 | ||||
-rw-r--r-- | apt-pkg/algorithms.h | 3 | ||||
-rw-r--r-- | apt-pkg/cacheiterators.h | 4 | ||||
-rw-r--r-- | apt-pkg/cdrom.cc | 3 | ||||
-rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 4 | ||||
-rw-r--r-- | apt-pkg/deb/debsystem.cc | 7 | ||||
-rw-r--r-- | apt-pkg/pkgrecords.cc | 5 | ||||
-rw-r--r-- | apt-pkg/pkgrecords.h | 1 |
9 files changed, 17 insertions, 30 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index dea68f3ee..ef107444f 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -142,21 +142,20 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, { Decompression = false; Erase = false; - + DestFile = _config->FindDir("Dir::State::lists") + "partial/"; DestFile += URItoFileName(URI); if(comprExt.empty()) { - // autoselect the compression method - if(FileExists("/usr/bin/bzip2")) - CompressionExtension = ".bz2"; - else - CompressionExtension = ".gz"; + // autoselect + if(FileExists("/usr/bin/bzip2")) + Desc.URI = URI + ".bz2"; + else + Desc.URI = URI + ".gz"; } else { - CompressionExtension = comprExt; + Desc.URI = URI + comprExt; } - Desc.URI = URI + CompressionExtension; Desc.Description = URIDesc; Desc.Owner = this; diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 90f80368b..ea71153d5 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -92,8 +92,7 @@ class pkgAcqIndex : public pkgAcquire::Item pkgAcquire::ItemDesc Desc; string RealURI; string ExpectedMD5; - string CompressionExtension; - + public: // Specialized action members @@ -101,7 +100,7 @@ class pkgAcqIndex : public pkgAcquire::Item virtual void Done(string Message,unsigned long Size,string Md5Hash, pkgAcquire::MethodConfig *Cnf); virtual string Custom600Headers(); - virtual string DescURI() {return RealURI + CompressionExtension;}; + virtual string DescURI() {return RealURI + ".gz";}; pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesct, string ExpectedMD5, string compressExt=""); diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index b95218061..174a7f58d 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -118,8 +118,7 @@ class pkgProblemResolver // Try to resolve problems only by using keep bool ResolveByKeep(); - - // Install all protected packages + void InstallProtect(); pkgProblemResolver(pkgDepCache *Cache); diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index c3a0d0a5a..62d2695dd 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -222,7 +222,7 @@ class pkgCache::PrvIterator void operator ++(int) {if (Prv != Owner->ProvideP) Prv = Owner->ProvideP + (Type == PrvVer?Prv->NextPkgProv:Prv->NextProvides);}; inline void operator ++() {operator ++(0);}; - inline bool end() const {return Owner == 0 || Prv == Owner->ProvideP?true:false;}; + inline bool end() const {return Prv == Owner->ProvideP?true:false;}; // Comparison inline bool operator ==(const PrvIterator &B) const {return Prv == B.Prv;}; @@ -244,8 +244,6 @@ class pkgCache::PrvIterator inline PkgIterator OwnerPkg() {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[Prv->Version].ParentPkg);}; inline unsigned long Index() const {return Prv - Owner->ProvideP;}; - inline PrvIterator() : Prv(0), Type(PrvVer), Owner(0) {}; - inline PrvIterator(pkgCache &Owner,Provides *Trg,Version *) : Prv(Trg), Type(PrvVer), Owner(&Owner) { diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index ce1beb39b..d7ef844a2 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -422,9 +422,6 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source) { F.getline(Buffer,sizeof(Buffer)); CurLine++; - if (F.fail() && !F.eof()) - return _error->Error(_("Line %u too long in source list %s."), - CurLine,File.c_str()); _strtabexpand(Buffer,sizeof(Buffer)); _strstrip(Buffer); diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 526c8c0b2..85e5b16b3 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -165,6 +165,10 @@ bool debReleaseIndex::IsTrusted() const string VerifiedSigFile = _config->FindDir("Dir::State::lists") + URItoFileName(MetaIndexURI("Release")) + ".gpg"; + if(_config->FindB("APT::Authentication::TrustCDROM", false)) + if(URI.substr(0,strlen("cdrom:")) == "cdrom:") + return true; + if (FileExists(VerifiedSigFile)) return true; return false; diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index 2d805ea6f..0b3a4f742 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -164,12 +164,7 @@ bool debSystem::Initialize(Configuration &Cnf) Cnf.CndSet("Dir::State::userstatus","status.user"); // Defunct Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status"); Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg"); - - if (StatusFile) { - delete StatusFile; - StatusFile = 0; - } - + return true; } /*}}}*/ diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc index 1d71d3e2f..9c2655d6a 100644 --- a/apt-pkg/pkgrecords.cc +++ b/apt-pkg/pkgrecords.cc @@ -42,9 +42,6 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0) if (Files[I->ID] == 0) return; } - // We store that to make sure that the destructor won't segfault, - // even if the Cache object was destructed before this instance. - PackageFileCount = Cache.HeaderP->PackageFileCount; } /*}}}*/ // Records::~pkgRecords - Destructor /*{{{*/ @@ -52,7 +49,7 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0) /* */ pkgRecords::~pkgRecords() { - for (unsigned I = 0; I != PackageFileCount; I++) + for (unsigned I = 0; I != Cache.HeaderP->PackageFileCount; I++) delete Files[I]; delete [] Files; } diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h index f31e83afe..08f004414 100644 --- a/apt-pkg/pkgrecords.h +++ b/apt-pkg/pkgrecords.h @@ -33,7 +33,6 @@ class pkgRecords pkgCache &Cache; Parser **Files; - int PackageFileCount; public: |