From: Michael Vogt Date: Tue, 21 Jul 2009 16:31:36 +0000 (+0200) Subject: The 'not dead yet' release X-Git-Tag: 0.7.22~13 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/d59725349555939d39af81cf7746069d6aa3536c?ds=inline;hp=-c The 'not dead yet' release * add hook for MarkInstall and MarkDelete (closes: #470035) * add the various foldmarkers in apt-pkg & cmdline (no code change) * versions with a pin of -1 shouldn't be a candidate (Closes: #355237) * prefer mmap as memory allocator in MMap instead of a static char array which can (at least in theory) grow dynamic * eliminate (hopefully all) segfaults in pkgcachegen.cc and mmap.cc which can arise if cache doesn't fit into the mmap (Closes: #535218) * display warnings instead of errors if the parts dirs doesn't exist * honor the dpkg hold state in new Marker hooks (closes: #64141) --- d59725349555939d39af81cf7746069d6aa3536c diff --combined apt-pkg/acquire.cc index c1f6581e2,68ff393d0..74510ae21 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@@ -24,8 -24,7 +24,8 @@@ #include #include - +#include + #include #include #include @@@ -485,7 -484,7 +485,7 @@@ double pkgAcquire::PartialPresent( Total += (*I)->PartialSize; return Total; } - + /*}}}*/ // Acquire::UriBegin - Start iterator for the uri list /*{{{*/ // --------------------------------------------------------------------- /* */ @@@ -502,7 -501,6 +502,6 @@@ pkgAcquire::UriIterator pkgAcquire::Uri return UriIterator(0); } /*}}}*/ - // Acquire::MethodConfig::MethodConfig - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ @@@ -516,7 -514,6 +515,6 @@@ pkgAcquire::MethodConfig::MethodConfig( Next = 0; } /*}}}*/ - // Queue::Queue - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ @@@ -621,7 -618,7 +619,7 @@@ bool pkgAcquire::Queue::Startup( added other source retry to have cycle maintain a pipeline depth on its own. */ if (Cnf->Pipeline == true) - MaxPipeDepth = 1000; + MaxPipeDepth = _config->FindI("Acquire::Max-Pipeline-Depth",10); else MaxPipeDepth = 1; } @@@ -728,7 -725,6 +726,6 @@@ void pkgAcquire::Queue::Bump( Cycle(); } /*}}}*/ - // AcquireStatus::pkgAcquireStatus - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ diff --combined apt-pkg/algorithms.cc index 1fd3d39a4,a30a02edb..34da745de --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@@ -442,7 -442,6 +442,6 @@@ bool pkgMinimizeUpgrade(pkgDepCache &Ca return true; } /*}}}*/ - // ProblemResolver::pkgProblemResolver - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ @@@ -501,7 -500,6 +500,7 @@@ void pkgProblemResolver::MakeScores( signed short PrioEssentials = _config->FindI("pkgProblemResolver::Scores::Essentials",100); signed short PrioInstalledAndNotObsolete = _config->FindI("pkgProblemResolver::Scores::NotObsolete",1); signed short PrioDepends = _config->FindI("pkgProblemResolver::Scores::Depends",1); + signed short PrioRecommends = _config->FindI("pkgProblemResolver::Scores::Recommends",1); signed short AddProtected = _config->FindI("pkgProblemResolver::Scores::AddProtected",10000); signed short AddEssential = _config->FindI("pkgProblemResolver::Scores::AddEssential",5000); @@@ -515,7 -513,6 +514,7 @@@ << " Essentials => " << PrioEssentials << endl << " InstalledAndNotObsolete => " << PrioInstalledAndNotObsolete << endl << " Depends => " << PrioDepends << endl + << " Recommends => " << PrioRecommends << endl << " AddProtected => " << AddProtected << endl << " AddEssential => " << AddEssential << endl; @@@ -554,11 -551,8 +553,11 @@@ for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); D.end() == false; D++) { - if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends) - Scores[D.TargetPkg()->ID]+= PrioDepends; + if (D->Type == pkgCache::Dep::Depends || + D->Type == pkgCache::Dep::PreDepends) + Scores[D.TargetPkg()->ID] += PrioDepends; + else if (D->Type == pkgCache::Dep::Recommends) + Scores[D.TargetPkg()->ID] += PrioRecommends; } } @@@ -578,9 -572,7 +577,9 @@@ { // Only do it for the install version if ((pkgCache::Version *)D.ParentVer() != Cache[D.ParentPkg()].InstallVer || - (D->Type != pkgCache::Dep::Depends && D->Type != pkgCache::Dep::PreDepends)) + (D->Type != pkgCache::Dep::Depends && + D->Type != pkgCache::Dep::PreDepends && + D->Type != pkgCache::Dep::Recommends)) continue; Scores[I->ID] += abs(OldScores[D.ParentPkg()->ID]); @@@ -992,26 -984,11 +991,11 @@@ bool pkgProblemResolver::Resolve(bool B // Consider other options if (InOr == false) { - if (Cache.AutoInstOk(I, Cache[I].CandidateVerIter(Cache),Start) == true) - { - if (Debug == true) - clog << " Removing " << I.Name() << " rather than change " << Start.TargetPkg().Name() << endl; - Cache.MarkDelete(I); - if (Counter > 1) - { - if (Scores[Pkg->ID] > Scores[I->ID]) - Scores[I->ID] = Scores[Pkg->ID]; - } - } else { - /* The dependency of the TargetPkg would be satisfiable with I but it is - forbidden to install I automatical, so anything we can do is hold - back the TargetPkg. - */ - if (Debug == true) - clog << " Hold back " << Start.TargetPkg().Name() << - " rather than change denied AutoInstall " << I.Name() << endl; - Cache.MarkKeep(Start.TargetPkg()); - } + if (Debug == true) + clog << " Removing " << I.Name() << " rather than change " << Start.TargetPkg().Name() << endl; + Cache.MarkDelete(I); + if (Counter > 1 && Scores[Pkg->ID] > Scores[I->ID]) + Scores[I->ID] = Scores[Pkg->ID]; } } } @@@ -1330,7 -1307,6 +1314,6 @@@ void pkgProblemResolver::InstallProtect } } /*}}}*/ - // PrioSortList - Sort a list of versions by priority /*{{{*/ // --------------------------------------------------------------------- /* This is ment to be used in conjunction with AllTargets to get a list @@@ -1361,7 -1337,6 +1344,6 @@@ void pkgPrioSortList(pkgCache &Cache,pk qsort(List,Count,sizeof(*List),PrioComp); } /*}}}*/ - // CacheFile::ListUpdate - update the cache files /*{{{*/ // --------------------------------------------------------------------- /* This is a simple wrapper to update the cache. it will fetch stuff diff --combined apt-pkg/cacheiterators.h index af21681ed,3d35e4298..28466cd40 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@@ -32,7 -32,7 +32,7 @@@ #define PKGLIB_CACHEITERATORS_H - // Package Iterator + // Package Iterator /*{{{*/ class pkgCache::PkgIterator { friend class pkgCache; @@@ -96,8 -96,8 +96,8 @@@ }; inline PkgIterator() : Pkg(0), Owner(0), HashIndex(0) {}; }; - - // Version Iterator + /*}}}*/ + // Version Iterator /*{{{*/ class pkgCache::VerIterator { Version *Ver; @@@ -110,7 -110,7 +110,7 @@@ // Iteration void operator ++(int) {if (Ver != Owner->VerP) Ver = Owner->VerP + Ver->NextVer;}; inline void operator ++() {operator ++(0);}; - inline bool end() const {return Owner == NULL || (Ver == Owner->VerP?true:false);}; + inline bool end() const {return Owner == 0 || (Ver == Owner->VerP?true:false);}; inline void operator =(const VerIterator &B) {Ver = B.Ver; Owner = B.Owner;}; // Comparison @@@ -155,8 -155,8 +155,8 @@@ Ver = Owner.VerP; }; }; - - // Description Iterator + /*}}}*/ + // Description Iterator /*{{{*/ class pkgCache::DescIterator { Description *Desc; @@@ -169,7 -169,7 +169,7 @@@ // Iteration void operator ++(int) {if (Desc != Owner->DescP) Desc = Owner->DescP + Desc->NextDesc;}; inline void operator ++() {operator ++(0);}; - inline bool end() const {return Desc == Owner->DescP?true:false;}; + inline bool end() const {return Owner == 0 || Desc == Owner->DescP?true:false;}; inline void operator =(const DescIterator &B) {Desc = B.Desc; Owner = B.Owner;}; // Comparison @@@ -199,8 -199,8 +199,8 @@@ Desc = Owner.DescP; }; }; - - // Dependency iterator + /*}}}*/ + // Dependency iterator /*{{{*/ class pkgCache::DepIterator { Dependency *Dep; @@@ -258,8 -258,8 +258,8 @@@ }; inline DepIterator() : Dep(0), Type(DepVer), Owner(0) {}; }; - - // Provides iterator + /*}}}*/ + // Provides iterator /*{{{*/ class pkgCache::PrvIterator { Provides *Prv; @@@ -311,8 -311,8 +311,8 @@@ Prv = Owner.ProvideP; }; }; - - // Package file + /*}}}*/ + // Package file /*{{{*/ class pkgCache::PkgFileIterator { pkgCache *Owner; @@@ -323,7 -323,7 +323,7 @@@ // Iteration void operator ++(int) {if (File!= Owner->PkgFileP) File = Owner->PkgFileP + File->NextFile;}; inline void operator ++() {operator ++(0);}; - inline bool end() const {return File == Owner->PkgFileP?true:false;}; + inline bool end() const {return Owner == 0 || File == Owner->PkgFileP?true:false;}; // Comparison inline bool operator ==(const PkgFileIterator &B) const {return File == B.File;}; @@@ -358,8 -358,8 +358,8 @@@ inline PkgFileIterator(pkgCache &Owner) : Owner(&Owner), File(Owner.PkgFileP) {}; inline PkgFileIterator(pkgCache &Owner,PackageFile *Trg) : Owner(&Owner), File(Trg) {}; }; - - // Version File + /*}}}*/ + // Version File /*{{{*/ class pkgCache::VerFileIterator { pkgCache *Owner; @@@ -370,7 -370,7 +370,7 @@@ // Iteration void operator ++(int) {if (FileP != Owner->VerFileP) FileP = Owner->VerFileP + FileP->NextFile;}; inline void operator ++() {operator ++(0);}; - inline bool end() const {return FileP == Owner->VerFileP?true:false;}; + inline bool end() const {return Owner == 0 || FileP == Owner->VerFileP?true:false;}; // Comparison inline bool operator ==(const VerFileIterator &B) const {return FileP == B.FileP;}; @@@ -390,8 -390,8 +390,8 @@@ inline VerFileIterator() : Owner(0), FileP(0) {}; inline VerFileIterator(pkgCache &Owner,VerFile *Trg) : Owner(&Owner), FileP(Trg) {}; }; - - // Description File + /*}}}*/ + // Description File /*{{{*/ class pkgCache::DescFileIterator { pkgCache *Owner; @@@ -402,7 -402,7 +402,7 @@@ // Iteration void operator ++(int) {if (FileP != Owner->DescFileP) FileP = Owner->DescFileP + FileP->NextFile;}; inline void operator ++() {operator ++(0);}; - inline bool end() const {return FileP == Owner->DescFileP?true:false;}; + inline bool end() const {return Owner == 0 || FileP == Owner->DescFileP?true:false;}; // Comparison inline bool operator ==(const DescFileIterator &B) const {return FileP == B.FileP;}; @@@ -422,8 -422,8 +422,8 @@@ inline DescFileIterator() : Owner(0), FileP(0) {}; inline DescFileIterator(pkgCache &Owner,DescFile *Trg) : Owner(&Owner), FileP(Trg) {}; }; - - // Inlined Begin functions cant be in the class because of order problems + /*}}}*/ + // Inlined Begin functions cant be in the class because of order problems /*{{{*/ inline pkgCache::VerIterator pkgCache::PkgIterator::VersionList() const {return VerIterator(*Owner,Owner->VerP + Pkg->VersionList);}; inline pkgCache::VerIterator pkgCache::PkgIterator::CurrentVer() const @@@ -442,5 -442,5 +442,5 @@@ inline pkgCache::VerFileIterator pkgCac {return VerFileIterator(*Owner,Owner->VerFileP + Ver->FileList);}; inline pkgCache::DescFileIterator pkgCache::DescIterator::FileList() const {return DescFileIterator(*Owner,Owner->DescFileP + Desc->FileList);}; - + /*}}}*/ #endif diff --combined apt-pkg/cdrom.cc index a31602dfa,891c59836..8796805bb --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@@ -160,7 -160,7 +160,7 @@@ bool pkgCdrom::FindPackages(string CD return !_error->PendingError(); } - + /*}}}*/ // Score - We compute a 'score' for a path /*{{{*/ // --------------------------------------------------------------------- /* Paths are scored based on how close they come to what I consider @@@ -210,7 -210,6 +210,6 @@@ int pkgCdrom::Score(string Path return Res; } - /*}}}*/ // DropBinaryArch - Dump dirs with a string like /binary-/ /*{{{*/ // --------------------------------------------------------------------- @@@ -248,8 -247,7 +247,7 @@@ bool pkgCdrom::DropBinaryArch(vectorFindB("APT::CDROM::NoMount",false) == false) UnmountCdrom(CDROM); - return _error->Error("Unable to locate any package files, perhaps this is not a Debian Disc"); + return _error->Error(_("Unable to locate any package files, perhaps this is not a Debian Disc or the wrong architecture?")); } // Check if the CD is in the database @@@ -844,3 -839,4 +839,4 @@@ return true; } + /*}}}*/ diff --combined apt-pkg/contrib/hashes.cc index 70f2db06d,52b9bfbe6..b43771ea7 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@@ -34,7 -34,7 +34,7 @@@ HashString::HashString(string Type, str { } - HashString::HashString(string StringedHash) + HashString::HashString(string StringedHash) /*{{{*/ { // legacy: md5sum without "MD5Sum:" prefix if (StringedHash.find(":") == string::npos && StringedHash.size() == 32) @@@ -50,9 -50,8 +50,8 @@@ if(_config->FindB("Debug::Hashes",false) == true) std::clog << "HashString(string): " << Type << " : " << Hash << std::endl; } - - - bool HashString::VerifyFile(string filename) const + /*}}}*/ + bool HashString::VerifyFile(string filename) const /*{{{*/ { FileFd fd; MD5Summation MD5; @@@ -83,7 -82,7 +82,7 @@@ return (fileHash == Hash); } - + /*}}}*/ const char** HashString::SupportedHashes() { return _SupportedHashes; @@@ -94,13 -93,11 +93,11 @@@ bool HashString::empty() cons return (Type.empty() || Hash.empty()); } - string HashString::toStr() const { return Type+string(":")+Hash; } - // Hashes::AddFD - Add the contents of the FD /*{{{*/ // --------------------------------------------------------------------- /* */ @@@ -108,16 -105,11 +105,16 @@@ bool Hashes::AddFD(int Fd,unsigned lon { unsigned char Buf[64*64]; int Res = 0; - while (Size != 0) + int ToEOF = (Size == 0); + while (Size != 0 || ToEOF) { - Res = read(Fd,Buf,min(Size,(unsigned long)sizeof(Buf))); - if (Res < 0 || (unsigned)Res != min(Size,(unsigned long)sizeof(Buf))) - return false; + unsigned n = sizeof(Buf); + if (!ToEOF) n = min(Size,(unsigned long)n); + Res = read(Fd,Buf,n); + if (Res < 0 || (!ToEOF && (unsigned) Res != n)) // error, or short read + return false; + if (ToEOF && Res == 0) // EOF + break; Size -= Res; MD5.Add(Buf,Res); SHA1.Add(Buf,Res); diff --combined apt-pkg/contrib/mmap.cc index 04a45811b,ba4482131..229b18037 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@@ -13,11 -13,6 +13,6 @@@ libc6 generates warnings -- which should be errors, g++ isn't properly strict. - The configure test notes that some OS's have broken private mmap's - so on those OS's we can't use mmap. This means we have to use - configure to test mmap and can't rely on the POSIX - _POSIX_MAPPED_FILES test. - ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ @@@ -31,6 -26,7 +26,7 @@@ #include #include #include + #include #include /*}}}*/ @@@ -141,10 -137,11 +137,11 @@@ bool MMap::Sync(unsigned long Start,uns } /*}}}*/ + /*}}}*/ // DynamicMMap::DynamicMMap - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ - DynamicMMap::DynamicMMap(FileFd &F,unsigned long Flags,unsigned long WorkSpace) : + DynamicMMap::DynamicMMap(FileFd &F,unsigned long Flags,unsigned long WorkSpace) : MMap(F,Flags | NoImmMap), Fd(&F), WorkSpace(WorkSpace) { if (_error->PendingError() == true) @@@ -166,15 -163,25 +163,26 @@@ /*}}}*/ // DynamicMMap::DynamicMMap - Constructor for a non-file backed map /*{{{*/ // --------------------------------------------------------------------- - /* This is just a fancy malloc really.. */ + /* We try here to use mmap to reserve some space - this is much more + cooler than the fallback solution to simply allocate a char array + and could come in handy later than we are able to grow such an mmap */ DynamicMMap::DynamicMMap(unsigned long Flags,unsigned long WorkSpace) : MMap(Flags | NoImmMap | UnMapped), Fd(0), WorkSpace(WorkSpace) { if (_error->PendingError() == true) return; - + + #ifdef _POSIX_MAPPED_FILES + // use anonymous mmap() to get the memory + Base = (unsigned char*) mmap(0, WorkSpace, PROT_READ|PROT_WRITE, - MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); - if(Base != MAP_FAILED) ++ MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); ++ if(Base == MAP_FAILED) + return; -#endif ++#else + // fallback to a static allocated space Base = new unsigned char[WorkSpace]; memset(Base,0,WorkSpace); ++#endif iSize = 0; } /*}}}*/ @@@ -185,7 -192,11 +193,11 @@@ DynamicMMap::~DynamicMMap( { if (Fd == 0) { + #ifdef _POSIX_MAPPED_FILES - munmap(Base, WorkSpace); ++ if(munmap(Base, WorkSpace) < 0) + #else delete [] (unsigned char *)Base; + #endif return; } @@@ -204,17 -215,19 +216,19 @@@ unsigned long DynamicMMap::RawAllocate( unsigned long Result = iSize; if (Aln != 0) Result += Aln - (iSize%Aln); - + iSize = Result + Size; - - // Just in case error check - if (Result + Size > WorkSpace) + + // try to grow the buffer + while(Result + Size > WorkSpace) { - _error->Error(_("Dynamic MMap ran out of room. Please increase the size " - "of APT::Cache-Limit. Current value: %lu. (man 5 apt.conf)"), WorkSpace); - return 0; + if(!Grow()) + { + _error->Error(_("Dynamic MMap ran out of room. Please increase the size " + "of APT::Cache-Limit. Current value: %lu. (man 5 apt.conf)"), WorkSpace); + return 0; + } } - return Result; } /*}}}*/ @@@ -223,7 -236,7 +237,7 @@@ /* This allocates an Item of size ItemSize so that it is aligned to its size in the file. */ unsigned long DynamicMMap::Allocate(unsigned long ItemSize) - { + { // Look for a matching pool entry Pool *I; Pool *Empty = 0; @@@ -234,7 -247,6 +248,6 @@@ if (I->ItemSize == ItemSize) break; } - // No pool is allocated, use an unallocated one if (I == Pools + PoolCount) { @@@ -249,17 -261,24 +262,24 @@@ I->ItemSize = ItemSize; I->Count = 0; } - + + unsigned long Result = 0; // Out of space, allocate some more if (I->Count == 0) { - I->Count = 20*1024/ItemSize; - I->Start = RawAllocate(I->Count*ItemSize,ItemSize); - } + const unsigned long size = 20*1024; + I->Count = size/ItemSize; + Result = RawAllocate(size,ItemSize); + // Does the allocation failed ? + if (Result == 0 && _error->PendingError()) + return 0; + I->Start = Result; + } + else + Result = I->Start; I->Count--; - unsigned long Result = I->Start; - I->Start += ItemSize; + I->Start += ItemSize; return Result/ItemSize; } /*}}}*/ @@@ -269,20 -288,45 +289,45 @@@ unsigned long DynamicMMap::WriteString(const char *String, unsigned long Len) { - unsigned long Result = iSize; - // Just in case error check - if (Result + Len > WorkSpace) - { - _error->Error(_("Dynamic MMap ran out of room. Please increase the size " - "of APT::Cache-Limit. Current value: %lu. (man 5 apt.conf)"), WorkSpace); - return 0; - } - if (Len == (unsigned long)-1) Len = strlen(String); - iSize += Len + 1; + + unsigned long Result = RawAllocate(Len+1,0); + + if (Result == 0 && _error->PendingError()) + return 0; + memcpy((char *)Base + Result,String,Len); ((char *)Base)[Result + Len] = 0; return Result; } /*}}}*/ + // DynamicMMap::Grow - Grow the mmap /*{{{*/ + // --------------------------------------------------------------------- + /* This method will try to grow the mmap we currently use. This doesn't + work most of the time because we can't move the mmap around in the + memory for now as this would require to adjust quite a lot of pointers + but why we should not at least try to grow it before we give up? */ + bool DynamicMMap::Grow() + { + #ifdef _POSIX_MAPPED_FILES + unsigned long newSize = WorkSpace + 1024*1024; + + if(Fd != 0) + { + Fd->Seek(newSize - 1); + char C = 0; + Fd->Write(&C,sizeof(C)); + } + + Base = mremap(Base, WorkSpace, newSize, 0); + if(Base == MAP_FAILED) + return false; + + WorkSpace = newSize; + return true; + #else + return false; + #endif + } + /*}}}*/ diff --combined apt-pkg/indexcopy.cc index 5a92c79b7,22ee29697..15696585a --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@@ -522,15 -522,6 +522,15 @@@ bool SigVerify::Verify(string prefix, s { const indexRecords::checkSum *Record = MetaIndex->Lookup(file); + // we skip non-existing files in the verifcation to support a cdrom + // with no Packages file (just a Package.gz), see LP: #255545 + // (non-existing files are not considered a error) + if(!FileExists(prefix+file)) + { + _error->Warning("Skipping non-exisiting file %s", string(prefix+file).c_str()); + return true; + } + if (!Record) { _error->Warning("Can't find authentication record for: %s",file.c_str()); @@@ -551,8 -542,8 +551,8 @@@ return true; } - - bool SigVerify::CopyMetaIndex(string CDROM, string CDName, + /*}}}*/ + bool SigVerify::CopyMetaIndex(string CDROM, string CDName, /*{{{*/ string prefix, string file) { char S[400]; @@@ -572,8 -563,8 +572,8 @@@ return true; } - - bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, + /*}}}*/ + bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, /*{{{*/ vector PkgList,vector SrcList) { if (SigList.size() == 0) @@@ -660,7 -651,6 +660,7 @@@ if(!Verify(prefix,*I, MetaIndex)) { // something went wrong, don't copy the Release.gpg // FIXME: delete any existing gpg file? + _error->Discard(); continue; } } @@@ -675,10 -665,9 +675,9 @@@ return true; } - - - bool TranslationsCopy::CopyTranslations(string CDROM,string Name,vector &List, - pkgCdromStatus *log) + /*}}}*/ + bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ + vector &List, pkgCdromStatus *log) { OpProgress *Progress = NULL; if (List.size() == 0) @@@ -850,3 -839,4 +849,4 @@@ return true; } + /*}}}*/ diff --combined apt-pkg/indexrecords.cc index ab208e246,77fe03d45..1fc27b1a1 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@@ -9,7 -9,7 +9,7 @@@ #include #include #include - + /*}}}*/ string indexRecords::GetDist() const { return this->Dist; @@@ -31,20 -31,20 +31,20 @@@ const indexRecords::checkSum *indexReco return Entries[MetaKey]; } - bool indexRecords::Load(const string Filename) + bool indexRecords::Load(const string Filename) /*{{{*/ { FileFd Fd(Filename, FileFd::ReadOnly); pkgTagFile TagFile(&Fd, Fd.Size() + 256); // XXX if (_error->PendingError() == true) { - ErrorText = _(("Unable to parse Release file " + Filename).c_str()); + strprintf(ErrorText, _("Unable to parse Release file %s"),Filename.c_str()); return false; } pkgTagSection Section; if (TagFile.Step(Section) == false) { - ErrorText = _(("No sections in Release file " + Filename).c_str()); + strprintf(ErrorText, _("No sections in Release file %s"), Filename.c_str()); return false; } @@@ -78,15 -78,15 +78,15 @@@ if(HashString::SupportedHashes()[i] == NULL) { - ErrorText = _(("No Hash entry in Release file " + Filename).c_str()); + strprintf(ErrorText, _("No Hash entry in Release file %s"), Filename.c_str()); return false; } string Strdate = Section.FindS("Date"); // FIXME: verify this somehow? return true; } - - vector indexRecords::MetaKeys() + /*}}}*/ + vector indexRecords::MetaKeys() /*{{{*/ { std::vector keys; std::map::iterator I = Entries.begin(); @@@ -96,8 -96,8 +96,8 @@@ } return keys; } - - bool indexRecords::parseSumData(const char *&Start, const char *End, + /*}}}*/ + bool indexRecords::parseSumData(const char *&Start, const char *End, /*{{{*/ string &Name, string &Hash, size_t &Size) { Name = ""; @@@ -154,7 -154,7 +154,7 @@@ Start = EntryEnd; //prepare for the next round return true; } - + /*}}}*/ indexRecords::indexRecords() { } diff --combined cmdline/apt-cache.cc index c30e22b76,57da9426f..0e950310b --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@@ -102,13 -102,15 +102,13 @@@ bool UnMet(CommandLine &CmdL if (End->Type != pkgCache::Dep::PreDepends && End->Type != pkgCache::Dep::Depends && End->Type != pkgCache::Dep::Suggests && - End->Type != pkgCache::Dep::Recommends && - End->Type != pkgCache::Dep::DpkgBreaks) + End->Type != pkgCache::Dep::Recommends) continue; // Important deps only if (Important == true) if (End->Type != pkgCache::Dep::PreDepends && - End->Type != pkgCache::Dep::Depends && - End->Type != pkgCache::Dep::DpkgBreaks) + End->Type != pkgCache::Dep::Depends) continue; // Verify the or group @@@ -555,7 -557,6 +555,7 @@@ bool Depends(CommandLine &CmdL bool Recurse = _config->FindB("APT::Cache::RecurseDepends",false); bool Installed = _config->FindB("APT::Cache::Installed",false); + bool Important = _config->FindB("APT::Cache::Important",false); bool DidSomething; do { @@@ -578,12 -579,7 +578,12 @@@ for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++) { - + // Important deps only + if (Important == true) + if (D->Type != pkgCache::Dep::PreDepends && + D->Type != pkgCache::Dep::Depends) + continue; + pkgCache::PkgIterator Trg = D.TargetPkg(); if((Installed && Trg->CurrentVer != 0) || !Installed) @@@ -626,7 -622,7 +626,7 @@@ return true; } - + /*}}}*/ // RDepends - Print out a reverse dependency tree - mbc /*{{{*/ // --------------------------------------------------------------------- /* */ @@@ -714,10 -710,7 +714,7 @@@ bool RDepends(CommandLine &CmdL return true; } - /*}}}*/ - - // xvcg - Generate a graph for xvcg /*{{{*/ // --------------------------------------------------------------------- // Code contributed from Junichi Uekawa on 20 June 2002. @@@ -937,8 -930,6 +934,6 @@@ bool XVcg(CommandLine &CmdL return true; } /*}}}*/ - - // Dotty - Generate a graph for Dotty /*{{{*/ // --------------------------------------------------------------------- /* Dotty is the graphvis program for generating graphs. It is a fairly @@@ -1274,15 -1265,16 +1269,16 @@@ bool DisplayRecord(pkgCache::VerIterato return true; } /*}}}*/ - // Search - Perform a search /*{{{*/ - // --------------------------------------------------------------------- - /* This searches the package names and package descriptions for a pattern */ + struct ExDescFile { pkgCache::DescFile *Df; bool NameMatch; }; + // Search - Perform a search /*{{{*/ + // --------------------------------------------------------------------- + /* This searches the package names and package descriptions for a pattern */ bool Search(CommandLine &CmdL) { pkgCache &Cache = *GCache; @@@ -1533,8 -1525,7 +1529,8 @@@ bool Policy(CommandLine &CmdL if (SrcList->FindIndex(F,Indx) == false && _system->FindIndex(F,Indx) == false) return _error->Error(_("Cache is out of sync, can't x-ref a package file")); - printf(_("%4i %s\n"), + + printf("%4i %s\n", Plcy.GetPriority(F),Indx->Describe(true).c_str()); // Print the reference information for the package @@@ -1696,7 -1687,6 +1692,6 @@@ bool Madison(CommandLine &CmdL return true; } - /*}}}*/ // GenCaches - Call the main cache generator /*{{{*/ // --------------------------------------------------------------------- @@@ -1770,8 -1760,7 +1765,7 @@@ void CacheInitialize( _config->Set("help",false); } /*}}}*/ - - int main(int argc,const char *argv[]) + int main(int argc,const char *argv[]) /*{{{*/ { CommandLine::Args Args[] = { {'h',"help","help",0}, @@@ -1878,3 -1867,4 +1872,4 @@@ return 0; } + /*}}}*/ diff --combined debian/changelog index 6e03bbbd4,ea7e0469b..970c7029f --- a/debian/changelog +++ b/debian/changelog @@@ -1,11 -1,9 +1,13 @@@ apt (0.7.22) UNRELEASED; urgency=low ++ The 'not dead yet' release ++ [ Christian Perrier ] * Documentation translations: - Fix a typo in apt-get(8) French translation. Closes: #525043 Thanks to Guillaume Delacour for spotting it. + - Updated apt.conf(5) manpgae French translation. + Thanks to Aurélien Couderc. * Translations: - fr.po - sk.po. Closes: #525857 @@@ -32,58 -30,22 +34,64 @@@ * add Debug::pkgProblemResolver::ShowScores and make the scores adjustable * do not write state file in simulate mode (closes: #433007) - * add hook for auto-install (closes: #470035) - * support IsAutoInstallOk in the resolver too + * add hook for MarkInstall and MarkDelete (closes: #470035) * fix typo in apt-pkg/acquire.cc which prevents Dl-Limit to work correctly when downloading from multiple sites (Closes: #534752) + * add the various foldmarkers in apt-pkg & cmdline (no code change) + * versions with a pin of -1 shouldn't be a candidate (Closes: #355237) + * prefer mmap as memory allocator in MMap instead of a static char + array which can (at least in theory) grow dynamic + * eliminate (hopefully all) segfaults in pkgcachegen.cc and mmap.cc + which can arise if cache doesn't fit into the mmap (Closes: #535218) + * display warnings instead of errors if the parts dirs doesn't exist [ Michael Vogt ] - * honor the dpkg hold state in AutoInstOk (closes: #64141) + * honor the dpkg hold state in new Marker hooks (closes: #64141) * debian/apt.cron.daily: - if the timestamp is too far in the future, delete it - + * apt-pkg/acquire.cc: + - make the max pipeline depth of the acquire queue configurable + via Acquire::Max-Pipeline-Depth + * apt-pkg/deb/dpkgpm.cc: + - add Dpkg::UseIoNice boolean option to run dpkg with ionice -c3 + (off by default) + - send "dpkg-exec" message on the status fd when dpkg is run + - provide DPkg::Chroot-Directory config option (useful for testing) + - fix potential hang when in a backgroud process group + * apt-pkg/algorithms.cc: + - consider recommends when making the scores for the problem + resolver + * apt-pkg/acquire-worker.cc: + - show error details of failed methods + * apt-pkg/contrib/fileutl.cc: + - if a process aborts with signal, show signal number + * methods/http.cc: + - ignore SIGPIPE, we deal with EPIPE from write in + HttpMethod::ServerDie() (LP: #385144) + * apt-pkg/indexcopy.cc: + - support having CDs with no Packages file (just a Packages.gz) + by not forcing a verification on non-existing files + (LP: #255545) + - remove the gettext from a string that consists entirely + of variables (LP: #56792) + * apt-pkg/cacheiterators.h: + - add missing checks for Owner == 0 in end() + * apt-pkg/indexrecords.cc: + - fix some i18n issues + * apt-pkg/contrib/strutl.h: + - add new strprintf() function to make i18n strings easier + - fix compiler warning + * apt-pkg/deb/debsystem.cc: + - make strings i18n able + * fix problematic use of tolower() when calculating the version + hash by using locale independant tolower_ascii() function. + Thanks to M. Vefa Bicakci (LP: #80248) + * build fixes for g++-4.4 + * cmdline/apt-mark: + - add "showauto" option to show automatically installed packages + * document --install-recommends and --no-install-recommends + (thanks to Dereck Wonnacott, LP: #126180) + [ Julian Andres Klode ] * apt-pkg/contrib/configuration.cc: Fix a small memory leak in ReadConfigFile. @@@ -92,25 -54,7 +100,23 @@@ * configure-index: document Dir::Etc::SourceParts and some other options (Closes: #459605) * Remove Eugene V. Lyubimkin from uploaders as requested. + * apt-pkg/contrib/hashes.cc, apt-pkg/contrib/md5.cc: + - Support reading until EOF if Size=0 to match behaviour of + SHA1Summation and SHA256Summation + + [ Osamu Aoki ] + * Updated cron script to support backups by hardlinks and + verbose levels. All features turned off by default. + * Added more error handlings. Closes: #438803, #462734, #454989, + * Refactored condition structure to make download and upgrade performed + if only previous steps succeeded. Closes: #341970 + * Documented all cron script related configuration items in + configure-index. + + [ Dereck Wonnacott ] + * apt-ftparchive might write corrupt Release files (LP: #46439) + * Apply --important option to apt-cache depends (LP: #16947) - - -- Julian Andres Klode Fri, 03 Jul 2009 08:27:35 +0200 apt (0.7.21) unstable; urgency=low diff --combined doc/apt-get.8.xml index 609674d75,50971d0f5..920f6b36e --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@@ -364,7 -364,8 +364,8 @@@ Configuration Item: APT::Get::Simulate. Simulation run as user will deactivate locking (Debug::NoLocking) - automatical and display a notice indicating that this is only a simulation. + automatical. Also a notice will be displayed indicating that this is only a simulation, + if the option APT::Get::Show-User-Simulation-Note is set (Default: true) Neigther NoLocking nor the notice will be triggered if run as root (root should know what he is doing without further warnings by apt-get). @@@ -401,14 -402,6 +402,14 @@@ Configuration Item: APT::Get::Compile. + + Also install recommended packages. + + + + Do not install recommended packages. + + Ignore package Holds; This causes apt-get to ignore a hold placed on a package. This may be useful in conjunction with diff --combined doc/examples/configure-index index ada6b12ce,2045ca1f3..5dc7b5246 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@@ -55,6 -55,7 +55,7 @@@ AP Diff-Only "false"; Tar-Only "false"; Build-Dep-Automatic "true"; + Show-User-Simulation-Note "true"; }; Cache @@@ -115,56 -116,6 +116,56 @@@ // Keep the list of FDs open (normally apt closes all fds when it // does a ExecFork) Keep-Fds {}; + + // control parameters for cron jobs by /etc/cron.daily/apt + Periodic + { + BackupArchiveInterval "0"; + // - Backup after n-days if archive contents changed.(0=disable) + + BackupLevel "3"; + // - Backup level.(0=disable), 1 is invalid. + + // APT::Archives::MaxAge "0"; (old, deprecated) + MaxAge "0"; // (new) + // - Set maximum allowed age of a cache package file. If a cache + // package file is older it is deleted (0=disable) + + // APT::Archives::MinAge "2"; (old, deprecated) + MinAge "2"; // (new) + // - Set minimum age of a package file. If a file is younger it + // will not be deleted (0=disable). Usefull to prevent races + // and to keep backups of the packages for emergency. + + // APT::Archives::MaxSize "0"; (old, deprecated) + MaxSize "0"; // (new) + // - Set maximum size of the cache in MB (0=disable). If the cache + // is bigger, cached package files are deleted until the size + // requirement is met (the biggest packages will be deleted + // first). + + Update-Package-Lists "0"; + // - Do "apt-get update" automatically every n-days (0=disable) + // + Download-Upgradeable-Packages "0"; + // - Do "apt-get upgrade --download-only" every n-days (0=disable) + // + Unattended-Upgrade "0"; + // - Run the "unattended-upgrade" security upgrade script + // every n-days (0=disabled) + // Requires the package "unattended-upgrades" and will write + // a log in /var/log/unattended-upgrades + // + AutocleanInterval "0"; + // - Do "apt-get autoclean" every n-days (0=disable) + + Verbose "0"; + // - Send report mail to root + // 0: no report (or null string) + // 1: progress report (actually any string) + // 2: + command outputs (remove -qq, remove 2>/dev/null, add -d) + // 3: + trace on + }; }; // Options for the downloading routines @@@ -263,8 -214,6 +264,8 @@@ Dir "/ // Location of the cache dir Cache "var/cache/apt/" { Archives "archives/"; + // backup directory created by /etc/cron.daily/apt + Backup "backup/"; srcpkgcache "srcpkgcache.bin"; pkgcache "pkgcache.bin"; };