From 5530255b5f3ad7de2e23dfcb39ce325001126501 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 17 Mar 2015 09:59:41 +0100 Subject: Add "ca-certificates" recommends to apt-transport-https The rational is that https downloads fail with cryptic error messages if the certificates are missing. --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 8c3eea3f1..e71cb5103 100644 --- a/debian/control +++ b/debian/control @@ -121,6 +121,7 @@ Description: package management related utility programs Package: apt-transport-https Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: ca-certificates Priority: optional Description: https download transport for APT This package enables the usage of 'deb https://foo distro main' lines -- cgit v1.2.3 From 58702f8563a443a7c6e66253b259c2488b877290 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 19 May 2015 10:40:55 +0200 Subject: don't try other compressions on hashsum mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we e.g. fail on hash verification for Packages.xz its highly unlikely that it will be any better with Packages.gz, so we just waste download bandwidth and time. It also causes us always to fallback to the uncompressed Packages file for which the error will finally be reported, which in turn confuses users as the file usually doesn't exist on the mirrors, so a bug in apt is suspected for even trying it… --- apt-pkg/acquire-item.cc | 33 +++++++++++++++++++-------- test/integration/test-apt-update-not-modified | 23 +++++++++++++++++-- test/integration/test-apt-update-rollback | 4 ++-- test/integration/test-apt-update-transactions | 8 +++++-- 4 files changed, 52 insertions(+), 16 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 8155b9bfe..cf89717c4 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -154,7 +154,18 @@ void pkgAcquire::Item::Failed(string Message,pkgAcquire::MethodConfig *Cnf) return; } - Status = StatError; + switch (Status) + { + case StatIdle: + case StatFetching: + case StatDone: + Status = StatError; + break; + case StatAuthError: + case StatError: + case StatTransientNetworkError: + break; + } Complete = false; Dequeue(); } @@ -167,7 +178,7 @@ void pkgAcquire::Item::Failed(string Message,pkgAcquire::MethodConfig *Cnf) RenameOnError(MaximumSizeExceeded); // report mirror failure back to LP if we actually use a mirror - if(FailReason.size() != 0) + if(FailReason.empty() == false) ReportMirrorFailure(FailReason); else ReportMirrorFailure(ErrorText); @@ -1403,17 +1414,19 @@ void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) { Item::Failed(Message,Cnf); - size_t const nextExt = CompressionExtensions.find(' '); - if (nextExt != std::string::npos) + // authorisation matches will not be fixed by other compression types + if (Status != StatAuthError) { - CompressionExtensions = CompressionExtensions.substr(nextExt+1); - Init(RealURI, Desc.Description, Desc.ShortDesc); - Status = StatIdle; - return; + size_t const nextExt = CompressionExtensions.find(' '); + if (nextExt != std::string::npos) + { + CompressionExtensions = CompressionExtensions.substr(nextExt+1); + Init(RealURI, Desc.Description, Desc.ShortDesc); + Status = StatIdle; + return; + } } - Item::Failed(Message,Cnf); - if(Target->IsOptional() && ExpectedHashes.empty() && Stage == STAGE_DOWNLOAD) Status = StatDone; else diff --git a/test/integration/test-apt-update-not-modified b/test/integration/test-apt-update-not-modified index b1d55c156..bac33d531 100755 --- a/test/integration/test-apt-update-not-modified +++ b/test/integration/test-apt-update-not-modified @@ -14,6 +14,7 @@ setupaptarchive --no-update methodtest() { msgmsg 'Test InRelease with' "$1" rm -rf rootdir/var/lib/apt/lists + cp -a aptarchive/dists aptarchive/dists.good # get our cache populated testsuccess aptget update listcurrentlistsdirectory > listsdir.lst @@ -30,8 +31,27 @@ Reading package lists..." aptget update Reading package lists..." aptget update testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)" - # readd arch so its downloaded again + # readd arch so its downloaded again… configarchitecture 'amd64' 'i386' + # … but oh noes, hashsum mismatch! + find aptarchive/dists/unstable/main/binary-amd64/ -type f -delete + cat >> aptarchive/dists/unstable/main/binary-amd64/Packages < "$1" < listsdir.lst redatereleasefiles '+1hour' testrun 'listsdir.lst' -- cgit v1.2.3 From 448c38bdcd72b52f11ec5f326f822cf57653f81c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 6 Jun 2015 12:28:00 +0200 Subject: rework hashsum verification in the acquire system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Having every item having its own code to verify the file(s) it handles is an errorprune process and easy to break, especially if items move through various stages (download, uncompress, patching, …). With a giant rework we centralize (most of) the verification to have a better enforcement rate and (hopefully) less chance for bugs, but it breaks the ABI bigtime in exchange – and as we break it anyway, it is broken even harder. It shouldn't effect most frontends as they don't deal with the acquire system at all or implement their own items, but some do and will need to be patched (might be an opportunity to use apt on-board material). The theory is simple: Items implement methods to decide if hashes need to be checked (in this stage) and to return the expected hashes for this item (in this stage). The verification itself is done in worker message passing which has the benefit that a hashsum error is now a proper error for the acquire system rather than a Done() which is later revised to a Failed(). --- apt-pkg/acquire-item.cc | 3750 ++++++++++---------- apt-pkg/acquire-item.h | 677 ++-- apt-pkg/acquire-method.cc | 5 +- apt-pkg/acquire-worker.cc | 189 +- apt-pkg/contrib/hashes.cc | 10 + apt-pkg/contrib/hashes.h | 9 + apt-pkg/deb/debindexfile.cc | 4 +- apt-pkg/deb/debmetaindex.cc | 78 +- apt-pkg/indexrecords.cc | 2 +- apt-pkg/pkgcache.h | 7 +- methods/file.cc | 6 +- test/integration/test-apt-get-source-authenticated | 2 +- test/integration/test-apt-sources-deb822 | 55 +- test/integration/test-apt-update-expected-size | 2 +- test/integration/test-apt-update-file | 4 + test/integration/test-apt-update-nofallback | 11 +- test/integration/test-apt-update-not-modified | 30 +- test/integration/test-apt-update-stale | 9 +- .../test-bug-595691-empty-and-broken-archive-files | 2 +- .../test-ubuntu-bug-1098738-apt-get-source-md5sum | 8 + test/libapt/acqprogress_test.cc | 6 +- test/libapt/hashsums_test.cc | 3 + 22 files changed, 2411 insertions(+), 2458 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index cf89717c4..ec6ec6e84 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -107,36 +107,296 @@ static bool AllowInsecureRepositories(indexRecords const * const MetaIndexParser } /*}}}*/ +// all ::HashesRequired and ::GetExpectedHashes implementations /*{{{*/ +/* ::GetExpectedHashes is abstract and has to be implemented by all subclasses. + It is best to implement it as broadly as possible, while ::HashesRequired defaults + to true and should be as restrictive as possible for false cases. Note that if + a hash is returned by ::GetExpectedHashes it must match. Only if it doesn't + ::HashesRequired is called to evaluate if its okay to have no hashes. */ +APT_CONST bool pkgAcqTransactionItem::HashesRequired() const +{ + /* signed repositories obviously have a parser and good hashes. + unsigned repositories, too, as even if we can't trust them for security, + we can at least trust them for integrity of the download itself. + Only repositories without a Release file can (obviously) not have + hashes – and they are very uncommon and strongly discouraged */ + return TransactionManager->MetaIndexParser != NULL; +} +HashStringList pkgAcqTransactionItem::GetExpectedHashes() const +{ + return GetExpectedHashesFor(GetMetaKey()); +} + +APT_CONST bool pkgAcqMetaBase::HashesRequired() const +{ + // Release and co have no hashes 'by design'. + return false; +} +HashStringList pkgAcqMetaBase::GetExpectedHashes() const +{ + return HashStringList(); +} + +APT_CONST bool pkgAcqIndexDiffs::HashesRequired() const +{ + /* FIXME: We have only hashes for uncompressed pdiffs. + rred uncompresses them on the fly while parsing. + In StateFetchDiff state we also uncompress on the fly for hash check. + Hashes are checked while searching for (next) patch to apply. */ + return false; +} +HashStringList pkgAcqIndexDiffs::GetExpectedHashes() const +{ + return HashStringList(); +} + +APT_CONST bool pkgAcqIndexMergeDiffs::HashesRequired() const +{ + /* @see #pkgAcqIndexDiffs::HashesRequired, with the difference that + we can check the rred result after all patches are applied as + we know the expected result rather than potentially apply more patches */ + return State == StateApplyDiff; +} +HashStringList pkgAcqIndexMergeDiffs::GetExpectedHashes() const +{ + if (State == StateApplyDiff) + return GetExpectedHashesFor(Target->MetaKey); + return HashStringList(); +} + +APT_CONST bool pkgAcqArchive::HashesRequired() const +{ + return LocalSource == false; +} +HashStringList pkgAcqArchive::GetExpectedHashes() const +{ + // figured out while parsing the records + return ExpectedHashes; +} + +APT_CONST bool pkgAcqFile::HashesRequired() const +{ + // supplied as parameter at creation time, so the caller decides + return ExpectedHashes.usable(); +} +HashStringList pkgAcqFile::GetExpectedHashes() const +{ + return ExpectedHashes; +} + /*}}}*/ +// Acquire::Item::QueueURI and specialisations from child classes /*{{{*/ +bool pkgAcquire::Item::QueueURI(pkgAcquire::ItemDesc &Item) +{ + Owner->Enqueue(Item); + return true; +} +/* The idea here is that an item isn't queued if it exists on disk and the + transition manager was a hit as this means that the files it contains + the checksums for can't be updated either (or they are and we are asking + for a hashsum mismatch to happen which helps nobody) */ +bool pkgAcqTransactionItem::QueueURI(pkgAcquire::ItemDesc &Item) +{ + std::string const FinalFile = GetFinalFilename(); + if (TransactionManager != NULL && TransactionManager->IMSHit == true && + FileExists(FinalFile) == true) + { + PartialFile = DestFile = FinalFile; + Status = StatDone; + return false; + } + return pkgAcquire::Item::QueueURI(Item); +} +/* The transition manager InRelease itself (or its older sisters-in-law + Release & Release.gpg) is always queued as this allows us to rerun gpgv + on it to verify that we aren't stalled with old files */ +bool pkgAcqMetaBase::QueueURI(pkgAcquire::ItemDesc &Item) +{ + return pkgAcquire::Item::QueueURI(Item); +} +/* the Diff/Index needs to queue also the up-to-date complete index file + to ensure that the list cleaner isn't eating it */ +bool pkgAcqDiffIndex::QueueURI(pkgAcquire::ItemDesc &Item) +{ + if (pkgAcqTransactionItem::QueueURI(Item) == true) + return true; + QueueOnIMSHit(); + return false; +} + /*}}}*/ +// Acquire::Item::GetFinalFilename and specialisations for child classes /*{{{*/ +std::string pkgAcquire::Item::GetFinalFilename() const +{ + return GetFinalFileNameFromURI(Desc.URI); +} +std::string pkgAcqDiffIndex::GetFinalFilename() const +{ + // the logic we inherent from pkgAcqBaseIndex isn't what we need here + return pkgAcquire::Item::GetFinalFilename(); +} +std::string pkgAcqIndex::GetFinalFilename() const +{ + std::string const FinalFile = GetFinalFileNameFromURI(Target->URI); + return GetCompressedFileName(Target->URI, FinalFile, CurrentCompressionExtension); +} +std::string pkgAcqMetaSig::GetFinalFilename() const +{ + return GetFinalFileNameFromURI(Target->URI); +} +std::string pkgAcqBaseIndex::GetFinalFilename() const +{ + return GetFinalFileNameFromURI(Target->URI); +} +std::string pkgAcqMetaBase::GetFinalFilename() const +{ + return GetFinalFileNameFromURI(DataTarget.URI); +} +std::string pkgAcqArchive::GetFinalFilename() const +{ + return _config->FindDir("Dir::Cache::Archives") + flNotDir(StoreFilename); +} + /*}}}*/ +// pkgAcqTransactionItem::GetMetaKey and specialisations for child classes /*{{{*/ +std::string pkgAcqTransactionItem::GetMetaKey() const +{ + return Target->MetaKey; +} +std::string pkgAcqIndex::GetMetaKey() const +{ + if (Stage == STAGE_DECOMPRESS_AND_VERIFY || CurrentCompressionExtension == "uncompressed") + return Target->MetaKey; + return Target->MetaKey + "." + CurrentCompressionExtension; +} +std::string pkgAcqDiffIndex::GetMetaKey() const +{ + return Target->MetaKey + ".diff/Index"; +} + /*}}}*/ +//pkgAcqTransactionItem::TransactionState and specialisations for child classes /*{{{*/ +bool pkgAcqTransactionItem::TransactionState(TransactionStates const state) +{ + bool const Debug = _config->FindB("Debug::Acquire::Transaction", false); + switch(state) + { + case TransactionAbort: + if(Debug == true) + std::clog << " Cancel: " << DestFile << std::endl; + if (Status == pkgAcquire::Item::StatIdle) + { + Status = pkgAcquire::Item::StatDone; + Dequeue(); + } + break; + case TransactionCommit: + if(PartialFile != "") + { + if(Debug == true) + std::clog << "mv " << PartialFile << " -> "<< DestFile << " # " << DescURI() << std::endl; + + Rename(PartialFile, DestFile); + } else { + if(Debug == true) + std::clog << "rm " << DestFile << " # " << DescURI() << std::endl; + unlink(DestFile.c_str()); + } + break; + } + return true; +} +bool pkgAcqMetaBase::TransactionState(TransactionStates const state) +{ + // Do not remove InRelease on IMSHit of Release.gpg [yes, this is very edgecasey] + if (TransactionManager->IMSHit == false) + return pkgAcqTransactionItem::TransactionState(state); + return true; +} +bool pkgAcqIndex::TransactionState(TransactionStates const state) +{ + if (pkgAcqTransactionItem::TransactionState(state) == false) + return false; + + switch (state) + { + case TransactionAbort: + if (Stage == STAGE_DECOMPRESS_AND_VERIFY) + { + // keep the compressed file, but drop the decompressed + EraseFileName.clear(); + if (PartialFile.empty() == false && flExtension(PartialFile) == "decomp") + unlink(PartialFile.c_str()); + } + break; + case TransactionCommit: + if (EraseFileName.empty() == false) + unlink(EraseFileName.c_str()); + break; + } + return true; +} +bool pkgAcqDiffIndex::TransactionState(TransactionStates const state) +{ + if (pkgAcqTransactionItem::TransactionState(state) == false) + return false; + + switch (state) + { + case TransactionCommit: + break; + case TransactionAbort: + std::string const Partial = GetPartialFileNameFromURI(Target->URI); + unlink(Partial.c_str()); + break; + } + + return true; +} + /*}}}*/ // Acquire::Item::Item - Constructor /*{{{*/ APT_IGNORE_DEPRECATED_PUSH -pkgAcquire::Item::Item(pkgAcquire *Owner, - HashStringList const &ExpectedHashes, - pkgAcqMetaBase *TransactionManager) - : Owner(Owner), FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), - Local(false), QueueCounter(0), TransactionManager(TransactionManager), - ExpectedAdditionalItems(0), ExpectedHashes(ExpectedHashes) +pkgAcquire::Item::Item(pkgAcquire * const Owner) : + FileSize(0), PartialSize(0), Mode(0), Complete(false), Local(false), + QueueCounter(0), ExpectedAdditionalItems(0), Owner(Owner) { Owner->Add(this); Status = StatIdle; - if(TransactionManager != NULL) - TransactionManager->Add(this); } APT_IGNORE_DEPRECATED_POP /*}}}*/ // Acquire::Item::~Item - Destructor /*{{{*/ -// --------------------------------------------------------------------- -/* */ pkgAcquire::Item::~Item() { Owner->Remove(this); } /*}}}*/ +std::string pkgAcquire::Item::Custom600Headers() const /*{{{*/ +{ + return std::string(); +} + /*}}}*/ +std::string pkgAcquire::Item::ShortDesc() const /*{{{*/ +{ + return DescURI(); +} + /*}}}*/ +APT_CONST void pkgAcquire::Item::Finished() /*{{{*/ +{ +} + /*}}}*/ +APT_PURE pkgAcquire * pkgAcquire::Item::GetOwner() const /*{{{*/ +{ + return Owner; +} + /*}}}*/ +APT_CONST bool pkgAcquire::Item::IsTrusted() const /*{{{*/ +{ + return false; +} + /*}}}*/ // Acquire::Item::Failed - Item failed to download /*{{{*/ // --------------------------------------------------------------------- /* We return to an idle state if there are still other queues that could fetch this object */ -void pkgAcquire::Item::Failed(string Message,pkgAcquire::MethodConfig *Cnf) +void pkgAcquire::Item::Failed(string const &Message,pkgAcquire::MethodConfig const * const Cnf) { if(ErrorText.empty()) ErrorText = LookupTag(Message,"Message"); @@ -169,59 +429,28 @@ void pkgAcquire::Item::Failed(string Message,pkgAcquire::MethodConfig *Cnf) Complete = false; Dequeue(); } - else - Status = StatIdle; - // check fail reason string const FailReason = LookupTag(Message, "FailReason"); - if(FailReason == "MaximumSizeExceeded") + if (FailReason == "MaximumSizeExceeded") RenameOnError(MaximumSizeExceeded); + else if (Status == StatAuthError) + RenameOnError(HashSumMismatch); // report mirror failure back to LP if we actually use a mirror - if(FailReason.empty() == false) + if (FailReason.empty() == false) ReportMirrorFailure(FailReason); else ReportMirrorFailure(ErrorText); -} - /*}}}*/ -bool pkgAcquire::Item::TransactionState(TransactionStates const state) /*{{{*/ -{ - bool const Debug = _config->FindB("Debug::Acquire::Transaction", false); - switch(state) - { - case TransactionAbort: - if(Debug == true) - std::clog << " Cancel: " << DestFile << std::endl; - if (Status == pkgAcquire::Item::StatIdle) - { - Status = pkgAcquire::Item::StatDone; - Dequeue(); - } - break; - case TransactionCommit: - if(PartialFile != "") - { - if(Debug == true) - std::clog << "mv " << PartialFile << " -> "<< DestFile << " # " << DescURI() << std::endl; - Rename(PartialFile, DestFile); - } else { - if(Debug == true) - std::clog << "rm " << DestFile << " # " << DescURI() << std::endl; - unlink(DestFile.c_str()); - } - // mark that this transaction is finished - TransactionManager = 0; - break; - } - return true; + if (QueueCounter > 1) + Status = StatIdle; } /*}}}*/ // Acquire::Item::Start - Item has begun to download /*{{{*/ // --------------------------------------------------------------------- -/* Stash status and the file size. Note that setting Complete means +/* Stash status and the file size. Note that setting Complete means sub-phases of the acquire process such as decompresion are operating */ -void pkgAcquire::Item::Start(string /*Message*/,unsigned long long Size) +void pkgAcquire::Item::Start(string const &/*Message*/, unsigned long long const Size) { Status = StatFetching; ErrorText.clear(); @@ -230,22 +459,24 @@ void pkgAcquire::Item::Start(string /*Message*/,unsigned long long Size) } /*}}}*/ // Acquire::Item::Done - Item downloaded OK /*{{{*/ -// --------------------------------------------------------------------- -/* */ -void pkgAcquire::Item::Done(string Message,unsigned long long Size,HashStringList const &/*Hash*/, - pkgAcquire::MethodConfig * /*Cnf*/) +void pkgAcquire::Item::Done(string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const /*Cnf*/) { // We just downloaded something.. string FileName = LookupTag(Message,"Filename"); UsedMirror = LookupTag(Message,"UsedMirror"); - if (Complete == false && !Local && FileName == DestFile) + unsigned long long const downloadedSize = Hashes.FileSize(); + if (downloadedSize != 0) { - if (Owner->Log != 0) - Owner->Log->Fetched(Size,atoi(LookupTag(Message,"Resume-Point","0").c_str())); - } + if (Complete == false && !Local && FileName == DestFile) + { + if (Owner->Log != 0) + Owner->Log->Fetched(Hashes.FileSize(),atoi(LookupTag(Message,"Resume-Point","0").c_str())); + } - if (FileSize == 0) - FileSize= Size; + if (FileSize == 0) + FileSize= downloadedSize; + } Status = StatDone; ErrorText = string(); Owner->Dequeue(this); @@ -255,7 +486,7 @@ void pkgAcquire::Item::Done(string Message,unsigned long long Size,HashStringLis // --------------------------------------------------------------------- /* This helper function is used by a lot of item methods as their final step */ -bool pkgAcquire::Item::Rename(string From,string To) +bool pkgAcquire::Item::Rename(string const &From,string const &To) { if (From == To || rename(From.c_str(),To.c_str()) == 0) return true; @@ -271,76 +502,40 @@ bool pkgAcquire::Item::Rename(string From,string To) return false; } /*}}}*/ -// Acquire::Item::QueueURI and specialisations from child classes /*{{{*/ -/* The idea here is that an item isn't queued if it exists on disk and the - transition manager was a hit as this means that the files it contains - the checksums for can't be updated either (or they are and we are asking - for a hashsum mismatch to happen which helps nobody) */ -bool pkgAcquire::Item::QueueURI(ItemDesc &Item) +void pkgAcquire::Item::Dequeue() /*{{{*/ { - std::string const FinalFile = GetFinalFilename(); - if (TransactionManager != NULL && TransactionManager->IMSHit == true && - FileExists(FinalFile) == true) - { - PartialFile = DestFile = FinalFile; - Status = StatDone; - return false; - } - - Owner->Enqueue(Item); - return true; + Owner->Dequeue(this); } -/* The transition manager InRelease itself (or its older sisters-in-law - Release & Release.gpg) is always queued as this allows us to rerun gpgv - on it to verify that we aren't stalled with old files */ -bool pkgAcqMetaBase::QueueURI(pkgAcquire::ItemDesc &Item) -{ - Owner->Enqueue(Item); - return true; -} -/* the Diff/Index needs to queue also the up-to-date complete index file - to ensure that the list cleaner isn't eating it */ -bool pkgAcqDiffIndex::QueueURI(pkgAcquire::ItemDesc &Item) -{ - if (pkgAcquire::Item::QueueURI(Item) == true) - return true; - QueueOnIMSHit(); - return false; -} - /*}}}*/ -void pkgAcquire::Item::Dequeue() /*{{{*/ -{ - Owner->Dequeue(this); -} - /*}}}*/ -bool pkgAcquire::Item::RenameOnError(pkgAcquire::Item::RenameOnErrorState const error)/*{{{*/ + /*}}}*/ +bool pkgAcquire::Item::RenameOnError(pkgAcquire::Item::RenameOnErrorState const error)/*{{{*/ { if (RealFileExists(DestFile)) Rename(DestFile, DestFile + ".FAILED"); + std::string errtext; switch (error) { case HashSumMismatch: - ErrorText = _("Hash Sum mismatch"); + errtext = _("Hash Sum mismatch"); Status = StatAuthError; ReportMirrorFailure("HashChecksumFailure"); break; case SizeMismatch: - ErrorText = _("Size mismatch"); + errtext = _("Size mismatch"); Status = StatAuthError; ReportMirrorFailure("SizeFailure"); break; case InvalidFormat: - ErrorText = _("Invalid file format"); + errtext = _("Invalid file format"); Status = StatError; // do not report as usually its not the mirrors fault, but Portal/Proxy break; case SignatureError: - ErrorText = _("Signature error"); + errtext = _("Signature error"); Status = StatError; break; case NotClearsigned: - ErrorText = _("Does not start with a cleartext signature"); + errtext = _("Does not start with a cleartext signature"); Status = StatError; break; case MaximumSizeExceeded: @@ -351,6 +546,8 @@ bool pkgAcquire::Item::RenameOnError(pkgAcquire::Item::RenameOnErrorState const // no handling here, done by callers break; } + if (ErrorText.empty()) + ErrorText = errtext; return false; } /*}}}*/ @@ -360,15 +557,8 @@ void pkgAcquire::Item::SetActiveSubprocess(const std::string &subprocess)/*{{{*/ APT_IGNORE_DEPRECATED(Mode = ActiveSubprocess.c_str();) } /*}}}*/ -// Acquire::Item::GetFinalFilename - Return the full final file path /*{{{*/ -std::string pkgAcquire::Item::GetFinalFilename() const -{ - return GetFinalFileNameFromURI(Desc.URI); -} - /*}}}*/ // Acquire::Item::ReportMirrorFailure /*{{{*/ -// --------------------------------------------------------------------- -void pkgAcquire::Item::ReportMirrorFailure(string FailCode) +void pkgAcquire::Item::ReportMirrorFailure(string const &FailCode) { // we only act if a mirror was used at all if(UsedMirror.empty()) @@ -411,2083 +601,1897 @@ void pkgAcquire::Item::ReportMirrorFailure(string FailCode) } } /*}}}*/ -// AcqDiffIndex::AcqDiffIndex - Constructor /*{{{*/ -// --------------------------------------------------------------------- -/* Get the DiffIndex file first and see if there are patches available - * If so, create a pkgAcqIndexDiffs fetcher that will get and apply the - * patches. If anything goes wrong in that process, it will fall back to - * the original packages file - */ -pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - IndexTarget const * const Target, - HashStringList const &ExpectedHashes, - indexRecords *MetaIndexParser) - : pkgAcqBaseIndex(Owner, TransactionManager, Target, ExpectedHashes, - MetaIndexParser) +std::string pkgAcquire::Item::HashSum() const /*{{{*/ { - - Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); - - RealURI = Target->URI; - Desc.Owner = this; - Desc.Description = Target->Description + ".diff/Index"; - Desc.ShortDesc = Target->ShortDesc; - Desc.URI = Target->URI + ".diff/Index"; - - DestFile = GetPartialFileNameFromURI(Desc.URI); + HashStringList const hashes = GetExpectedHashes(); + HashString const * const hs = hashes.find(NULL); + return hs != NULL ? hs->toStr() : ""; +} + /*}}}*/ - if(Debug) - std::clog << "pkgAcqDiffIndex: " << Desc.URI << std::endl; +pkgAcqTransactionItem::pkgAcqTransactionItem(pkgAcquire * const Owner, /*{{{*/ + pkgAcqMetaBase * const TransactionManager, IndexTarget const * const Target) : + pkgAcquire::Item(Owner), Target(Target), TransactionManager(TransactionManager) +{ + if (TransactionManager != this) + TransactionManager->Add(this); +} + /*}}}*/ +pkgAcqTransactionItem::~pkgAcqTransactionItem() /*{{{*/ +{ +} + /*}}}*/ +HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const MetaKey) const /*{{{*/ +{ + if (TransactionManager->MetaIndexParser == NULL) + return HashStringList(); + indexRecords::checkSum * const R = TransactionManager->MetaIndexParser->Lookup(MetaKey); + if (R == NULL) + return HashStringList(); + return R->Hashes; +} + /*}}}*/ - // look for the current package file - CurrentPackagesFile = GetFinalFileNameFromURI(RealURI); +// AcqMetaBase - Constructor /*{{{*/ +pkgAcqMetaBase::pkgAcqMetaBase(pkgAcquire * const Owner, + pkgAcqMetaBase * const TransactionManager, + std::vector const * const IndexTargets, + IndexTarget const &DataTarget, + indexRecords * const MetaIndexParser) +: pkgAcqTransactionItem(Owner, TransactionManager, NULL), DataTarget(DataTarget), + MetaIndexParser(MetaIndexParser), LastMetaIndexParser(NULL), IndexTargets(IndexTargets), + AuthPass(false), IMSHit(false) +{ +} + /*}}}*/ +// AcqMetaBase::Add - Add a item to the current Transaction /*{{{*/ +void pkgAcqMetaBase::Add(pkgAcqTransactionItem * const I) +{ + Transaction.push_back(I); +} + /*}}}*/ +// AcqMetaBase::AbortTransaction - Abort the current Transaction /*{{{*/ +void pkgAcqMetaBase::AbortTransaction() +{ + if(_config->FindB("Debug::Acquire::Transaction", false) == true) + std::clog << "AbortTransaction: " << TransactionManager << std::endl; - // FIXME: this file:/ check is a hack to prevent fetching - // from local sources. this is really silly, and - // should be fixed cleanly as soon as possible - if(!FileExists(CurrentPackagesFile) || - Desc.URI.substr(0,strlen("file:/")) == "file:/") + // ensure the toplevel is in error state too + for (std::vector::iterator I = Transaction.begin(); + I != Transaction.end(); ++I) { - // we don't have a pkg file or we don't want to queue - Failed("No index file, local or canceld by user", NULL); - return; + (*I)->TransactionState(TransactionAbort); } + Transaction.clear(); +} + /*}}}*/ +// AcqMetaBase::TransactionHasError - Check for errors in Transaction /*{{{*/ +APT_PURE bool pkgAcqMetaBase::TransactionHasError() const +{ + for (std::vector::const_iterator I = Transaction.begin(); + I != Transaction.end(); ++I) + { + switch((*I)->Status) { + case StatDone: break; + case StatIdle: break; + case StatAuthError: return true; + case StatError: return true; + case StatTransientNetworkError: return true; + case StatFetching: break; + } + } + return false; +} + /*}}}*/ +// AcqMetaBase::CommitTransaction - Commit a transaction /*{{{*/ +void pkgAcqMetaBase::CommitTransaction() +{ + if(_config->FindB("Debug::Acquire::Transaction", false) == true) + std::clog << "CommitTransaction: " << this << std::endl; - if(Debug) - std::clog << "pkgAcqDiffIndex::pkgAcqDiffIndex(): " - << CurrentPackagesFile << std::endl; - - QueueURI(Desc); - + // move new files into place *and* remove files that are not + // part of the transaction but are still on disk + for (std::vector::iterator I = Transaction.begin(); + I != Transaction.end(); ++I) + { + (*I)->TransactionState(TransactionCommit); + } + Transaction.clear(); } /*}}}*/ -// Acquire::Item::GetFinalFilename - Return the full final file path /*{{{*/ -std::string pkgAcqDiffIndex::GetFinalFilename() const +// AcqMetaBase::TransactionStageCopy - Stage a file for copying /*{{{*/ +void pkgAcqMetaBase::TransactionStageCopy(pkgAcqTransactionItem * const I, + const std::string &From, + const std::string &To) { - // the logic we inherent from pkgAcqBaseIndex isn't what we need here - return pkgAcquire::Item::GetFinalFilename(); + I->PartialFile = From; + I->DestFile = To; } /*}}}*/ -// AcqIndex::Custom600Headers - Insert custom request headers /*{{{*/ +// AcqMetaBase::TransactionStageRemoval - Stage a file for removal /*{{{*/ +void pkgAcqMetaBase::TransactionStageRemoval(pkgAcqTransactionItem * const I, + const std::string &FinalFile) +{ + I->PartialFile = ""; + I->DestFile = FinalFile; +} + /*}}}*/ +// AcqMetaBase::GenerateAuthWarning - Check gpg authentication error /*{{{*/ +bool pkgAcqMetaBase::CheckStopAuthentication(pkgAcquire::Item * const I, const std::string &Message) +{ + // FIXME: this entire function can do now that we disallow going to + // a unauthenticated state and can cleanly rollback + + string const Final = I->GetFinalFilename(); + if(FileExists(Final)) + { + I->Status = StatTransientNetworkError; + _error->Warning(_("An error occurred during the signature " + "verification. The repository is not updated " + "and the previous index files will be used. " + "GPG error: %s: %s\n"), + Desc.Description.c_str(), + LookupTag(Message,"Message").c_str()); + RunScripts("APT::Update::Auth-Failure"); + return true; + } else if (LookupTag(Message,"Message").find("NODATA") != string::npos) { + /* Invalid signature file, reject (LP: #346386) (Closes: #627642) */ + _error->Error(_("GPG error: %s: %s"), + Desc.Description.c_str(), + LookupTag(Message,"Message").c_str()); + I->Status = StatError; + return true; + } else { + _error->Warning(_("GPG error: %s: %s"), + Desc.Description.c_str(), + LookupTag(Message,"Message").c_str()); + } + // gpgv method failed + ReportMirrorFailure("GPGFailure"); + return false; +} + /*}}}*/ +// AcqMetaBase::Custom600Headers - Get header for AcqMetaBase /*{{{*/ // --------------------------------------------------------------------- -/* The only header we use is the last-modified header. */ -#if APT_PKG_ABI >= 413 -string pkgAcqDiffIndex::Custom600Headers() const -#else -string pkgAcqDiffIndex::Custom600Headers() -#endif +string pkgAcqMetaBase::Custom600Headers() const { - string const Final = GetFinalFilename(); + std::string Header = "\nIndex-File: true"; + std::string MaximumSize; + strprintf(MaximumSize, "\nMaximum-Size: %i", + _config->FindI("Acquire::MaxReleaseFileSize", 10*1000*1000)); + Header += MaximumSize; - if(Debug) - std::clog << "Custom600Header-IMS: " << Final << std::endl; + string const FinalFile = GetFinalFilename(); struct stat Buf; - if (stat(Final.c_str(),&Buf) != 0) - return "\nIndex-File: true"; - - return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); + if (stat(FinalFile.c_str(),&Buf) == 0) + Header += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); + + return Header; } /*}}}*/ -void pkgAcqDiffIndex::QueueOnIMSHit() const /*{{{*/ +// AcqMetaBase::QueueForSignatureVerify /*{{{*/ +void pkgAcqMetaBase::QueueForSignatureVerify(pkgAcqTransactionItem * const I, std::string const &File, std::string const &Signature) { - // list cleanup needs to know that this file as well as the already - // present index is ours, so we create an empty diff to save it for us - new pkgAcqIndexDiffs(Owner, TransactionManager, Target, - ExpectedHashes, MetaIndexParser); + AuthPass = true; + I->Desc.URI = "gpgv:" + Signature; + I->DestFile = File; + QueueURI(I->Desc); + I->SetActiveSubprocess("gpgv"); } /*}}}*/ -bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) /*{{{*/ +// AcqMetaBase::CheckDownloadDone /*{{{*/ +bool pkgAcqMetaBase::CheckDownloadDone(pkgAcqTransactionItem * const I, const std::string &Message, HashStringList const &Hashes) const { - // failing here is fine: our caller will take care of trying to - // get the complete file if patching fails - if(Debug) - std::clog << "pkgAcqDiffIndex::ParseIndexDiff() " << IndexDiffFile - << std::endl; - - FileFd Fd(IndexDiffFile,FileFd::ReadOnly); - pkgTagFile TF(&Fd); - if (_error->PendingError() == true) - return false; - - pkgTagSection Tags; - if(unlikely(TF.Step(Tags) == false)) - return false; - - HashStringList ServerHashes; - unsigned long long ServerSize = 0; + // We have just finished downloading a Release file (it is not + // verified yet) - for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) + string const FileName = LookupTag(Message,"Filename"); + if (FileName.empty() == true) { - std::string tagname = *type; - tagname.append("-Current"); - std::string const tmp = Tags.FindS(tagname.c_str()); - if (tmp.empty() == true) - continue; - - string hash; - unsigned long long size; - std::stringstream ss(tmp); - ss >> hash >> size; - if (unlikely(hash.empty() == true)) - continue; - if (unlikely(ServerSize != 0 && ServerSize != size)) - continue; - ServerHashes.push_back(HashString(*type, hash)); - ServerSize = size; + I->Status = StatError; + I->ErrorText = "Method gave a blank filename"; + return false; } - if (ServerHashes.usable() == false) + if (FileName != I->DestFile) { - if (Debug == true) - std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": Did not find a good hashsum in the index" << std::endl; + I->Local = true; + I->Desc.URI = "copy:" + FileName; + I->QueueURI(I->Desc); return false; } - if (ServerHashes != HashSums()) + // make sure to verify against the right file on I-M-S hit + bool IMSHit = StringToBool(LookupTag(Message,"IMS-Hit"), false); + if (IMSHit == false && Hashes.usable()) { - if (Debug == true) + // detect IMS-Hits servers haven't detected by Hash comparison + std::string const FinalFile = I->GetFinalFilename(); + if (RealFileExists(FinalFile) && Hashes.VerifyFile(FinalFile) == true) { - std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": Index has different hashes than parser, probably older, so fail pdiffing" << std::endl; - printHashSumComparision(CurrentPackagesFile, ServerHashes, HashSums()); + IMSHit = true; + unlink(I->DestFile.c_str()); } - return false; } - if (ServerHashes.VerifyFile(CurrentPackagesFile) == true) + if(IMSHit == true) { - // we have the same sha1 as the server so we are done here - if(Debug) - std::clog << "pkgAcqDiffIndex: Package file " << CurrentPackagesFile << " is up-to-date" << std::endl; - QueueOnIMSHit(); - return true; + // for simplicity, the transaction manager is always InRelease + // even if it doesn't exist. + if (TransactionManager != NULL) + TransactionManager->IMSHit = true; + I->PartialFile = I->DestFile = I->GetFinalFilename(); } - FileFd fd(CurrentPackagesFile, FileFd::ReadOnly); - Hashes LocalHashesCalc; - LocalHashesCalc.AddFD(fd); - HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); + // set Item to complete as the remaining work is all local (verify etc) + I->Complete = true; - if(Debug) - std::clog << "Server-Current: " << ServerHashes.find(NULL)->toStr() << " and we start at " - << fd.Name() << " " << fd.FileSize() << " " << LocalHashes.find(NULL)->toStr() << std::endl; + return true; +} + /*}}}*/ +bool pkgAcqMetaBase::CheckAuthDone(string const &Message) /*{{{*/ +{ + // At this point, the gpgv method has succeeded, so there is a + // valid signature from a key in the trusted keyring. We + // perform additional verification of its contents, and use them + // to verify the indexes we are about to download - // parse all of (provided) history - vector available_patches; - bool firstAcceptedHashes = true; - for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) + if (TransactionManager->IMSHit == false) { - if (LocalHashes.find(*type) == NULL) - continue; - - std::string tagname = *type; - tagname.append("-History"); - std::string const tmp = Tags.FindS(tagname.c_str()); - if (tmp.empty() == true) - continue; - - string hash, filename; - unsigned long long size; - std::stringstream ss(tmp); - - while (ss >> hash >> size >> filename) + // open the last (In)Release if we have it + std::string const FinalFile = GetFinalFilename(); + std::string FinalRelease; + std::string FinalInRelease; + if (APT::String::Endswith(FinalFile, "InRelease")) { - if (unlikely(hash.empty() == true || filename.empty() == true)) - continue; - - // see if we have a record for this file already - std::vector::iterator cur = available_patches.begin(); - for (; cur != available_patches.end(); ++cur) - { - if (cur->file != filename || unlikely(cur->result_size != size)) - continue; - cur->result_hashes.push_back(HashString(*type, hash)); - break; - } - if (cur != available_patches.end()) - continue; - if (firstAcceptedHashes == true) - { - DiffInfo next; - next.file = filename; - next.result_hashes.push_back(HashString(*type, hash)); - next.result_size = size; - next.patch_size = 0; - available_patches.push_back(next); - } + FinalInRelease = FinalFile; + FinalRelease = FinalFile.substr(0, FinalFile.length() - strlen("InRelease")) + "Release"; + } + else + { + FinalInRelease = FinalFile.substr(0, FinalFile.length() - strlen("Release")) + "InRelease"; + FinalRelease = FinalFile; + } + if (RealFileExists(FinalInRelease) || RealFileExists(FinalRelease)) + { + TransactionManager->LastMetaIndexParser = new indexRecords; + _error->PushToStack(); + if (RealFileExists(FinalInRelease)) + TransactionManager->LastMetaIndexParser->Load(FinalInRelease); else + TransactionManager->LastMetaIndexParser->Load(FinalRelease); + // its unlikely to happen, but if what we have is bad ignore it + if (_error->PendingError()) { - if (Debug == true) - std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": File " << filename - << " wasn't in the list for the first parsed hash! (history)" << std::endl; - break; + delete TransactionManager->LastMetaIndexParser; + TransactionManager->LastMetaIndexParser = NULL; } + _error->RevertToStack(); } - firstAcceptedHashes = false; } - if (unlikely(available_patches.empty() == true)) + if (TransactionManager->MetaIndexParser->Load(DestFile) == false) { - if (Debug) - std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": " - << "Couldn't find any patches for the patch series." << std::endl; + Status = StatAuthError; + ErrorText = TransactionManager->MetaIndexParser->ErrorText; return false; } - for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) + if (!VerifyVendor(Message)) { - if (LocalHashes.find(*type) == NULL) - continue; + Status = StatAuthError; + return false; + } - std::string tagname = *type; - tagname.append("-Patches"); - std::string const tmp = Tags.FindS(tagname.c_str()); - if (tmp.empty() == true) - continue; + if (_config->FindB("Debug::pkgAcquire::Auth", false)) + std::cerr << "Signature verification succeeded: " + << DestFile << std::endl; - string hash, filename; - unsigned long long size; - std::stringstream ss(tmp); + // Download further indexes with verification + QueueIndexes(true); - while (ss >> hash >> size >> filename) + return true; +} + /*}}}*/ +void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/ +{ + // at this point the real Items are loaded in the fetcher + ExpectedAdditionalItems = 0; + + vector ::const_iterator Target; + for (Target = IndexTargets->begin(); + Target != IndexTargets->end(); + ++Target) + { + if (verify == true && TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey) == false) { - if (unlikely(hash.empty() == true || filename.empty() == true)) + // optional target that we do not have in the Release file are skipped + if ((*Target)->IsOptional()) continue; - // see if we have a record for this file already - std::vector::iterator cur = available_patches.begin(); - for (; cur != available_patches.end(); ++cur) - { - if (cur->file != filename) - continue; - if (unlikely(cur->patch_size != 0 && cur->patch_size != size)) - continue; - cur->patch_hashes.push_back(HashString(*type, hash)); - cur->patch_size = size; - break; - } - if (cur != available_patches.end()) - continue; - if (Debug == true) - std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": File " << filename - << " wasn't in the list for the first parsed hash! (patches)" << std::endl; - break; + Status = StatAuthError; + strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str()); + return; } + + /* Queue the Index file (Packages, Sources, Translation-$foo + (either diff or full packages files, depending + on the users option) - we also check if the PDiff Index file is listed + in the Meta-Index file. Ideal would be if pkgAcqDiffIndex would test this + instead, but passing the required info to it is to much hassle */ + if(_config->FindB("Acquire::PDiffs",true) == true && (verify == false || + TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey + ".diff/Index") == true)) + new pkgAcqDiffIndex(Owner, TransactionManager, *Target); + else + new pkgAcqIndex(Owner, TransactionManager, *Target); } +} + /*}}}*/ +bool pkgAcqMetaBase::VerifyVendor(string const &Message) /*{{{*/ +{ + string::size_type pos; - bool foundStart = false; - for (std::vector::iterator cur = available_patches.begin(); - cur != available_patches.end(); ++cur) + // check for missing sigs (that where not fatal because otherwise we had + // bombed earlier) + string missingkeys; + string msg = _("There is no public key available for the " + "following key IDs:\n"); + pos = Message.find("NO_PUBKEY "); + if (pos != std::string::npos) { - if (LocalHashes != cur->result_hashes) - continue; - - available_patches.erase(available_patches.begin(), cur); - foundStart = true; - break; + string::size_type start = pos+strlen("NO_PUBKEY "); + string Fingerprint = Message.substr(start, Message.find("\n")-start); + missingkeys += (Fingerprint); } + if(!missingkeys.empty()) + _error->Warning("%s", (msg + missingkeys).c_str()); - if (foundStart == false || unlikely(available_patches.empty() == true)) + string Transformed = TransactionManager->MetaIndexParser->GetExpectedDist(); + + if (Transformed == "../project/experimental") { - if (Debug) - std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": " - << "Couldn't find the start of the patch series." << std::endl; - return false; + Transformed = "experimental"; } - // patching with too many files is rather slow compared to a fast download - unsigned long const fileLimit = _config->FindI("Acquire::PDiffs::FileLimit", 0); - if (fileLimit != 0 && fileLimit < available_patches.size()) + pos = Transformed.rfind('/'); + if (pos != string::npos) { - if (Debug) - std::clog << "Need " << available_patches.size() << " diffs (Limit is " << fileLimit - << ") so fallback to complete download" << std::endl; - return false; + Transformed = Transformed.substr(0, pos); } - // calculate the size of all patches we have to get - // note that all sizes are uncompressed, while we download compressed files - unsigned long long patchesSize = 0; - for (std::vector::const_iterator cur = available_patches.begin(); - cur != available_patches.end(); ++cur) - patchesSize += cur->patch_size; - unsigned long long const sizeLimit = ServerSize * _config->FindI("Acquire::PDiffs::SizeLimit", 100); - if (sizeLimit > 0 && (sizeLimit/100) < patchesSize) + if (Transformed == ".") { - if (Debug) - std::clog << "Need " << patchesSize << " bytes (Limit is " << sizeLimit/100 - << ") so fallback to complete download" << std::endl; - return false; + Transformed = ""; } - // we have something, queue the diffs - string::size_type const last_space = Description.rfind(" "); - if(last_space != string::npos) - Description.erase(last_space, Description.size()-last_space); + if (_config->FindB("Acquire::Check-Valid-Until", true) == true && + TransactionManager->MetaIndexParser->GetValidUntil() > 0) { + time_t const invalid_since = time(NULL) - TransactionManager->MetaIndexParser->GetValidUntil(); + if (invalid_since > 0) + { + std::string errmsg; + strprintf(errmsg, + // TRANSLATOR: The first %s is the URL of the bad Release file, the second is + // the time since then the file is invalid - formated in the same way as in + // the download progress display (e.g. 7d 3h 42min 1s) + _("Release file for %s is expired (invalid since %s). " + "Updates for this repository will not be applied."), + DataTarget.URI.c_str(), TimeToStr(invalid_since).c_str()); + if (ErrorText.empty()) + ErrorText = errmsg; + return _error->Error("%s", errmsg.c_str()); + } + } - /* decide if we should download patches one by one or in one go: - The first is good if the server merges patches, but many don't so client - based merging can be attempt in which case the second is better. - "bad things" will happen if patches are merged on the server, - but client side merging is attempt as well */ - bool pdiff_merge = _config->FindB("Acquire::PDiffs::Merge", true); - if (pdiff_merge == true) + /* Did we get a file older than what we have? This is a last minute IMS hit and doubles + as a prevention of downgrading us to older (still valid) files */ + if (TransactionManager->IMSHit == false && TransactionManager->LastMetaIndexParser != NULL && + TransactionManager->LastMetaIndexParser->GetDate() > TransactionManager->MetaIndexParser->GetDate()) { - // reprepro adds this flag if it has merged patches on the server - std::string const precedence = Tags.FindS("X-Patch-Precedence"); - pdiff_merge = (precedence != "merged"); + TransactionManager->IMSHit = true; + unlink(DestFile.c_str()); + PartialFile = DestFile = GetFinalFilename(); + delete TransactionManager->MetaIndexParser; + TransactionManager->MetaIndexParser = TransactionManager->LastMetaIndexParser; + TransactionManager->LastMetaIndexParser = NULL; } - if (pdiff_merge == false) + if (_config->FindB("Debug::pkgAcquire::Auth", false)) { - new pkgAcqIndexDiffs(Owner, TransactionManager, Target, ExpectedHashes, - MetaIndexParser, available_patches); + std::cerr << "Got Codename: " << TransactionManager->MetaIndexParser->GetDist() << std::endl; + std::cerr << "Expecting Dist: " << TransactionManager->MetaIndexParser->GetExpectedDist() << std::endl; + std::cerr << "Transformed Dist: " << Transformed << std::endl; } - else + + if (TransactionManager->MetaIndexParser->CheckDist(Transformed) == false) { - std::vector *diffs = new std::vector(available_patches.size()); - for(size_t i = 0; i < available_patches.size(); ++i) - (*diffs)[i] = new pkgAcqIndexMergeDiffs(Owner, TransactionManager, - Target, - ExpectedHashes, - MetaIndexParser, - available_patches[i], - diffs); + // This might become fatal one day +// Status = StatAuthError; +// ErrorText = "Conflicting distribution; expected " +// + MetaIndexParser->GetExpectedDist() + " but got " +// + MetaIndexParser->GetDist(); +// return false; + if (!Transformed.empty()) + { + _error->Warning(_("Conflicting distribution: %s (expected %s but got %s)"), + Desc.Description.c_str(), + Transformed.c_str(), + TransactionManager->MetaIndexParser->GetDist().c_str()); + } } - Complete = false; - Status = StatDone; - Dequeue(); return true; } /*}}}*/ -void pkgAcqDiffIndex::Failed(string Message,pkgAcquire::MethodConfig * Cnf)/*{{{*/ -{ - Item::Failed(Message,Cnf); - Status = StatDone; - - if(Debug) - std::clog << "pkgAcqDiffIndex failed: " << Desc.URI << " with " << Message << std::endl - << "Falling back to normal index file acquire" << std::endl; - new pkgAcqIndex(Owner, TransactionManager, Target, ExpectedHashes, MetaIndexParser); +pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/ + IndexTarget const &ClearsignedTarget, + IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget, + const vector* const IndexTargets, + indexRecords * const MetaIndexParser) : + pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets, MetaIndexParser), + ClearsignedTarget(ClearsignedTarget), + DetachedDataTarget(DetachedDataTarget), DetachedSigTarget(DetachedSigTarget) +{ + // index targets + (worst case:) Release/Release.gpg + ExpectedAdditionalItems = IndexTargets->size() + 2; + TransactionManager->Add(this); } /*}}}*/ -bool pkgAcqDiffIndex::TransactionState(TransactionStates const state) /*{{{*/ +pkgAcqMetaClearSig::~pkgAcqMetaClearSig() /*{{{*/ { - if (pkgAcquire::Item::TransactionState(state) == false) - return false; - - switch (state) - { - case TransactionCommit: - break; - case TransactionAbort: - std::string const Partial = GetPartialFileNameFromURI(RealURI); - unlink(Partial.c_str()); - break; - } - - return true; } /*}}}*/ -void pkgAcqDiffIndex::Done(string Message,unsigned long long Size,HashStringList const &Hashes, /*{{{*/ - pkgAcquire::MethodConfig *Cnf) +// pkgAcqMetaClearSig::Custom600Headers - Insert custom request headers /*{{{*/ +string pkgAcqMetaClearSig::Custom600Headers() const { - if(Debug) - std::clog << "pkgAcqDiffIndex::Done(): " << Desc.URI << std::endl; - - Item::Done(Message, Size, Hashes, Cnf); + string Header = pkgAcqMetaBase::Custom600Headers(); + Header += "\nFail-Ignore: true"; + return Header; +} + /*}}}*/ +// pkgAcqMetaClearSig::Done - We got a file /*{{{*/ +class APT_HIDDEN DummyItem : public pkgAcquire::Item +{ + IndexTarget const * const Target; + public: + virtual std::string DescURI() const {return Target->URI;}; + virtual HashStringList GetExpectedHashes() const {return HashStringList();}; - // verify the index target - if(Target && Target->MetaKey != "" && MetaIndexParser && Hashes.usable()) + DummyItem(pkgAcquire * const Owner, IndexTarget const * const Target) : + pkgAcquire::Item(Owner), Target(Target) { - std::string IndexMetaKey = Target->MetaKey + ".diff/Index"; - indexRecords::checkSum *Record = MetaIndexParser->Lookup(IndexMetaKey); - if(Record && Record->Hashes.usable() && Hashes != Record->Hashes) - { - RenameOnError(HashSumMismatch); - printHashSumComparision(RealURI, Record->Hashes, Hashes); - Failed(Message, Cnf); - return; - } - + Status = StatDone; + DestFile = GetFinalFileNameFromURI(Target->URI); } +}; +void pkgAcqMetaClearSig::Done(std::string const &Message, + HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf) +{ + Item::Done(Message, Hashes, Cnf); - string const FinalFile = GetFinalFilename(); - if(StringToBool(LookupTag(Message,"IMS-Hit"),false)) - DestFile = FinalFile; - - if(ParseDiffIndex(DestFile) == false) + // if we expect a ClearTextSignature (InRelease), ensure that + // this is what we get and if not fail to queue a + // Release/Release.gpg, see #346386 + if (FileExists(DestFile) && !StartsWithGPGClearTextSignature(DestFile)) { - Failed("Message: Couldn't parse pdiff index", Cnf); - // queue for final move - this should happen even if we fail - // while parsing (e.g. on sizelimit) and download the complete file. - TransactionManager->TransactionStageCopy(this, DestFile, FinalFile); + pkgAcquire::Item::Failed(Message, Cnf); + RenameOnError(NotClearsigned); + TransactionManager->AbortTransaction(); return; } - TransactionManager->TransactionStageCopy(this, DestFile, FinalFile); - - Complete = true; - Status = StatDone; - Dequeue(); - - return; + if(AuthPass == false) + { + if(CheckDownloadDone(this, Message, Hashes) == true) + QueueForSignatureVerify(this, DestFile, DestFile); + return; + } + else if(CheckAuthDone(Message) == true) + { + if (TransactionManager->IMSHit == false) + TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); + else if (RealFileExists(GetFinalFilename()) == false) + { + // We got an InRelease file IMSHit, but we haven't one, which means + // we had a valid Release/Release.gpg combo stepping in, which we have + // to 'acquire' now to ensure list cleanup isn't removing them + new DummyItem(Owner, &DetachedDataTarget); + new DummyItem(Owner, &DetachedSigTarget); + } + } } /*}}}*/ -// AcqIndexDiffs::AcqIndexDiffs - Constructor /*{{{*/ -// --------------------------------------------------------------------- -/* The package diff is added to the queue. one object is constructed - * for each diff and the index - */ -pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - struct IndexTarget const * const Target, - HashStringList const &ExpectedHashes, - indexRecords *MetaIndexParser, - vector diffs) - : pkgAcqBaseIndex(Owner, TransactionManager, Target, ExpectedHashes, MetaIndexParser), - available_patches(diffs) +void pkgAcqMetaClearSig::Failed(string const &Message,pkgAcquire::MethodConfig const * const Cnf) /*{{{*/ { - DestFile = GetPartialFileNameFromURI(Target->URI); - - Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); + Item::Failed(Message, Cnf); - RealURI = Target->URI; - Desc.Owner = this; - Description = Target->Description; - Desc.ShortDesc = Target->ShortDesc; + // we failed, we will not get additional items from this method + ExpectedAdditionalItems = 0; - if(available_patches.empty() == true) + if (AuthPass == false) { - // we are done (yeah!), check hashes against the final file - DestFile = GetFinalFileNameFromURI(Target->URI); - Finish(true); + // Queue the 'old' InRelease file for removal if we try Release.gpg + // as otherwise the file will stay around and gives a false-auth + // impression (CVE-2012-0214) + TransactionManager->TransactionStageRemoval(this, GetFinalFilename()); + Status = StatDone; + + new pkgAcqMetaIndex(Owner, TransactionManager, DetachedDataTarget, DetachedSigTarget, IndexTargets, TransactionManager->MetaIndexParser); } else { - // patching needs to be bootstrapped with the 'old' version - std::string const PartialFile = GetPartialFileNameFromURI(RealURI); - if (RealFileExists(PartialFile) == false) + if(CheckStopAuthentication(this, Message)) + return; + + _error->Warning(_("The data from '%s' is not signed. Packages " + "from that repository can not be authenticated."), + ClearsignedTarget.Description.c_str()); + + // No Release file was present, or verification failed, so fall + // back to queueing Packages files without verification + // only allow going further if the users explicitely wants it + if(AllowInsecureRepositories(TransactionManager->MetaIndexParser, TransactionManager, this) == true) { - if (symlink(GetFinalFilename().c_str(), PartialFile.c_str()) != 0) + Status = StatDone; + + /* InRelease files become Release files, otherwise + * they would be considered as trusted later on */ + string const FinalRelease = GetFinalFileNameFromURI(DetachedDataTarget.URI); + string const PartialRelease = GetPartialFileNameFromURI(DetachedDataTarget.URI); + string const FinalReleasegpg = GetFinalFileNameFromURI(DetachedSigTarget.URI); + string const FinalInRelease = GetFinalFilename(); + Rename(DestFile, PartialRelease); + TransactionManager->TransactionStageCopy(this, PartialRelease, FinalRelease); + + if (RealFileExists(FinalReleasegpg) || RealFileExists(FinalInRelease)) { - Failed("Link creation of " + PartialFile + " to " + GetFinalFilename() + " failed", NULL); - return; + // open the last Release if we have it + if (TransactionManager->IMSHit == false) + { + TransactionManager->LastMetaIndexParser = new indexRecords; + _error->PushToStack(); + if (RealFileExists(FinalInRelease)) + TransactionManager->LastMetaIndexParser->Load(FinalInRelease); + else + TransactionManager->LastMetaIndexParser->Load(FinalRelease); + // its unlikely to happen, but if what we have is bad ignore it + if (_error->PendingError()) + { + delete TransactionManager->LastMetaIndexParser; + TransactionManager->LastMetaIndexParser = NULL; + } + _error->RevertToStack(); + } } - } - // get the next diff - State = StateFetchDiff; - QueueNextDiff(); + // we parse the indexes here because at this point the user wanted + // a repository that may potentially harm him + if (TransactionManager->MetaIndexParser->Load(PartialRelease) == false || VerifyVendor(Message) == false) + /* expired Release files are still a problem you need extra force for */; + else + QueueIndexes(true); + } } } /*}}}*/ -void pkgAcqIndexDiffs::Failed(string Message,pkgAcquire::MethodConfig * Cnf)/*{{{*/ -{ - Item::Failed(Message,Cnf); - Status = StatDone; - if(Debug) - std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << " with " << Message << std::endl - << "Falling back to normal index file acquire" << std::endl; - DestFile = GetPartialFileNameFromURI(Target->URI); - RenameOnError(PDiffError); - new pkgAcqIndex(Owner, TransactionManager, Target, ExpectedHashes, MetaIndexParser); - Finish(); -} - /*}}}*/ -// Finish - helper that cleans the item out of the fetcher queue /*{{{*/ -void pkgAcqIndexDiffs::Finish(bool allDone) +pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire * const Owner, /*{{{*/ + pkgAcqMetaBase * const TransactionManager, + IndexTarget const &DataTarget, + IndexTarget const &DetachedSigTarget, + vector const * const IndexTargets, + indexRecords * const MetaIndexParser) : + pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser), + DetachedSigTarget(DetachedSigTarget) { - if(Debug) - std::clog << "pkgAcqIndexDiffs::Finish(): " - << allDone << " " - << Desc.URI << std::endl; - - // we restore the original name, this is required, otherwise - // the file will be cleaned - if(allDone) - { - if(HashSums().usable() && !HashSums().VerifyFile(DestFile)) - { - RenameOnError(HashSumMismatch); - Dequeue(); - return; - } + if(_config->FindB("Debug::Acquire::Transaction", false) == true) + std::clog << "New pkgAcqMetaIndex with TransactionManager " + << this->TransactionManager << std::endl; - TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); + DestFile = GetPartialFileNameFromURI(DataTarget.URI); - // this is for the "real" finish - Complete = true; - Status = StatDone; - Dequeue(); - if(Debug) - std::clog << "\n\nallDone: " << DestFile << "\n" << std::endl; - return; - } + // Create the item + Desc.Description = DataTarget.Description; + Desc.Owner = this; + Desc.ShortDesc = DataTarget.ShortDesc; + Desc.URI = DataTarget.URI; - if(Debug) - std::clog << "Finishing: " << Desc.URI << std::endl; - Complete = false; - Status = StatDone; - Dequeue(); - return; + // we expect more item + ExpectedAdditionalItems = IndexTargets->size(); + QueueURI(Desc); } /*}}}*/ -bool pkgAcqIndexDiffs::QueueNextDiff() /*{{{*/ +void pkgAcqMetaIndex::Done(string const &Message, /*{{{*/ + HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cfg) { - // calc sha1 of the just patched file - std::string const FinalFile = GetPartialFileNameFromURI(RealURI); + Item::Done(Message,Hashes,Cfg); - if(!FileExists(FinalFile)) + if(CheckDownloadDone(this, Message, Hashes)) { - Failed("Message: No FinalFile " + FinalFile + " available", NULL); - return false; + // we have a Release file, now download the Signature, all further + // verify/queue for additional downloads will be done in the + // pkgAcqMetaSig::Done() code + new pkgAcqMetaSig(Owner, TransactionManager, &DetachedSigTarget, this); } +} + /*}}}*/ +// pkgAcqMetaIndex::Failed - no Release file present /*{{{*/ +void pkgAcqMetaIndex::Failed(string const &Message, + pkgAcquire::MethodConfig const * const Cnf) +{ + pkgAcquire::Item::Failed(Message, Cnf); + Status = StatDone; - FileFd fd(FinalFile, FileFd::ReadOnly); - Hashes LocalHashesCalc; - LocalHashesCalc.AddFD(fd); - HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); - - if(Debug) - std::clog << "QueueNextDiff: " << FinalFile << " (" << LocalHashes.find(NULL)->toStr() << ")" << std::endl; + _error->Warning(_("The repository '%s' does not have a Release file. " + "This is deprecated, please contact the owner of the " + "repository."), DataTarget.Description.c_str()); - if (unlikely(LocalHashes.usable() == false || ExpectedHashes.usable() == false)) + // No Release file was present so fall + // back to queueing Packages files without verification + // only allow going further if the users explicitely wants it + if(AllowInsecureRepositories(TransactionManager->MetaIndexParser, TransactionManager, this) == true) { - Failed("Local/Expected hashes are not usable", NULL); - return false; - } - + // ensure old Release files are removed + TransactionManager->TransactionStageRemoval(this, GetFinalFilename()); + delete TransactionManager->MetaIndexParser; + TransactionManager->MetaIndexParser = NULL; - // final file reached before all patches are applied - if(LocalHashes == ExpectedHashes) - { - Finish(true); - return true; - } - - // remove all patches until the next matching patch is found - // this requires the Index file to be ordered - for(vector::iterator I = available_patches.begin(); - available_patches.empty() == false && - I != available_patches.end() && - I->result_hashes != LocalHashes; - ++I) - { - available_patches.erase(I); + // queue without any kind of hashsum support + QueueIndexes(false); } +} + /*}}}*/ +void pkgAcqMetaIndex::Finished() /*{{{*/ +{ + if(_config->FindB("Debug::Acquire::Transaction", false) == true) + std::clog << "Finished: " << DestFile <TransactionHasError() == false) + TransactionManager->CommitTransaction(); +} + /*}}}*/ +std::string pkgAcqMetaIndex::DescURI() const /*{{{*/ +{ + return DataTarget.URI; +} + /*}}}*/ - // error checking and falling back if no patch was found - if(available_patches.empty() == true) - { - Failed("No patches left to reach target", NULL); - return false; - } +// AcqMetaSig::AcqMetaSig - Constructor /*{{{*/ +pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner, + pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target, + pkgAcqMetaIndex * const MetaIndex) : + pkgAcqTransactionItem(Owner, TransactionManager, Target), MetaIndex(MetaIndex) +{ + DestFile = GetPartialFileNameFromURI(Target->URI); - // queue the right diff - Desc.URI = RealURI + ".diff/" + available_patches[0].file + ".gz"; - Desc.Description = Description + " " + available_patches[0].file + string(".pdiff"); - DestFile = GetPartialFileNameFromURI(RealURI + ".diff/" + available_patches[0].file); + // remove any partial downloaded sig-file in partial/. + // it may confuse proxies and is too small to warrant a + // partial download anyway + unlink(DestFile.c_str()); - if(Debug) - std::clog << "pkgAcqIndexDiffs::QueueNextDiff(): " << Desc.URI << std::endl; + // set the TransactionManager + if(_config->FindB("Debug::Acquire::Transaction", false) == true) + std::clog << "New pkgAcqMetaSig with TransactionManager " + << TransactionManager << std::endl; - QueueURI(Desc); + // Create the item + Desc.Description = Target->Description; + Desc.Owner = this; + Desc.ShortDesc = Target->ShortDesc; + Desc.URI = Target->URI; - return true; + // If we got a hit for Release, we will get one for Release.gpg too (or obscure errors), + // so we skip the download step and go instantly to verification + if (TransactionManager->IMSHit == true && RealFileExists(GetFinalFilename())) + { + Complete = true; + Status = StatDone; + PartialFile = DestFile = GetFinalFilename(); + MetaIndexFileSignature = DestFile; + MetaIndex->QueueForSignatureVerify(this, MetaIndex->DestFile, DestFile); + } + else + QueueURI(Desc); } /*}}}*/ -void pkgAcqIndexDiffs::Done(string Message,unsigned long long Size, HashStringList const &Hashes, /*{{{*/ - pkgAcquire::MethodConfig *Cnf) +pkgAcqMetaSig::~pkgAcqMetaSig() /*{{{*/ { - if(Debug) - std::clog << "pkgAcqIndexDiffs::Done(): " << Desc.URI << std::endl; - - Item::Done(Message, Size, Hashes, Cnf); - - // FIXME: verify this download too before feeding it to rred - std::string const FinalFile = GetPartialFileNameFromURI(RealURI); - - // success in downloading a diff, enter ApplyDiff state - if(State == StateFetchDiff) +} + /*}}}*/ +// AcqMetaSig::Done - The signature was downloaded/verified /*{{{*/ +void pkgAcqMetaSig::Done(string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cfg) +{ + if (MetaIndexFileSignature.empty() == false) { - FileFd fd(DestFile, FileFd::ReadOnly, FileFd::Gzip); - class Hashes LocalHashesCalc; - LocalHashesCalc.AddFD(fd); - HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); + DestFile = MetaIndexFileSignature; + MetaIndexFileSignature.clear(); + } + Item::Done(Message, Hashes, Cfg); - if (fd.Size() != available_patches[0].patch_size || - available_patches[0].patch_hashes != LocalHashes) + if(MetaIndex->AuthPass == false) + { + if(MetaIndex->CheckDownloadDone(this, Message, Hashes) == true) { - // patchfiles are dated, so bad indicates a bad download, so kill it - unlink(DestFile.c_str()); - Failed("Patch has Size/Hashsum mismatch", NULL); - return; + // destfile will be modified to point to MetaIndexFile for the + // gpgv method, so we need to save it here + MetaIndexFileSignature = DestFile; + MetaIndex->QueueForSignatureVerify(this, MetaIndex->DestFile, DestFile); + } + return; + } + else if(MetaIndex->CheckAuthDone(Message) == true) + { + if (TransactionManager->IMSHit == false) + { + TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); + TransactionManager->TransactionStageCopy(MetaIndex, MetaIndex->DestFile, MetaIndex->GetFinalFilename()); } + } +} + /*}}}*/ +void pkgAcqMetaSig::Failed(string const &Message,pkgAcquire::MethodConfig const * const Cnf)/*{{{*/ +{ + Item::Failed(Message,Cnf); - // rred excepts the patch as $FinalFile.ed - Rename(DestFile,FinalFile+".ed"); + // check if we need to fail at this point + if (MetaIndex->AuthPass == true && MetaIndex->CheckStopAuthentication(this, Message)) + return; - if(Debug) - std::clog << "Sending to rred method: " << FinalFile << std::endl; + string const FinalRelease = MetaIndex->GetFinalFilename(); + string const FinalReleasegpg = GetFinalFilename(); + string const FinalInRelease = TransactionManager->GetFinalFilename(); - State = StateApplyDiff; - Local = true; - Desc.URI = "rred:" + FinalFile; - QueueURI(Desc); - SetActiveSubprocess("rred"); - return; - } + if (RealFileExists(FinalReleasegpg) || RealFileExists(FinalInRelease)) + { + std::string downgrade_msg; + strprintf(downgrade_msg, _("The repository '%s' is no longer signed."), + MetaIndex->DataTarget.Description.c_str()); + if(_config->FindB("Acquire::AllowDowngradeToInsecureRepositories")) + { + // meh, the users wants to take risks (we still mark the packages + // from this repository as unauthenticated) + _error->Warning("%s", downgrade_msg.c_str()); + _error->Warning(_("This is normally not allowed, but the option " + "Acquire::AllowDowngradeToInsecureRepositories was " + "given to override it.")); + Status = StatDone; + } else { + _error->Error("%s", downgrade_msg.c_str()); + if (TransactionManager->IMSHit == false) + Rename(MetaIndex->DestFile, MetaIndex->DestFile + ".FAILED"); + Item::Failed("Message: " + downgrade_msg, Cnf); + TransactionManager->AbortTransaction(); + return; + } + } + else + _error->Warning(_("The data from '%s' is not signed. Packages " + "from that repository can not be authenticated."), + MetaIndex->DataTarget.Description.c_str()); + // ensures that a Release.gpg file in the lists/ is removed by the transaction + TransactionManager->TransactionStageRemoval(this, DestFile); - // success in download/apply a diff, queue next (if needed) - if(State == StateApplyDiff) + // only allow going further if the users explicitely wants it + if(AllowInsecureRepositories(TransactionManager->MetaIndexParser, TransactionManager, this) == true) { - // remove the just applied patch - available_patches.erase(available_patches.begin()); - unlink((FinalFile + ".ed").c_str()); - - // move into place - if(Debug) + if (RealFileExists(FinalReleasegpg) || RealFileExists(FinalInRelease)) { - std::clog << "Moving patched file in place: " << std::endl - << DestFile << " -> " << FinalFile << std::endl; + // open the last Release if we have it + if (TransactionManager->IMSHit == false) + { + TransactionManager->LastMetaIndexParser = new indexRecords; + _error->PushToStack(); + if (RealFileExists(FinalInRelease)) + TransactionManager->LastMetaIndexParser->Load(FinalInRelease); + else + TransactionManager->LastMetaIndexParser->Load(FinalRelease); + // its unlikely to happen, but if what we have is bad ignore it + if (_error->PendingError()) + { + delete TransactionManager->LastMetaIndexParser; + TransactionManager->LastMetaIndexParser = NULL; + } + _error->RevertToStack(); + } } - Rename(DestFile,FinalFile); - chmod(FinalFile.c_str(),0644); - // see if there is more to download - if(available_patches.empty() == false) { - new pkgAcqIndexDiffs(Owner, TransactionManager, Target, - ExpectedHashes, MetaIndexParser, - available_patches); - return Finish(); - } else - // update - DestFile = FinalFile; - return Finish(true); + // we parse the indexes here because at this point the user wanted + // a repository that may potentially harm him + if (TransactionManager->MetaIndexParser->Load(MetaIndex->DestFile) == false || MetaIndex->VerifyVendor(Message) == false) + /* expired Release files are still a problem you need extra force for */; + else + MetaIndex->QueueIndexes(true); + + TransactionManager->TransactionStageCopy(MetaIndex, MetaIndex->DestFile, MetaIndex->GetFinalFilename()); + } + + // FIXME: this is used often (e.g. in pkgAcqIndexTrans) so refactor + if (Cnf->LocalOnly == true || + StringToBool(LookupTag(Message,"Transient-Failure"),false) == false) + { + // Ignore this + Status = StatDone; } } /*}}}*/ -// AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor /*{{{*/ -pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - struct IndexTarget const * const Target, - HashStringList const &ExpectedHashes, - indexRecords *MetaIndexParser, - DiffInfo const &patch, - std::vector const * const allPatches) - : pkgAcqBaseIndex(Owner, TransactionManager, Target, ExpectedHashes, MetaIndexParser), - patch(patch), allPatches(allPatches), State(StateFetchDiff) + + +// AcqBaseIndex - Constructor /*{{{*/ +pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner, + pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target) +: pkgAcqTransactionItem(Owner, TransactionManager, Target) +{ +} + /*}}}*/ + +// AcqDiffIndex::AcqDiffIndex - Constructor /*{{{*/ +// --------------------------------------------------------------------- +/* Get the DiffIndex file first and see if there are patches available + * If so, create a pkgAcqIndexDiffs fetcher that will get and apply the + * patches. If anything goes wrong in that process, it will fall back to + * the original packages file + */ +pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner, + pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target) + : pkgAcqBaseIndex(Owner, TransactionManager, Target) { Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); - RealURI = Target->URI; Desc.Owner = this; - Description = Target->Description; + Desc.Description = Target->Description + ".diff/Index"; Desc.ShortDesc = Target->ShortDesc; + Desc.URI = Target->URI + ".diff/Index"; - Desc.URI = RealURI + ".diff/" + patch.file + ".gz"; - Desc.Description = Description + " " + patch.file + string(".pdiff"); + DestFile = GetPartialFileNameFromURI(Desc.URI); + + if(Debug) + std::clog << "pkgAcqDiffIndex: " << Desc.URI << std::endl; - DestFile = GetPartialFileNameFromURI(RealURI + ".diff/" + patch.file); + // look for the current package file + CurrentPackagesFile = GetFinalFileNameFromURI(Target->URI); + + // FIXME: this file:/ check is a hack to prevent fetching + // from local sources. this is really silly, and + // should be fixed cleanly as soon as possible + if(!FileExists(CurrentPackagesFile) || + Desc.URI.substr(0,strlen("file:/")) == "file:/") + { + // we don't have a pkg file or we don't want to queue + Failed("No index file, local or canceld by user", NULL); + return; + } if(Debug) - std::clog << "pkgAcqIndexMergeDiffs: " << Desc.URI << std::endl; + std::clog << "pkgAcqDiffIndex::pkgAcqDiffIndex(): " + << CurrentPackagesFile << std::endl; QueueURI(Desc); + } /*}}}*/ -void pkgAcqIndexMergeDiffs::Failed(string Message,pkgAcquire::MethodConfig * Cnf)/*{{{*/ +// AcqIndex::Custom600Headers - Insert custom request headers /*{{{*/ +// --------------------------------------------------------------------- +/* The only header we use is the last-modified header. */ +string pkgAcqDiffIndex::Custom600Headers() const { - if(Debug) - std::clog << "pkgAcqIndexMergeDiffs failed: " << Desc.URI << " with " << Message << std::endl; - - Item::Failed(Message,Cnf); - Status = StatDone; + string const Final = GetFinalFilename(); - // check if we are the first to fail, otherwise we are done here - State = StateDoneDiff; - for (std::vector::const_iterator I = allPatches->begin(); - I != allPatches->end(); ++I) - if ((*I)->State == StateErrorDiff) - return; + if(Debug) + std::clog << "Custom600Header-IMS: " << Final << std::endl; - // first failure means we should fallback - State = StateErrorDiff; - if (Debug) - std::clog << "Falling back to normal index file acquire" << std::endl; - DestFile = GetPartialFileNameFromURI(Target->URI); - RenameOnError(PDiffError); - new pkgAcqIndex(Owner, TransactionManager, Target, ExpectedHashes, MetaIndexParser); + struct stat Buf; + if (stat(Final.c_str(),&Buf) != 0) + return "\nIndex-File: true"; + + return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); +} + /*}}}*/ +void pkgAcqDiffIndex::QueueOnIMSHit() const /*{{{*/ +{ + // list cleanup needs to know that this file as well as the already + // present index is ours, so we create an empty diff to save it for us + new pkgAcqIndexDiffs(Owner, TransactionManager, Target); } /*}}}*/ -void pkgAcqIndexMergeDiffs::Done(string Message,unsigned long long Size,HashStringList const &Hashes, /*{{{*/ - pkgAcquire::MethodConfig *Cnf) +bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ { + // failing here is fine: our caller will take care of trying to + // get the complete file if patching fails if(Debug) - std::clog << "pkgAcqIndexMergeDiffs::Done(): " << Desc.URI << std::endl; - - Item::Done(Message,Size,Hashes,Cnf); - - // FIXME: verify download before feeding it to rred - string const FinalFile = GetPartialFileNameFromURI(RealURI); - - if (State == StateFetchDiff) - { - FileFd fd(DestFile, FileFd::ReadOnly, FileFd::Gzip); - class Hashes LocalHashesCalc; - LocalHashesCalc.AddFD(fd); - HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); - - if (fd.Size() != patch.patch_size || patch.patch_hashes != LocalHashes) - { - // patchfiles are dated, so bad indicates a bad download, so kill it - unlink(DestFile.c_str()); - Failed("Patch has Size/Hashsum mismatch", NULL); - return; - } + std::clog << "pkgAcqDiffIndex::ParseIndexDiff() " << IndexDiffFile + << std::endl; - // rred expects the patch as $FinalFile.ed.$patchname.gz - Rename(DestFile, FinalFile + ".ed." + patch.file + ".gz"); + FileFd Fd(IndexDiffFile,FileFd::ReadOnly); + pkgTagFile TF(&Fd); + if (_error->PendingError() == true) + return false; - // check if this is the last completed diff - State = StateDoneDiff; - for (std::vector::const_iterator I = allPatches->begin(); - I != allPatches->end(); ++I) - if ((*I)->State != StateDoneDiff) - { - if(Debug) - std::clog << "Not the last done diff in the batch: " << Desc.URI << std::endl; - return; - } + pkgTagSection Tags; + if(unlikely(TF.Step(Tags) == false)) + return false; - // this is the last completed diff, so we are ready to apply now - State = StateApplyDiff; + HashStringList ServerHashes; + unsigned long long ServerSize = 0; - // patching needs to be bootstrapped with the 'old' version - if (symlink(GetFinalFilename().c_str(), FinalFile.c_str()) != 0) - { - Failed("Link creation of " + FinalFile + " to " + GetFinalFilename() + " failed", NULL); - return; - } + for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) + { + std::string tagname = *type; + tagname.append("-Current"); + std::string const tmp = Tags.FindS(tagname.c_str()); + if (tmp.empty() == true) + continue; - if(Debug) - std::clog << "Sending to rred method: " << FinalFile << std::endl; + string hash; + unsigned long long size; + std::stringstream ss(tmp); + ss >> hash >> size; + if (unlikely(hash.empty() == true)) + continue; + if (unlikely(ServerSize != 0 && ServerSize != size)) + continue; + ServerHashes.push_back(HashString(*type, hash)); + ServerSize = size; + } - Local = true; - Desc.URI = "rred:" + FinalFile; - QueueURI(Desc); - SetActiveSubprocess("rred"); - return; + if (ServerHashes.usable() == false) + { + if (Debug == true) + std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": Did not find a good hashsum in the index" << std::endl; + return false; } - // success in download/apply all diffs, clean up - else if (State == StateApplyDiff) + + HashStringList const TargetFileHashes = GetExpectedHashesFor(Target->MetaKey); + if (TargetFileHashes.usable() == false || ServerHashes != TargetFileHashes) { - // see if we really got the expected file - if(ExpectedHashes.usable() && ExpectedHashes != Hashes) + if (Debug == true) { - RenameOnError(HashSumMismatch); - return; + std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": Index has different hashes than parser, probably older, so fail pdiffing" << std::endl; + printHashSumComparision(CurrentPackagesFile, ServerHashes, TargetFileHashes); } + return false; + } - // move the result into place - std::string const Final = GetFinalFilename(); + if (ServerHashes.VerifyFile(CurrentPackagesFile) == true) + { + // we have the same sha1 as the server so we are done here if(Debug) - std::clog << "Queue patched file in place: " << std::endl - << DestFile << " -> " << Final << std::endl; + std::clog << "pkgAcqDiffIndex: Package file " << CurrentPackagesFile << " is up-to-date" << std::endl; + QueueOnIMSHit(); + return true; + } - // queue for copy by the transaction manager - TransactionManager->TransactionStageCopy(this, DestFile, Final); + FileFd fd(CurrentPackagesFile, FileFd::ReadOnly); + Hashes LocalHashesCalc; + LocalHashesCalc.AddFD(fd); + HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); - // ensure the ed's are gone regardless of list-cleanup - for (std::vector::const_iterator I = allPatches->begin(); - I != allPatches->end(); ++I) - { - std::string const PartialFile = GetPartialFileNameFromURI(RealURI); - std::string patch = PartialFile + ".ed." + (*I)->patch.file + ".gz"; - unlink(patch.c_str()); - } - unlink(FinalFile.c_str()); + if(Debug) + std::clog << "Server-Current: " << ServerHashes.find(NULL)->toStr() << " and we start at " + << fd.Name() << " " << fd.FileSize() << " " << LocalHashes.find(NULL)->toStr() << std::endl; - // all set and done - Complete = true; - if(Debug) - std::clog << "allDone: " << DestFile << "\n" << std::endl; - } -} - /*}}}*/ -// AcqBaseIndex - Constructor /*{{{*/ -pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - struct IndexTarget const * const Target, - HashStringList const &ExpectedHashes, - indexRecords *MetaIndexParser) -: Item(Owner, ExpectedHashes, TransactionManager), Target(Target), - MetaIndexParser(MetaIndexParser) -{ -} - /*}}}*/ -// AcqBaseIndex::VerifyHashByMetaKey - verify hash for the given metakey /*{{{*/ -bool pkgAcqBaseIndex::VerifyHashByMetaKey(HashStringList const &Hashes) -{ - if(MetaKey != "" && Hashes.usable()) + // parse all of (provided) history + vector available_patches; + bool firstAcceptedHashes = true; + for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) { - indexRecords::checkSum *Record = MetaIndexParser->Lookup(MetaKey); - if(Record && Record->Hashes.usable() && Hashes != Record->Hashes) - { - printHashSumComparision(RealURI, Record->Hashes, Hashes); - return false; - } - } - return true; -} - /*}}}*/ -// AcqBaseIndex::GetFinalFilename - Return the full final file path /*{{{*/ -std::string pkgAcqBaseIndex::GetFinalFilename() const -{ - return GetFinalFileNameFromURI(RealURI); -} - /*}}}*/ -// AcqIndex::AcqIndex - Constructor /*{{{*/ -// --------------------------------------------------------------------- -/* The package file is added to the queue and a second class is - instantiated to fetch the revision file */ -pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, - string URI,string URIDesc,string ShortDesc, - HashStringList const &ExpectedHash) - : pkgAcqBaseIndex(Owner, 0, NULL, ExpectedHash, NULL) -{ - RealURI = URI; - - AutoSelectCompression(); - Init(URI, URIDesc, ShortDesc); + if (LocalHashes.find(*type) == NULL) + continue; - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "New pkgIndex with TransactionManager " - << TransactionManager << std::endl; -} - /*}}}*/ -// AcqIndex::AcqIndex - Constructor /*{{{*/ -pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - IndexTarget const *Target, - HashStringList const &ExpectedHash, - indexRecords *MetaIndexParser) - : pkgAcqBaseIndex(Owner, TransactionManager, Target, ExpectedHash, - MetaIndexParser) -{ - RealURI = Target->URI; + std::string tagname = *type; + tagname.append("-History"); + std::string const tmp = Tags.FindS(tagname.c_str()); + if (tmp.empty() == true) + continue; - // autoselect the compression method - AutoSelectCompression(); - Init(Target->URI, Target->Description, Target->ShortDesc); + string hash, filename; + unsigned long long size; + std::stringstream ss(tmp); - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "New pkgIndex with TransactionManager " - << TransactionManager << std::endl; -} - /*}}}*/ -// AcqIndex::AutoSelectCompression - Select compression /*{{{*/ -void pkgAcqIndex::AutoSelectCompression() -{ - std::vector types = APT::Configuration::getCompressionTypes(); - CompressionExtensions = ""; - if (ExpectedHashes.usable()) - { - for (std::vector::const_iterator t = types.begin(); - t != types.end(); ++t) + while (ss >> hash >> size >> filename) { - std::string CompressedMetaKey = string(Target->MetaKey).append(".").append(*t); - if (*t == "uncompressed" || - MetaIndexParser->Exists(CompressedMetaKey) == true) - CompressionExtensions.append(*t).append(" "); + if (unlikely(hash.empty() == true || filename.empty() == true)) + continue; + + // see if we have a record for this file already + std::vector::iterator cur = available_patches.begin(); + for (; cur != available_patches.end(); ++cur) + { + if (cur->file != filename || unlikely(cur->result_size != size)) + continue; + cur->result_hashes.push_back(HashString(*type, hash)); + break; + } + if (cur != available_patches.end()) + continue; + if (firstAcceptedHashes == true) + { + DiffInfo next; + next.file = filename; + next.result_hashes.push_back(HashString(*type, hash)); + next.result_size = size; + next.patch_size = 0; + available_patches.push_back(next); + } + else + { + if (Debug == true) + std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": File " << filename + << " wasn't in the list for the first parsed hash! (history)" << std::endl; + break; + } } + firstAcceptedHashes = false; } - else + + if (unlikely(available_patches.empty() == true)) { - for (std::vector::const_iterator t = types.begin(); t != types.end(); ++t) - CompressionExtensions.append(*t).append(" "); + if (Debug) + std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": " + << "Couldn't find any patches for the patch series." << std::endl; + return false; } - if (CompressionExtensions.empty() == false) - CompressionExtensions.erase(CompressionExtensions.end()-1); -} - /*}}}*/ -// AcqIndex::Init - defered Constructor /*{{{*/ -void pkgAcqIndex::Init(string const &URI, string const &URIDesc, - string const &ShortDesc) -{ - Stage = STAGE_DOWNLOAD; - - DestFile = GetPartialFileNameFromURI(URI); - CurrentCompressionExtension = CompressionExtensions.substr(0, CompressionExtensions.find(' ')); - if (CurrentCompressionExtension == "uncompressed") + for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) { - Desc.URI = URI; - if(Target) - MetaKey = string(Target->MetaKey); - } - else - { - Desc.URI = URI + '.' + CurrentCompressionExtension; - DestFile = DestFile + '.' + CurrentCompressionExtension; - if(Target) - MetaKey = string(Target->MetaKey) + '.' + CurrentCompressionExtension; - } - - // load the filesize - if(MetaIndexParser) - { - indexRecords::checkSum *Record = MetaIndexParser->Lookup(MetaKey); - if(Record) - FileSize = Record->Size; - - InitByHashIfNeeded(MetaKey); - } - - Desc.Description = URIDesc; - Desc.Owner = this; - Desc.ShortDesc = ShortDesc; - - QueueURI(Desc); -} - /*}}}*/ -// AcqIndex::AdjustForByHash - modify URI for by-hash support /*{{{*/ -void pkgAcqIndex::InitByHashIfNeeded(const std::string MetaKey) -{ - // TODO: - // - (maybe?) add support for by-hash into the sources.list as flag - // - make apt-ftparchive generate the hashes (and expire?) - std::string HostKnob = "APT::Acquire::" + ::URI(Desc.URI).Host + "::By-Hash"; - if(_config->FindB("APT::Acquire::By-Hash", false) == true || - _config->FindB(HostKnob, false) == true || - MetaIndexParser->GetSupportsAcquireByHash()) - { - indexRecords::checkSum *Record = MetaIndexParser->Lookup(MetaKey); - if(Record) - { - // FIXME: should we really use the best hash here? or a fixed one? - const HashString *TargetHash = Record->Hashes.find(""); - std::string ByHash = "/by-hash/" + TargetHash->HashType() + "/" + TargetHash->HashValue(); - size_t trailing_slash = Desc.URI.find_last_of("/"); - Desc.URI = Desc.URI.replace( - trailing_slash, - Desc.URI.substr(trailing_slash+1).size()+1, - ByHash); - } else { - _error->Warning( - "Fetching ByHash requested but can not find record for %s", - MetaKey.c_str()); - } - } -} - /*}}}*/ -// AcqIndex::Custom600Headers - Insert custom request headers /*{{{*/ -// --------------------------------------------------------------------- -/* The only header we use is the last-modified header. */ -#if APT_PKG_ABI >= 413 -string pkgAcqIndex::Custom600Headers() const -#else -string pkgAcqIndex::Custom600Headers() -#endif -{ - string Final = GetFinalFilename(); - - string msg = "\nIndex-File: true"; - struct stat Buf; - if (stat(Final.c_str(),&Buf) == 0) - msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); + if (LocalHashes.find(*type) == NULL) + continue; - if(Target->IsOptional()) - msg += "\nFail-Ignore: true"; + std::string tagname = *type; + tagname.append("-Patches"); + std::string const tmp = Tags.FindS(tagname.c_str()); + if (tmp.empty() == true) + continue; - return msg; -} - /*}}}*/ -// pkgAcqIndex::Failed - getting the indexfile failed /*{{{*/ -void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) -{ - Item::Failed(Message,Cnf); + string hash, filename; + unsigned long long size; + std::stringstream ss(tmp); - // authorisation matches will not be fixed by other compression types - if (Status != StatAuthError) - { - size_t const nextExt = CompressionExtensions.find(' '); - if (nextExt != std::string::npos) + while (ss >> hash >> size >> filename) { - CompressionExtensions = CompressionExtensions.substr(nextExt+1); - Init(RealURI, Desc.Description, Desc.ShortDesc); - Status = StatIdle; - return; - } - } - - if(Target->IsOptional() && ExpectedHashes.empty() && Stage == STAGE_DOWNLOAD) - Status = StatDone; - else - TransactionManager->AbortTransaction(); -} - /*}}}*/ -bool pkgAcqIndex::TransactionState(TransactionStates const state) /*{{{*/ -{ - if (pkgAcquire::Item::TransactionState(state) == false) - return false; + if (unlikely(hash.empty() == true || filename.empty() == true)) + continue; - switch (state) - { - case TransactionAbort: - if (Stage == STAGE_DECOMPRESS_AND_VERIFY) + // see if we have a record for this file already + std::vector::iterator cur = available_patches.begin(); + for (; cur != available_patches.end(); ++cur) { - // keep the compressed file, but drop the decompressed - EraseFileName.clear(); - if (PartialFile.empty() == false && flExtension(PartialFile) == "decomp") - unlink(PartialFile.c_str()); + if (cur->file != filename) + continue; + if (unlikely(cur->patch_size != 0 && cur->patch_size != size)) + continue; + cur->patch_hashes.push_back(HashString(*type, hash)); + cur->patch_size = size; + break; } + if (cur != available_patches.end()) + continue; + if (Debug == true) + std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": File " << filename + << " wasn't in the list for the first parsed hash! (patches)" << std::endl; break; - case TransactionCommit: - if (EraseFileName.empty() == false) - unlink(EraseFileName.c_str()); - break; - } - return true; -} - /*}}}*/ -// pkgAcqIndex::GetFinalFilename - Return the full final file path /*{{{*/ -std::string pkgAcqIndex::GetFinalFilename() const -{ - std::string const FinalFile = GetFinalFileNameFromURI(RealURI); - return GetCompressedFileName(RealURI, FinalFile, CurrentCompressionExtension); -} - /*}}}*/ -// AcqIndex::ReverifyAfterIMS - Reverify index after an ims-hit /*{{{*/ -void pkgAcqIndex::ReverifyAfterIMS() -{ - // update destfile to *not* include the compression extension when doing - // a reverify (as its uncompressed on disk already) - DestFile = GetCompressedFileName(RealURI, GetPartialFileNameFromURI(RealURI), CurrentCompressionExtension); - - // copy FinalFile into partial/ so that we check the hash again - string FinalFile = GetFinalFilename(); - Stage = STAGE_DECOMPRESS_AND_VERIFY; - Desc.URI = "copy:" + FinalFile; - QueueURI(Desc); -} - /*}}}*/ -// AcqIndex::ValidateFile - Validate the content of the downloaded file /*{{{*/ -bool pkgAcqIndex::ValidateFile(const std::string &FileName) -{ - // FIXME: this can go away once we only ever download stuff that - // has a valid hash and we never do GET based probing - // FIXME2: this also leaks debian-isms into the code and should go therefore - - /* Always validate the index file for correctness (all indexes must - * have a Package field) (LP: #346386) (Closes: #627642) - */ - FileFd fd(FileName, FileFd::ReadOnly, FileFd::Extension); - // Only test for correctness if the content of the file is not empty - // (empty is ok) - if (fd.Size() > 0) - { - pkgTagSection sec; - pkgTagFile tag(&fd); - - // all our current indexes have a field 'Package' in each section - if (_error->PendingError() == true || - tag.Step(sec) == false || - sec.Exists("Package") == false) - return false; - } - return true; -} - /*}}}*/ -// AcqIndex::Done - Finished a fetch /*{{{*/ -// --------------------------------------------------------------------- -/* This goes through a number of states.. On the initial fetch the - method could possibly return an alternate filename which points - to the uncompressed version of the file. If this is so the file - is copied into the partial directory. In all other cases the file - is decompressed with a compressed uri. */ -void pkgAcqIndex::Done(string Message, - unsigned long long Size, - HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cfg) -{ - Item::Done(Message,Size,Hashes,Cfg); - - switch(Stage) - { - case STAGE_DOWNLOAD: - StageDownloadDone(Message, Hashes, Cfg); - break; - case STAGE_DECOMPRESS_AND_VERIFY: - StageDecompressDone(Message, Hashes, Cfg); - break; - } -} - /*}}}*/ -// AcqIndex::StageDownloadDone - Queue for decompress and verify /*{{{*/ -void pkgAcqIndex::StageDownloadDone(string Message, - HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cfg) -{ - // First check if the calculcated Hash of the (compressed) downloaded - // file matches the hash we have in the MetaIndexRecords for this file - if(VerifyHashByMetaKey(Hashes) == false) - { - RenameOnError(HashSumMismatch); - Failed(Message, Cfg); - return; - } - - Complete = true; - - // Handle the unzipd case - string FileName = LookupTag(Message,"Alt-Filename"); - if (FileName.empty() == false) - { - Stage = STAGE_DECOMPRESS_AND_VERIFY; - Local = true; - DestFile += ".decomp"; - Desc.URI = "copy:" + FileName; - QueueURI(Desc); - SetActiveSubprocess("copy"); - return; - } - - FileName = LookupTag(Message,"Filename"); - if (FileName.empty() == true) - { - Status = StatError; - ErrorText = "Method gave a blank filename"; - } - - // Methods like e.g. "file:" will give us a (compressed) FileName that is - // not the "DestFile" we set, in this case we uncompress from the local file - if (FileName != DestFile) - Local = true; - else - EraseFileName = FileName; - - // we need to verify the file against the current Release file again - // on if-modfied-since hit to avoid a stale attack against us - if(StringToBool(LookupTag(Message,"IMS-Hit"),false) == true) - { - // The files timestamp matches, reverify by copy into partial/ - EraseFileName = ""; - ReverifyAfterIMS(); - return; - } - - // If we have compressed indexes enabled, queue for hash verification - if (_config->FindB("Acquire::GzipIndexes",false)) - { - DestFile = GetPartialFileNameFromURI(RealURI + '.' + CurrentCompressionExtension); - EraseFileName = ""; - Stage = STAGE_DECOMPRESS_AND_VERIFY; - Desc.URI = "copy:" + FileName; - QueueURI(Desc); - SetActiveSubprocess("copy"); - return; - } - - // get the binary name for your used compression type - string decompProg; - if(CurrentCompressionExtension == "uncompressed") - decompProg = "copy"; - else - decompProg = _config->Find(string("Acquire::CompressionTypes::").append(CurrentCompressionExtension),""); - if(decompProg.empty() == true) - { - _error->Error("Unsupported extension: %s", CurrentCompressionExtension.c_str()); - return; - } - - // queue uri for the next stage - Stage = STAGE_DECOMPRESS_AND_VERIFY; - DestFile += ".decomp"; - Desc.URI = decompProg + ":" + FileName; - QueueURI(Desc); - SetActiveSubprocess(decompProg); -} - /*}}}*/ -// pkgAcqIndex::StageDecompressDone - Final verification /*{{{*/ -void pkgAcqIndex::StageDecompressDone(string Message, - HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cfg) -{ - if (ExpectedHashes.usable() && ExpectedHashes != Hashes) - { - Desc.URI = RealURI; - RenameOnError(HashSumMismatch); - printHashSumComparision(RealURI, ExpectedHashes, Hashes); - Failed(Message, Cfg); - return; - } - - if(!ValidateFile(DestFile)) - { - RenameOnError(InvalidFormat); - Failed(Message, Cfg); - return; - } - - // Done, queue for rename on transaction finished - TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); - - return; -} - /*}}}*/ -// AcqMetaBase - Constructor /*{{{*/ -pkgAcqMetaBase::pkgAcqMetaBase(pkgAcquire *Owner, - const std::vector* IndexTargets, - indexRecords* MetaIndexParser, - std::string const &RealURI, - HashStringList const &ExpectedHashes, - pkgAcqMetaBase *TransactionManager) -: Item(Owner, ExpectedHashes, TransactionManager), - MetaIndexParser(MetaIndexParser), LastMetaIndexParser(NULL), IndexTargets(IndexTargets), - AuthPass(false), RealURI(RealURI), IMSHit(false) -{ -} - /*}}}*/ -// AcqMetaBase::Add - Add a item to the current Transaction /*{{{*/ -void pkgAcqMetaBase::Add(Item *I) -{ - Transaction.push_back(I); -} - /*}}}*/ -// AcqMetaBase::AbortTransaction - Abort the current Transaction /*{{{*/ -void pkgAcqMetaBase::AbortTransaction() -{ - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "AbortTransaction: " << TransactionManager << std::endl; - - // ensure the toplevel is in error state too - for (std::vector::iterator I = Transaction.begin(); - I != Transaction.end(); ++I) - { - (*I)->TransactionState(TransactionAbort); - } - Transaction.clear(); -} - /*}}}*/ -// AcqMetaBase::TransactionHasError - Check for errors in Transaction /*{{{*/ -bool pkgAcqMetaBase::TransactionHasError() -{ - for (pkgAcquire::ItemIterator I = Transaction.begin(); - I != Transaction.end(); ++I) - { - switch((*I)->Status) { - case StatDone: break; - case StatIdle: break; - case StatAuthError: return true; - case StatError: return true; - case StatTransientNetworkError: return true; - case StatFetching: break; } } - return false; -} - /*}}}*/ -// AcqMetaBase::CommitTransaction - Commit a transaction /*{{{*/ -void pkgAcqMetaBase::CommitTransaction() -{ - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "CommitTransaction: " << this << std::endl; - - // move new files into place *and* remove files that are not - // part of the transaction but are still on disk - for (std::vector::iterator I = Transaction.begin(); - I != Transaction.end(); ++I) - { - (*I)->TransactionState(TransactionCommit); - } - Transaction.clear(); -} - /*}}}*/ -bool pkgAcqMetaBase::TransactionState(TransactionStates const state) /*{{{*/ -{ - // Do not remove InRelease on IMSHit of Release.gpg [yes, this is very edgecasey] - if (TransactionManager->IMSHit == false) - return pkgAcquire::Item::TransactionState(state); - return true; -} - /*}}}*/ -// AcqMetaBase::TransactionStageCopy - Stage a file for copying /*{{{*/ -void pkgAcqMetaBase::TransactionStageCopy(Item *I, - const std::string &From, - const std::string &To) -{ - I->PartialFile = From; - I->DestFile = To; -} - /*}}}*/ -// AcqMetaBase::TransactionStageRemoval - Stage a file for removal /*{{{*/ -void pkgAcqMetaBase::TransactionStageRemoval(Item *I, - const std::string &FinalFile) -{ - I->PartialFile = ""; - I->DestFile = FinalFile; -} - /*}}}*/ -// AcqMetaBase::GenerateAuthWarning - Check gpg authentication error /*{{{*/ -bool pkgAcqMetaBase::CheckStopAuthentication(pkgAcquire::Item * const I, const std::string &Message) -{ - // FIXME: this entire function can do now that we disallow going to - // a unauthenticated state and can cleanly rollback - string const Final = I->GetFinalFilename(); - if(FileExists(Final)) - { - I->Status = StatTransientNetworkError; - _error->Warning(_("An error occurred during the signature " - "verification. The repository is not updated " - "and the previous index files will be used. " - "GPG error: %s: %s\n"), - Desc.Description.c_str(), - LookupTag(Message,"Message").c_str()); - RunScripts("APT::Update::Auth-Failure"); - return true; - } else if (LookupTag(Message,"Message").find("NODATA") != string::npos) { - /* Invalid signature file, reject (LP: #346386) (Closes: #627642) */ - _error->Error(_("GPG error: %s: %s"), - Desc.Description.c_str(), - LookupTag(Message,"Message").c_str()); - I->Status = StatError; - return true; - } else { - _error->Warning(_("GPG error: %s: %s"), - Desc.Description.c_str(), - LookupTag(Message,"Message").c_str()); + bool foundStart = false; + for (std::vector::iterator cur = available_patches.begin(); + cur != available_patches.end(); ++cur) + { + if (LocalHashes != cur->result_hashes) + continue; + + available_patches.erase(available_patches.begin(), cur); + foundStart = true; + break; } - // gpgv method failed - ReportMirrorFailure("GPGFailure"); - return false; -} - /*}}}*/ -// AcqMetaSig::AcqMetaSig - Constructor /*{{{*/ -pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - string const &URI, string const &URIDesc,string const &ShortDesc, - pkgAcqMetaIndex * const MetaIndex) : - pkgAcquire::Item(Owner, HashStringList(), TransactionManager), MetaIndex(MetaIndex), - URIDesc(URIDesc), RealURI(URI) -{ - DestFile = GetPartialFileNameFromURI(URI); - // remove any partial downloaded sig-file in partial/. - // it may confuse proxies and is too small to warrant a - // partial download anyway - unlink(DestFile.c_str()); + if (foundStart == false || unlikely(available_patches.empty() == true)) + { + if (Debug) + std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": " + << "Couldn't find the start of the patch series." << std::endl; + return false; + } - // set the TransactionManager - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "New pkgAcqMetaSig with TransactionManager " - << TransactionManager << std::endl; + // patching with too many files is rather slow compared to a fast download + unsigned long const fileLimit = _config->FindI("Acquire::PDiffs::FileLimit", 0); + if (fileLimit != 0 && fileLimit < available_patches.size()) + { + if (Debug) + std::clog << "Need " << available_patches.size() << " diffs (Limit is " << fileLimit + << ") so fallback to complete download" << std::endl; + return false; + } - // Create the item - Desc.Description = URIDesc; - Desc.Owner = this; - Desc.ShortDesc = ShortDesc; - Desc.URI = URI; + // calculate the size of all patches we have to get + // note that all sizes are uncompressed, while we download compressed files + unsigned long long patchesSize = 0; + for (std::vector::const_iterator cur = available_patches.begin(); + cur != available_patches.end(); ++cur) + patchesSize += cur->patch_size; + unsigned long long const sizeLimit = ServerSize * _config->FindI("Acquire::PDiffs::SizeLimit", 100); + if (sizeLimit > 0 && (sizeLimit/100) < patchesSize) + { + if (Debug) + std::clog << "Need " << patchesSize << " bytes (Limit is " << sizeLimit/100 + << ") so fallback to complete download" << std::endl; + return false; + } - // If we got a hit for Release, we will get one for Release.gpg too (or obscure errors), - // so we skip the download step and go instantly to verification - if (TransactionManager->IMSHit == true && RealFileExists(GetFinalFilename())) + // we have something, queue the diffs + string::size_type const last_space = Description.rfind(" "); + if(last_space != string::npos) + Description.erase(last_space, Description.size()-last_space); + + /* decide if we should download patches one by one or in one go: + The first is good if the server merges patches, but many don't so client + based merging can be attempt in which case the second is better. + "bad things" will happen if patches are merged on the server, + but client side merging is attempt as well */ + bool pdiff_merge = _config->FindB("Acquire::PDiffs::Merge", true); + if (pdiff_merge == true) { - Complete = true; - Status = StatDone; - PartialFile = DestFile = GetFinalFilename(); - MetaIndexFileSignature = DestFile; - MetaIndex->QueueForSignatureVerify(this, MetaIndex->DestFile, DestFile); + // reprepro adds this flag if it has merged patches on the server + std::string const precedence = Tags.FindS("X-Patch-Precedence"); + pdiff_merge = (precedence != "merged"); } + + if (pdiff_merge == false) + new pkgAcqIndexDiffs(Owner, TransactionManager, Target, available_patches); else - QueueURI(Desc); -} - /*}}}*/ -pkgAcqMetaSig::~pkgAcqMetaSig() /*{{{*/ -{ + { + std::vector *diffs = new std::vector(available_patches.size()); + for(size_t i = 0; i < available_patches.size(); ++i) + (*diffs)[i] = new pkgAcqIndexMergeDiffs(Owner, TransactionManager, + Target, + available_patches[i], + diffs); + } + + Complete = false; + Status = StatDone; + Dequeue(); + return true; } /*}}}*/ -// pkgAcqMetaSig::GetFinalFilename - Return the full final file path /*{{{*/ -std::string pkgAcqMetaSig::GetFinalFilename() const +void pkgAcqDiffIndex::Failed(string const &Message,pkgAcquire::MethodConfig const * const Cnf)/*{{{*/ { - return GetFinalFileNameFromURI(RealURI); + Item::Failed(Message,Cnf); + Status = StatDone; + + if(Debug) + std::clog << "pkgAcqDiffIndex failed: " << Desc.URI << " with " << Message << std::endl + << "Falling back to normal index file acquire" << std::endl; + + new pkgAcqIndex(Owner, TransactionManager, Target); } /*}}}*/ -// pkgAcqMetaSig::Done - The signature was downloaded/verified /*{{{*/ -// --------------------------------------------------------------------- -/* The only header we use is the last-modified header. */ -void pkgAcqMetaSig::Done(string Message,unsigned long long Size, - HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cfg) +void pkgAcqDiffIndex::Done(string const &Message,HashStringList const &Hashes, /*{{{*/ + pkgAcquire::MethodConfig const * const Cnf) { - if (MetaIndexFileSignature.empty() == false) - { - DestFile = MetaIndexFileSignature; - MetaIndexFileSignature.clear(); - } - Item::Done(Message, Size, Hashes, Cfg); + if(Debug) + std::clog << "pkgAcqDiffIndex::Done(): " << Desc.URI << std::endl; - if(MetaIndex->AuthPass == false) + Item::Done(Message, Hashes, Cnf); + + string const FinalFile = GetFinalFilename(); + if(StringToBool(LookupTag(Message,"IMS-Hit"),false)) + DestFile = FinalFile; + + if(ParseDiffIndex(DestFile) == false) { - if(MetaIndex->CheckDownloadDone(this, Message, Hashes) == true) - { - // destfile will be modified to point to MetaIndexFile for the - // gpgv method, so we need to save it here - MetaIndexFileSignature = DestFile; - MetaIndex->QueueForSignatureVerify(this, MetaIndex->DestFile, DestFile); - } + Failed("Message: Couldn't parse pdiff index", Cnf); + // queue for final move - this should happen even if we fail + // while parsing (e.g. on sizelimit) and download the complete file. + TransactionManager->TransactionStageCopy(this, DestFile, FinalFile); return; } - else if(MetaIndex->CheckAuthDone(Message) == true) - { - if (TransactionManager->IMSHit == false) - { - TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); - TransactionManager->TransactionStageCopy(MetaIndex, MetaIndex->DestFile, MetaIndex->GetFinalFilename()); - } - } + + TransactionManager->TransactionStageCopy(this, DestFile, FinalFile); + + Complete = true; + Status = StatDone; + Dequeue(); + + return; } /*}}}*/ -void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/ + +// AcqIndexDiffs::AcqIndexDiffs - Constructor /*{{{*/ +// --------------------------------------------------------------------- +/* The package diff is added to the queue. one object is constructed + * for each diff and the index + */ +pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire * const Owner, + pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target, + vector const &diffs) + : pkgAcqBaseIndex(Owner, TransactionManager, Target), + available_patches(diffs) { - Item::Failed(Message,Cnf); + DestFile = GetPartialFileNameFromURI(Target->URI); - // check if we need to fail at this point - if (MetaIndex->AuthPass == true && MetaIndex->CheckStopAuthentication(this, Message)) - return; + Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); - string const FinalRelease = MetaIndex->GetFinalFilename(); - string const FinalReleasegpg = GetFinalFilename(); - string const FinalInRelease = TransactionManager->GetFinalFilename(); + Desc.Owner = this; + Description = Target->Description; + Desc.ShortDesc = Target->ShortDesc; - if (RealFileExists(FinalReleasegpg) || RealFileExists(FinalInRelease)) + if(available_patches.empty() == true) { - std::string downgrade_msg; - strprintf(downgrade_msg, _("The repository '%s' is no longer signed."), - MetaIndex->URIDesc.c_str()); - if(_config->FindB("Acquire::AllowDowngradeToInsecureRepositories")) - { - // meh, the users wants to take risks (we still mark the packages - // from this repository as unauthenticated) - _error->Warning("%s", downgrade_msg.c_str()); - _error->Warning(_("This is normally not allowed, but the option " - "Acquire::AllowDowngradeToInsecureRepositories was " - "given to override it.")); - Status = StatDone; - } else { - _error->Error("%s", downgrade_msg.c_str()); - if (TransactionManager->IMSHit == false) - Rename(MetaIndex->DestFile, MetaIndex->DestFile + ".FAILED"); - Item::Failed("Message: " + downgrade_msg, Cnf); - TransactionManager->AbortTransaction(); - return; - } + // we are done (yeah!), check hashes against the final file + DestFile = GetFinalFileNameFromURI(Target->URI); + Finish(true); } else - _error->Warning(_("The data from '%s' is not signed. Packages " - "from that repository can not be authenticated."), - MetaIndex->URIDesc.c_str()); - - // ensures that a Release.gpg file in the lists/ is removed by the transaction - TransactionManager->TransactionStageRemoval(this, DestFile); - - // only allow going further if the users explicitely wants it - if(AllowInsecureRepositories(MetaIndex->MetaIndexParser, TransactionManager, this) == true) { - if (RealFileExists(FinalReleasegpg) || RealFileExists(FinalInRelease)) + // patching needs to be bootstrapped with the 'old' version + std::string const PartialFile = GetPartialFileNameFromURI(Target->URI); + if (RealFileExists(PartialFile) == false) { - // open the last Release if we have it - if (TransactionManager->IMSHit == false) + if (symlink(GetFinalFilename().c_str(), PartialFile.c_str()) != 0) { - MetaIndex->LastMetaIndexParser = new indexRecords; - _error->PushToStack(); - if (RealFileExists(FinalInRelease)) - MetaIndex->LastMetaIndexParser->Load(FinalInRelease); - else - MetaIndex->LastMetaIndexParser->Load(FinalRelease); - // its unlikely to happen, but if what we have is bad ignore it - if (_error->PendingError()) - { - delete MetaIndex->LastMetaIndexParser; - MetaIndex->LastMetaIndexParser = NULL; - } - _error->RevertToStack(); + Failed("Link creation of " + PartialFile + " to " + GetFinalFilename() + " failed", NULL); + return; } } - // we parse the indexes here because at this point the user wanted - // a repository that may potentially harm him - MetaIndex->MetaIndexParser->Load(MetaIndex->DestFile); - if (MetaIndex->VerifyVendor(Message) == false) - /* expired Release files are still a problem you need extra force for */; - else - MetaIndex->QueueIndexes(true); - - TransactionManager->TransactionStageCopy(MetaIndex, MetaIndex->DestFile, MetaIndex->GetFinalFilename()); + // get the next diff + State = StateFetchDiff; + QueueNextDiff(); } +} + /*}}}*/ +void pkgAcqIndexDiffs::Failed(string const &Message,pkgAcquire::MethodConfig const * const Cnf)/*{{{*/ +{ + Item::Failed(Message,Cnf); + Status = StatDone; - // FIXME: this is used often (e.g. in pkgAcqIndexTrans) so refactor - if (Cnf->LocalOnly == true || - StringToBool(LookupTag(Message,"Transient-Failure"),false) == false) + if(Debug) + std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << " with " << Message << std::endl + << "Falling back to normal index file acquire" << std::endl; + DestFile = GetPartialFileNameFromURI(Target->URI); + RenameOnError(PDiffError); + new pkgAcqIndex(Owner, TransactionManager, Target); + Finish(); +} + /*}}}*/ +// Finish - helper that cleans the item out of the fetcher queue /*{{{*/ +void pkgAcqIndexDiffs::Finish(bool allDone) +{ + if(Debug) + std::clog << "pkgAcqIndexDiffs::Finish(): " + << allDone << " " + << Desc.URI << std::endl; + + // we restore the original name, this is required, otherwise + // the file will be cleaned + if(allDone) { - // Ignore this + TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); + + // this is for the "real" finish + Complete = true; Status = StatDone; + Dequeue(); + if(Debug) + std::clog << "\n\nallDone: " << DestFile << "\n" << std::endl; + return; } + + if(Debug) + std::clog << "Finishing: " << Desc.URI << std::endl; + Complete = false; + Status = StatDone; + Dequeue(); + return; } /*}}}*/ -pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire *Owner, /*{{{*/ - pkgAcqMetaBase *TransactionManager, - string URI,string URIDesc,string ShortDesc, - string MetaIndexSigURI,string MetaIndexSigURIDesc, string MetaIndexSigShortDesc, - const vector* IndexTargets, - indexRecords* MetaIndexParser) : - pkgAcqMetaBase(Owner, IndexTargets, MetaIndexParser, URI, HashStringList(), - TransactionManager), - URIDesc(URIDesc), ShortDesc(ShortDesc), - MetaIndexSigURI(MetaIndexSigURI), MetaIndexSigURIDesc(MetaIndexSigURIDesc), - MetaIndexSigShortDesc(MetaIndexSigShortDesc) +bool pkgAcqIndexDiffs::QueueNextDiff() /*{{{*/ { - if(TransactionManager == NULL) + // calc sha1 of the just patched file + std::string const FinalFile = GetPartialFileNameFromURI(Target->URI); + + if(!FileExists(FinalFile)) { - this->TransactionManager = this; - this->TransactionManager->Add(this); + Failed("Message: No FinalFile " + FinalFile + " available", NULL); + return false; } - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "New pkgAcqMetaIndex with TransactionManager " - << this->TransactionManager << std::endl; - - - Init(URIDesc, ShortDesc); -} - /*}}}*/ -// pkgAcqMetaIndex::Init - Delayed constructor /*{{{*/ -void pkgAcqMetaIndex::Init(std::string URIDesc, std::string ShortDesc) -{ - DestFile = GetPartialFileNameFromURI(RealURI); - - // Create the item - Desc.Description = URIDesc; - Desc.Owner = this; - Desc.ShortDesc = ShortDesc; - Desc.URI = RealURI; + FileFd fd(FinalFile, FileFd::ReadOnly); + Hashes LocalHashesCalc; + LocalHashesCalc.AddFD(fd); + HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); - // we expect more item - ExpectedAdditionalItems = IndexTargets->size(); - QueueURI(Desc); -} - /*}}}*/ -void pkgAcqMetaIndex::Done(string Message,unsigned long long Size, /*{{{*/ - HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cfg) -{ - Item::Done(Message,Size,Hashes,Cfg); + if(Debug) + std::clog << "QueueNextDiff: " << FinalFile << " (" << LocalHashes.find(NULL)->toStr() << ")" << std::endl; - if(CheckDownloadDone(this, Message, Hashes)) + HashStringList const TargetFileHashes = GetExpectedHashesFor(Target->MetaKey); + if (unlikely(LocalHashes.usable() == false || TargetFileHashes.usable() == false)) { - // we have a Release file, now download the Signature, all further - // verify/queue for additional downloads will be done in the - // pkgAcqMetaSig::Done() code - new pkgAcqMetaSig(Owner, TransactionManager, - MetaIndexSigURI, MetaIndexSigURIDesc, - MetaIndexSigShortDesc, this); + Failed("Local/Expected hashes are not usable", NULL); + return false; } -} - /*}}}*/ -bool pkgAcqMetaBase::CheckAuthDone(string Message) /*{{{*/ -{ - // At this point, the gpgv method has succeeded, so there is a - // valid signature from a key in the trusted keyring. We - // perform additional verification of its contents, and use them - // to verify the indexes we are about to download - if (TransactionManager->IMSHit == false) + + // final file reached before all patches are applied + if(LocalHashes == TargetFileHashes) { - // open the last (In)Release if we have it - std::string const FinalFile = GetFinalFilename(); - std::string FinalRelease; - std::string FinalInRelease; - if (APT::String::Endswith(FinalFile, "InRelease")) - { - FinalInRelease = FinalFile; - FinalRelease = FinalFile.substr(0, FinalFile.length() - strlen("InRelease")) + "Release"; - } - else - { - FinalInRelease = FinalFile.substr(0, FinalFile.length() - strlen("Release")) + "InRelease"; - FinalRelease = FinalFile; - } - if (RealFileExists(FinalInRelease) || RealFileExists(FinalRelease)) - { - LastMetaIndexParser = new indexRecords; - _error->PushToStack(); - if (RealFileExists(FinalInRelease)) - LastMetaIndexParser->Load(FinalInRelease); - else - LastMetaIndexParser->Load(FinalRelease); - // its unlikely to happen, but if what we have is bad ignore it - if (_error->PendingError()) - { - delete LastMetaIndexParser; - LastMetaIndexParser = NULL; - } - _error->RevertToStack(); - } + Finish(true); + return true; } - if (!MetaIndexParser->Load(DestFile)) + // remove all patches until the next matching patch is found + // this requires the Index file to be ordered + for(vector::iterator I = available_patches.begin(); + available_patches.empty() == false && + I != available_patches.end() && + I->result_hashes != LocalHashes; + ++I) { - Status = StatAuthError; - ErrorText = MetaIndexParser->ErrorText; - return false; + available_patches.erase(I); } - if (!VerifyVendor(Message)) + // error checking and falling back if no patch was found + if(available_patches.empty() == true) { - Status = StatAuthError; + Failed("No patches left to reach target", NULL); return false; } - if (_config->FindB("Debug::pkgAcquire::Auth", false)) - std::cerr << "Signature verification succeeded: " - << DestFile << std::endl; + // queue the right diff + Desc.URI = Target->URI + ".diff/" + available_patches[0].file + ".gz"; + Desc.Description = Description + " " + available_patches[0].file + string(".pdiff"); + DestFile = GetPartialFileNameFromURI(Target->URI + ".diff/" + available_patches[0].file); - // Download further indexes with verification - QueueIndexes(true); + if(Debug) + std::clog << "pkgAcqIndexDiffs::QueueNextDiff(): " << Desc.URI << std::endl; + + QueueURI(Desc); return true; } /*}}}*/ -// pkgAcqMetaBase::Custom600Headers - Get header for AcqMetaBase /*{{{*/ -// --------------------------------------------------------------------- -#if APT_PKG_ABI >= 413 -string pkgAcqMetaBase::Custom600Headers() const -#else -string pkgAcqMetaBase::Custom600Headers() -#endif +void pkgAcqIndexDiffs::Done(string const &Message, HashStringList const &Hashes, /*{{{*/ + pkgAcquire::MethodConfig const * const Cnf) { - std::string Header = "\nIndex-File: true"; - std::string MaximumSize; - strprintf(MaximumSize, "\nMaximum-Size: %i", - _config->FindI("Acquire::MaxReleaseFileSize", 10*1000*1000)); - Header += MaximumSize; - - string const FinalFile = GetFinalFilename(); + if(Debug) + std::clog << "pkgAcqIndexDiffs::Done(): " << Desc.URI << std::endl; - struct stat Buf; - if (stat(FinalFile.c_str(),&Buf) == 0) - Header += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); + Item::Done(Message, Hashes, Cnf); - return Header; -} - /*}}}*/ -// pkgAcqMetaBase::GetFinalFilename - Return the full final file path /*{{{*/ -std::string pkgAcqMetaBase::GetFinalFilename() const -{ - return GetFinalFileNameFromURI(RealURI); -} - /*}}}*/ -// pkgAcqMetaBase::QueueForSignatureVerify /*{{{*/ -void pkgAcqMetaBase::QueueForSignatureVerify(pkgAcquire::Item * const I, std::string const &File, std::string const &Signature) -{ - AuthPass = true; - I->Desc.URI = "gpgv:" + Signature; - I->DestFile = File; - QueueURI(I->Desc); - I->SetActiveSubprocess("gpgv"); -} - /*}}}*/ -// pkgAcqMetaBase::CheckDownloadDone /*{{{*/ -bool pkgAcqMetaBase::CheckDownloadDone(pkgAcquire::Item * const I, const std::string &Message, HashStringList const &Hashes) const -{ - // We have just finished downloading a Release file (it is not - // verified yet) + // FIXME: verify this download too before feeding it to rred + std::string const FinalFile = GetPartialFileNameFromURI(Target->URI); - string const FileName = LookupTag(Message,"Filename"); - if (FileName.empty() == true) + // success in downloading a diff, enter ApplyDiff state + if(State == StateFetchDiff) { - I->Status = StatError; - I->ErrorText = "Method gave a blank filename"; - return false; - } + FileFd fd(DestFile, FileFd::ReadOnly, FileFd::Gzip); + class Hashes LocalHashesCalc; + LocalHashesCalc.AddFD(fd); + HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); - if (FileName != I->DestFile) - { - I->Local = true; - I->Desc.URI = "copy:" + FileName; - I->QueueURI(I->Desc); - return false; - } + if (fd.Size() != available_patches[0].patch_size || + available_patches[0].patch_hashes != LocalHashes) + { + // patchfiles are dated, so bad indicates a bad download, so kill it + unlink(DestFile.c_str()); + Failed("Patch has Size/Hashsum mismatch", NULL); + return; + } - // make sure to verify against the right file on I-M-S hit - bool IMSHit = StringToBool(LookupTag(Message,"IMS-Hit"), false); - if (IMSHit == false && Hashes.usable()) + // rred excepts the patch as $FinalFile.ed + Rename(DestFile,FinalFile+".ed"); + + if(Debug) + std::clog << "Sending to rred method: " << FinalFile << std::endl; + + State = StateApplyDiff; + Local = true; + Desc.URI = "rred:" + FinalFile; + QueueURI(Desc); + SetActiveSubprocess("rred"); + return; + } + + + // success in download/apply a diff, queue next (if needed) + if(State == StateApplyDiff) { - // detect IMS-Hits servers haven't detected by Hash comparison - std::string const FinalFile = I->GetFinalFilename(); - if (RealFileExists(FinalFile) && Hashes.VerifyFile(FinalFile) == true) + // remove the just applied patch + available_patches.erase(available_patches.begin()); + unlink((FinalFile + ".ed").c_str()); + + // move into place + if(Debug) { - IMSHit = true; - unlink(I->DestFile.c_str()); + std::clog << "Moving patched file in place: " << std::endl + << DestFile << " -> " << FinalFile << std::endl; } - } + Rename(DestFile,FinalFile); + chmod(FinalFile.c_str(),0644); - if(IMSHit == true) - { - // for simplicity, the transaction manager is always InRelease - // even if it doesn't exist. - if (TransactionManager != NULL) - TransactionManager->IMSHit = true; - I->PartialFile = I->DestFile = I->GetFinalFilename(); + // see if there is more to download + if(available_patches.empty() == false) { + new pkgAcqIndexDiffs(Owner, TransactionManager, Target, + available_patches); + return Finish(); + } else + // update + DestFile = FinalFile; + return Finish(true); } +} + /*}}}*/ + +// AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor /*{{{*/ +pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, + pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target, + DiffInfo const &patch, + std::vector const * const allPatches) + : pkgAcqBaseIndex(Owner, TransactionManager, Target), + patch(patch), allPatches(allPatches), State(StateFetchDiff) +{ + Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); + + Desc.Owner = this; + Description = Target->Description; + Desc.ShortDesc = Target->ShortDesc; + + Desc.URI = Target->URI + ".diff/" + patch.file + ".gz"; + Desc.Description = Description + " " + patch.file + string(".pdiff"); + + DestFile = GetPartialFileNameFromURI(Target->URI + ".diff/" + patch.file); + + if(Debug) + std::clog << "pkgAcqIndexMergeDiffs: " << Desc.URI << std::endl; + + QueueURI(Desc); +} + /*}}}*/ +void pkgAcqIndexMergeDiffs::Failed(string const &Message,pkgAcquire::MethodConfig const * const Cnf)/*{{{*/ +{ + if(Debug) + std::clog << "pkgAcqIndexMergeDiffs failed: " << Desc.URI << " with " << Message << std::endl; - // set Item to complete as the remaining work is all local (verify etc) - I->Complete = true; + Item::Failed(Message,Cnf); + Status = StatDone; - return true; + // check if we are the first to fail, otherwise we are done here + State = StateDoneDiff; + for (std::vector::const_iterator I = allPatches->begin(); + I != allPatches->end(); ++I) + if ((*I)->State == StateErrorDiff) + return; + + // first failure means we should fallback + State = StateErrorDiff; + if (Debug) + std::clog << "Falling back to normal index file acquire" << std::endl; + DestFile = GetPartialFileNameFromURI(Target->URI); + RenameOnError(PDiffError); + new pkgAcqIndex(Owner, TransactionManager, Target); } /*}}}*/ -void pkgAcqMetaBase::QueueIndexes(bool verify) /*{{{*/ +void pkgAcqIndexMergeDiffs::Done(string const &Message, HashStringList const &Hashes, /*{{{*/ + pkgAcquire::MethodConfig const * const Cnf) { - // at this point the real Items are loaded in the fetcher - ExpectedAdditionalItems = 0; + if(Debug) + std::clog << "pkgAcqIndexMergeDiffs::Done(): " << Desc.URI << std::endl; - vector ::const_iterator Target; - for (Target = IndexTargets->begin(); - Target != IndexTargets->end(); - ++Target) - { - HashStringList ExpectedIndexHashes; - const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey); + Item::Done(Message, Hashes, Cnf); - // optional target that we do not have in the Release file are - // skipped - if (verify == true && Record == NULL && (*Target)->IsOptional()) - continue; + // FIXME: verify download before feeding it to rred + string const FinalFile = GetPartialFileNameFromURI(Target->URI); + + if (State == StateFetchDiff) + { + FileFd fd(DestFile, FileFd::ReadOnly, FileFd::Gzip); + class Hashes LocalHashesCalc; + LocalHashesCalc.AddFD(fd); + HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); - // targets without a hash record are a error when verify is required - if (verify == true && Record == NULL) + if (fd.Size() != patch.patch_size || patch.patch_hashes != LocalHashes) { - Status = StatAuthError; - strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str()); - return; + // patchfiles are dated, so bad indicates a bad download, so kill it + unlink(DestFile.c_str()); + Failed("Patch has Size/Hashsum mismatch", NULL); + return; } - if (Record) - ExpectedIndexHashes = Record->Hashes; - - if (_config->FindB("Debug::pkgAcquire::Auth", false)) - { - std::cerr << "Queueing: " << (*Target)->URI << std::endl - << "Expected Hash:" << std::endl; - for (HashStringList::const_iterator hs = ExpectedIndexHashes.begin(); hs != ExpectedIndexHashes.end(); ++hs) - std::cerr << "\t- " << hs->toStr() << std::endl; - std::cerr << "For: " << ((Record == NULL) ? "" : Record->MetaKeyFilename) << std::endl; + // rred expects the patch as $FinalFile.ed.$patchname.gz + Rename(DestFile, FinalFile + ".ed." + patch.file + ".gz"); + + // check if this is the last completed diff + State = StateDoneDiff; + for (std::vector::const_iterator I = allPatches->begin(); + I != allPatches->end(); ++I) + if ((*I)->State != StateDoneDiff) + { + if(Debug) + std::clog << "Not the last done diff in the batch: " << Desc.URI << std::endl; + return; + } + + // this is the last completed diff, so we are ready to apply now + State = StateApplyDiff; + // patching needs to be bootstrapped with the 'old' version + if (symlink(GetFinalFilename().c_str(), FinalFile.c_str()) != 0) + { + Failed("Link creation of " + FinalFile + " to " + GetFinalFilename() + " failed", NULL); + return; } - if (verify == true && ExpectedIndexHashes.empty() == true) + + if(Debug) + std::clog << "Sending to rred method: " << FinalFile << std::endl; + + Local = true; + Desc.URI = "rred:" + FinalFile; + QueueURI(Desc); + SetActiveSubprocess("rred"); + return; + } + // success in download/apply all diffs, clean up + else if (State == StateApplyDiff) + { + // move the result into place + std::string const Final = GetFinalFilename(); + if(Debug) + std::clog << "Queue patched file in place: " << std::endl + << DestFile << " -> " << Final << std::endl; + + // queue for copy by the transaction manager + TransactionManager->TransactionStageCopy(this, DestFile, Final); + + // ensure the ed's are gone regardless of list-cleanup + for (std::vector::const_iterator I = allPatches->begin(); + I != allPatches->end(); ++I) { - Status = StatAuthError; - strprintf(ErrorText, _("Unable to find hash sum for '%s' in Release file"), (*Target)->MetaKey.c_str()); - return; + std::string const PartialFile = GetPartialFileNameFromURI(Target->URI); + std::string patch = PartialFile + ".ed." + (*I)->patch.file + ".gz"; + unlink(patch.c_str()); } + unlink(FinalFile.c_str()); - /* Queue the Index file (Packages, Sources, Translation-$foo - (either diff or full packages files, depending - on the users option) - we also check if the PDiff Index file is listed - in the Meta-Index file. Ideal would be if pkgAcqDiffIndex would test this - instead, but passing the required info to it is to much hassle */ - if(_config->FindB("Acquire::PDiffs",true) == true && (verify == false || - MetaIndexParser->Exists((*Target)->MetaKey + ".diff/Index") == true)) - new pkgAcqDiffIndex(Owner, TransactionManager, *Target, ExpectedIndexHashes, MetaIndexParser); - else - new pkgAcqIndex(Owner, TransactionManager, *Target, ExpectedIndexHashes, MetaIndexParser); + // all set and done + Complete = true; + if(Debug) + std::clog << "allDone: " << DestFile << "\n" << std::endl; } } /*}}}*/ -bool pkgAcqMetaBase::VerifyVendor(string Message) /*{{{*/ + +// AcqIndex::AcqIndex - Constructor /*{{{*/ +pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner, + pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target) + : pkgAcqBaseIndex(Owner, TransactionManager, Target) { - string::size_type pos; + // autoselect the compression method + AutoSelectCompression(); + Init(Target->URI, Target->Description, Target->ShortDesc); - // check for missing sigs (that where not fatal because otherwise we had - // bombed earlier) - string missingkeys; - string msg = _("There is no public key available for the " - "following key IDs:\n"); - pos = Message.find("NO_PUBKEY "); - if (pos != std::string::npos) + if(_config->FindB("Debug::Acquire::Transaction", false) == true) + std::clog << "New pkgIndex with TransactionManager " + << TransactionManager << std::endl; +} + /*}}}*/ +// AcqIndex::AutoSelectCompression - Select compression /*{{{*/ +void pkgAcqIndex::AutoSelectCompression() +{ + std::vector types = APT::Configuration::getCompressionTypes(); + CompressionExtensions = ""; + if (TransactionManager->MetaIndexParser != NULL && TransactionManager->MetaIndexParser->Exists(Target->MetaKey)) { - string::size_type start = pos+strlen("NO_PUBKEY "); - string Fingerprint = Message.substr(start, Message.find("\n")-start); - missingkeys += (Fingerprint); + for (std::vector::const_iterator t = types.begin(); + t != types.end(); ++t) + { + std::string CompressedMetaKey = string(Target->MetaKey).append(".").append(*t); + if (*t == "uncompressed" || + TransactionManager->MetaIndexParser->Exists(CompressedMetaKey) == true) + CompressionExtensions.append(*t).append(" "); + } } - if(!missingkeys.empty()) - _error->Warning("%s", (msg + missingkeys).c_str()); - - string Transformed = MetaIndexParser->GetExpectedDist(); - - if (Transformed == "../project/experimental") + else { - Transformed = "experimental"; + for (std::vector::const_iterator t = types.begin(); t != types.end(); ++t) + CompressionExtensions.append(*t).append(" "); } + if (CompressionExtensions.empty() == false) + CompressionExtensions.erase(CompressionExtensions.end()-1); +} + /*}}}*/ +// AcqIndex::Init - defered Constructor /*{{{*/ +void pkgAcqIndex::Init(string const &URI, string const &URIDesc, + string const &ShortDesc) +{ + Stage = STAGE_DOWNLOAD; - pos = Transformed.rfind('/'); - if (pos != string::npos) - { - Transformed = Transformed.substr(0, pos); - } + DestFile = GetPartialFileNameFromURI(URI); - if (Transformed == ".") + size_t const nextExt = CompressionExtensions.find(' '); + if (nextExt == std::string::npos) { - Transformed = ""; + CurrentCompressionExtension = CompressionExtensions; + CompressionExtensions.clear(); } - - if (_config->FindB("Acquire::Check-Valid-Until", true) == true && - MetaIndexParser->GetValidUntil() > 0) { - time_t const invalid_since = time(NULL) - MetaIndexParser->GetValidUntil(); - if (invalid_since > 0) - { - std::string errmsg; - strprintf(errmsg, - // TRANSLATOR: The first %s is the URL of the bad Release file, the second is - // the time since then the file is invalid - formated in the same way as in - // the download progress display (e.g. 7d 3h 42min 1s) - _("Release file for %s is expired (invalid since %s). " - "Updates for this repository will not be applied."), - RealURI.c_str(), TimeToStr(invalid_since).c_str()); - if (ErrorText.empty()) - ErrorText = errmsg; - return _error->Error("%s", errmsg.c_str()); - } + else + { + CurrentCompressionExtension = CompressionExtensions.substr(0, nextExt); + CompressionExtensions = CompressionExtensions.substr(nextExt+1); } - /* Did we get a file older than what we have? This is a last minute IMS hit and doubles - as a prevention of downgrading us to older (still valid) files */ - if (TransactionManager->IMSHit == false && LastMetaIndexParser != NULL && - LastMetaIndexParser->GetDate() > MetaIndexParser->GetDate()) + if (CurrentCompressionExtension == "uncompressed") { - TransactionManager->IMSHit = true; - unlink(DestFile.c_str()); - PartialFile = DestFile = GetFinalFilename(); - delete MetaIndexParser; - MetaIndexParser = LastMetaIndexParser; - LastMetaIndexParser = NULL; + Desc.URI = URI; } - - if (_config->FindB("Debug::pkgAcquire::Auth", false)) + else if (unlikely(CurrentCompressionExtension.empty())) + return; + else { - std::cerr << "Got Codename: " << MetaIndexParser->GetDist() << std::endl; - std::cerr << "Expecting Dist: " << MetaIndexParser->GetExpectedDist() << std::endl; - std::cerr << "Transformed Dist: " << Transformed << std::endl; + Desc.URI = URI + '.' + CurrentCompressionExtension; + DestFile = DestFile + '.' + CurrentCompressionExtension; } - if (MetaIndexParser->CheckDist(Transformed) == false) + if(TransactionManager->MetaIndexParser != NULL) + InitByHashIfNeeded(); + + Desc.Description = URIDesc; + Desc.Owner = this; + Desc.ShortDesc = ShortDesc; + + QueueURI(Desc); +} + /*}}}*/ +// AcqIndex::AdjustForByHash - modify URI for by-hash support /*{{{*/ +void pkgAcqIndex::InitByHashIfNeeded() +{ + // TODO: + // - (maybe?) add support for by-hash into the sources.list as flag + // - make apt-ftparchive generate the hashes (and expire?) + std::string HostKnob = "APT::Acquire::" + ::URI(Desc.URI).Host + "::By-Hash"; + if(_config->FindB("APT::Acquire::By-Hash", false) == true || + _config->FindB(HostKnob, false) == true || + TransactionManager->MetaIndexParser->GetSupportsAcquireByHash()) { - // This might become fatal one day -// Status = StatAuthError; -// ErrorText = "Conflicting distribution; expected " -// + MetaIndexParser->GetExpectedDist() + " but got " -// + MetaIndexParser->GetDist(); -// return false; - if (!Transformed.empty()) + HashStringList const Hashes = GetExpectedHashes(); + if(Hashes.usable()) { - _error->Warning(_("Conflicting distribution: %s (expected %s but got %s)"), - Desc.Description.c_str(), - Transformed.c_str(), - MetaIndexParser->GetDist().c_str()); + // FIXME: should we really use the best hash here? or a fixed one? + HashString const * const TargetHash = Hashes.find(""); + std::string const ByHash = "/by-hash/" + TargetHash->HashType() + "/" + TargetHash->HashValue(); + size_t const trailing_slash = Desc.URI.find_last_of("/"); + Desc.URI = Desc.URI.replace( + trailing_slash, + Desc.URI.substr(trailing_slash+1).size()+1, + ByHash); + } else { + _error->Warning( + "Fetching ByHash requested but can not find record for %s", + GetMetaKey().c_str()); } } - - return true; } /*}}}*/ -// pkgAcqMetaIndex::Failed - no Release file present /*{{{*/ -void pkgAcqMetaIndex::Failed(string Message, - pkgAcquire::MethodConfig * Cnf) +// AcqIndex::Custom600Headers - Insert custom request headers /*{{{*/ +// --------------------------------------------------------------------- +/* The only header we use is the last-modified header. */ +string pkgAcqIndex::Custom600Headers() const { - pkgAcquire::Item::Failed(Message, Cnf); - Status = StatDone; - - _error->Warning(_("The repository '%s' does not have a Release file. " - "This is deprecated, please contact the owner of the " - "repository."), URIDesc.c_str()); + string Final = GetFinalFilename(); - // No Release file was present so fall - // back to queueing Packages files without verification - // only allow going further if the users explicitely wants it - if(AllowInsecureRepositories(MetaIndexParser, TransactionManager, this) == true) - { - // Done, queue for rename on transaction finished - if (FileExists(DestFile)) - TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); + string msg = "\nIndex-File: true"; + struct stat Buf; + if (stat(Final.c_str(),&Buf) == 0) + msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); - // queue without any kind of hashsum support - QueueIndexes(false); - } + if(Target->IsOptional()) + msg += "\nFail-Ignore: true"; + + return msg; } /*}}}*/ -void pkgAcqMetaIndex::Finished() /*{{{*/ +// AcqIndex::Failed - getting the indexfile failed /*{{{*/ +void pkgAcqIndex::Failed(string const &Message,pkgAcquire::MethodConfig const * const Cnf) { - if(_config->FindB("Debug::Acquire::Transaction", false) == true) - std::clog << "Finished: " << DestFile <TransactionHasError() == false) - TransactionManager->CommitTransaction(); + Item::Failed(Message,Cnf); + + // authorisation matches will not be fixed by other compression types + if (Status != StatAuthError) + { + if (CompressionExtensions.empty() == false) + { + Init(Target->URI, Desc.Description, Desc.ShortDesc); + Status = StatIdle; + return; + } + } + + if(Target->IsOptional() && GetExpectedHashes().empty() && Stage == STAGE_DOWNLOAD) + Status = StatDone; + else + TransactionManager->AbortTransaction(); } /*}}}*/ -pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire *Owner, /*{{{*/ - string const &URI, string const &URIDesc, string const &ShortDesc, - string const &MetaIndexURI, string const &MetaIndexURIDesc, string const &MetaIndexShortDesc, - string const &MetaSigURI, string const &MetaSigURIDesc, string const &MetaSigShortDesc, - const vector* IndexTargets, - indexRecords* MetaIndexParser) : - pkgAcqMetaIndex(Owner, NULL, URI, URIDesc, ShortDesc, MetaSigURI, MetaSigURIDesc,MetaSigShortDesc, IndexTargets, MetaIndexParser), - MetaIndexURI(MetaIndexURI), MetaIndexURIDesc(MetaIndexURIDesc), MetaIndexShortDesc(MetaIndexShortDesc), - MetaSigURI(MetaSigURI), MetaSigURIDesc(MetaSigURIDesc), MetaSigShortDesc(MetaSigShortDesc) +// AcqIndex::ReverifyAfterIMS - Reverify index after an ims-hit /*{{{*/ +void pkgAcqIndex::ReverifyAfterIMS() { - // index targets + (worst case:) Release/Release.gpg - ExpectedAdditionalItems = IndexTargets->size() + 2; + // update destfile to *not* include the compression extension when doing + // a reverify (as its uncompressed on disk already) + DestFile = GetCompressedFileName(Target->URI, GetPartialFileNameFromURI(Target->URI), CurrentCompressionExtension); + + // copy FinalFile into partial/ so that we check the hash again + string FinalFile = GetFinalFilename(); + Stage = STAGE_DECOMPRESS_AND_VERIFY; + Desc.URI = "copy:" + FinalFile; + QueueURI(Desc); } /*}}}*/ -pkgAcqMetaClearSig::~pkgAcqMetaClearSig() /*{{{*/ +// AcqIndex::ValidateFile - Validate the content of the downloaded file /*{{{*/ +bool pkgAcqIndex::ValidateFile(const std::string &FileName) { + // FIXME: this can go away once we only ever download stuff that + // has a valid hash and we never do GET based probing + // FIXME2: this also leaks debian-isms into the code and should go therefore + + /* Always validate the index file for correctness (all indexes must + * have a Package field) (LP: #346386) (Closes: #627642) + */ + FileFd fd(FileName, FileFd::ReadOnly, FileFd::Extension); + // Only test for correctness if the content of the file is not empty + // (empty is ok) + if (fd.Size() > 0) + { + pkgTagSection sec; + pkgTagFile tag(&fd); + + // all our current indexes have a field 'Package' in each section + if (_error->PendingError() == true || + tag.Step(sec) == false || + sec.Exists("Package") == false) + return false; + } + return true; } /*}}}*/ -// pkgAcqMetaClearSig::Custom600Headers - Insert custom request headers /*{{{*/ -#if APT_PKG_ABI >= 413 -string pkgAcqMetaClearSig::Custom600Headers() const -#else -string pkgAcqMetaClearSig::Custom600Headers() -#endif +// AcqIndex::Done - Finished a fetch /*{{{*/ +// --------------------------------------------------------------------- +/* This goes through a number of states.. On the initial fetch the + method could possibly return an alternate filename which points + to the uncompressed version of the file. If this is so the file + is copied into the partial directory. In all other cases the file + is decompressed with a compressed uri. */ +void pkgAcqIndex::Done(string const &Message, + HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cfg) { - string Header = pkgAcqMetaBase::Custom600Headers(); - Header += "\nFail-Ignore: true"; - return Header; + Item::Done(Message,Hashes,Cfg); + + switch(Stage) + { + case STAGE_DOWNLOAD: + StageDownloadDone(Message, Hashes, Cfg); + break; + case STAGE_DECOMPRESS_AND_VERIFY: + StageDecompressDone(Message, Hashes, Cfg); + break; + } } /*}}}*/ -// pkgAcqMetaClearSig::Done - We got a file /*{{{*/ -class APT_HIDDEN DummyItem : public pkgAcquire::Item +// AcqIndex::StageDownloadDone - Queue for decompress and verify /*{{{*/ +void pkgAcqIndex::StageDownloadDone(string const &Message, HashStringList const &, + pkgAcquire::MethodConfig const * const) { - std::string URI; - public: - virtual std::string DescURI() {return URI;}; + Complete = true; - DummyItem(pkgAcquire *Owner, std::string const &URI) : pkgAcquire::Item(Owner), URI(URI) + // Handle the unzipd case + string FileName = LookupTag(Message,"Alt-Filename"); + if (FileName.empty() == false) { - Status = StatDone; - DestFile = GetFinalFileNameFromURI(URI); + Stage = STAGE_DECOMPRESS_AND_VERIFY; + Local = true; + DestFile += ".decomp"; + Desc.URI = "copy:" + FileName; + QueueURI(Desc); + SetActiveSubprocess("copy"); + return; } -}; -void pkgAcqMetaClearSig::Done(std::string Message,unsigned long long Size, - HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf) -{ - Item::Done(Message, Size, Hashes, Cnf); - // if we expect a ClearTextSignature (InRelease), ensure that - // this is what we get and if not fail to queue a - // Release/Release.gpg, see #346386 - if (FileExists(DestFile) && !StartsWithGPGClearTextSignature(DestFile)) + FileName = LookupTag(Message,"Filename"); + if (FileName.empty() == true) { - pkgAcquire::Item::Failed(Message, Cnf); - RenameOnError(NotClearsigned); - TransactionManager->AbortTransaction(); - return; + Status = StatError; + ErrorText = "Method gave a blank filename"; } - if(AuthPass == false) + // Methods like e.g. "file:" will give us a (compressed) FileName that is + // not the "DestFile" we set, in this case we uncompress from the local file + if (FileName != DestFile) + Local = true; + else + EraseFileName = FileName; + + // we need to verify the file against the current Release file again + // on if-modfied-since hit to avoid a stale attack against us + if(StringToBool(LookupTag(Message,"IMS-Hit"),false) == true) { - if(CheckDownloadDone(this, Message, Hashes) == true) - QueueForSignatureVerify(this, DestFile, DestFile); + // The files timestamp matches, reverify by copy into partial/ + EraseFileName = ""; + ReverifyAfterIMS(); return; } - else if(CheckAuthDone(Message) == true) + + // If we have compressed indexes enabled, queue for hash verification + if (_config->FindB("Acquire::GzipIndexes",false)) { - if (TransactionManager->IMSHit == false) - TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); - else if (RealFileExists(GetFinalFilename()) == false) - { - // We got an InRelease file IMSHit, but we haven't one, which means - // we had a valid Release/Release.gpg combo stepping in, which we have - // to 'acquire' now to ensure list cleanup isn't removing them - new DummyItem(Owner, MetaIndexURI); - new DummyItem(Owner, MetaSigURI); - } + DestFile = GetPartialFileNameFromURI(Target->URI + '.' + CurrentCompressionExtension); + EraseFileName = ""; + Stage = STAGE_DECOMPRESS_AND_VERIFY; + Desc.URI = "copy:" + FileName; + QueueURI(Desc); + SetActiveSubprocess("copy"); + return; + } + + // get the binary name for your used compression type + string decompProg; + if(CurrentCompressionExtension == "uncompressed") + decompProg = "copy"; + else + decompProg = _config->Find(string("Acquire::CompressionTypes::").append(CurrentCompressionExtension),""); + if(decompProg.empty() == true) + { + _error->Error("Unsupported extension: %s", CurrentCompressionExtension.c_str()); + return; } + + // queue uri for the next stage + Stage = STAGE_DECOMPRESS_AND_VERIFY; + DestFile += ".decomp"; + Desc.URI = decompProg + ":" + FileName; + QueueURI(Desc); + SetActiveSubprocess(decompProg); } /*}}}*/ -void pkgAcqMetaClearSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/ +// AcqIndex::StageDecompressDone - Final verification /*{{{*/ +void pkgAcqIndex::StageDecompressDone(string const &Message, + HashStringList const &, + pkgAcquire::MethodConfig const * const Cfg) { - Item::Failed(Message, Cnf); - - // we failed, we will not get additional items from this method - ExpectedAdditionalItems = 0; - - if (AuthPass == false) + if(!ValidateFile(DestFile)) { - // Queue the 'old' InRelease file for removal if we try Release.gpg - // as otherwise the file will stay around and gives a false-auth - // impression (CVE-2012-0214) - TransactionManager->TransactionStageRemoval(this, GetFinalFilename()); - Status = StatDone; - - new pkgAcqMetaIndex(Owner, TransactionManager, - MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc, - MetaSigURI, MetaSigURIDesc, MetaSigShortDesc, - IndexTargets, MetaIndexParser); + RenameOnError(InvalidFormat); + Failed(Message, Cfg); + return; } - else - { - if(CheckStopAuthentication(this, Message)) - return; - _error->Warning(_("The data from '%s' is not signed. Packages " - "from that repository can not be authenticated."), - URIDesc.c_str()); - - // No Release file was present, or verification failed, so fall - // back to queueing Packages files without verification - // only allow going further if the users explicitely wants it - if(AllowInsecureRepositories(MetaIndexParser, TransactionManager, this) == true) - { - Status = StatDone; + // Done, queue for rename on transaction finished + TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); - /* Always move the meta index, even if gpgv failed. This ensures - * that PackageFile objects are correctly filled in */ - if (FileExists(DestFile)) - { - string FinalFile = GetFinalFilename(); - /* InRelease files become Release files, otherwise - * they would be considered as trusted later on */ - RealURI = RealURI.replace(RealURI.rfind("InRelease"), 9, - "Release"); - FinalFile = FinalFile.replace(FinalFile.rfind("InRelease"), 9, - "Release"); - - // Done, queue for rename on transaction finished - TransactionManager->TransactionStageCopy(this, DestFile, FinalFile); - } - QueueIndexes(false); - } - } + return; } /*}}}*/ + + // AcqArchive::AcqArchive - Constructor /*{{{*/ // --------------------------------------------------------------------- /* This just sets up the initial fetch environment and queues the first possibilitiy */ -pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources, - pkgRecords *Recs,pkgCache::VerIterator const &Version, +pkgAcqArchive::pkgAcqArchive(pkgAcquire * const Owner,pkgSourceList * const Sources, + pkgRecords * const Recs,pkgCache::VerIterator const &Version, string &StoreFilename) : - Item(Owner, HashStringList()), Version(Version), Sources(Sources), Recs(Recs), - StoreFilename(StoreFilename), Vf(Version.FileList()), + Item(Owner), LocalSource(false), Version(Version), Sources(Sources), Recs(Recs), + StoreFilename(StoreFilename), Vf(Version.FileList()), Trusted(false) { Retries = _config->FindI("Acquire::Retries",0); @@ -2573,15 +2577,17 @@ bool pkgAcqArchive::QueueNext() { for (; Vf.end() == false; ++Vf) { + pkgCache::PkgFileIterator const PkgF = Vf.File(); // Ignore not source sources - if ((Vf.File()->Flags & pkgCache::Flag::NotSource) != 0) + if ((PkgF->Flags & pkgCache::Flag::NotSource) != 0) continue; // Try to cross match against the source list pkgIndexFile *Index; - if (Sources->FindIndex(Vf.File(),Index) == false) + if (Sources->FindIndex(PkgF, Index) == false) continue; - + LocalSource = (PkgF->Flags & pkgCache::Flag::LocalSource) == pkgCache::Flag::LocalSource; + // only try to get a trusted package from another source if that source // is also trusted if(Trusted && !Index->IsTrusted()) @@ -2681,25 +2687,10 @@ bool pkgAcqArchive::QueueNext() // AcqArchive::Done - Finished fetching /*{{{*/ // --------------------------------------------------------------------- /* */ -void pkgAcqArchive::Done(string Message,unsigned long long Size, HashStringList const &CalcHashes, - pkgAcquire::MethodConfig *Cfg) +void pkgAcqArchive::Done(string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cfg) { - Item::Done(Message, Size, CalcHashes, Cfg); - - // Check the size - if (Size != Version->Size) - { - RenameOnError(SizeMismatch); - return; - } - - // FIXME: could this empty() check impose *any* sort of security issue? - if(ExpectedHashes.usable() && ExpectedHashes != CalcHashes) - { - RenameOnError(HashSumMismatch); - printHashSumComparision(DestFile, ExpectedHashes, CalcHashes); - return; - } + Item::Done(Message, Hashes, Cfg); // Grab the output filename string FileName = LookupTag(Message,"Filename"); @@ -2726,23 +2717,17 @@ void pkgAcqArchive::Done(string Message,unsigned long long Size, HashStringList Complete = true; } /*}}}*/ -// Acquire::Item::GetFinalFilename - Return the full final file path /*{{{*/ -std::string pkgAcqArchive::GetFinalFilename() const -{ - return _config->FindDir("Dir::Cache::Archives") + flNotDir(StoreFilename); -} - /*}}}*/ // AcqArchive::Failed - Failure handler /*{{{*/ // --------------------------------------------------------------------- /* Here we try other sources */ -void pkgAcqArchive::Failed(string Message,pkgAcquire::MethodConfig *Cnf) +void pkgAcqArchive::Failed(string const &Message,pkgAcquire::MethodConfig const * const Cnf) { Item::Failed(Message,Cnf); - /* We don't really want to retry on failed media swaps, this prevents + /* We don't really want to retry on failed media swaps, this prevents that. An interesting observation is that permanent failures are not recorded. */ - if (Cnf->Removable == true && + if (Cnf->Removable == true && StringToBool(LookupTag(Message,"Transient-Failure"),false) == true) { // Vf = Version.FileList(); @@ -2770,21 +2755,12 @@ void pkgAcqArchive::Failed(string Message,pkgAcquire::MethodConfig *Cnf) } } /*}}}*/ -// AcqArchive::IsTrusted - Determine whether this archive comes from a trusted source /*{{{*/ -// --------------------------------------------------------------------- -#if APT_PKG_ABI >= 413 -APT_PURE bool pkgAcqArchive::IsTrusted() const -#else -APT_PURE bool pkgAcqArchive::IsTrusted() -#endif +APT_PURE bool pkgAcqArchive::IsTrusted() const /*{{{*/ { return Trusted; } /*}}}*/ -// AcqArchive::Finished - Fetching has finished, tidy up /*{{{*/ -// --------------------------------------------------------------------- -/* */ -void pkgAcqArchive::Finished() +void pkgAcqArchive::Finished() /*{{{*/ { if (Status == pkgAcquire::Item::StatDone && Complete == true) @@ -2792,17 +2768,26 @@ void pkgAcqArchive::Finished() StoreFilename = string(); } /*}}}*/ +std::string pkgAcqArchive::DescURI() const /*{{{*/ +{ + return Desc.URI; +} + /*}}}*/ +std::string pkgAcqArchive::ShortDesc() const /*{{{*/ +{ + return Desc.ShortDesc; +} + /*}}}*/ + // AcqFile::pkgAcqFile - Constructor /*{{{*/ -// --------------------------------------------------------------------- -/* The file is added to the queue */ -pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI, HashStringList const &Hashes, - unsigned long long Size,string Dsc,string ShortDesc, +pkgAcqFile::pkgAcqFile(pkgAcquire * const Owner,string const &URI, HashStringList const &Hashes, + unsigned long long const Size,string const &Dsc,string const &ShortDesc, const string &DestDir, const string &DestFilename, - bool IsIndexFile) : - Item(Owner, Hashes), IsIndexFile(IsIndexFile) + bool const IsIndexFile) : + Item(Owner), IsIndexFile(IsIndexFile), ExpectedHashes(Hashes) { Retries = _config->FindI("Acquire::Retries",0); - + if(!DestFilename.empty()) DestFile = DestFilename; else if(!DestDir.empty()) @@ -2817,7 +2802,7 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI, HashStringList const &Hashe // Set the short description to the archive component Desc.ShortDesc = ShortDesc; - + // Get the transfer sizes FileSize = Size; struct stat Buf; @@ -2834,21 +2819,11 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI, HashStringList const &Hashe } /*}}}*/ // AcqFile::Done - Item downloaded OK /*{{{*/ -// --------------------------------------------------------------------- -/* */ -void pkgAcqFile::Done(string Message,unsigned long long Size,HashStringList const &CalcHashes, - pkgAcquire::MethodConfig *Cnf) +void pkgAcqFile::Done(string const &Message,HashStringList const &CalcHashes, + pkgAcquire::MethodConfig const * const Cnf) { - Item::Done(Message,Size,CalcHashes,Cnf); + Item::Done(Message,CalcHashes,Cnf); - // Check the hash - if(ExpectedHashes.usable() && ExpectedHashes != CalcHashes) - { - RenameOnError(HashSumMismatch); - printHashSumComparision(DestFile, ExpectedHashes, CalcHashes); - return; - } - string FileName = LookupTag(Message,"Filename"); if (FileName.empty() == true) { @@ -2858,11 +2833,11 @@ void pkgAcqFile::Done(string Message,unsigned long long Size,HashStringList cons } Complete = true; - + // The files timestamp matches if (StringToBool(LookupTag(Message,"IMS-Hit"),false) == true) return; - + // We have to copy it into place if (FileName != DestFile) { @@ -2874,7 +2849,7 @@ void pkgAcqFile::Done(string Message,unsigned long long Size,HashStringList cons QueueURI(Desc); return; } - + // Erase the file if it is a symlink so we can overwrite it struct stat St; if (lstat(DestFile.c_str(),&St) == 0) @@ -2882,7 +2857,7 @@ void pkgAcqFile::Done(string Message,unsigned long long Size,HashStringList cons if (S_ISLNK(St.st_mode) != 0) unlink(DestFile.c_str()); } - + // Symlink the file if (symlink(FileName.c_str(),DestFile.c_str()) != 0) { @@ -2894,14 +2869,14 @@ void pkgAcqFile::Done(string Message,unsigned long long Size,HashStringList cons ErrorText = msg.str(); Status = StatError; Complete = false; - } + } } } /*}}}*/ // AcqFile::Failed - Failure handler /*{{{*/ // --------------------------------------------------------------------- /* Here we try other sources */ -void pkgAcqFile::Failed(string Message,pkgAcquire::MethodConfig *Cnf) +void pkgAcqFile::Failed(string const &Message, pkgAcquire::MethodConfig const * const Cnf) { Item::Failed(Message,Cnf); @@ -2918,14 +2893,7 @@ void pkgAcqFile::Failed(string Message,pkgAcquire::MethodConfig *Cnf) } /*}}}*/ -// AcqIndex::Custom600Headers - Insert custom request headers /*{{{*/ -// --------------------------------------------------------------------- -/* The only header we use is the last-modified header. */ -#if APT_PKG_ABI >= 413 -string pkgAcqFile::Custom600Headers() const -#else -string pkgAcqFile::Custom600Headers() -#endif +string pkgAcqFile::Custom600Headers() const /*{{{*/ { if (IsIndexFile) return "\nIndex-File: true"; diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 07c86f31b..97d5ea1dd 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -6,15 +6,15 @@ Acquire Item - Item to acquire When an item is instantiated it will add it self to the local list in - the Owner Acquire class. Derived classes will then call QueueURI to - register all the URI's they wish to fetch at the initial moment. - + the Owner Acquire class. Derived classes will then call QueueURI to + register all the URI's they wish to fetch at the initial moment. + Three item classes are provided to provide functionality for downloading of Index, Translation and Packages files. - + A Archive class is provided for downloading .deb files. It does Hash checking and source location as well as a retry algorithm. - + ##################################################################### */ /*}}}*/ #ifndef PKGLIB_ACQUIRE_ITEM_H @@ -49,7 +49,48 @@ class pkgSourceList; class IndexTarget; class pkgAcqMetaBase; -/** \brief Represents the process by which a pkgAcquire object should {{{ +class APT_HIDDEN IndexTarget /*{{{*/ +/** \brief Information about an index file. */ +{ + public: + /** \brief A URI from which the index file can be downloaded. */ + std::string const URI; + + /** \brief A description of the index file. */ + std::string const Description; + + /** \brief A shorter description of the index file. */ + std::string const ShortDesc; + + /** \brief The key by which this index file should be + * looked up within the meta signature file. + */ + std::string const MetaKey; + + virtual bool IsOptional() const { + return false; + } + + IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, + std::string const &LongDesc, std::string const &URI) : + URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey) {} +}; + /*}}}*/ +class APT_HIDDEN OptionalIndexTarget : public IndexTarget /*{{{*/ +/** \brief Information about an optional index file. */ +{ + public: + virtual bool IsOptional() const { + return true; + } + + OptionalIndexTarget(std::string const &MetaKey, std::string const &ShortDesc, + std::string const &LongDesc, std::string const &URI) : + IndexTarget(MetaKey, ShortDesc, LongDesc, URI) {} +}; + /*}}}*/ +class pkgAcquire::Item : public WeakPointable /*{{{*/ +/** \brief Represents the process by which a pkgAcquire object should * retrieve a file or a collection of files. * * By convention, Item subclasses should insert themselves into the @@ -61,46 +102,7 @@ class pkgAcqMetaBase; * * \see pkgAcquire */ -class pkgAcquire::Item : public WeakPointable -{ - friend class pkgAcqMetaBase; - - void *d; - - protected: - - /** \brief The acquire object with which this item is associated. */ - pkgAcquire *Owner; - - /** \brief Insert this item into its owner's queue. - * - * The method is designed to check if the request would end - * in an IMSHit and if it determines that it would, it isn't - * queueing the Item and instead sets it to completion instantly. - * - * \param Item Metadata about this item (its URI and - * description). - * \return true if the item was inserted, false if IMSHit was detected - */ - virtual bool QueueURI(ItemDesc &Item); - - /** \brief Remove this item from its owner's queue. */ - void Dequeue(); - - /** \brief Rename a file without modifying its timestamp. - * - * Many item methods call this as their final action. - * - * \param From The file to be renamed. - * - * \param To The new name of \a From. If \a To exists it will be - * overwritten. - */ - bool Rename(std::string From,std::string To); - - /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; - +{ public: /** \brief The current status of this item. */ @@ -125,7 +127,7 @@ class pkgAcquire::Item : public WeakPointable */ StatAuthError, - /** \brief The item was could not be downloaded because of + /** \brief The item was could not be downloaded because of * a transient network error (e.g. network down) */ StatTransientNetworkError, @@ -153,11 +155,11 @@ class pkgAcquire::Item : public WeakPointable std::string ActiveSubprocess; /** \brief A client-supplied unique identifier. - * + * * This field is initalized to 0; it is meant to be filled in by * clients that wish to use it to uniquely identify items. * - * \todo it's unused in apt itself + * APT progress reporting will store an ID there as shown in "Get:42 …" */ unsigned long ID; @@ -173,6 +175,7 @@ class pkgAcquire::Item : public WeakPointable * download progress indicator's overall statistics. */ bool Local; + std::string UsedMirror; /** \brief The number of fetch queues into which this item has been @@ -185,9 +188,6 @@ class pkgAcquire::Item : public WeakPointable */ unsigned int QueueCounter; - /** \brief TransactionManager */ - pkgAcqMetaBase *TransactionManager; - /** \brief The number of additional fetch items that are expected * once this item is done. * @@ -197,15 +197,12 @@ class pkgAcquire::Item : public WeakPointable * progress. */ unsigned int ExpectedAdditionalItems; - + /** \brief The name of the file into which the retrieved object * will be written. */ std::string DestFile; - /** \brief storge name until a transaction is finished */ - std::string PartialFile; - /** \brief Invoked by the acquire worker when the object couldn't * be fetched. * @@ -219,7 +216,7 @@ class pkgAcquire::Item : public WeakPointable * * \sa pkgAcqMethod */ - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); /** \brief Invoked by the acquire worker when the object was * fetched successfully. @@ -234,25 +231,24 @@ class pkgAcquire::Item : public WeakPointable * * \param Message Data from the acquire method. Use LookupTag() * to parse it. - * \param Size The size of the object that was fetched. * \param Hashes The HashSums of the object that was fetched. * \param Cnf The method via which the object was fetched. * * \sa pkgAcqMethod */ - virtual void Done(std::string Message, unsigned long long Size, HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf); + virtual void Done(std::string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf); /** \brief Invoked when the worker starts to fetch this object. * * \param Message RFC822-formatted data from the worker process. * Use LookupTag() to parse it. * - * \param Size The size of the object being fetched. + * \param Hashes The expected hashes of the object being fetched. * * \sa pkgAcqMethod */ - virtual void Start(std::string Message,unsigned long long Size); + virtual void Start(std::string const &Message, unsigned long long const Size); /** \brief Custom headers to be sent to the fetch process. * @@ -262,61 +258,55 @@ class pkgAcquire::Item : public WeakPointable * line, so they should (if nonempty) have a leading newline and * no trailing newline. */ -#if APT_PKG_ABI >= 413 - virtual std::string Custom600Headers() const {return std::string();}; -#else - virtual std::string Custom600Headers() {return std::string();}; -#endif + virtual std::string Custom600Headers() const; /** \brief A "descriptive" URI-like string. * * \return a URI that should be used to describe what is being fetched. */ - virtual std::string DescURI() = 0; + virtual std::string DescURI() const = 0; /** \brief Short item description. * * \return a brief description of the object being fetched. */ - virtual std::string ShortDesc() {return DescURI();} + virtual std::string ShortDesc() const; /** \brief Invoked by the worker when the download is completely done. */ - virtual void Finished() {}; - - /** \brief HashSums + virtual void Finished(); + + /** \return HashSums the DestFile is supposed to have in this stage */ + virtual HashStringList GetExpectedHashes() const = 0; + /** \return the 'best' hash for display proposes like --print-uris */ + std::string HashSum() const; + + /** \return if having no hashes is a hard failure or not * - * \return the HashSums of this object, if applicable; otherwise, an - * empty list. + * Idealy this is always \b true for every subclass, but thanks to + * historical grow we don't have hashes for all files in all cases + * in all steps, so it is slightly more complicated than it should be. */ - HashStringList HashSums() const {return ExpectedHashes;}; - std::string HashSum() const {HashStringList const hashes = HashSums(); HashString const * const hs = hashes.find(NULL); return hs != NULL ? hs->toStr() : ""; }; + virtual bool HashesRequired() const { return true; } /** \return the acquire process with which this item is associated. */ - pkgAcquire *GetOwner() const {return Owner;}; -#if APT_PKG_ABI < 413 - pkgAcquire *GetOwner() {return Owner;}; -#endif + pkgAcquire *GetOwner() const; /** \return \b true if this object is being fetched from a trusted source. */ -#if APT_PKG_ABI >= 413 - virtual bool IsTrusted() const {return false;}; -#else - virtual bool IsTrusted() {return false;}; -#endif - + virtual bool IsTrusted() const; + /** \brief Report mirror problem - * + * * This allows reporting mirror failures back to a centralized * server. The apt-report-mirror-failure script is called for this - * + * * \param FailCode A short failure string that is send */ - void ReportMirrorFailure(std::string FailCode); + void ReportMirrorFailure(std::string const &FailCode); /** \brief Set the name of the current active subprocess * * See also #ActiveSubprocess */ - void SetActiveSubprocess(const std::string &subprocess); + void SetActiveSubprocess(std::string const &subprocess); /** \brief Initialize an item. * @@ -325,11 +315,8 @@ class pkgAcquire::Item : public WeakPointable * manually invoke QueueURI() to do so). * * \param Owner The new owner of this item. - * \param ExpectedHashes of the file represented by this item */ - Item(pkgAcquire *Owner, - HashStringList const &ExpectedHashes=HashStringList(), - pkgAcqMetaBase *TransactionManager=NULL); + Item(pkgAcquire * const Owner); /** \brief Remove this item from its owner's queue by invoking * pkgAcquire::Remove. @@ -337,6 +324,11 @@ class pkgAcquire::Item : public WeakPointable virtual ~Item(); protected: + /** \brief The acquire object with which this item is associated. */ + pkgAcquire * const Owner; + + /** \brief The item that is currently being downloaded. */ + pkgAcquire::ItemDesc Desc; enum RenameOnErrorState { HashSumMismatch, @@ -354,63 +346,99 @@ class pkgAcquire::Item : public WeakPointable */ bool RenameOnError(RenameOnErrorState const state); + /** \brief Insert this item into its owner's queue. + * + * The method is designed to check if the request would end + * in an IMSHit and if it determines that it would, it isn't + * queueing the Item and instead sets it to completion instantly. + * + * \param Item Metadata about this item (its URI and + * description). + * \return true if the item was inserted, false if IMSHit was detected + */ + virtual bool QueueURI(ItemDesc &Item); + + /** \brief Remove this item from its owner's queue. */ + void Dequeue(); + + /** \brief Rename a file without modifying its timestamp. + * + * Many item methods call this as their final action. + * + * \param From The file to be renamed. + * + * \param To The new name of \a From. If \a To exists it will be + * overwritten. If \a From and \a To are equal nothing happens. + */ + bool Rename(std::string const &From, std::string const &To); + + /** \brief Get the full pathname of the final file for the current URI */ + virtual std::string GetFinalFilename() const; + + private: + void *d; + + friend class pkgAcqMetaBase; +}; + /*}}}*/ +class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ +/** \brief baseclass for the indexes files to manage them all together */ +{ + protected: + IndexTarget const * const Target; + HashStringList GetExpectedHashesFor(std::string const MetaKey) const; + + bool QueueURI(pkgAcquire::ItemDesc &Item); + + public: + /** \brief storge name until a transaction is finished */ + std::string PartialFile; + + /** \brief TransactionManager */ + pkgAcqMetaBase * const TransactionManager; + enum TransactionStates { TransactionCommit, TransactionAbort, }; virtual bool TransactionState(TransactionStates const state); - /** \brief The HashSums of the item is supposed to have than done */ - HashStringList ExpectedHashes; + virtual std::string DescURI() const { return Target->URI; } + virtual HashStringList GetExpectedHashes() const; + virtual std::string GetMetaKey() const; + virtual bool HashesRequired() const; - /** \brief The item that is currently being downloaded. */ - pkgAcquire::ItemDesc Desc; -}; - /*}}}*/ -/** \brief Information about an index patch (aka diff). */ /*{{{*/ -struct APT_HIDDEN DiffInfo { - /** The filename of the diff. */ - std::string file; - /** The hashes of the diff */ - HashStringList result_hashes; - - /** The hashes of the file after the diff is applied */ - HashStringList patch_hashes; + pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const * const Target); + virtual ~pkgAcqTransactionItem(); - /** The size of the file after the diff is applied */ - unsigned long long result_size; - - /** The size of the diff itself */ - unsigned long long patch_size; + friend class pkgAcqMetaBase; }; /*}}}*/ -class pkgAcqMetaBase : public pkgAcquire::Item /*{{{*/ +class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ +/** \brief the manager of a transaction */ { void *d; protected: - std::vector Transaction; + std::vector Transaction; + IndexTarget const DataTarget; + public: /** \brief A package-system-specific parser for the meta-index file. */ indexRecords *MetaIndexParser; indexRecords *LastMetaIndexParser; + protected: /** \brief The index files which should be looked up in the meta-index * and then downloaded. */ - const std::vector* IndexTargets; + const std::vector* const IndexTargets; /** \brief If \b true, the index's signature is currently being verified. */ bool AuthPass; - /** \brief The URI of the signature file. Unlike Desc.URI, this is - * never modified; it is used to determine the file that is being - * downloaded. - */ - std::string RealURI; - /** \brief Starts downloading the individual index files. * * \param verify If \b true, only indices whose expected hashsum @@ -419,7 +447,7 @@ class pkgAcqMetaBase : public pkgAcquire::Item /*{{{*/ * #StatAuthError if there is a mismatch). If verify is \b false, * no hashsum checking will be performed. */ - void QueueIndexes(bool verify); + void QueueIndexes(bool const verify); /** \brief Called when a file is finished being retrieved. * @@ -430,16 +458,12 @@ class pkgAcqMetaBase : public pkgAcquire::Item /*{{{*/ * \param Message The message block received from the fetch * subprocess. */ - bool CheckDownloadDone(pkgAcquire::Item * const I, const std::string &Message, HashStringList const &Hashes) const; + bool CheckDownloadDone(pkgAcqTransactionItem * const I, const std::string &Message, HashStringList const &Hashes) const; /** \brief Queue the downloaded Signature for verification */ - void QueueForSignatureVerify(pkgAcquire::Item * const I, std::string const &File, std::string const &Signature); + void QueueForSignatureVerify(pkgAcqTransactionItem * const I, std::string const &File, std::string const &Signature); -#if APT_PKG_ABI >= 413 virtual std::string Custom600Headers() const; -#else - virtual std::string Custom600Headers(); -#endif /** \brief Called when authentication succeeded. * @@ -450,7 +474,7 @@ class pkgAcqMetaBase : public pkgAcquire::Item /*{{{*/ * \param Message The message block received from the fetch * subprocess. */ - bool CheckAuthDone(std::string Message); + bool CheckAuthDone(std::string const &Message); /** Check if the current item should fail at this point */ bool CheckStopAuthentication(pkgAcquire::Item * const I, const std::string &Message); @@ -460,7 +484,7 @@ class pkgAcqMetaBase : public pkgAcquire::Item /*{{{*/ * * \return \b true if no fatal errors were encountered. */ - bool VerifyVendor(std::string Message); + bool VerifyVendor(std::string const &Message); virtual bool TransactionState(TransactionStates const state); @@ -468,33 +492,32 @@ class pkgAcqMetaBase : public pkgAcquire::Item /*{{{*/ // This refers more to the Transaction-Manager than the actual file bool IMSHit; - virtual std::string DescURI() {return RealURI; }; virtual bool QueueURI(pkgAcquire::ItemDesc &Item); + virtual HashStringList GetExpectedHashes() const; + virtual bool HashesRequired() const; // transaction code - void Add(Item *I); + void Add(pkgAcqTransactionItem * const I); void AbortTransaction(); - bool TransactionHasError() APT_PURE; + bool TransactionHasError() const; void CommitTransaction(); /** \brief Stage (queue) a copy action when the transaction is committed */ - void TransactionStageCopy(Item *I, - const std::string &From, + void TransactionStageCopy(pkgAcqTransactionItem * const I, + const std::string &From, const std::string &To); /** \brief Stage (queue) a removal action when the transaction is committed */ - void TransactionStageRemoval(Item *I, const std::string &FinalFile); + void TransactionStageRemoval(pkgAcqTransactionItem * const I, const std::string &FinalFile); /** \brief Get the full pathname of the final file for the current URI */ virtual std::string GetFinalFilename() const; - pkgAcqMetaBase(pkgAcquire *Owner, - const std::vector* IndexTargets, - indexRecords* MetaIndexParser, - std::string const &RealURI, - HashStringList const &ExpectedHashes=HashStringList(), - pkgAcqMetaBase *TransactionManager=NULL); + pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + std::vector const * const IndexTargets, + IndexTarget const &DataTarget, + indexRecords* const MetaIndexParser); }; /*}}}*/ /** \brief An item that is responsible for downloading the meta-index {{{ @@ -512,36 +535,24 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase void *d; protected: - std::string URIDesc; - std::string ShortDesc; - - /** \brief The URI of the meta-index file for the detached signature */ - std::string MetaIndexSigURI; - - /** \brief A "URI-style" description of the meta-index file */ - std::string MetaIndexSigURIDesc; - - /** \brief A brief description of the meta-index file */ - std::string MetaIndexSigShortDesc; + IndexTarget const DetachedSigTarget; /** \brief delayed constructor */ - void Init(std::string URIDesc, std::string ShortDesc); - + void Init(std::string const &URIDesc, std::string const &ShortDesc); + public: + virtual std::string DescURI() const; // Specialized action members - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Done(std::string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf); virtual void Finished(); /** \brief Create a new pkgAcqMetaIndex. */ - pkgAcqMetaIndex(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - std::string URI,std::string URIDesc, std::string ShortDesc, - std::string MetaIndexSigURI, std::string MetaIndexSigURIDesc, std::string MetaIndexSigShortDesc, - const std::vector* IndexTargets, - indexRecords* MetaIndexParser); + pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget, + const std::vector* const IndexTargets, indexRecords * const MetaIndexParser); friend class pkgAcqMetaSig; }; @@ -554,7 +565,7 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase * * \sa pkgAcqMetaIndex */ -class APT_HIDDEN pkgAcqMetaSig : public pkgAcquire::Item +class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem { void *d; @@ -565,29 +576,20 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcquire::Item protected: - /** \brief Long URI description used in the acquire system */ - std::string URIDesc; - - /** \brief URI used to get the file */ - std::string RealURI; - /** \brief Get the full pathname of the final file for the current URI */ virtual std::string GetFinalFilename() const; public: - virtual std::string DescURI() {return RealURI;}; + virtual bool HashesRequired() const { return false; } // Specialized action members - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(std::string Message,unsigned long long Size, - HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Done(std::string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf); /** \brief Create a new pkgAcqMetaSig. */ - pkgAcqMetaSig(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - std::string const &URI,std::string const &URIDesc, - std::string const &ShortDesc, pkgAcqMetaIndex * const MetaIndex); + pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const * const Target, + pkgAcqMetaIndex * const MetaIndex); virtual ~pkgAcqMetaSig(); }; /*}}}*/ @@ -596,78 +598,37 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex { void *d; - /** \brief The URI of the meta-index file for the detached signature */ - std::string MetaIndexURI; - - /** \brief A "URI-style" description of the meta-index file */ - std::string MetaIndexURIDesc; - - /** \brief A brief description of the meta-index file */ - std::string MetaIndexShortDesc; - - /** \brief The URI of the detached meta-signature file if the clearsigned one failed. */ - std::string MetaSigURI; - - /** \brief A "URI-style" description of the meta-signature file */ - std::string MetaSigURIDesc; - - /** \brief A brief description of the meta-signature file */ - std::string MetaSigShortDesc; + IndexTarget const ClearsignedTarget; + IndexTarget const DetachedDataTarget; + IndexTarget const DetachedSigTarget; public: - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); -#if APT_PKG_ABI >= 413 + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); virtual std::string Custom600Headers() const; -#else - virtual std::string Custom600Headers(); -#endif - virtual void Done(std::string Message,unsigned long long Size, - HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf); + virtual void Done(std::string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf); /** \brief Create a new pkgAcqMetaClearSig. */ - pkgAcqMetaClearSig(pkgAcquire *Owner, - std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc, - std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc, - std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc, - const std::vector* IndexTargets, - indexRecords* MetaIndexParser); + pkgAcqMetaClearSig(pkgAcquire * const Owner, + IndexTarget const &ClearsignedTarget, + IndexTarget const &DetachedDataTarget, + IndexTarget const &DetachedSigTarget, + std::vector const * const IndexTargets, + indexRecords * const MetaIndexParser); virtual ~pkgAcqMetaClearSig(); }; /*}}}*/ -/** \brief Common base class for all classes that deal with fetching {{{ - indexes - */ -class pkgAcqBaseIndex : public pkgAcquire::Item +/** \brief Common base class for all classes that deal with fetching indexes {{{*/ +class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem { void *d; - protected: - /** \brief Pointer to the IndexTarget data - */ - const struct IndexTarget * Target; - - /** \brief Pointer to the indexRecords parser */ - indexRecords *MetaIndexParser; - - /** \brief The MetaIndex Key */ - std::string MetaKey; - - /** \brief The URI of the index file to recreate at our end (either - * by downloading it or by applying partial patches). - */ - std::string RealURI; - - bool VerifyHashByMetaKey(HashStringList const &Hashes); - + public: /** \brief Get the full pathname of the final file for the current URI */ virtual std::string GetFinalFilename() const; - pkgAcqBaseIndex(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - struct IndexTarget const * const Target, - HashStringList const &ExpectedHashes, - indexRecords *MetaIndexParser); + pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target); }; /*}}}*/ /** \brief An item that is responsible for fetching an index file of {{{ @@ -705,15 +666,12 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex virtual bool TransactionState(TransactionStates const state); public: // Specialized action members - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() {return RealURI + "Index";}; -#if APT_PKG_ABI >= 413 + virtual void Failed(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf); + virtual void Done(std::string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf); + virtual std::string DescURI() const {return Target->URI + "Index";}; virtual std::string Custom600Headers() const; -#else - virtual std::string Custom600Headers(); -#endif + virtual std::string GetMetaKey() const; /** \brief Parse the Index file for a set of Packages diffs. * @@ -725,7 +683,7 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex * \return \b true if the Index file was successfully parsed, \b * false otherwise. */ - bool ParseDiffIndex(std::string IndexDiffFile); + bool ParseDiffIndex(std::string const &IndexDiffFile); /** \brief Create a new pkgAcqDiffIndex. * @@ -736,18 +694,30 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex * \param URIDesc A long description of the list file to download. * * \param ShortDesc A short description of the list file to download. - * - * \param ExpectedHashes The list file's hashsums which are expected. */ - pkgAcqDiffIndex(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - struct IndexTarget const * const Target, - HashStringList const &ExpectedHashes, - indexRecords *MetaIndexParser); + pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target); private: APT_HIDDEN void QueueOnIMSHit() const; }; /*}}}*/ +struct APT_HIDDEN DiffInfo { /*{{{*/ + /** The filename of the diff. */ + std::string file; + + /** The hashes of the diff */ + HashStringList result_hashes; + + /** The hashes of the file after the diff is applied */ + HashStringList patch_hashes; + + /** The size of the file after the diff is applied */ + unsigned long long result_size; + + /** The size of the diff itself */ + unsigned long long patch_size; +}; + /*}}}*/ /** \brief An item that is responsible for fetching client-merge patches {{{ * that need to be applied to a given package index file. * @@ -801,10 +771,12 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex * This method will fall back to downloading the whole index file * outright; its arguments are ignored. */ - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() {return RealURI + "Index";}; + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Done(std::string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf); + virtual std::string DescURI() const {return Target->URI + "Index";}; + virtual HashStringList GetExpectedHashes() const; + virtual bool HashesRequired() const; /** \brief Create an index merge-diff item. * @@ -817,22 +789,15 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex * * \param ShortDesc A brief description of this item. * - * \param ExpectedHashes The expected md5sum of the completely - * reconstructed package index file; the index file will be tested - * against this value when it is entirely reconstructed. - * * \param patch contains infos about the patch this item is supposed * to download which were read from the index * * \param allPatches contains all related items so that each item can * check if it was the last one to complete the download step */ - pkgAcqIndexMergeDiffs(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - struct IndexTarget const * const Target, - HashStringList const &ExpectedHash, - indexRecords *MetaIndexParser, - DiffInfo const &patch, + pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target, + DiffInfo const &patch, std::vector const * const allPatches); }; /*}}}*/ @@ -875,7 +840,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex * \param allDone If \b true, the file was entirely reconstructed, * and its md5sum is verified. */ - APT_HIDDEN void Finish(bool allDone=false); + APT_HIDDEN void Finish(bool const allDone=false); protected: @@ -905,26 +870,25 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex /** \brief The diff is currently being fetched. */ StateFetchDiff, - - /** \brief The diff is currently being uncompressed. */ - StateUnzipDiff, // FIXME: No longer used /** \brief The diff is currently being applied. */ StateApplyDiff } State; public: - + /** \brief Called when the patch file failed to be downloaded. * * This method will fall back to downloading the whole index file * outright; its arguments are ignored. */ - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); - virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() {return RealURI + "IndexDiffs";}; + virtual void Done(std::string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf); + virtual std::string DescURI() const {return Target->URI + "IndexDiffs";}; + virtual HashStringList GetExpectedHashes() const; + virtual bool HashesRequired() const; /** \brief Create an index diff item. * @@ -940,20 +904,13 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex * * \param ShortDesc A brief description of this item. * - * \param ExpectedHashes The expected hashsums of the completely - * reconstructed package index file; the index file will be tested - * against this value when it is entirely reconstructed. - * * \param diffs The remaining diffs from the index of diffs. They * should be ordered so that each diff appears before any diff * that depends on it. */ - pkgAcqIndexDiffs(pkgAcquire *Owner, - pkgAcqMetaBase *TransactionManager, - struct IndexTarget const * const Target, - HashStringList const &ExpectedHash, - indexRecords *MetaIndexParser, - std::vector diffs=std::vector()); + pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target, + std::vector const &diffs=std::vector()); }; /*}}}*/ /** \brief An acquire item that is responsible for fetching an index {{{ @@ -981,16 +938,16 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex AllStages Stage; /** \brief Handle what needs to be done when the download is done */ - void StageDownloadDone(std::string Message, + void StageDownloadDone(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cfg); + pkgAcquire::MethodConfig const * const Cfg); /** \brief Handle what needs to be done when the decompression/copy is * done */ - void StageDecompressDone(std::string Message, + void StageDecompressDone(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cfg); + pkgAcquire::MethodConfig const * const Cfg); /** \brief If \b set, this partially downloaded file will be * removed when the download completes. @@ -1006,7 +963,7 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex std::string CurrentCompressionExtension; /** \brief Do the changes needed to fetch via AptByHash (if needed) */ - void InitByHashIfNeeded(const std::string MetaKey); + void InitByHashIfNeeded(); /** \brief Auto select the right compression to use */ void AutoSelectCompression(); @@ -1015,7 +972,7 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex void ReverifyAfterIMS(); /** \brief Validate the downloaded index file */ - bool ValidateFile(const std::string &FileName); + bool ValidateFile(std::string const &FileName); /** \brief Get the full pathname of the final file for the current URI */ virtual std::string GetFinalFilename() const; @@ -1024,82 +981,20 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex public: // Specialized action members - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(std::string Message,unsigned long long Size, - HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf); -#if APT_PKG_ABI >= 413 + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Done(std::string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf); virtual std::string Custom600Headers() const; -#else - virtual std::string Custom600Headers(); -#endif - virtual std::string DescURI() {return Desc.URI;}; + virtual std::string DescURI() const {return Desc.URI;}; + virtual std::string GetMetaKey() const; + + pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + IndexTarget const * const Target); - /** \brief Create a pkgAcqIndex. - * - * \param Owner The pkgAcquire object with which this item is - * associated. - * - * \param URI The URI of the index file that is to be downloaded. - * - * \param URIDesc A "URI-style" description of this index file. - * - * \param ShortDesc A brief description of this index file. - * - * \param ExpectedHashes The expected hashsum of this index file. - * - * \param compressExt The compression-related extension with which - * this index file should be downloaded, or "" to autodetect - * Compression types can be set with config Acquire::CompressionTypes, - * default is ".lzma" or ".bz2" (if the needed binaries are present) - * fallback is ".gz" or none. - */ - pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc, - std::string ShortDesc, HashStringList const &ExpectedHashes); - pkgAcqIndex(pkgAcquire *Owner, pkgAcqMetaBase *TransactionManager, - IndexTarget const * const Target, - HashStringList const &ExpectedHash, - indexRecords *MetaIndexParser); - void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc); }; /*}}}*/ -/** \brief Information about an index file. */ /*{{{*/ -class APT_HIDDEN IndexTarget -{ - void *d; - - public: - /** \brief A URI from which the index file can be downloaded. */ - std::string URI; - - /** \brief A description of the index file. */ - std::string Description; - - /** \brief A shorter description of the index file. */ - std::string ShortDesc; - - /** \brief The key by which this index file should be - * looked up within the meta signature file. - */ - std::string MetaKey; - - virtual bool IsOptional() const { - return false; - } -}; - /*}}}*/ -/** \brief Information about an optional index file. */ /*{{{*/ -class APT_HIDDEN OptionalIndexTarget : public IndexTarget -{ - void *d; - - virtual bool IsOptional() const { - return true; - } -}; - /*}}}*/ /** \brief An item that is responsible for fetching a package file. {{{ * * If the package file already exists in the cache, nothing will be @@ -1109,6 +1004,9 @@ class pkgAcqArchive : public pkgAcquire::Item { void *d; + bool LocalSource; + HashStringList ExpectedHashes; + protected: /** \brief The package version being fetched. */ pkgCache::VerIterator Version; @@ -1141,7 +1039,7 @@ class pkgAcqArchive : public pkgAcquire::Item /** \brief \b true if this version file is being downloaded from a * trusted source. */ - bool Trusted; + bool Trusted; /** \brief Queue up the next available file for this version. */ bool QueueNext(); @@ -1151,17 +1049,15 @@ class pkgAcqArchive : public pkgAcquire::Item public: - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes, - pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() {return Desc.URI;}; - virtual std::string ShortDesc() {return Desc.ShortDesc;}; + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Done(std::string const &Message, HashStringList const &Hashes, + pkgAcquire::MethodConfig const * const Cnf); + virtual std::string DescURI() const; + virtual std::string ShortDesc() const; virtual void Finished(); -#if APT_PKG_ABI >= 413 virtual bool IsTrusted() const; -#else - virtual bool IsTrusted(); -#endif + virtual HashStringList GetExpectedHashes() const; + virtual bool HashesRequired() const; /** \brief Create a new pkgAcqArchive. * @@ -1181,8 +1077,8 @@ class pkgAcqArchive : public pkgAcquire::Item * basename in the constructor, and filled in with a fully * qualified filename once the download finishes. */ - pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources, - pkgRecords *Recs,pkgCache::VerIterator const &Version, + pkgAcqArchive(pkgAcquire * const Owner,pkgSourceList * const Sources, + pkgRecords * const Recs,pkgCache::VerIterator const &Version, std::string &StoreFilename); }; /*}}}*/ @@ -1200,22 +1096,21 @@ class pkgAcqFile : public pkgAcquire::Item * Acquire::Retries. */ unsigned int Retries; - + /** \brief Should this file be considered a index file */ bool IsIndexFile; + HashStringList const ExpectedHashes; public: - + virtual HashStringList GetExpectedHashes() const; + virtual bool HashesRequired() const; + // Specialized action members - virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(std::string Message,unsigned long long Size, HashStringList const &CalcHashes, - pkgAcquire::MethodConfig *Cnf); - virtual std::string DescURI() {return Desc.URI;}; -#if APT_PKG_ABI >= 413 + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Done(std::string const &Message, HashStringList const &CalcHashes, + pkgAcquire::MethodConfig const * const Cnf); + virtual std::string DescURI() const {return Desc.URI;}; virtual std::string Custom600Headers() const; -#else - virtual std::string Custom600Headers(); -#endif /** \brief Create a new pkgAcqFile object. * @@ -1248,10 +1143,10 @@ class pkgAcqFile : public pkgAcquire::Item * is the absolute name to which the file should be downloaded. */ - pkgAcqFile(pkgAcquire *Owner, std::string URI, HashStringList const &Hashes, unsigned long long Size, - std::string Desc, std::string ShortDesc, - const std::string &DestDir="", const std::string &DestFilename="", - bool IsIndexFile=false); + pkgAcqFile(pkgAcquire * const Owner, std::string const &URI, HashStringList const &Hashes, unsigned long long const Size, + std::string const &Desc, std::string const &ShortDesc, + std::string const &DestDir="", std::string const &DestFilename="", + bool const IsIndexFile=false); }; /*}}}*/ /** @} */ diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index c29ef469e..b77096efd 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -376,7 +376,10 @@ int pkgAcqMethod::Run(bool Single) Tmp->ExpectedHashes.push_back(HashString(*t, hash)); } char *End; - Tmp->MaximumSize = strtoll(LookupTag(Message, "Maximum-Size", "0").c_str(), &End, 10); + if (Tmp->ExpectedHashes.FileSize() > 0) + Tmp->MaximumSize = Tmp->ExpectedHashes.FileSize(); + else + Tmp->MaximumSize = strtoll(LookupTag(Message, "Maximum-Size", "0").c_str(), &End, 10); Tmp->Next = 0; // Append it to the list diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 9254e20a3..099a1f87d 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -55,8 +55,8 @@ pkgAcquire::Worker::Worker(Queue *Q,MethodConfig *Cnf, CurrentItem = 0; TotalSize = 0; CurrentSize = 0; - - Construct(); + + Construct(); } /*}}}*/ // Worker::Worker - Constructor for method config startup /*{{{*/ @@ -70,8 +70,8 @@ pkgAcquire::Worker::Worker(MethodConfig *Cnf) CurrentItem = 0; TotalSize = 0; CurrentSize = 0; - - Construct(); + + Construct(); } /*}}}*/ // Worker::Construct - Constructor helper /*{{{*/ @@ -136,7 +136,7 @@ bool pkgAcquire::Worker::Start() } for (int I = 0; I != 4; I++) SetCloseExec(Pipes[I],true); - + // Fork off the process Process = ExecFork(); if (Process == 0) @@ -145,9 +145,9 @@ bool pkgAcquire::Worker::Start() dup2(Pipes[1],STDOUT_FILENO); dup2(Pipes[2],STDIN_FILENO); SetCloseExec(STDOUT_FILENO,false); - SetCloseExec(STDIN_FILENO,false); + SetCloseExec(STDIN_FILENO,false); SetCloseExec(STDERR_FILENO,false); - + const char *Args[2]; Args[0] = Method.c_str(); Args[1] = 0; @@ -165,7 +165,7 @@ bool pkgAcquire::Worker::Start() close(Pipes[2]); OutReady = false; InReady = true; - + // Read the configuration data if (WaitFd(InFd) == false || ReadMessages() == false) @@ -174,7 +174,7 @@ bool pkgAcquire::Worker::Start() RunMessages(); if (OwnerQ != 0) SendConfiguration(); - + return true; } /*}}}*/ @@ -201,7 +201,7 @@ bool pkgAcquire::Worker::RunMessages() if (Debug == true) clog << " <- " << Access << ':' << QuoteString(Message,"\n") << endl; - + // Fetch the message number char *End; int Number = strtol(Message.c_str(),&End,10); @@ -215,15 +215,15 @@ bool pkgAcquire::Worker::RunMessages() // update used mirror string UsedMirror = LookupTag(Message,"UsedMirror", ""); - if (!UsedMirror.empty() && + if (!UsedMirror.empty() && Itm && - Itm->Description.find(" ") != string::npos) + Itm->Description.find(" ") != string::npos) { Itm->Description.replace(0, Itm->Description.find(" "), UsedMirror); // FIXME: will we need this as well? //Itm->ShortDesc = UsedMirror; } - + // Determine the message number and dispatch switch (Number) { @@ -232,18 +232,18 @@ bool pkgAcquire::Worker::RunMessages() if (Capabilities(Message) == false) return _error->Error("Unable to process Capabilities message from %s",Access.c_str()); break; - + // 101 Log case 101: if (Debug == true) clog << " <- (log) " << LookupTag(Message,"Message") << endl; break; - + // 102 Status case 102: Status = LookupTag(Message,"Message"); break; - + // 103 Redirect case 103: { @@ -252,7 +252,7 @@ bool pkgAcquire::Worker::RunMessages() _error->Error("Method gave invalid 103 Redirect message"); break; } - + string NewURI = LookupTag(Message,"New-URI",URI.c_str()); Itm->URI = NewURI; @@ -272,7 +272,7 @@ bool pkgAcquire::Worker::RunMessages() Log->Done(Desc); break; } - + // 200 URI Start case 200: { @@ -281,23 +281,23 @@ bool pkgAcquire::Worker::RunMessages() _error->Error("Method gave invalid 200 URI Start message"); break; } - + CurrentItem = Itm; CurrentSize = 0; TotalSize = strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10); ResumePoint = strtoull(LookupTag(Message,"Resume-Point","0").c_str(), NULL, 10); - Itm->Owner->Start(Message,strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10)); + Itm->Owner->Start(Message, TotalSize); // Display update before completion if (Log != 0 && Log->MorePulses == true) Log->Pulse(Itm->Owner->GetOwner()); - + if (Log != 0) Log->Fetch(*Itm); break; } - + // 201 URI Done case 201: { @@ -306,7 +306,7 @@ bool pkgAcquire::Worker::RunMessages() _error->Error("Method gave invalid 201 URI Done message"); break; } - + pkgAcquire::Item *Owner = Itm->Owner; pkgAcquire::ItemDesc Desc = *Itm; @@ -316,22 +316,11 @@ bool pkgAcquire::Worker::RunMessages() // Display update before completion if (Log != 0 && Log->MorePulses == true) Log->Pulse(Owner->GetOwner()); - + OwnerQ->ItemDone(Itm); - unsigned long long const ServerSize = strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10); - bool isHit = StringToBool(LookupTag(Message,"IMS-Hit"),false) || - StringToBool(LookupTag(Message,"Alt-IMS-Hit"),false); - // Using the https method the server might return 200, but the - // If-Modified-Since condition is not satsified, libcurl will - // discard the download. In this case, however, TotalSize will be - // set to the actual size of the file, while ServerSize will be set - // to 0. Therefore, if the item is marked as a hit and the - // downloaded size (ServerSize) is 0, we ignore TotalSize. - if (TotalSize != 0 && (!isHit || ServerSize != 0) && ServerSize != TotalSize) - _error->Warning("Size of file %s is not what the server reported %s %llu", - Owner->DestFile.c_str(), LookupTag(Message,"Size","0").c_str(),TotalSize); - - // see if there is a hash to verify + + HashStringList const ExpectedHashes = Owner->GetExpectedHashes(); + // see if we got hashes to verify HashStringList ReceivedHashes; for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) { @@ -340,6 +329,18 @@ bool pkgAcquire::Worker::RunMessages() if (hashsum.empty() == false) ReceivedHashes.push_back(HashString(*type, hashsum)); } + // not all methods always sent Hashes our way + if (ExpectedHashes.usable() == true && ReceivedHashes.usable() == false) + { + std::string const filename = LookupTag(Message, "Filename", Owner->DestFile.c_str()); + if (filename.empty() == false && RealFileExists(filename)) + { + Hashes calc(ExpectedHashes); + FileFd file(filename, FileFd::ReadOnly, FileFd::None); + calc.AddFD(file); + ReceivedHashes = calc.GetHashStringList(); + } + } if(_config->FindB("Debug::pkgAcquire::Auth", false) == true) { @@ -348,30 +349,66 @@ bool pkgAcquire::Worker::RunMessages() for (HashStringList::const_iterator hs = ReceivedHashes.begin(); hs != ReceivedHashes.end(); ++hs) std::clog << "\t- " << hs->toStr() << std::endl; std::clog << "ExpectedHash:" << endl; - HashStringList expectedHashes = Owner->HashSums(); - for (HashStringList::const_iterator hs = expectedHashes.begin(); hs != expectedHashes.end(); ++hs) + for (HashStringList::const_iterator hs = ExpectedHashes.begin(); hs != ExpectedHashes.end(); ++hs) std::clog << "\t- " << hs->toStr() << std::endl; std::clog << endl; } - Owner->Done(Message, ServerSize, ReceivedHashes, Config); - ItemDone(); - // Log that we are done - if (Log != 0) + // decide if what we got is what we expected + bool consideredOkay = false; + bool const isIMSHit = StringToBool(LookupTag(Message,"IMS-Hit"),false) || + StringToBool(LookupTag(Message,"Alt-IMS-Hit"),false); + if (ExpectedHashes.usable()) { - if (isHit) + if (ReceivedHashes.usable() == false) { - /* Hide 'hits' for local only sources - we also manage to - hide gets */ - if (Config->LocalOnly == false) - Log->IMSHit(Desc); - } + /* IMS-Hits can't be checked here as we will have uncompressed file, + but the hashes for the compressed file. What we have was good through + so all we have to ensure later is that we are not stalled. */ + consideredOkay = isIMSHit; + } + else if (ReceivedHashes == ExpectedHashes) + consideredOkay = true; else - Log->Done(Desc); + consideredOkay = false; + + } + else if (Owner->HashesRequired() == true) + consideredOkay = false; + else + consideredOkay = true; + + if (consideredOkay == true) + { + Owner->Done(Message, ReceivedHashes, Config); + ItemDone(); + + // Log that we are done + if (Log != 0) + { + if (isIMSHit) + { + /* Hide 'hits' for local only sources - we also manage to + hide gets */ + if (Config->LocalOnly == false) + Log->IMSHit(Desc); + } + else + Log->Done(Desc); + } + } + else + { + Owner->Status = pkgAcquire::Item::StatAuthError; + Owner->Failed(Message,Config); + ItemDone(); + + if (Log != 0) + Log->Fail(Desc); } break; - } - + } + // 400 URI Failure case 400: { @@ -408,18 +445,18 @@ bool pkgAcquire::Worker::RunMessages() Log->Fail(Desc); break; - } - + } + // 401 General Failure case 401: _error->Error("Method %s General failure: %s",Access.c_str(),LookupTag(Message,"Message").c_str()); break; - + // 403 Media Change case 403: - MediaChange(Message); + MediaChange(Message); break; - } + } } return true; } @@ -432,7 +469,7 @@ bool pkgAcquire::Worker::Capabilities(string Message) { if (Config == 0) return true; - + Config->Version = LookupTag(Message,"Version"); Config->SingleInstance = StringToBool(LookupTag(Message,"Single-Instance"),false); Config->Pipeline = StringToBool(LookupTag(Message,"Pipeline"),false); @@ -447,13 +484,13 @@ bool pkgAcquire::Worker::Capabilities(string Message) clog << "Configured access method " << Config->Access << endl; clog << "Version:" << Config->Version << " SingleInstance:" << Config->SingleInstance << - " Pipeline:" << Config->Pipeline << - " SendConfig:" << Config->SendConfig << - " LocalOnly: " << Config->LocalOnly << - " NeedsCleanup: " << Config->NeedsCleanup << + " Pipeline:" << Config->Pipeline << + " SendConfig:" << Config->SendConfig << + " LocalOnly: " << Config->LocalOnly << + " NeedsCleanup: " << Config->NeedsCleanup << " Removable: " << Config->Removable << endl; } - + return true; } /*}}}*/ @@ -463,10 +500,10 @@ bool pkgAcquire::Worker::Capabilities(string Message) bool pkgAcquire::Worker::MediaChange(string Message) { int status_fd = _config->FindI("APT::Status-Fd",-1); - if(status_fd > 0) + if(status_fd > 0) { string Media = LookupTag(Message,"Media"); - string Drive = LookupTag(Message,"Drive"); + string Drive = LookupTag(Message,"Drive"); ostringstream msg,status; ioprintf(msg,_("Please insert the disc labeled: " "'%s' " @@ -536,12 +573,12 @@ bool pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem *Item) { if (OutFd == -1) return false; - + string Message = "600 URI Acquire\n"; Message.reserve(300); Message += "URI: " + Item->URI; Message += "\nFilename: " + Item->Owner->DestFile; - HashStringList const hsl = Item->Owner->HashSums(); + HashStringList const hsl = Item->Owner->GetExpectedHashes(); for (HashStringList::const_iterator hs = hsl.begin(); hs != hsl.end(); ++hs) Message += "\nExpected-" + hs->HashType() + ": " + hs->HashValue(); if(Item->Owner->FileSize > 0) @@ -564,7 +601,7 @@ bool pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem *Item) clog << " -> " << Access << ':' << QuoteString(Message,"\n") << endl; OutQueue += Message; OutReady = true; - + return true; } /*}}}*/ @@ -586,7 +623,7 @@ bool pkgAcquire::Worker::OutFdReady() OutQueue.erase(0,Res); if (OutQueue.empty() == true) OutReady = false; - + return true; } /*}}}*/ @@ -608,7 +645,7 @@ bool pkgAcquire::Worker::InFdReady() bool pkgAcquire::Worker::MethodFailure() { _error->Error("Method %s has died unexpectedly!",Access.c_str()); - + // do not reap the child here to show meaningfull error to the user ExecWait(Process,Access.c_str(),false); Process = -1; @@ -620,26 +657,22 @@ bool pkgAcquire::Worker::MethodFailure() InReady = false; OutQueue = string(); MessageQueue.erase(MessageQueue.begin(),MessageQueue.end()); - + return false; } /*}}}*/ -// Worker::Pulse - Called periodically /*{{{*/ +// Worker::Pulse - Called periodically /*{{{*/ // --------------------------------------------------------------------- /* */ void pkgAcquire::Worker::Pulse() { if (CurrentItem == 0) return; - + struct stat Buf; if (stat(CurrentItem->Owner->DestFile.c_str(),&Buf) != 0) return; CurrentSize = Buf.st_size; - - // Hmm? Should not happen... - if (CurrentSize > TotalSize && TotalSize != 0) - TotalSize = CurrentSize; } /*}}}*/ // Worker::ItemDone - Called when the current item is finished /*{{{*/ diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 0fa443b4a..11a7e479b 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include #include /*}}}*/ @@ -178,6 +179,15 @@ HashString const * HashStringList::find(char const * const type) const /*{{{*/ return NULL; } /*}}}*/ +unsigned long long HashStringList::FileSize() const /*{{{*/ +{ + HashString const * const hsf = find("Checksum-FileSize"); + if (hsf == NULL) + return 0; + std::string const hv = hsf->HashValue(); + return strtoull(hv.c_str(), NULL, 10); +} + /*}}}*/ bool HashStringList::supported(char const * const type) /*{{{*/ { for (char const * const * t = HashString::SupportedHashes(); *t != NULL; ++t) diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index ac13c8ace..176ce4faa 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -87,6 +87,15 @@ class HashStringList */ HashString const * find(char const * const type) const; HashString const * find(std::string const &type) const { return find(type.c_str()); } + + /** finds the filesize hash and returns it as number + * + * @return beware: if the size isn't known we return \b 0 here, + * just like we would do for an empty file. If that is a problem + * for you have to get the size manually out of the list. + */ + unsigned long long FileSize() const; + /** check if the given hash type is supported * * @param type to check diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index d672b4fd8..185248619 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -742,13 +742,13 @@ bool debDebPkgFileIndex::Merge(pkgCacheGenerator& Gen, OpProgress* Prog) const // and give it to the list parser debDebFileParser Parser(DebControl, DebFile); - if(Gen.SelectFile(DebFile, "local", *this) == false) + if(Gen.SelectFile(DebFile, "local", *this, pkgCache::Flag::LocalSource) == false) return _error->Error("Problem with SelectFile %s", DebFile.c_str()); pkgCache::PkgFileIterator File = Gen.GetCurFile(); File->Size = DebControl->Size(); File->mtime = DebControl->ModificationTime(); - + if (Gen.MergeList(Parser) == false) return _error->Error("Problem with MergeLister for %s", DebFile.c_str()); diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index aa2db8149..eb5e78e3b 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -192,11 +192,13 @@ vector * debReleaseIndex::ComputeIndexTargets() const { vector const SectionEntries = src->second; for (vector::const_iterator I = SectionEntries.begin(); I != SectionEntries.end(); ++I) { - IndexTarget * Target = new IndexTarget(); - Target->ShortDesc = "Sources"; - Target->MetaKey = SourceIndexURISuffix(Target->ShortDesc.c_str(), (*I)->Section); - Target->URI = SourceIndexURI(Target->ShortDesc.c_str(), (*I)->Section); - Target->Description = Info (Target->ShortDesc.c_str(), (*I)->Section); + char const * const ShortDesc = "Sources"; + IndexTarget * const Target = new IndexTarget( + SourceIndexURISuffix(ShortDesc, (*I)->Section), + ShortDesc, + Info(ShortDesc, (*I)->Section), + SourceIndexURI(ShortDesc, (*I)->Section) + ); IndexTargets->push_back (Target); } } @@ -212,11 +214,13 @@ vector * debReleaseIndex::ComputeIndexTargets() const { continue; for (vector ::const_iterator I = a->second.begin(); I != a->second.end(); ++I) { - IndexTarget * Target = new IndexTarget(); - Target->ShortDesc = "Packages"; - Target->MetaKey = IndexURISuffix(Target->ShortDesc.c_str(), (*I)->Section, a->first); - Target->URI = IndexURI(Target->ShortDesc.c_str(), (*I)->Section, a->first); - Target->Description = Info (Target->ShortDesc.c_str(), (*I)->Section, a->first); + char const * const ShortDesc = "Packages"; + IndexTarget * const Target = new IndexTarget( + IndexURISuffix(ShortDesc, (*I)->Section, a->first), + ShortDesc, + Info (ShortDesc, (*I)->Section, a->first), + IndexURI(ShortDesc, (*I)->Section, a->first) + ); IndexTargets->push_back (Target); sections.insert((*I)->Section); } @@ -235,11 +239,13 @@ vector * debReleaseIndex::ComputeIndexTargets() const { s != sections.end(); ++s) { for (std::vector::const_iterator l = lang.begin(); l != lang.end(); ++l) { - IndexTarget * Target = new OptionalIndexTarget(); - Target->ShortDesc = "Translation-" + *l; - Target->MetaKey = TranslationIndexURISuffix(l->c_str(), *s); - Target->URI = TranslationIndexURI(l->c_str(), *s); - Target->Description = Info (Target->ShortDesc.c_str(), *s); + std::string const ShortDesc = "Translation-" + *l; + IndexTarget * const Target = new OptionalIndexTarget( + TranslationIndexURISuffix(l->c_str(), *s), + ShortDesc, + Info (ShortDesc.c_str(), *s), + TranslationIndexURI(l->c_str(), *s) + ); IndexTargets->push_back(Target); } } @@ -249,8 +255,6 @@ vector * debReleaseIndex::ComputeIndexTargets() const { /*}}}*/ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const { - bool const tryInRelease = _config->FindB("Acquire::TryInRelease", true); - indexRecords * const iR = new indexRecords(Dist); if (Trusted == ALWAYS_TRUSTED) iR->SetTrusted(true); @@ -258,37 +262,17 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const iR->SetTrusted(false); // special case for --print-uris - if (GetAll) { - vector *targets = ComputeIndexTargets(); - for (vector ::const_iterator Target = targets->begin(); Target != targets->end(); ++Target) { - new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description, - (*Target)->ShortDesc, HashStringList()); - } - delete targets; - - // this is normally created in pkgAcqMetaSig, but if we run - // in --print-uris mode, we add it here - if (tryInRelease == false) - new pkgAcqMetaIndex(Owner, NULL, - MetaIndexURI("Release"), - MetaIndexInfo("Release"), "Release", - MetaIndexURI("Release.gpg"), MetaIndexInfo("Release.gpg"), "Release.gpg", - ComputeIndexTargets(), - iR); + vector const * const targets = ComputeIndexTargets(); +#define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X)) + pkgAcqMetaBase * const TransactionManager = new pkgAcqMetaClearSig(Owner, + APT_TARGET("InRelease"), APT_TARGET("Release"), APT_TARGET("Release.gpg"), + targets, iR); +#undef APT_TARGET + if (GetAll) + { + for (vector ::const_iterator Target = targets->begin(); Target != targets->end(); ++Target) + new pkgAcqIndex(Owner, TransactionManager, *Target); } - if (tryInRelease == true) - new pkgAcqMetaClearSig(Owner, - MetaIndexURI("InRelease"), MetaIndexInfo("InRelease"), "InRelease", - MetaIndexURI("Release"), MetaIndexInfo("Release"), "Release", - MetaIndexURI("Release.gpg"), MetaIndexInfo("Release.gpg"), "Release.gpg", - ComputeIndexTargets(), - iR); - else - new pkgAcqMetaIndex(Owner, NULL, - MetaIndexURI("Release"), MetaIndexInfo("Release"), "Release", - MetaIndexURI("Release.gpg"), MetaIndexInfo("Release.gpg"), "Release.gpg", - ComputeIndexTargets(), - iR); return true; } diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index de2617833..c26868cac 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -73,7 +73,7 @@ APT_PURE indexRecords::checkSum *indexRecords::Lookup(const string MetaKey) APT_PURE bool indexRecords::Exists(string const &MetaKey) const { - return Entries.count(MetaKey) == 1; + return Entries.find(MetaKey) != Entries.end(); } bool indexRecords::Load(const string Filename) /*{{{*/ diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 2ba23c5c0..b4d56611a 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -190,7 +190,12 @@ class pkgCache /*{{{*/ struct Flag { enum PkgFlags {Auto=(1<<0),Essential=(1<<3),Important=(1<<4)}; - enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1),ButAutomaticUpgrades=(1<<2)}; + enum PkgFFlags { + NotSource=(1<<0), /*!< packages can't be fetched from here, e.g. dpkg/status file */ + NotAutomatic=(1<<1), /*!< archive has a default pin of 1 */ + ButAutomaticUpgrades=(1<<2), /*!< (together with the previous) archive has a default pin of 100 */ + LocalSource=(1<<3), /*!< local sources can't and will not be verified by hashes */ + }; }; protected: diff --git a/methods/file.cc b/methods/file.cc index 043ab04b8..353e54bd5 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -57,7 +57,11 @@ bool FileMethod::Fetch(FetchItem *Itm) Res.LastModified = Buf.st_mtime; Res.IMSHit = false; if (Itm->LastModified == Buf.st_mtime && Itm->LastModified != 0) - Res.IMSHit = true; + { + unsigned long long const filesize = Itm->ExpectedHashes.FileSize(); + if (filesize != 0 && filesize == Res.Size) + Res.IMSHit = true; + } } // See if the uncompressed file exists and reuse it diff --git a/test/integration/test-apt-get-source-authenticated b/test/integration/test-apt-get-source-authenticated index 685bc566b..da63f7cb3 100755 --- a/test/integration/test-apt-get-source-authenticated +++ b/test/integration/test-apt-get-source-authenticated @@ -1,7 +1,7 @@ #!/bin/sh # # Regression test for debian bug #749795. Ensure that we fail with -# a error if apt-get source foo will download a source that comes +# an error if apt-get source foo will download a source that comes # from a unauthenticated repository # set -e diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822 index d8b2334ad..51fe7bcfe 100755 --- a/test/integration/test-apt-sources-deb822 +++ b/test/integration/test-apt-sources-deb822 @@ -23,46 +23,45 @@ Description: summay msgtest 'Test sources.list' 'old style' echo "deb http://ftp.debian.org/debian stable main" > $SOURCES -testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 -'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 -'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris msgtest 'Test sources.list' 'simple deb822' echo "$BASE" > $SOURCES -testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 -'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 -'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris - +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris msgtest 'Test deb822 with' 'two entries' # Two entries echo "$BASE" > $SOURCES echo "" >> $SOURCES echo "$BASE" | sed s/stable/unstable/ >> $SOURCES -testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 -'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 -'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 -'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris +'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris # two suite entries msgtest 'Test deb822 with' 'two Suite entries' echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES -testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 -'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 -'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 -'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris +'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris msgtest 'Test deb822' 'architecture option' echo "$BASE" > $SOURCES echo "Architectures: amd64 armel" >> $SOURCES -testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 -'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 -'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris msgtest 'Test old-style sources.list file which has' 'malformed dist' @@ -85,20 +84,20 @@ testempty aptget update --print-uris # multiple URIs msgtest 'Test deb822 sources.list file which has' 'Multiple URIs work' echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES -testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0 +testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0 'http://ftp.de.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.de.debian.org_debian_dists_stable_main_i18n_Translation-en 0 -'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 -'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 -'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris # multiple Type in one field msgtest 'Test deb822 sources.list file which has' 'Multiple Types work' echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES -testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/source/Sources.bz2' ftp.debian.org_debian_dists_stable_main_source_Sources 0 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/main/source/Sources.bz2' ftp.debian.org_debian_dists_stable_main_source_Sources 0 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 -'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 -'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris # a Suite msgtest 'Test deb822 sources.list file which has' 'a exact path and no sections' @@ -107,6 +106,6 @@ Types: deb URIs: http://emacs.naquadah.org Suites: stable/ EOF -testequal --nomsg "'http://emacs.naquadah.org/stable/Packages.bz2' emacs.naquadah.org_stable_Packages 0 -'http://emacs.naquadah.org/stable/en.bz2' emacs.naquadah.org_stable_en 0 -'http://emacs.naquadah.org/stable/InRelease' emacs.naquadah.org_stable_InRelease 0 " aptget update --print-uris +testequal --nomsg "'http://emacs.naquadah.org/stable/InRelease' emacs.naquadah.org_stable_InRelease 0 +'http://emacs.naquadah.org/stable/Packages.bz2' emacs.naquadah.org_stable_Packages 0 +'http://emacs.naquadah.org/stable/en.bz2' emacs.naquadah.org_stable_en 0 " aptget update --print-uris diff --git a/test/integration/test-apt-update-expected-size b/test/integration/test-apt-update-expected-size index 55a5da848..55bba8188 100755 --- a/test/integration/test-apt-update-expected-size +++ b/test/integration/test-apt-update-expected-size @@ -35,7 +35,7 @@ test_packagestoobig() { done NEW_SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages)" testfailuremsg "W: Failed to fetch ${1}/dists/unstable/main/binary-i386/Packages Writing more data than expected ($NEW_SIZE > $SIZE) -E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -o Debug::pkgAcquire::Worker=0 -o Debug::Acquire::Transaction=0 +E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::Transaction=0 } methodtest() { diff --git a/test/integration/test-apt-update-file b/test/integration/test-apt-update-file index 1ecf9a38a..665f94fa5 100755 --- a/test/integration/test-apt-update-file +++ b/test/integration/test-apt-update-file @@ -22,6 +22,10 @@ addtrap 'prefix' 'chmod 750 aptarchive/dists/unstable/main/binary-amd64;' chmod 550 aptarchive/dists/unstable/main/binary-amd64 testsuccess aptget update + +# the release files aren't an IMS-hit, but the indexes are +redatereleasefiles '+1 hour' + testsuccess aptget update -o Debug::pkgAcquire::Auth=1 cp -a rootdir/tmp/testsuccess.output rootdir/tmp/update.output diff --git a/test/integration/test-apt-update-nofallback b/test/integration/test-apt-update-nofallback index db4430ea3..f132bcf8e 100755 --- a/test/integration/test-apt-update-nofallback +++ b/test/integration/test-apt-update-nofallback @@ -28,6 +28,7 @@ Description: an autogenerated evil package EOF # avoid ims hit touch -d '+1hour' aptarchive/dists/unstable/main/binary-i386/Packages + compressfile aptarchive/dists/unstable/main/binary-i386/Packages } assert_update_is_refused_and_last_good_state_used() @@ -87,16 +88,16 @@ test_from_inrelease_to_unsigned_with_override() { # setup archive with InRelease file setupaptarchive_with_lists_clean - # FIXME: is not what the server reported 4104 4106 - testsuccess aptget update #-o Debug::pkgAcquire::Worker=1 + testsuccess aptget update # simulate moving to a unsigned but otherwise valid repo simulate_mitm_and_inject_evil_package - generatereleasefiles + generatereleasefiles '+2 hours' + find $APTARCHIVE -name '*Packages*' -exec touch -d '+2 hours' {} \; # and ensure we can update to it (with enough force) testwarning aptget update --allow-insecure-repositories \ - -o Acquire::AllowDowngradeToInsecureRepositories=1 + -o Acquire::AllowDowngradeToInsecureRepositories=1 -o Debug::pkgAcquire::Worker=1 -o Debug::pkgAcquire::Auth=1 # but that the individual packages are still considered untrusted testfailureequal "WARNING: The following packages cannot be authenticated! evil @@ -167,7 +168,7 @@ test_inrelease_to_invalid_inrelease() listcurrentlistsdirectory > lists.before # now remove InRelease and subvert Release do no longer verify - sed -i 's/Codename.*/Codename: evil!'/ $APTARCHIVE/dists/unstable/InRelease + sed -i 's/^Codename:.*/Codename: evil!/' $APTARCHIVE/dists/unstable/InRelease inject_evil_package testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) diff --git a/test/integration/test-apt-update-not-modified b/test/integration/test-apt-update-not-modified index bac33d531..a490f00de 100755 --- a/test/integration/test-apt-update-not-modified +++ b/test/integration/test-apt-update-not-modified @@ -43,7 +43,9 @@ Version: 1 EOF compressfile aptarchive/dists/unstable/main/binary-amd64/Packages testfailureequal "Hit $1 unstable InRelease -Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists.good/unstable/main/binary-amd64/Packages.gz') B] +Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] +Err $1 unstable/main amd64 Packages + Hash Sum mismatch W: Failed to fetch $1/dists/unstable/main/binary-amd64/Packages.gz Hash Sum mismatch E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update @@ -87,8 +89,32 @@ Hit $1 unstable Release Reading package lists..." aptget update testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)" - # readd arch so its downloaded again + # readd arch so its downloaded again… configarchitecture 'amd64' 'i386' + # … but oh noes, hashsum mismatch! + find aptarchive/dists/unstable/main/binary-amd64/ -type f -delete + cat >> aptarchive/dists/unstable/main/binary-amd64/Packages < rootdir/etc/apt/apt.conf.d/00nolanguages -testsuccess aptget update +testsuccess aptget update -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::http=1 listcurrentlistsdirectory > lists.before # insert new version @@ -26,7 +26,7 @@ mkdir aptarchive/dists/unstable/main/binary-i386/saved cp -p aptarchive/dists/unstable/main/binary-i386/Packages* \ aptarchive/dists/unstable/main/binary-i386/saved insertpackage 'unstable' 'foo' 'all' '2.0' - +touch -d '+1 hour' aptarchive/dists/unstable/main/binary-i386/Packages compressfile aptarchive/dists/unstable/main/binary-i386/Packages # ensure that we do not get a I-M-S hit for the Release file @@ -39,7 +39,6 @@ cp -p aptarchive/dists/unstable/main/binary-i386/saved/Packages* \ aptarchive/dists/unstable/main/binary-i386/ # ensure this raises an error -testfailureequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages Hash Sum mismatch - -E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq +testfailuremsg "W: Failed to fetch copy:$(readlink -f ./rootdir)/var/lib/apt/lists/localhost:8080_dists_unstable_main_binary-i386_Packages Hash Sum mismatch +E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::http=1 testfileequal lists.before "$(listcurrentlistsdirectory)" diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index bca07268c..486b8ba02 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -12,7 +12,7 @@ setupflataptarchive testaptgetupdate() { rm -rf rootdir/var/lib/apt - aptget update 2>> testaptgetupdate.diff >> testaptgetupdate.diff || true + aptget update >testaptgetupdate.diff 2>&1 || true sed -i -e '/Ign /,+1d' -e '/Release/ d' -e 's#Get:[0-9]\+ #Get: #' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff GIVEN="$1" shift diff --git a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum index ec74a750b..555d8fcaa 100755 --- a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum +++ b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum @@ -176,7 +176,11 @@ testmismatch() { Building dependency tree... Need to get 6 B of source archives. Get:1 http://localhost:8080/ $1 1.0 (dsc) [3 B] +Err http://localhost:8080/ $1 1.0 (dsc) + Hash Sum mismatch Get:2 http://localhost:8080/ $1 1.0 (tar) [3 B] +Err http://localhost:8080/ $1 1.0 (tar) + Hash Sum mismatch E: Failed to fetch http://localhost:8080/${1}_1.0.dsc Hash Sum mismatch E: Failed to fetch http://localhost:8080/${1}_1.0.tar.gz Hash Sum mismatch @@ -238,6 +242,8 @@ Building dependency tree... Need to get 6 B of source archives. Get:1 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (tar) [3 B] Get:2 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (dsc) [3 B] +Err http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (dsc) + Hash Sum mismatch E: Failed to fetch http://localhost:8080/pkg-mixed-sha1-bad_1.0.dsc Hash Sum mismatch E: Failed to fetch some archives.' aptget source -d pkg-mixed-sha1-bad @@ -247,6 +253,8 @@ testfailureequal 'Reading package lists... Building dependency tree... Need to get 6 B of source archives. Get:1 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (tar) [3 B] +Err http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (tar) + Hash Sum mismatch Get:2 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (dsc) [3 B] E: Failed to fetch http://localhost:8080/pkg-mixed-sha2-bad_1.0.tar.gz Hash Sum mismatch diff --git a/test/libapt/acqprogress_test.cc b/test/libapt/acqprogress_test.cc index 288e05aca..c634733d4 100644 --- a/test/libapt/acqprogress_test.cc +++ b/test/libapt/acqprogress_test.cc @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -10,9 +11,10 @@ class TestItem: public pkgAcquire::Item { public: - TestItem(pkgAcquire * const Acq) : pkgAcquire::Item(Acq, "", NULL) {} + TestItem(pkgAcquire * const Acq) : pkgAcquire::Item(Acq) {} - virtual std::string DescURI() { return ""; } + virtual std::string DescURI() const { return ""; } + virtual HashStringList GetExpectedHashes() const { return HashStringList(); } }; diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc index edcd8a11a..63c63ecd3 100644 --- a/test/libapt/hashsums_test.cc +++ b/test/libapt/hashsums_test.cc @@ -306,6 +306,7 @@ TEST(HashSumsTest, HashStringList) EXPECT_EQ(NULL, list.find(NULL)); EXPECT_EQ(NULL, list.find("")); EXPECT_EQ(NULL, list.find("MD5Sum")); + EXPECT_EQ(0, list.FileSize()); // empty lists aren't equal HashStringList list2; @@ -316,6 +317,8 @@ TEST(HashSumsTest, HashStringList) list.push_back(HashString("Checksum-FileSize", "29")); EXPECT_FALSE(list.empty()); EXPECT_FALSE(list.usable()); + EXPECT_EQ(1, list.size()); + EXPECT_EQ(29, list.FileSize()); Hashes hashes; hashes.Add("The quick brown fox jumps over the lazy dog"); -- cgit v1.2.3 From 3679515479136179e0d95325a6559fcc6d0af7f8 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 6 Jun 2015 19:16:45 +0200 Subject: check patch hashes in rred worker instead of in the handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rred is responsible for unpacking and reading the patch files in one go, but we currently only have hashes for the uncompressed patch files, so the handler read the entire patch file before dispatching it to the worker which would read it again – both with an implicit uncompress. Worse, while the workers operate in parallel the handler is the central orchestration unit, so having it busy with work means the workers do (potentially) nothing. This means rred is working with 'untrusted' data, which is bad. Yet, having the unpack in the handler meant that the untrusted uncompress was done as root which isn't better either. Now, we have it at least contained in a binary which we can harden a bit better. In the long run, we want hashes for the compressed patch files through to be safe. --- apt-pkg/acquire-item.cc | 95 +++++++++++++++++++++++---------------- apt-pkg/acquire-item.h | 2 + apt-pkg/acquire-method.cc | 14 +++--- apt-pkg/acquire-method.h | 5 ++- methods/rred.cc | 62 ++++++++++++++++++++----- test/integration/test-pdiff-usage | 2 + 6 files changed, 121 insertions(+), 59 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index ec6ec6e84..7b69ee993 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -95,6 +95,19 @@ static std::string GetCompressedFileName(std::string const &URI, std::string con return Name; } /*}}}*/ +static std::string GetMergeDiffsPatchFileName(std::string const &Final, std::string const &Patch)/*{{{*/ +{ + // rred expects the patch as $FinalFile.ed.$patchname.gz + return Final + ".ed." + Patch + ".gz"; +} + /*}}}*/ +static std::string GetDiffsPatchFileName(std::string const &Final) /*{{{*/ +{ + // rred expects the patch as $FinalFile.ed + return Final + ".ed"; +} + /*}}}*/ + static bool AllowInsecureRepositories(indexRecords const * const MetaIndexParser, pkgAcqMetaBase * const TransactionManager, pkgAcquire::Item * const I) /*{{{*/ { if(MetaIndexParser->IsAlwaysTrusted() || _config->FindB("Acquire::AllowInsecureRepositories") == true) @@ -1860,6 +1873,9 @@ void pkgAcqIndexDiffs::Failed(string const &Message,pkgAcquire::MethodConfig con << "Falling back to normal index file acquire" << std::endl; DestFile = GetPartialFileNameFromURI(Target->URI); RenameOnError(PDiffError); + std::string const patchname = GetDiffsPatchFileName(DestFile); + if (RealFileExists(patchname)) + rename(patchname.c_str(), std::string(patchname + ".FAILED").c_str()); new pkgAcqIndex(Owner, TransactionManager, Target); Finish(); } @@ -1968,28 +1984,13 @@ void pkgAcqIndexDiffs::Done(string const &Message, HashStringList const &Hashes, Item::Done(Message, Hashes, Cnf); - // FIXME: verify this download too before feeding it to rred std::string const FinalFile = GetPartialFileNameFromURI(Target->URI); + std::string const PatchFile = GetDiffsPatchFileName(FinalFile); // success in downloading a diff, enter ApplyDiff state if(State == StateFetchDiff) { - FileFd fd(DestFile, FileFd::ReadOnly, FileFd::Gzip); - class Hashes LocalHashesCalc; - LocalHashesCalc.AddFD(fd); - HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); - - if (fd.Size() != available_patches[0].patch_size || - available_patches[0].patch_hashes != LocalHashes) - { - // patchfiles are dated, so bad indicates a bad download, so kill it - unlink(DestFile.c_str()); - Failed("Patch has Size/Hashsum mismatch", NULL); - return; - } - - // rred excepts the patch as $FinalFile.ed - Rename(DestFile,FinalFile+".ed"); + Rename(DestFile, PatchFile); if(Debug) std::clog << "Sending to rred method: " << FinalFile << std::endl; @@ -2000,18 +2001,17 @@ void pkgAcqIndexDiffs::Done(string const &Message, HashStringList const &Hashes, QueueURI(Desc); SetActiveSubprocess("rred"); return; - } - + } // success in download/apply a diff, queue next (if needed) if(State == StateApplyDiff) { // remove the just applied patch available_patches.erase(available_patches.begin()); - unlink((FinalFile + ".ed").c_str()); + unlink(PatchFile.c_str()); // move into place - if(Debug) + if(Debug) { std::clog << "Moving patched file in place: " << std::endl << DestFile << " -> " << FinalFile << std::endl; @@ -2031,6 +2031,18 @@ void pkgAcqIndexDiffs::Done(string const &Message, HashStringList const &Hashes, } } /*}}}*/ +std::string pkgAcqIndexDiffs::Custom600Headers() const /*{{{*/ +{ + if(State != StateApplyDiff) + return pkgAcqBaseIndex::Custom600Headers(); + std::ostringstream patchhashes; + HashStringList const ExpectedHashes = available_patches[0].patch_hashes; + for (HashStringList::const_iterator hs = ExpectedHashes.begin(); hs != ExpectedHashes.end(); ++hs) + patchhashes << "\nPatch-0-" << hs->HashType() << "-Hash: " << hs->HashValue(); + patchhashes << pkgAcqBaseIndex::Custom600Headers(); + return patchhashes.str(); +} + /*}}}*/ // AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor /*{{{*/ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, @@ -2079,6 +2091,9 @@ void pkgAcqIndexMergeDiffs::Failed(string const &Message,pkgAcquire::MethodConfi std::clog << "Falling back to normal index file acquire" << std::endl; DestFile = GetPartialFileNameFromURI(Target->URI); RenameOnError(PDiffError); + std::string const patchname = GetMergeDiffsPatchFileName(DestFile, patch.file); + if (RealFileExists(patchname)) + rename(patchname.c_str(), std::string(patchname + ".FAILED").c_str()); new pkgAcqIndex(Owner, TransactionManager, Target); } /*}}}*/ @@ -2090,26 +2105,10 @@ void pkgAcqIndexMergeDiffs::Done(string const &Message, HashStringList const &Ha Item::Done(Message, Hashes, Cnf); - // FIXME: verify download before feeding it to rred string const FinalFile = GetPartialFileNameFromURI(Target->URI); - if (State == StateFetchDiff) { - FileFd fd(DestFile, FileFd::ReadOnly, FileFd::Gzip); - class Hashes LocalHashesCalc; - LocalHashesCalc.AddFD(fd); - HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); - - if (fd.Size() != patch.patch_size || patch.patch_hashes != LocalHashes) - { - // patchfiles are dated, so bad indicates a bad download, so kill it - unlink(DestFile.c_str()); - Failed("Patch has Size/Hashsum mismatch", NULL); - return; - } - - // rred expects the patch as $FinalFile.ed.$patchname.gz - Rename(DestFile, FinalFile + ".ed." + patch.file + ".gz"); + Rename(DestFile, GetMergeDiffsPatchFileName(FinalFile, patch.file)); // check if this is the last completed diff State = StateDoneDiff; @@ -2158,7 +2157,7 @@ void pkgAcqIndexMergeDiffs::Done(string const &Message, HashStringList const &Ha I != allPatches->end(); ++I) { std::string const PartialFile = GetPartialFileNameFromURI(Target->URI); - std::string patch = PartialFile + ".ed." + (*I)->patch.file + ".gz"; + std::string const patch = GetMergeDiffsPatchFileName(PartialFile, (*I)->patch.file); unlink(patch.c_str()); } unlink(FinalFile.c_str()); @@ -2170,6 +2169,24 @@ void pkgAcqIndexMergeDiffs::Done(string const &Message, HashStringList const &Ha } } /*}}}*/ +std::string pkgAcqIndexMergeDiffs::Custom600Headers() const /*{{{*/ +{ + if(State != StateApplyDiff) + return pkgAcqBaseIndex::Custom600Headers(); + std::ostringstream patchhashes; + unsigned int seen_patches = 0; + for (std::vector::const_iterator I = allPatches->begin(); + I != allPatches->end(); ++I) + { + HashStringList const ExpectedHashes = (*I)->patch.patch_hashes; + for (HashStringList::const_iterator hs = ExpectedHashes.begin(); hs != ExpectedHashes.end(); ++hs) + patchhashes << "\nPatch-" << seen_patches << "-" << hs->HashType() << "-Hash: " << hs->HashValue(); + ++seen_patches; + } + patchhashes << pkgAcqBaseIndex::Custom600Headers(); + return patchhashes.str(); +} + /*}}}*/ // AcqIndex::AcqIndex - Constructor /*{{{*/ pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner, diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 97d5ea1dd..f24af1aec 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -774,6 +774,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); virtual void Done(std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const Cnf); + virtual std::string Custom600Headers() const; virtual std::string DescURI() const {return Target->URI + "Index";}; virtual HashStringList GetExpectedHashes() const; virtual bool HashesRequired() const; @@ -886,6 +887,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex virtual void Done(std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const Cnf); + virtual std::string Custom600Headers() const; virtual std::string DescURI() const {return Target->URI + "IndexDiffs";}; virtual HashStringList GetExpectedHashes() const; virtual bool HashesRequired() const; diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index b77096efd..a8fc75f8e 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -388,14 +388,14 @@ int pkgAcqMethod::Run(bool Single) *I = Tmp; if (QueueBack == 0) QueueBack = Tmp; - + // Notify that this item is to be fetched. - if (Fetch(Tmp) == false) + if (URIAcquire(Message, Tmp) == false) Fail(); - - break; - } - } + + break; + } + } } Exit(); @@ -403,8 +403,6 @@ int pkgAcqMethod::Run(bool Single) } /*}}}*/ // AcqMethod::PrintStatus - privately really send a log/status message /*{{{*/ -// --------------------------------------------------------------------- -/* */ void pkgAcqMethod::PrintStatus(char const * const header, const char* Format, va_list &args) const { diff --git a/apt-pkg/acquire-method.h b/apt-pkg/acquire-method.h index 399454892..6480eb4b5 100644 --- a/apt-pkg/acquire-method.h +++ b/apt-pkg/acquire-method.h @@ -76,11 +76,12 @@ class pkgAcqMethod std::string FailReason; std::string UsedMirror; std::string IP; - + // Handlers for messages virtual bool Configuration(std::string Message); virtual bool Fetch(FetchItem * /*Item*/) {return true;}; - + virtual bool URIAcquire(std::string const &/*Message*/, FetchItem *Itm) { return Fetch(Itm); }; + // Outgoing messages void Fail(bool Transient = false); inline void Fail(const char *Why, bool Transient = false) {Fail(std::string(Why),Transient);}; diff --git a/methods/rred.cc b/methods/rred.cc index 554ac99b4..3da33c126 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -388,7 +388,7 @@ class Patch { public: - void read_diff(FileFd &f) + void read_diff(FileFd &f, Hashes * const h) { char buffer[BLOCK_SIZE]; bool cmdwanted = true; @@ -396,6 +396,8 @@ class Patch { Change ch(0); while(f.ReadLine(buffer, sizeof(buffer))) { + if (h != NULL) + h->Add(buffer); if (cmdwanted) { char *m, *c; size_t s, e; @@ -519,8 +521,29 @@ class RredMethod : public pkgAcqMethod { private: bool Debug; + struct PDiffFile { + std::string FileName; + HashStringList ExpectedHashes; + PDiffFile(std::string const &FileName, HashStringList const &ExpectedHashes) : + FileName(FileName), ExpectedHashes(ExpectedHashes) {} + }; + + HashStringList ReadExpectedHashesForPatch(unsigned int const patch, std::string const &Message) + { + HashStringList ExpectedHashes; + for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) + { + std::string tagname; + strprintf(tagname, "Patch-%d-%s-Hash", patch, *type); + std::string const hashsum = LookupTag(Message, tagname.c_str()); + if (hashsum.empty() == false) + ExpectedHashes.push_back(HashString(*type, hashsum)); + } + return ExpectedHashes; + } + protected: - virtual bool Fetch(FetchItem *Itm) { + virtual bool URIAcquire(std::string const &Message, FetchItem *Itm) { Debug = _config->FindB("Debug::pkgAcquire::RRed", false); URI Get = Itm->Uri; std::string Path = Get.Host + Get.Path; // rred:/path - no host @@ -534,11 +557,17 @@ class RredMethod : public pkgAcqMethod { } else URIStart(Res); - std::vector patchpaths; + std::vector patchfiles; Patch patch; if (FileExists(Path + ".ed") == true) - patchpaths.push_back(Path + ".ed"); + { + HashStringList const ExpectedHashes = ReadExpectedHashesForPatch(0, Message); + std::string const FileName = Path + ".ed"; + if (ExpectedHashes.usable() == false) + return _error->Error("No hashes found for uncompressed patch: %s", FileName.c_str()); + patchfiles.push_back(PDiffFile(FileName, ExpectedHashes)); + } else { _error->PushToStack(); @@ -546,18 +575,27 @@ class RredMethod : public pkgAcqMethod { _error->RevertToStack(); std::string const baseName = Path + ".ed."; + unsigned int seen_patches = 0; for (std::vector::const_iterator p = patches.begin(); p != patches.end(); ++p) + { if (p->compare(0, baseName.length(), baseName) == 0) - patchpaths.push_back(*p); + { + HashStringList const ExpectedHashes = ReadExpectedHashesForPatch(seen_patches, Message); + if (ExpectedHashes.usable() == false) + return _error->Error("No hashes found for uncompressed patch %d: %s", seen_patches, p->c_str()); + patchfiles.push_back(PDiffFile(*p, ExpectedHashes)); + ++seen_patches; + } + } } std::string patch_name; - for (std::vector::iterator I = patchpaths.begin(); - I != patchpaths.end(); + for (std::vector::iterator I = patchfiles.begin(); + I != patchfiles.end(); ++I) { - patch_name = *I; + patch_name = I->FileName; if (Debug == true) std::clog << "Patching " << Path << " with " << patch_name << std::endl; @@ -569,8 +607,12 @@ class RredMethod : public pkgAcqMethod { _error->DumpErrors(std::cerr); abort(); } - patch.read_diff(p); + Hashes patch_hash(I->ExpectedHashes); + patch.read_diff(p, &patch_hash); p.Close(); + HashStringList const hsl = patch_hash.GetHashStringList(); + if (hsl != I->ExpectedHashes) + return _error->Error("Patch %s doesn't have the expected hashsum", patch_name.c_str()); } if (Debug == true) @@ -643,7 +685,7 @@ int main(int argc, char **argv) _error->DumpErrors(std::cerr); exit(1); } - patch.read_diff(p); + patch.read_diff(p, NULL); } if (just_diff) { diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 7d72a6944..73df61895 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -170,6 +170,8 @@ SHA256-Patches: generatereleasefiles '+1hour' signreleasefiles testsuccess aptget update "$@" + cp -f rootdir/tmp/testsuccess.output rootdir/tmp/aptgetupdate.output + testsuccess grep 'have the expected hashsum' rootdir/tmp/aptgetupdate.output testnopackage oldstuff testsuccessequal "$(cat ${PKGFILE}-new) " aptcache show apt newstuff -- cgit v1.2.3 From 6d3e5bd8e08564c5eb12ecd869de5bd71e25f59d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 7 Jun 2015 02:17:15 +0200 Subject: add more parsing error checking for rred The rred parser is very accepting regarding 'invalid' files. Given that we can't trust the input it might be a bit too relaxed. In any case, checking for more errors can't hurt given that we support only a very specific subset of ed commands. --- methods/rred.cc | 70 +++++++++----- test/integration/test-method-rred | 194 ++++++++++++++++++++++++++++++++++++++ test/integration/test-pdiff-usage | 3 +- 3 files changed, 245 insertions(+), 22 deletions(-) create mode 100755 test/integration/test-method-rred diff --git a/methods/rred.cc b/methods/rred.cc index 3da33c126..81ecf8553 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -35,7 +36,7 @@ class MemBlock { char *start; size_t size; char *free; - struct MemBlock *next; + MemBlock *next; MemBlock(size_t size) : size(size), next(NULL) { @@ -116,7 +117,7 @@ struct Change { size_t add_len; /* bytes */ char *add; - Change(int off) + Change(size_t off) { offset = off; del_cnt = add_cnt = add_len = 0; @@ -388,30 +389,37 @@ class Patch { public: - void read_diff(FileFd &f, Hashes * const h) + bool read_diff(FileFd &f, Hashes * const h) { char buffer[BLOCK_SIZE]; bool cmdwanted = true; - Change ch(0); - while(f.ReadLine(buffer, sizeof(buffer))) - { + Change ch(std::numeric_limits::max()); + if (f.ReadLine(buffer, sizeof(buffer)) == NULL) + return _error->Error("Reading first line of patchfile %s failed", f.Name().c_str()); + do { if (h != NULL) h->Add(buffer); if (cmdwanted) { char *m, *c; size_t s, e; - s = strtol(buffer, &m, 10); - if (m == buffer) { - s = e = ch.offset + ch.add_cnt; - c = buffer; - } else if (*m == ',') { - m++; + errno = 0; + s = strtoul(buffer, &m, 10); + if (unlikely(m == buffer || s == ULONG_MAX || errno != 0)) + return _error->Error("Parsing patchfile %s failed: Expected an effected line start", f.Name().c_str()); + else if (*m == ',') { + ++m; e = strtol(m, &c, 10); + if (unlikely(m == c || e == ULONG_MAX || errno != 0)) + return _error->Error("Parsing patchfile %s failed: Expected an effected line end", f.Name().c_str()); + if (unlikely(e < s)) + return _error->Error("Parsing patchfile %s failed: Effected lines end %lu is before start %lu", f.Name().c_str(), e, s); } else { e = s; c = m; } + if (s > ch.offset) + return _error->Error("Parsing patchfile %s failed: Effected line is after previous effected line", f.Name().c_str()); switch(*c) { case 'a': cmdwanted = false; @@ -422,6 +430,8 @@ class Patch { ch.del_cnt = 0; break; case 'c': + if (unlikely(s == 0)) + return _error->Error("Parsing patchfile %s failed: Change command can't effect line zero", f.Name().c_str()); cmdwanted = false; ch.add = NULL; ch.add_cnt = 0; @@ -430,6 +440,8 @@ class Patch { ch.del_cnt = e - s + 1; break; case 'd': + if (unlikely(s == 0)) + return _error->Error("Parsing patchfile %s failed: Delete command can't effect line zero", f.Name().c_str()); ch.offset = s - 1; ch.del_cnt = e - s + 1; ch.add = NULL; @@ -437,9 +449,11 @@ class Patch { ch.add_len = 0; filechanges.add_change(ch); break; + default: + return _error->Error("Parsing patchfile %s failed: Unknown command", f.Name().c_str()); } } else { /* !cmdwanted */ - if (buffer[0] == '.' && buffer[1] == '\n') { + if (strcmp(buffer, ".\n") == 0) { cmdwanted = true; filechanges.add_change(ch); } else { @@ -465,7 +479,8 @@ class Patch { } } } - } + } while(f.ReadLine(buffer, sizeof(buffer))); + return true; } void write_diff(FILE *f) @@ -601,14 +616,14 @@ class RredMethod : public pkgAcqMethod { << std::endl; FileFd p; + Hashes patch_hash(I->ExpectedHashes); // all patches are compressed, even if the name doesn't reflect it - if (p.Open(patch_name, FileFd::ReadOnly, FileFd::Gzip) == false) { - std::cerr << "Could not open patch file " << patch_name << std::endl; + if (p.Open(patch_name, FileFd::ReadOnly, FileFd::Gzip) == false || + patch.read_diff(p, &patch_hash) == false) + { _error->DumpErrors(std::cerr); - abort(); + return false; } - Hashes patch_hash(I->ExpectedHashes); - patch.read_diff(p, &patch_hash); p.Close(); HashStringList const hsl = patch_hash.GetHashStringList(); if (hsl != I->ExpectedHashes) @@ -624,7 +639,6 @@ class RredMethod : public pkgAcqMethod { FILE *out = fopen(Itm->DestFile.c_str(), "w"); Hashes hash(Itm->ExpectedHashes); - patch.apply_against_file(out, inp, &hash); fclose(out); @@ -657,6 +671,16 @@ class RredMethod : public pkgAcqMethod { return true; } + bool Configuration(std::string Message) + { + if (pkgAcqMethod::Configuration(Message) == false) + return false; + + DropPrivsOrDie(); + + return true; + } + public: RredMethod() : pkgAcqMethod("2.0",SingleInstance | SendConfig), Debug(false) {} }; @@ -685,7 +709,11 @@ int main(int argc, char **argv) _error->DumpErrors(std::cerr); exit(1); } - patch.read_diff(p, NULL); + if (patch.read_diff(p, NULL) == false) + { + _error->DumpErrors(std::cerr); + exit(2); + } } if (just_diff) { diff --git a/test/integration/test-method-rred b/test/integration/test-method-rred new file mode 100755 index 000000000..a8de3ea28 --- /dev/null +++ b/test/integration/test-method-rred @@ -0,0 +1,194 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'i386' + +echo 'Package: coolstuff +Version: 0.8.15 +Description: collection of stuff + A lot, too much to iterate all, but at least this: + - stuff + - more stuff + - even more stuff + . + And a cow. + +Package: oldstuff +Version: 0-1 +Description: collection of outdated stuff + A lot, but of no use nowadays, but at least this: + - stuff + - more stuff + - even more stuff + . + And a dog.' > Packages + +testrred() { + msgtest "$1" "$2" + if [ -z "$3" ]; then + echo -n '' > Packages.ed + else + echo "$3" > Packages.ed + fi + rred() { + cat Packages | runapt "${METHODSDIR}/rred" "$@" + } + testsuccessequal "$4" --nomsg rred -f Packages.ed +} + +testrred 'Remove' 'first line' '1d' "$(tail -n +2 ./Packages)" +testrred 'Remove' 'empty line' '10d' "$(head -n 9 ./Packages) +$(tail -n 9 ./Packages)" +testrred 'Remove' 'line in a paragraph' '5d' "$(head -n 4 ./Packages) +$(tail -n 14 ./Packages)" +testrred 'Remove' 'last line' '19d' "$(head -n -1 ./Packages)" +testrred 'Remove' 'multiple single lines' '17d +7d' "$(sed -e '/^ - even more stuff$/ d' ./Packages)" +testrred 'Remove' 'first paragraph' '1,10d' "$(tail -n 9 ./Packages)" +testrred 'Remove' 'a few lines in the middle' '5,14d' "$(head -n 4 ./Packages) +$(tail -n 5 ./Packages)" +testrred 'Remove' 'second paragraph' '10,19d' "$(head -n 9 ./Packages)" +testrred 'Mass Remove' 'all stuff lines' '15,17d +13d +11d +5,7d +3d +1d' "$(sed '/stuff/ d' ./Packages)" + +testrred 'Single line add' 'first line' '0a +Format: 3.0 (native) +.' "Format: 3.0 (native) +$(cat ./Packages)" +testrred 'Single line add' 'last line' '19a +Multi-Arch: foreign +.' "$(cat ./Packages) +Multi-Arch: foreign" +testrred 'Single line add' 'middle' '9a +Multi-Arch: foreign +.' "$(head -n 9 ./Packages) +Multi-Arch: foreign +$(tail -n 10 ./Packages)" + +testrred 'Multi line add' 'first line' '0a +Format: 3.0 (native) +Source: apt +.' "Format: 3.0 (native) +Source: apt +$(cat ./Packages)" +testrred 'Multi line add' 'last line' '19a +Multi-Arch: foreign +Homepage: https://debian.org +.' "$(cat ./Packages) +Multi-Arch: foreign +Homepage: https://debian.org" +testrred 'Multi line add' 'middle' '9a +Multi-Arch: foreign +Homepage: https://debian.org +.' "$(head -n 9 ./Packages) +Multi-Arch: foreign +Homepage: https://debian.org +$(tail -n 10 ./Packages)" + +testrred 'Single line change' 'first line' '1c +Package: supercoolstuff +.' "Package: supercoolstuff +$(tail -n +2 ./Packages)" +testrred 'Single line change' 'in the middle' '9c + And a super cow. +.' "$(head -n 8 ./Packages) + And a super cow. +$(tail -n 10 ./Packages)" +testrred 'Single line change' 'an empty line' '10c + +.' "$(head -n 9 ./Packages) + +$(tail -n 9 ./Packages)" +testrred 'Single line change' 'a spacy line' '10c + +.' "$(head -n 9 ./Packages) + +$(tail -n 9 ./Packages)" +testrred 'Single line change' 'last line' '19c + And a cat. +.' "$(head -n -1 ./Packages) + And a cat." + +testrred 'Multi line change' 'exchange' '5,7c + - good stuff + - more good stuff + - even more good stuff +.' "$(head -n 4 ./Packages) + - good stuff + - more good stuff + - even more good stuff +$(tail -n 12 ./Packages)" +testrred 'Multi line change' 'less' '5,7c + - good stuff + - more good stuff +.' "$(head -n 4 ./Packages) + - good stuff + - more good stuff +$(tail -n 12 ./Packages)" +testrred 'Multi line change' 'more' '5,7c + - good stuff + - more good stuff + - even more good stuff + - bonus good stuff +.' "$(head -n 4 ./Packages) + - good stuff + - more good stuff + - even more good stuff + - bonus good stuff +$(tail -n 12 ./Packages)" + +failrred() { + msgtest 'Failure caused by' "$1" + echo "$2" > Packages.ed + rred() { + cat Packages | runapt "${METHODSDIR}/rred" "$@" + } + testfailure --nomsg rred -f Packages.ed +} + +failrred 'Bogus content' ' +' + +# not a problem per-se, but we want our parser to be really strict +failrred 'Empty patch file' '' +failrred 'Empty line patch file' ' +' +failrred 'Empty line before command' ' +1d' +failrred 'Empty line after command' '1d +' +failrred 'Empty line between commands' '17d + +7d' +failrred 'Empty spaces lines before command' ' +1d' +failrred 'Empty spaces lines after command' '1d + ' +failrred 'Empty spaces lines between commands' '17d + +7d' + +# the line before the first one can't be deleted/changed +failrred 'zero line delete' '0d' +failrred 'zero line change' '0c +Package: supercoolstuff +.' +# and this makes no sense at all +failrred 'negative line delete' '-1d' +failrred 'negative line change' '-1c +Package: supercoolstuff +.' +failrred 'negative line add' '-1a +Package: supercoolstuff +.' +failrred 'Wrong order of commands' '7d +17d' +failrred 'End before start' '7,6d' diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 73df61895..7a9f6496b 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -165,7 +165,8 @@ SHA256-History: SHA256-Patches: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28 $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX - echo 'I am Mallory and I change files' >> $PATCHFILE + # needs to look like a valid command, otherwise the parser will fail before hashes are checked + echo '1d' >> $PATCHFILE cat $PATCHFILE | gzip > ${PATCHFILE}.gz generatereleasefiles '+1hour' signreleasefiles -- cgit v1.2.3 From fec55559451dc1c440c4770ee3faa116522fc59c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 7 Jun 2015 09:35:37 +0200 Subject: fix download-file using testcases to run as root Git-Dch: Ignore --- test/integration/test-apt-download-progress | 7 ++++--- test/integration/test-apt-helper | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/test/integration/test-apt-download-progress b/test/integration/test-apt-download-progress index 65c438e8f..7caeca971 100755 --- a/test/integration/test-apt-download-progress +++ b/test/integration/test-apt-download-progress @@ -24,18 +24,19 @@ assertprogress() { # actually report progress - but not too big to ensure its not delaying the # test too much TESTFILE=testfile.big -testsuccess dd if=/dev/zero of=./aptarchive/$TESTFILE bs=800k count=1 +testsuccess dd if=/dev/zero of=./aptarchive/$TESTFILE bs=800k count=1 OPT='-o APT::Status-Fd=3 -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::http=1 -o Debug::Acquire::https=1' msgtest 'download progress works via' 'http' exec 3> apt-progress.log -testsuccess --nomsg apthelper download-file "http://localhost:8080/$TESTFILE" http-$TESTFILE $OPT -o Acquire::http::Dl-Limit=800 +testsuccess --nomsg apthelper download-file "http://localhost:8080/$TESTFILE" ./downloaded/http-$TESTFILE $OPT -o Acquire::http::Dl-Limit=800 assertprogress apt-progress.log msgtest 'download progress works via' 'https' exec 3> apt-progress.log -testsuccess --nomsg apthelper download-file "https://localhost:4433/$TESTFILE" https-$TESTFILE $OPT -o Acquire::https::Dl-Limit=800 +testsuccess --nomsg apthelper download-file "https://localhost:4433/$TESTFILE" ./downloaded/https-$TESTFILE $OPT -o Acquire::https::Dl-Limit=800 +assertprogress apt-progress.log # cleanup rm -f apt-progress*.log diff --git a/test/integration/test-apt-helper b/test/integration/test-apt-helper index 431210797..00d859ad5 100755 --- a/test/integration/test-apt-helper +++ b/test/integration/test-apt-helper @@ -14,32 +14,32 @@ test_apt_helper_download() { echo 'bar' > aptarchive/foo2 msgtest 'apt-file download-file md5sum' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo foo2 MD5Sum:d3b07384d113edec49eaa6238ad5ff00 - testfileequal foo2 'foo' + testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo2 MD5Sum:d3b07384d113edec49eaa6238ad5ff00 + testfileequal ./downloaded/foo2 'foo' msgtest 'apt-file download-file sha1' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo foo1 SHA1:f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 - testfileequal foo1 'foo' + testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo1 SHA1:f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 + testfileequal ./downloaded/foo1 'foo' msgtest 'apt-file download-file sha256' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo foo3 SHA256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c - testfileequal foo3 'foo' + testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo3 SHA256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c + testfileequal ./downloaded/foo3 'foo' msgtest 'apt-file download-file no-hash' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo foo4 - testfileequal foo4 'foo' + testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo4 + testfileequal ./downloaded/foo4 'foo' msgtest 'apt-file download-file wrong hash' - testfailure --nomsg apthelper -qq download-file http://localhost:8080/foo foo5 MD5Sum:aabbcc + testfailure --nomsg apthelper -qq download-file http://localhost:8080/foo ./downloaded/foo5 MD5Sum:aabbcc testfileequal rootdir/tmp/testfailure.output 'E: Failed to fetch http://localhost:8080/foo Hash Sum mismatch E: Download Failed' - testfileequal foo5.FAILED 'foo' + testfileequal ./downloaded/foo5.FAILED 'foo' msgtest 'apt-file download-file md5sum sha1' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo foo6 MD5Sum:d3b07384d113edec49eaa6238ad5ff00 http://localhost:8080/foo2 foo7 SHA1:e242ed3bffccdf271b7fbaf34ed72d089537b42f - testfileequal foo6 'foo' - testfileequal foo7 'bar' + testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo6 MD5Sum:d3b07384d113edec49eaa6238ad5ff00 http://localhost:8080/foo2 ./downloaded/foo7 SHA1:e242ed3bffccdf271b7fbaf34ed72d089537b42f + testfileequal ./downloaded/foo6 'foo' + testfileequal ./downloaded/foo7 'bar' } test_apt_helper_detect_proxy() { -- cgit v1.2.3 From 4f51fd8636592a96aecf17c8bf4cfdb3ea2207cc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Jun 2015 00:06:41 +0200 Subject: support hashes for compressed pdiff files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At the moment we only have hashes for the uncompressed pdiff files, but via the new '$HASH-Download' field in the .diff/Index hashes can be provided for the .gz compressed pdiff file, which apt will pick up now and use to verify the download. Now, we "just" need a buy in from the creators of repositories… --- apt-pkg/acquire-item.cc | 72 ++++++++++++++++++++++++++++++++------- apt-pkg/acquire-item.h | 11 +++--- apt-pkg/contrib/hashes.cc | 11 ++++-- apt-pkg/contrib/hashes.h | 7 ++++ apt-pkg/indexrecords.cc | 4 +-- methods/rred.cc | 2 +- test/integration/test-pdiff-usage | 46 +++++++++++++++++++++++-- 7 files changed, 125 insertions(+), 28 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 7b69ee993..a3f47242f 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -152,14 +152,18 @@ HashStringList pkgAcqMetaBase::GetExpectedHashes() const APT_CONST bool pkgAcqIndexDiffs::HashesRequired() const { - /* FIXME: We have only hashes for uncompressed pdiffs. - rred uncompresses them on the fly while parsing. - In StateFetchDiff state we also uncompress on the fly for hash check. - Hashes are checked while searching for (next) patch to apply. */ + /* We don't always have the diff of the downloaded pdiff file. + What we have for sure is hashes for the uncompressed file, + but rred uncompresses them on the fly while parsing, so not handled here. + Hashes are (also) checked while searching for (next) patch to apply. */ + if (State == StateFetchDiff) + return available_patches[0].download_hashes.empty() == false; return false; } HashStringList pkgAcqIndexDiffs::GetExpectedHashes() const { + if (State == StateFetchDiff) + return available_patches[0].download_hashes; return HashStringList(); } @@ -168,11 +172,15 @@ APT_CONST bool pkgAcqIndexMergeDiffs::HashesRequired() const /* @see #pkgAcqIndexDiffs::HashesRequired, with the difference that we can check the rred result after all patches are applied as we know the expected result rather than potentially apply more patches */ + if (State == StateFetchDiff) + return patch.download_hashes.empty() == false; return State == StateApplyDiff; } HashStringList pkgAcqIndexMergeDiffs::GetExpectedHashes() const { - if (State == StateApplyDiff) + if (State == StateFetchDiff) + return patch.download_hashes; + else if (State == StateApplyDiff) return GetExpectedHashesFor(Target->MetaKey); return HashStringList(); } @@ -1618,7 +1626,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ std::vector::iterator cur = available_patches.begin(); for (; cur != available_patches.end(); ++cur) { - if (cur->file != filename || unlikely(cur->result_size != size)) + if (cur->file != filename) continue; cur->result_hashes.push_back(HashString(*type, hash)); break; @@ -1630,8 +1638,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ DiffInfo next; next.file = filename; next.result_hashes.push_back(HashString(*type, hash)); - next.result_size = size; - next.patch_size = 0; + next.result_hashes.FileSize(size); available_patches.push_back(next); } else @@ -1679,10 +1686,9 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ { if (cur->file != filename) continue; - if (unlikely(cur->patch_size != 0 && cur->patch_size != size)) - continue; + if (cur->patch_hashes.empty()) + cur->patch_hashes.FileSize(size); cur->patch_hashes.push_back(HashString(*type, hash)); - cur->patch_size = size; break; } if (cur != available_patches.end()) @@ -1694,6 +1700,48 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ } } + for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) + { + std::string tagname = *type; + tagname.append("-Download"); + std::string const tmp = Tags.FindS(tagname.c_str()); + if (tmp.empty() == true) + continue; + + string hash, filename; + unsigned long long size; + std::stringstream ss(tmp); + + // FIXME: all of pdiff supports only .gz compressed patches + while (ss >> hash >> size >> filename) + { + if (unlikely(hash.empty() == true || filename.empty() == true)) + continue; + if (unlikely(APT::String::Endswith(filename, ".gz") == false)) + continue; + filename.erase(filename.length() - 3); + + // see if we have a record for this file already + std::vector::iterator cur = available_patches.begin(); + for (; cur != available_patches.end(); ++cur) + { + if (cur->file != filename) + continue; + if (cur->download_hashes.empty()) + cur->download_hashes.FileSize(size); + cur->download_hashes.push_back(HashString(*type, hash)); + break; + } + if (cur != available_patches.end()) + continue; + if (Debug == true) + std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": File " << filename + << " wasn't in the list for the first parsed hash! (download)" << std::endl; + break; + } + } + + bool foundStart = false; for (std::vector::iterator cur = available_patches.begin(); cur != available_patches.end(); ++cur) @@ -1729,7 +1777,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ unsigned long long patchesSize = 0; for (std::vector::const_iterator cur = available_patches.begin(); cur != available_patches.end(); ++cur) - patchesSize += cur->patch_size; + patchesSize += cur->patch_hashes.FileSize(); unsigned long long const sizeLimit = ServerSize * _config->FindI("Acquire::PDiffs::SizeLimit", 100); if (sizeLimit > 0 && (sizeLimit/100) < patchesSize) { diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index f24af1aec..910e4131b 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -705,17 +705,14 @@ struct APT_HIDDEN DiffInfo { /*{{{*/ /** The filename of the diff. */ std::string file; - /** The hashes of the diff */ + /** The hashes of the file after the diff is applied */ HashStringList result_hashes; - /** The hashes of the file after the diff is applied */ + /** The hashes of the diff */ HashStringList patch_hashes; - /** The size of the file after the diff is applied */ - unsigned long long result_size; - - /** The size of the diff itself */ - unsigned long long patch_size; + /** The hashes of the compressed diff */ + HashStringList download_hashes; }; /*}}}*/ /** \brief An item that is responsible for fetching client-merge patches {{{ diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 11a7e479b..46cf0ba08 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -188,6 +188,13 @@ unsigned long long HashStringList::FileSize() const /*{{{*/ return strtoull(hv.c_str(), NULL, 10); } /*}}}*/ +bool HashStringList::FileSize(unsigned long long const Size) /*{{{*/ +{ + std::string size; + strprintf(size, "%llu", Size); + return push_back(HashString("Checksum-FileSize", size)); +} + /*}}}*/ bool HashStringList::supported(char const * const type) /*{{{*/ { for (char const * const * t = HashString::SupportedHashes(); *t != NULL; ++t) @@ -361,9 +368,7 @@ APT_IGNORE_DEPRECATED_PUSH if ((d->CalcHashes & SHA512SUM) == SHA512SUM) hashes.push_back(HashString("SHA512", SHA512.Result().Value())); APT_IGNORE_DEPRECATED_POP - std::string SizeStr; - strprintf(SizeStr, "%llu", d->FileSize); - hashes.push_back(HashString("Checksum-FileSize", SizeStr)); + hashes.FileSize(d->FileSize); return hashes; } APT_IGNORE_DEPRECATED_PUSH diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index 176ce4faa..e8d84da9e 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -96,6 +96,13 @@ class HashStringList */ unsigned long long FileSize() const; + /** sets the filesize hash + * + * @param Size of the file + * @return @see #push_back + */ + bool FileSize(unsigned long long const Size); + /** check if the given hash type is supported * * @param type to check diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index c26868cac..7e6da9558 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -121,9 +121,7 @@ bool indexRecords::Load(const string Filename) /*{{{*/ indexRecords::checkSum *Sum = new indexRecords::checkSum; Sum->MetaKeyFilename = Name; Sum->Size = Size; - std::string SizeStr; - strprintf(SizeStr, "%llu", Size); - Sum->Hashes.push_back(HashString("Checksum-FileSize", SizeStr)); + Sum->Hashes.FileSize(Size); APT_IGNORE_DEPRECATED(Sum->Hash = HashString(HashString::SupportedHashes()[i],Hash);) Entries[Name] = Sum; } diff --git a/methods/rred.cc b/methods/rred.cc index 81ecf8553..12cf2b4a5 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -627,7 +627,7 @@ class RredMethod : public pkgAcqMethod { p.Close(); HashStringList const hsl = patch_hash.GetHashStringList(); if (hsl != I->ExpectedHashes) - return _error->Error("Patch %s doesn't have the expected hashsum", patch_name.c_str()); + return _error->Error("Hash Sum mismatch for uncompressed patch %s", patch_name.c_str()); } if (Debug == true) diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 7a9f6496b..3295d5497 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -42,6 +42,8 @@ wasmergeused() { testrun() { msgmsg "Testcase: setup the base with: $*" + local DOWNLOADHASH=true + if [ "$1" = 'nohash' ]; then DOWNLOADHASH=false; shift; fi find aptarchive -name 'Packages*' -type f -delete cp ${PKGFILE} aptarchive/Packages compressfile 'aptarchive/Packages' @@ -76,6 +78,15 @@ SHA256-History: SHA256-Patches: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28 $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX + if $DOWNLOADHASH; then + echo "SHA1-Download: + 2365ac0ac57cde3d43c63145e8251a3bd5410213 197 2010-08-18-2013.28.gz + $(sha1sum ${PATCHFILE}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE}.gz) $(basename ${PATCHFILE}.gz) +SHA256-Download: + d2a1b33187ed2d248eeae3b1223ea71791ea35f2138a713ed371332a6421f467 197 2010-08-18-2013.28.gz + $(sha256sum ${PATCHFILE}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE}.gz) $(basename ${PATCHFILE}.gz)" >> $PATCHINDEX + fi + generatereleasefiles '+1hour' signreleasefiles find aptarchive -name 'Packages*' -type f -delete @@ -131,6 +142,17 @@ SHA256-Patches: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28 $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE) $(sha256sum ${PATCHFILE2} | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE2}) $(basename ${PATCHFILE2})" > $PATCHINDEX + if $DOWNLOADHASH; then + echo "SHA1-Download: + 2365ac0ac57cde3d43c63145e8251a3bd5410213 197 2010-08-18-2013.28.gz + $(sha1sum ${PATCHFILE}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE}.gz) $(basename ${PATCHFILE}.gz) + $(sha1sum ${PATCHFILE2}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE2}.gz) $(basename ${PATCHFILE2}.gz) +SHA256-Download: + d2a1b33187ed2d248eeae3b1223ea71791ea35f2138a713ed371332a6421f467 197 2010-08-18-2013.28.gz + $(sha256sum ${PATCHFILE}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE}.gz) $(basename ${PATCHFILE}.gz) + $(sha256sum ${PATCHFILE2}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE2}.gz) $(basename ${PATCHFILE2}.gz)" >> $PATCHINDEX + fi + generatereleasefiles '+2hour' signreleasefiles cp -a aptarchive/Packages Packages-future @@ -150,6 +172,7 @@ SHA256-Patches: mkdir -p aptarchive/Packages.diff PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)" diff -e ${PKGFILE} ${PKGFILE}-new > ${PATCHFILE} || true + cat $PATCHFILE | gzip > ${PATCHFILE}.gz PATCHINDEX='aptarchive/Packages.diff/Index' echo "SHA1-Current: $(sha1sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new) SHA1-History: @@ -165,14 +188,22 @@ SHA256-History: SHA256-Patches: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28 $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX + if $DOWNLOADHASH; then + echo "SHA1-Download: + 2365ac0ac57cde3d43c63145e8251a3bd5410213 197 2010-08-18-2013.28.gz + $(sha1sum ${PATCHFILE}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE}.gz) $(basename ${PATCHFILE}.gz) +SHA256-Download: + d2a1b33187ed2d248eeae3b1223ea71791ea35f2138a713ed371332a6421f467 197 2010-08-18-2013.28.gz + $(sha256sum ${PATCHFILE}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE}.gz) $(basename ${PATCHFILE}.gz)" >> $PATCHINDEX + fi # needs to look like a valid command, otherwise the parser will fail before hashes are checked - echo '1d' >> $PATCHFILE + echo '1d' > $PATCHFILE cat $PATCHFILE | gzip > ${PATCHFILE}.gz generatereleasefiles '+1hour' signreleasefiles testsuccess aptget update "$@" cp -f rootdir/tmp/testsuccess.output rootdir/tmp/aptgetupdate.output - testsuccess grep 'have the expected hashsum' rootdir/tmp/aptgetupdate.output + testsuccess grep 'Hash Sum mismatch' rootdir/tmp/aptgetupdate.output testnopackage oldstuff testsuccessequal "$(cat ${PKGFILE}-new) " aptcache show apt newstuff @@ -201,6 +232,14 @@ SHA256-History: SHA256-Patches: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28 $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE)000 $(basename $PATCHFILE)" > $PATCHINDEX + if $DOWNLOADHASH; then + echo "SHA1-Download: + 2365ac0ac57cde3d43c63145e8251a3bd5410213 197 2010-08-18-2013.28.gz + $(sha1sum ${PATCHFILE}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE}.gz)000 $(basename ${PATCHFILE}.gz) +SHA256-Download: + d2a1b33187ed2d248eeae3b1223ea71791ea35f2138a713ed371332a6421f467 197 2010-08-18-2013.28.gz + $(sha256sum ${PATCHFILE}.gz | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE}.gz)000 $(basename ${PATCHFILE}.gz)" >> $PATCHINDEX + fi generatereleasefiles '+1hour' signreleasefiles #find aptarchive -name 'Packages*' -type f -delete @@ -215,6 +254,9 @@ echo 'Debug::pkgAcquire::Diffs "true"; Debug::Acquire::Transaction "true"; Debug::pkgAcquire::rred "true";' > rootdir/etc/apt/apt.conf.d/rreddebug.conf +testrun nohash -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=1 +testrun nohash -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=1 + testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=1 testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=1 testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=0 -- cgit v1.2.3 From 9b8c28f430a8fbe73252cc3e87b6e88e9d5063d9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Jun 2015 11:20:01 +0200 Subject: cleanup pdiff support detection decision Its a bit unclean to create an item just to let the item decide that it can't do anything and let it fail, so instead we let the item creator decide in all cases if patching should be attempted. Also pulls a small trick to get the hashes for the current file without calculating them by looking at the 'old' Release file if we have it. Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 85 ++++++++++++++++++++++++++----------------------- apt-pkg/acquire-item.h | 5 --- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index a3f47242f..13e971e9f 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -925,24 +925,36 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/ Target != IndexTargets->end(); ++Target) { - if (verify == true && TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey) == false) + bool trypdiff = _config->FindB("Acquire::PDiffs", true); + if (verify == true) { - // optional target that we do not have in the Release file are skipped - if ((*Target)->IsOptional()) - continue; + if (TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey) == false) + { + // optional targets that we do not have in the Release file are skipped + if ((*Target)->IsOptional()) + continue; - Status = StatAuthError; - strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str()); - return; + Status = StatAuthError; + strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str()); + return; + } + + // check if we have patches available + trypdiff &= TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey + ".diff/Index"); } + // if we have no file to patch, no point in trying + trypdiff &= RealFileExists(GetFinalFileNameFromURI((*Target)->URI)); - /* Queue the Index file (Packages, Sources, Translation-$foo - (either diff or full packages files, depending - on the users option) - we also check if the PDiff Index file is listed - in the Meta-Index file. Ideal would be if pkgAcqDiffIndex would test this - instead, but passing the required info to it is to much hassle */ - if(_config->FindB("Acquire::PDiffs",true) == true && (verify == false || - TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey + ".diff/Index") == true)) + // no point in patching from local sources + if (trypdiff) + { + std::string const proto = (*Target)->URI.substr(0, strlen("file:/")); + if (proto == "file:/" || proto == "copy:/" || proto == "cdrom:") + trypdiff = false; + } + + // Queue the Index file (Packages, Sources, Translation-$foo, …) + if (trypdiff) new pkgAcqDiffIndex(Owner, TransactionManager, *Target); else new pkgAcqIndex(Owner, TransactionManager, *Target); @@ -1477,26 +1489,7 @@ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner, if(Debug) std::clog << "pkgAcqDiffIndex: " << Desc.URI << std::endl; - // look for the current package file - CurrentPackagesFile = GetFinalFileNameFromURI(Target->URI); - - // FIXME: this file:/ check is a hack to prevent fetching - // from local sources. this is really silly, and - // should be fixed cleanly as soon as possible - if(!FileExists(CurrentPackagesFile) || - Desc.URI.substr(0,strlen("file:/")) == "file:/") - { - // we don't have a pkg file or we don't want to queue - Failed("No index file, local or canceld by user", NULL); - return; - } - - if(Debug) - std::clog << "pkgAcqDiffIndex::pkgAcqDiffIndex(): " - << CurrentPackagesFile << std::endl; - QueueURI(Desc); - } /*}}}*/ // AcqIndex::Custom600Headers - Insert custom request headers /*{{{*/ @@ -1570,6 +1563,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ return false; } + std::string const CurrentPackagesFile = GetFinalFileNameFromURI(Target->URI); HashStringList const TargetFileHashes = GetExpectedHashesFor(Target->MetaKey); if (TargetFileHashes.usable() == false || ServerHashes != TargetFileHashes) { @@ -1581,7 +1575,23 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ return false; } - if (ServerHashes.VerifyFile(CurrentPackagesFile) == true) + HashStringList LocalHashes; + // try avoiding calculating the hash here as this is costly + if (TransactionManager->LastMetaIndexParser != NULL) + { + indexRecords::checkSum * const R = TransactionManager->LastMetaIndexParser->Lookup(Target->MetaKey); + if (R != NULL) + LocalHashes = R->Hashes; + } + if (LocalHashes.usable() == false) + { + FileFd fd(CurrentPackagesFile, FileFd::ReadOnly); + Hashes LocalHashesCalc(ServerHashes); + LocalHashesCalc.AddFD(fd); + LocalHashes = LocalHashesCalc.GetHashStringList(); + } + + if (ServerHashes == LocalHashes) { // we have the same sha1 as the server so we are done here if(Debug) @@ -1590,14 +1600,9 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ return true; } - FileFd fd(CurrentPackagesFile, FileFd::ReadOnly); - Hashes LocalHashesCalc; - LocalHashesCalc.AddFD(fd); - HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList(); - if(Debug) std::clog << "Server-Current: " << ServerHashes.find(NULL)->toStr() << " and we start at " - << fd.Name() << " " << fd.FileSize() << " " << LocalHashes.find(NULL)->toStr() << std::endl; + << CurrentPackagesFile << " " << LocalHashes.FileSize() << " " << LocalHashes.find(NULL)->toStr() << std::endl; // parse all of (provided) history vector available_patches; diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 910e4131b..e823a64d2 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -648,11 +648,6 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex /** \brief If \b true, debugging information will be written to std::clog. */ bool Debug; - /** \brief The index file which will be patched to generate the new - * file. - */ - std::string CurrentPackagesFile; - /** \brief A description of the Packages file (stored in * pkgAcquire::ItemDesc::Description). */ -- cgit v1.2.3 From 8d041b4f4f353079268039dcbfd8b5e575196b66 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Jun 2015 15:22:01 +0200 Subject: do not request files if we expect an IMS hit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we have a file on disk and the hashes are the same in the new Release file and the old one we have on disk we know that if we ask the server for the file, we will at best get an IMS hit – at worse the server doesn't support this and sends us the (unchanged) file and we have to run all our checks on it again for nothing. So, we can save ourselves (and the servers) some unneeded requests if we figure this out on our own. --- apt-pkg/acquire-item.cc | 77 ++++++++++++++-------- test/integration/framework | 4 +- test/integration/test-apt-update-expected-size | 4 +- test/integration/test-apt-update-file | 25 +++++-- test/integration/test-apt-update-not-modified | 19 ++++++ test/integration/test-apt-update-rollback | 6 +- test/integration/test-apt-update-transactions | 24 +++++-- .../test-cve-2013-1051-InRelease-parsing | 13 ++-- 8 files changed, 127 insertions(+), 45 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 13e971e9f..511bbbc64 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -119,6 +119,16 @@ static bool AllowInsecureRepositories(indexRecords const * const MetaIndexParser return false; } /*}}}*/ +static HashStringList GetExpectedHashesFromFor(indexRecords * const Parser, std::string const MetaKey)/*{{{*/ +{ + if (Parser == NULL) + return HashStringList(); + indexRecords::checkSum * const R = Parser->Lookup(MetaKey); + if (R == NULL) + return HashStringList(); + return R->Hashes; +} + /*}}}*/ // all ::HashesRequired and ::GetExpectedHashes implementations /*{{{*/ /* ::GetExpectedHashes is abstract and has to be implemented by all subclasses. @@ -372,6 +382,25 @@ bool pkgAcqDiffIndex::TransactionState(TransactionStates const state) } /*}}}*/ +class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ +/* The sole purpose of this class is having an item which does nothing to + reach its done state to prevent cleanup deleting the mentioned file. + Handy in cases in which we know we have the file already, like IMS-Hits. */ +{ + IndexTarget const * const Target; + public: + virtual std::string DescURI() const {return Target->URI;}; + virtual HashStringList GetExpectedHashes() const {return HashStringList();}; + + NoActionItem(pkgAcquire * const Owner, IndexTarget const * const Target) : + pkgAcquire::Item(Owner), Target(Target) + { + Status = StatDone; + DestFile = GetFinalFileNameFromURI(Target->URI); + } +}; + /*}}}*/ + // Acquire::Item::Item - Constructor /*{{{*/ APT_IGNORE_DEPRECATED_PUSH pkgAcquire::Item::Item(pkgAcquire * const Owner) : @@ -644,12 +673,7 @@ pkgAcqTransactionItem::~pkgAcqTransactionItem() /*{{{*/ /*}}}*/ HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const MetaKey) const /*{{{*/ { - if (TransactionManager->MetaIndexParser == NULL) - return HashStringList(); - indexRecords::checkSum * const R = TransactionManager->MetaIndexParser->Lookup(MetaKey); - if (R == NULL) - return HashStringList(); - return R->Hashes; + return GetExpectedHashesFromFor(TransactionManager->MetaIndexParser, MetaKey); } /*}}}*/ @@ -939,6 +963,23 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/ return; } + if (RealFileExists(GetFinalFileNameFromURI((*Target)->URI))) + { + if (TransactionManager->LastMetaIndexParser != NULL) + { + HashStringList const newFile = GetExpectedHashesFromFor(TransactionManager->MetaIndexParser, (*Target)->MetaKey); + HashStringList const oldFile = GetExpectedHashesFromFor(TransactionManager->LastMetaIndexParser, (*Target)->MetaKey); + if (newFile == oldFile) + { + // we have the file already, no point in trying to acquire it again + new NoActionItem(Owner, *Target); + continue; + } + } + } + else + trypdiff = false; // no file to patch + // check if we have patches available trypdiff &= TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey + ".diff/Index"); } @@ -1085,20 +1126,6 @@ string pkgAcqMetaClearSig::Custom600Headers() const } /*}}}*/ // pkgAcqMetaClearSig::Done - We got a file /*{{{*/ -class APT_HIDDEN DummyItem : public pkgAcquire::Item -{ - IndexTarget const * const Target; - public: - virtual std::string DescURI() const {return Target->URI;}; - virtual HashStringList GetExpectedHashes() const {return HashStringList();}; - - DummyItem(pkgAcquire * const Owner, IndexTarget const * const Target) : - pkgAcquire::Item(Owner), Target(Target) - { - Status = StatDone; - DestFile = GetFinalFileNameFromURI(Target->URI); - } -}; void pkgAcqMetaClearSig::Done(std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const Cnf) @@ -1131,8 +1158,8 @@ void pkgAcqMetaClearSig::Done(std::string const &Message, // We got an InRelease file IMSHit, but we haven't one, which means // we had a valid Release/Release.gpg combo stepping in, which we have // to 'acquire' now to ensure list cleanup isn't removing them - new DummyItem(Owner, &DetachedDataTarget); - new DummyItem(Owner, &DetachedSigTarget); + new NoActionItem(Owner, &DetachedDataTarget); + new NoActionItem(Owner, &DetachedSigTarget); } } } @@ -1578,11 +1605,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ HashStringList LocalHashes; // try avoiding calculating the hash here as this is costly if (TransactionManager->LastMetaIndexParser != NULL) - { - indexRecords::checkSum * const R = TransactionManager->LastMetaIndexParser->Lookup(Target->MetaKey); - if (R != NULL) - LocalHashes = R->Hashes; - } + LocalHashes = GetExpectedHashesFromFor(TransactionManager->LastMetaIndexParser, Target->MetaKey); if (LocalHashes.usable() == false) { FileFd fd(CurrentPackagesFile, FileFd::ReadOnly); diff --git a/test/integration/framework b/test/integration/framework index b253deb91..56c4a1216 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -835,7 +835,9 @@ buildaptarchivefromincoming() { buildaptarchivefromfiles() { msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on prebuild files…" - find aptarchive -name 'Packages' -o -name 'Sources' -o -name 'Translation-*' | while read line; do + local DIR='aptarchive' + if [ -d "${DIR}/dists" ]; then DIR="${DIR}/dists"; fi + find "$DIR" -name 'Packages' -o -name 'Sources' -o -name 'Translation-*' | while read line; do msgninfo "\t${line} file… " compressfile "$line" "$1" msgdone "info" diff --git a/test/integration/test-apt-update-expected-size b/test/integration/test-apt-update-expected-size index 55bba8188..24ca85133 100755 --- a/test/integration/test-apt-update-expected-size +++ b/test/integration/test-apt-update-expected-size @@ -26,7 +26,9 @@ test_inreleasetoobig() { } test_packagestoobig() { - redatereleasefiles '+1hour' + insertpackage 'unstable' 'foo' 'all' '1.0' + buildaptarchivefromfiles '+1 hour' + signreleasefiles # append junk at the end of the Packages.gz/Packages SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages)" find aptarchive/dists -name 'Packages*' | while read pkg; do diff --git a/test/integration/test-apt-update-file b/test/integration/test-apt-update-file index 665f94fa5..94b604f0e 100755 --- a/test/integration/test-apt-update-file +++ b/test/integration/test-apt-update-file @@ -26,14 +26,29 @@ testsuccess aptget update # the release files aren't an IMS-hit, but the indexes are redatereleasefiles '+1 hour' +# we don't download the index if it isn't updated testsuccess aptget update -o Debug::pkgAcquire::Auth=1 +# file:/ isn't shown in the log, so see if it was downloaded anyhow cp -a rootdir/tmp/testsuccess.output rootdir/tmp/update.output +canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-amd64/Packages.bz2 | sha512sum |cut -f1 -d' ')" +testfailure grep -- "$canary" rootdir/tmp/update.output + +testfoo() { + # foo is still available + testsuccess aptget install -s foo + testsuccess aptcache showsrc foo + testsuccess aptget source foo --print-uris +} +testfoo + +# the release file is new again, the index still isn't, but it is somehow gone now from disk +redatereleasefiles '+2 hour' +find rootdir/var/lib/apt/lists -name '*_Packages*' -delete -# ensure that the hash of the uncompressed file was verified even on a local ims hit +testsuccess aptget update -o Debug::pkgAcquire::Auth=1 +# file:/ isn't shown in the log, so see if it was downloaded anyhow +cp -a rootdir/tmp/testsuccess.output rootdir/tmp/update.output canary="SHA512:$(bzcat aptarchive/dists/unstable/main/binary-amd64/Packages.bz2 | sha512sum |cut -f1 -d' ')" testsuccess grep -- "$canary" rootdir/tmp/update.output -# foo is still available -testsuccess aptget install -s foo -testsuccess aptcache showsrc foo -testsuccess aptget source foo --print-uris +testfoo diff --git a/test/integration/test-apt-update-not-modified b/test/integration/test-apt-update-not-modified index a490f00de..32818658f 100755 --- a/test/integration/test-apt-update-not-modified +++ b/test/integration/test-apt-update-not-modified @@ -133,6 +133,25 @@ Reading package lists..." aptget update rm -rf aptarchive/dists cp -a aptarchive/dists.good aptarchive/dists + + # new release file, but the indexes are the same + redatereleasefiles '+2 hours' + + rm -rf rootdir/var/lib/apt/lists.good + cp -a rootdir/var/lib/apt/lists rootdir/var/lib/apt/lists.good + testsuccessequal "Get:1 $1 unstable InRelease [$(stat -c '%s' 'aptarchive/dists/unstable/InRelease') B] +Reading package lists..." aptget update + + rm -rf rootdir/var/lib/apt/lists + cp -a rootdir/var/lib/apt/lists.good rootdir/var/lib/apt/lists + find rootdir/var/lib/apt/lists -name '*_Packages*' -delete + testsuccessequal "Get:1 $1 unstable InRelease [$(stat -c '%s' 'aptarchive/dists/unstable/InRelease') B] +Get:2 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] +Get:3 $1 unstable/main i386 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-i386/Packages.gz') B] +Reading package lists..." aptget update + + rm -rf aptarchive/dists + cp -a aptarchive/dists.good aptarchive/dists } changetowebserver diff --git a/test/integration/test-apt-update-rollback b/test/integration/test-apt-update-rollback index 6fd901715..6ecf322b2 100755 --- a/test/integration/test-apt-update-rollback +++ b/test/integration/test-apt-update-rollback @@ -158,7 +158,10 @@ test_inrelease_to_broken_gzip() { msgmsg "Test InRelease to broken gzip" start_with_good_inrelease - redatereleasefiles '+2hours' + break_repository_sources_index '+1hour' + generatereleasefiles '+2hours' + signreleasefiles + # append junk at the end of the compressed file echo "lala" >> $APTARCHIVE/dists/unstable/main/source/Sources.gz touch -d '+2min' $APTARCHIVE/dists/unstable/main/source/Sources.gz @@ -166,6 +169,7 @@ test_inrelease_to_broken_gzip() { rm $APTARCHIVE/dists/unstable/main/source/Sources testfailure aptget update + testsuccess grep 'Hash Sum mismatch' rootdir/tmp/testfailure.output testfileequal lists.before "$(listcurrentlistsdirectory)" } diff --git a/test/integration/test-apt-update-transactions b/test/integration/test-apt-update-transactions index 152e1617a..a5dac1737 100755 --- a/test/integration/test-apt-update-transactions +++ b/test/integration/test-apt-update-transactions @@ -29,6 +29,12 @@ restorefile() { } testrun() { + rm -rf aptarchive/dists.good + cp -a aptarchive/dists aptarchive/dists.good + insertpackage 'unstable' 'bar' 'all' '1.0' + insertsource 'unstable' 'bar' 'all' '1.0' + buildaptarchivefromfiles '+1 hour' + # produce an unsigned repository find aptarchive \( -name 'Release.gpg' -o -name 'InRelease' \) -delete testfailure aptget update --no-allow-insecure-repositories @@ -37,20 +43,27 @@ testrun() { # signed but broken signreleasefiles + onehashbroken() { + testfailure aptget update + # each file generates two messages with this string + testequal '2' grep --count 'Hash Sum mismatch' rootdir/tmp/testfailure.output + testfileequal "$1" "$(listcurrentlistsdirectory)" + } + breakfile aptarchive/dists/unstable/main/binary-i386/Packages - testfailure aptget update - testfileequal "$1" "$(listcurrentlistsdirectory)" + onehashbroken "$1" restorefile aptarchive/dists/unstable/main/binary-i386/Packages breakfile aptarchive/dists/unstable/main/source/Sources - testfailure aptget update - testfileequal "$1" "$(listcurrentlistsdirectory)" + onehashbroken "$1" restorefile aptarchive/dists/unstable/main/source/Sources + + rm -rf aptarchive/dists + cp -a aptarchive/dists.good aptarchive/dists } testsetup() { msgmsg 'Test with no initial data over' "$1" - redatereleasefiles 'now' rm -rf rootdir/var/lib/apt/lists mkdir -p rootdir/var/lib/apt/lists/partial listcurrentlistsdirectory > listsdir.lst @@ -60,7 +73,6 @@ testsetup() { rm -rf rootdir/var/lib/apt/lists testsuccess aptget update -o Debug::pkgAcquire::Worker=1 listcurrentlistsdirectory > listsdir.lst - redatereleasefiles '+1hour' testrun 'listsdir.lst' } diff --git a/test/integration/test-cve-2013-1051-InRelease-parsing b/test/integration/test-cve-2013-1051-InRelease-parsing index e38e40cc9..d99174553 100755 --- a/test/integration/test-cve-2013-1051-InRelease-parsing +++ b/test/integration/test-cve-2013-1051-InRelease-parsing @@ -39,10 +39,15 @@ sed -i '/^-----BEGIN PGP SIGNATURE-----/,/^-----END PGP SIGNATURE-----/ s/^$/ / cat aptarchive/dists/stable/Release >> aptarchive/dists/stable/InRelease touch -d '+1hour' aptarchive/dists/stable/InRelease -# ensure the update fails -# useful for debugging to add "-o Debug::pkgAcquire::auth=true" -msgtest 'apt-get update for should fail with the modified' 'InRelease' -aptget update 2>&1 | grep -E -q '(Writing more data than expected|Hash Sum mismatch)' > /dev/null && msgpass || msgfail +# ensure the update doesn't load bad data as good data +# Note that we will pick up the InRelease itself as we download no other +# indexes which would trigger a hashsum mismatch, but we ignore the 'bad' +# part of the InRelease +listcurrentlistsdirectory | sed '/_InRelease/ d' > listsdir.lst +msgtest 'apt-get update should ignore unsigned data in the' 'InRelease' +testsuccessequal "Get:1 http://localhost:8080 stable InRelease [$(stat -c%s aptarchive/dists/stable/InRelease) B] +Reading package lists..." --nomsg aptget update +testfileequal './listsdir.lst' "$(listcurrentlistsdirectory | sed '/_InRelease/ d')" # ensure there is no package testfailureequal 'Reading package lists... -- cgit v1.2.3 From 4cd86fc61960404ef7dd8a474c2dff2002016824 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Jun 2015 16:08:53 +0200 Subject: remove debianism file-content verification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code requires every index file we download to have a Package field, but that doesn't hold true for all index we might want to download in the future. Some might not even be deb822 formatted files… The check was needed as apt used to accept unverifiable files like Translation-*, but nowadays it requires hashes for these as well. Even for unsigned repositories we interpret the Release file as binding now, which means this check isn't triggerable expect for repositories which do not have a Release file at all – something which is highly discouraged! Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 39 ++------------------------------------- apt-pkg/acquire-item.h | 3 --- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 511bbbc64..a1357fb15 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -2430,33 +2430,6 @@ void pkgAcqIndex::ReverifyAfterIMS() QueueURI(Desc); } /*}}}*/ -// AcqIndex::ValidateFile - Validate the content of the downloaded file /*{{{*/ -bool pkgAcqIndex::ValidateFile(const std::string &FileName) -{ - // FIXME: this can go away once we only ever download stuff that - // has a valid hash and we never do GET based probing - // FIXME2: this also leaks debian-isms into the code and should go therefore - - /* Always validate the index file for correctness (all indexes must - * have a Package field) (LP: #346386) (Closes: #627642) - */ - FileFd fd(FileName, FileFd::ReadOnly, FileFd::Extension); - // Only test for correctness if the content of the file is not empty - // (empty is ok) - if (fd.Size() > 0) - { - pkgTagSection sec; - pkgTagFile tag(&fd); - - // all our current indexes have a field 'Package' in each section - if (_error->PendingError() == true || - tag.Step(sec) == false || - sec.Exists("Package") == false) - return false; - } - return true; -} - /*}}}*/ // AcqIndex::Done - Finished a fetch /*{{{*/ // --------------------------------------------------------------------- /* This goes through a number of states.. On the initial fetch the @@ -2557,20 +2530,12 @@ void pkgAcqIndex::StageDownloadDone(string const &Message, HashStringList const } /*}}}*/ // AcqIndex::StageDecompressDone - Final verification /*{{{*/ -void pkgAcqIndex::StageDecompressDone(string const &Message, +void pkgAcqIndex::StageDecompressDone(string const &, HashStringList const &, - pkgAcquire::MethodConfig const * const Cfg) + pkgAcquire::MethodConfig const * const) { - if(!ValidateFile(DestFile)) - { - RenameOnError(InvalidFormat); - Failed(Message, Cfg); - return; - } - // Done, queue for rename on transaction finished TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename()); - return; } /*}}}*/ diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index e823a64d2..38a7a8662 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -965,9 +965,6 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex /** \brief Schedule file for verification after a IMS hit */ void ReverifyAfterIMS(); - /** \brief Validate the downloaded index file */ - bool ValidateFile(std::string const &FileName); - /** \brief Get the full pathname of the final file for the current URI */ virtual std::string GetFinalFilename() const; -- cgit v1.2.3 From 1e0f0f28e1025f42a8172eb72f3e87984eb2b939 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 9 Jun 2015 11:59:22 +0200 Subject: configureable acquire targets to download additional files First pass at making the acquire system capable of downloading files based on configuration rather than hardcoded entries. It is now possible to instruct 'deb' and 'deb-src' sources.list lines to download more than just Packages/Translation-* and Sources files. Details on how to do that can be found in the included documentation file. --- apt-pkg/contrib/configuration.cc | 4 +- apt-pkg/contrib/configuration.h | 11 +- apt-pkg/deb/debmetaindex.cc | 317 ++++++++++----------- apt-pkg/deb/debmetaindex.h | 8 - apt-pkg/init.cc | 20 +- doc/acquire-additional-files.txt | 142 +++++++++ test/integration/test-apt-acquire-additional-files | 54 ++++ test/integration/test-apt-by-hash-update | 12 +- 8 files changed, 376 insertions(+), 192 deletions(-) create mode 100644 doc/acquire-additional-files.txt create mode 100755 test/integration/test-apt-acquire-additional-files diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 42e35d32a..2500ab631 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -259,7 +259,7 @@ vector Configuration::FindVector(const char *Name) const return FindVector(Name, ""); } #endif -vector Configuration::FindVector(const char *Name, std::string const &Default) const +vector Configuration::FindVector(const char *Name, std::string const &Default, bool const Keys) const { vector Vec; const Item *Top = Lookup(Name); @@ -272,7 +272,7 @@ vector Configuration::FindVector(const char *Name, std::string const &De Item *I = Top->Child; while(I != NULL) { - Vec.push_back(I->Value); + Vec.push_back(Keys ? I->Tag : I->Value); I = I->Next; } if (Vec.empty() == true) diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h index 8d7d51037..eacc26fda 100644 --- a/apt-pkg/contrib/configuration.h +++ b/apt-pkg/contrib/configuration.h @@ -84,15 +84,8 @@ class Configuration * * \param Name of the parent node * \param Default list of values separated by commas */ -#if APT_PKG_ABI >= 413 - std::vector FindVector(const char *Name, std::string const &Default = "") const; - std::vector FindVector(std::string const &Name, std::string const &Default = "") const { return FindVector(Name.c_str(), Default); }; -#else - std::vector FindVector(const char *Name, std::string const &Default) const; - std::vector FindVector(std::string const &Name, std::string const &Default) const { return FindVector(Name.c_str(), Default); }; - std::vector FindVector(const char *Name) const; - std::vector FindVector(std::string const &Name) const { return FindVector(Name.c_str(), ""); }; -#endif + std::vector FindVector(const char *Name, std::string const &Default = "", bool const Keys = false) const; + std::vector FindVector(std::string const &Name, std::string const &Default = "", bool const Keys = false) const { return FindVector(Name.c_str(), Default, Keys); }; int FindI(const char *Name,int const &Default = 0) const; int FindI(std::string const &Name,int const &Default = 0) const {return FindI(Name.c_str(),Default);}; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index eb5e78e3b..8fef05ab0 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -23,25 +23,6 @@ using namespace std; -string debReleaseIndex::Info(const char *Type, string const &Section, string const &Arch) const -{ - string Info = ::URI::SiteOnly(URI) + ' '; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Info += Dist; - } - else - { - Info += Dist + '/' + Section; - if (Arch.empty() != true) - Info += " " + Arch; - } - Info += " "; - Info += Type; - return Info; -} - string debReleaseIndex::MetaIndexInfo(const char *Type) const { string Info = ::URI::SiteOnly(URI) + ' '; @@ -92,81 +73,6 @@ std::string debReleaseIndex::LocalFileName() const return ""; } -string debReleaseIndex::IndexURISuffix(const char *Type, string const &Section, string const &Arch) const -{ - string Res =""; - if (Dist[Dist.size() - 1] != '/') - { - if (Arch == "native") - Res += Section + "/binary-" + _config->Find("APT::Architecture") + '/'; - else - Res += Section + "/binary-" + Arch + '/'; - } - return Res + Type; -} - - -string debReleaseIndex::IndexURI(const char *Type, string const &Section, string const &Arch) const -{ - if (Dist[Dist.size() - 1] == '/') - { - string Res; - if (Dist != "/") - Res = URI + Dist; - else - Res = URI; - return Res + Type; - } - else - return URI + "dists/" + Dist + '/' + IndexURISuffix(Type, Section, Arch); - } - -string debReleaseIndex::SourceIndexURISuffix(const char *Type, const string &Section) const -{ - string Res =""; - if (Dist[Dist.size() - 1] != '/') - Res += Section + "/source/"; - return Res + Type; -} - -string debReleaseIndex::SourceIndexURI(const char *Type, const string &Section) const -{ - string Res; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Res = URI + Dist; - else - Res = URI; - return Res + Type; - } - else - return URI + "dists/" + Dist + "/" + SourceIndexURISuffix(Type, Section); -} - -string debReleaseIndex::TranslationIndexURISuffix(const char *Type, const string &Section) const -{ - string Res =""; - if (Dist[Dist.size() - 1] != '/') - Res += Section + "/i18n/Translation-"; - return Res + Type; -} - -string debReleaseIndex::TranslationIndexURI(const char *Type, const string &Section) const -{ - string Res; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Res = URI + Dist; - else - Res = URI; - return Res + Type; - } - else - return URI + "dists/" + Dist + "/" + TranslationIndexURISuffix(Type, Section); -} - debReleaseIndex::debReleaseIndex(string const &URI, string const &Dist) : metaIndex(URI, Dist, "deb"), Trusted(CHECK_TRUST) {} @@ -184,73 +90,161 @@ debReleaseIndex::~debReleaseIndex() { delete *S; } -vector * debReleaseIndex::ComputeIndexTargets() const { - vector * IndexTargets = new vector ; +vector * debReleaseIndex::ComputeIndexTargets() const +{ + vector * IndexTargets = new vector ; - map >::const_iterator const src = ArchEntries.find("source"); - if (src != ArchEntries.end()) { - vector const SectionEntries = src->second; - for (vector::const_iterator I = SectionEntries.begin(); - I != SectionEntries.end(); ++I) { - char const * const ShortDesc = "Sources"; - IndexTarget * const Target = new IndexTarget( - SourceIndexURISuffix(ShortDesc, (*I)->Section), - ShortDesc, - Info(ShortDesc, (*I)->Section), - SourceIndexURI(ShortDesc, (*I)->Section) - ); - IndexTargets->push_back (Target); - } - } + bool const flatArchive = (Dist[Dist.length() - 1] == '/'); + std::string baseURI = URI; + if (flatArchive) + { + if (Dist != "/") + baseURI += Dist; + } + else + baseURI += "dists/" + Dist + "/"; + std::string const Release = (Dist == "/") ? "" : Dist; + std::string const Site = ::URI::SiteOnly(URI); + std::vector lang = APT::Configuration::getLanguages(true); + if (lang.empty()) + lang.push_back("none"); + map >::const_iterator const src = ArchEntries.find("source"); + if (src != ArchEntries.end()) + { + std::vector const targets = _config->FindVector("APT::Acquire::Targets::deb-src", "", true); + for (std::vector::const_iterator T = targets.begin(); T != targets.end(); ++T) + { +#define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb-src::") + *T + "::" + (X)) + std::string const URI = APT_T_CONFIG(flatArchive ? "flatURI" : "URI"); + std::string const ShortDesc = APT_T_CONFIG("ShortDescription"); + std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); + bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb-src::") + *T + "::Optional", true); +#undef APT_T_CONFIG + if (URI.empty()) + continue; - // Only source release - if (IndexTargets->empty() == false && ArchEntries.size() == 1) - return IndexTargets; + vector const SectionEntries = src->second; + for (vector::const_iterator I = SectionEntries.begin(); + I != SectionEntries.end(); ++I) + { + for (vector::const_iterator l = lang.begin(); l != lang.end(); ++l) + { + if (*l == "none" && URI.find("$(LANGUAGE)") != std::string::npos) + continue; + + struct SubstVar subst[] = { + { "$(SITE)", &Site }, + { "$(RELEASE)", &Release }, + { "$(COMPONENT)", &((*I)->Section) }, + { "$(LANGUAGE)", &(*l) }, + { NULL, NULL } + }; + std::string const name = SubstVar(URI, subst); + IndexTarget * Target; + if (IsOptional == true) + { + Target = new OptionalIndexTarget( + name, + SubstVar(ShortDesc, subst), + SubstVar(LongDesc, subst), + baseURI + name + ); + } + else + { + Target = new IndexTarget( + name, + SubstVar(ShortDesc, subst), + SubstVar(LongDesc, subst), + baseURI + name + ); + } + IndexTargets->push_back(Target); + + if (URI.find("$(LANGUAGE)") == std::string::npos) + break; + } - std::set sections; - for (map >::const_iterator a = ArchEntries.begin(); - a != ArchEntries.end(); ++a) { - if (a->first == "source") - continue; - for (vector ::const_iterator I = a->second.begin(); - I != a->second.end(); ++I) { - char const * const ShortDesc = "Packages"; - IndexTarget * const Target = new IndexTarget( - IndexURISuffix(ShortDesc, (*I)->Section, a->first), - ShortDesc, - Info (ShortDesc, (*I)->Section, a->first), - IndexURI(ShortDesc, (*I)->Section, a->first) - ); - IndexTargets->push_back (Target); - sections.insert((*I)->Section); - } - } + if (URI.find("$(COMPONENT)") == std::string::npos) + break; + } + } + } - std::vector lang = APT::Configuration::getLanguages(true); - std::vector::iterator lend = std::remove(lang.begin(), lang.end(), "none"); - if (lend != lang.end()) - lang.erase(lend); - - if (lang.empty() == true) - return IndexTargets; - - // get the Translation-* files, later we will skip download of non-existent if we have an index - for (std::set::const_iterator s = sections.begin(); - s != sections.end(); ++s) { - for (std::vector::const_iterator l = lang.begin(); - l != lang.end(); ++l) { - std::string const ShortDesc = "Translation-" + *l; - IndexTarget * const Target = new OptionalIndexTarget( - TranslationIndexURISuffix(l->c_str(), *s), - ShortDesc, - Info (ShortDesc.c_str(), *s), - TranslationIndexURI(l->c_str(), *s) - ); - IndexTargets->push_back(Target); - } - } + // Only source release + if (IndexTargets->empty() == false && ArchEntries.size() == 1) + return IndexTargets; - return IndexTargets; + std::vector const targets = _config->FindVector("APT::Acquire::Targets::deb", "", true); + for (std::vector::const_iterator T = targets.begin(); T != targets.end(); ++T) + { +#define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb::") + *T + "::" + (X)) + std::string const URI = APT_T_CONFIG(flatArchive ? "flatURI" : "URI"); + std::string const ShortDesc = APT_T_CONFIG("ShortDescription"); + std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); + bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb::") + *T + "::Optional", true); +#undef APT_T_CONFIG + if (URI.empty()) + continue; + + for (map >::const_iterator a = ArchEntries.begin(); + a != ArchEntries.end(); ++a) + { + if (a->first == "source") + continue; + + for (vector ::const_iterator I = a->second.begin(); + I != a->second.end(); ++I) { + + for (vector::const_iterator l = lang.begin(); l != lang.end(); ++l) + { + if (*l == "none" && URI.find("$(LANGUAGE)") != std::string::npos) + continue; + + struct SubstVar subst[] = { + { "$(SITE)", &Site }, + { "$(RELEASE)", &Release }, + { "$(COMPONENT)", &((*I)->Section) }, + { "$(LANGUAGE)", &(*l) }, + { "$(ARCHITECTURE)", &(a->first) }, + { NULL, NULL } + }; + std::string const name = SubstVar(URI, subst); + IndexTarget * Target; + if (IsOptional == true) + { + Target = new OptionalIndexTarget( + name, + SubstVar(ShortDesc, subst), + SubstVar(LongDesc, subst), + baseURI + name + ); + } + else + { + Target = new IndexTarget( + name, + SubstVar(ShortDesc, subst), + SubstVar(LongDesc, subst), + baseURI + name + ); + } + IndexTargets->push_back(Target); + + if (URI.find("$(LANGUAGE)") == std::string::npos) + break; + } + + if (URI.find("$(COMPONENT)") == std::string::npos) + break; + } + + if (URI.find("$(ARCHITECTURE)") == std::string::npos) + break; + } + } + + return IndexTargets; } /*}}}*/ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const @@ -361,17 +355,6 @@ void debReleaseIndex::PushSectionEntry(string const &Arch, const debSectionEntry ArchEntries[Arch].push_back(Entry); } -void debReleaseIndex::PushSectionEntry(const debSectionEntry *Entry) { - if (Entry->IsSrc == true) - PushSectionEntry("source", Entry); - else { - for (map >::iterator a = ArchEntries.begin(); - a != ArchEntries.end(); ++a) { - a->second.push_back(Entry); - } - } -} - debReleaseIndex::debSectionEntry::debSectionEntry (string const &Section, bool const &IsSrc): Section(Section), IsSrc(IsSrc) {} diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 94d005760..e1c1d91ef 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -47,7 +47,6 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; std::vector * ComputeIndexTargets() const; - std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const; std::string MetaIndexInfo(const char *Type) const; std::string MetaIndexFile(const char *Types) const; @@ -58,12 +57,6 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { #endif std::string LocalFileName() const; - std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const; - std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const; - std::string SourceIndexURI(const char *Type, const std::string &Section) const; - std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const; - std::string TranslationIndexURI(const char *Type, const std::string &Section) const; - std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const; virtual std::vector *GetIndexFiles(); void SetTrusted(bool const Trusted); @@ -71,7 +64,6 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { void PushSectionEntry(std::vector const &Archs, const debSectionEntry *Entry); void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry); - void PushSectionEntry(const debSectionEntry *Entry); }; class APT_HIDDEN debDebFileMetaIndex : public metaIndex diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index f756eab26..50ea2b49e 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -101,8 +101,26 @@ bool pkgInitConfig(Configuration &Cnf) // The default user we drop to in the methods Cnf.CndSet("APT::Sandbox::User", "_apt"); + Cnf.CndSet("APT::Acquire::Targets::deb::Packages::URI", "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages"); + Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatURI", "Packages"); + Cnf.CndSet("APT::Acquire::Targets::deb::Packages::ShortDescription", "Packages"); + Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Description", "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages"); + Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatDescription", "$(SITE) $(RELEASE) Packages"); + Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Optional", false); + Cnf.CndSet("APT::Acquire::Targets::deb::Translations::URI", "$(COMPONENT)/i18n/Translation-$(LANGUAGE)"); + Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatURI", "$(LANGUAGE)"); + Cnf.CndSet("APT::Acquire::Targets::deb::Translations::ShortDescription", "Translation-$(LANGUAGE)"); + Cnf.CndSet("APT::Acquire::Targets::deb::Translations::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)"); + Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatDescription", "$(SITE) $(RELEASE) Translation-$(LANGUAGE)"); + Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::URI", "$(COMPONENT)/source/Sources"); + Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatURI", "Sources"); + Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::ShortDescription", "Sources"); + Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Sources"); + Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatDescription", "$(SITE) $(RELEASE) Sources"); + Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::Optional", false); + bool Res = true; - + // Read an alternate config file const char *Cfg = getenv("APT_CONFIG"); if (Cfg != 0 && strlen(Cfg) != 0) diff --git a/doc/acquire-additional-files.txt b/doc/acquire-additional-files.txt new file mode 100644 index 000000000..5a07c2bec --- /dev/null +++ b/doc/acquire-additional-files.txt @@ -0,0 +1,142 @@ +# Acquire additional files in 'update' operations + +The download and verification of data from multiple sources in different +compression formats, with partial downloads and patches is an involved +process which is hard to implement correctly and securely. + +APT frontends share the code and binaries to make this happen in libapt +with the Acquire system, supported by helpers shipped in the apt package +itself and additional transports in individual packages like +apt-transport-https. + +For its own operation libapt needs or can make use of Packages, Sources +and Translation-* files, which it will acquire by default, but +a repository might contain more data files (e.g. Contents) a frontend +might want to use and would therefore need to be downloaded as well +(e.g. apt-file). + +This file describes the configuration scheme such a frontend can use to +instruct the Acquire system to download those additional files. + +Note that you can't download files from other sources. It must be files +in the same repository and below the Release file. The Release file must +also contain hashes for the file itself as well as for the compressed +file if wanted, otherwise a download isn't even tried! + + +# The Configuration Stanza + +The Acquire system uses the same configuration settings to implement the +files it downloads by default. These settings are the default, but if +they would be written in a configuration file the configuration +instructing the Acquire system to download the Packages files would look +like this (see also apt.conf(5) manpage for configuration file syntax): + + APT::Acquire::Targets::deb::Packages { + URI "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages"; + ShortDescription "Packages"; + Description "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages"; + + flatURI "Packages"; + flatDescription "$(SITE) $(RELEASE) Packages"; + + Optional "false"; + }; + +All files which should be downloaded (nicknamed 'Targets') are mentioned +below the APT::Acquire::Targets scope. 'deb' is here the type of the +sources.list entry the file should be acquired for. The only other +supported value is hence 'deb-src'. Beware: You can't specify multiple +types here and you can't download the same URI for multiple types! + +After the type you can pick any valid and unique string which preferable +refers to the file it downloads (In the example we picked 'Packages'). +This string is never shown or used. + +All targets have three main properties you can define: +* URI: The identifier of the file to be downloaded as used in the + Release file. It is also the relative location of the file from the + Release file. You can neither download from a different server + entirely (absolute URI) nor should you try to access directories above + the Release file (e.g. "../../"). +* ShortDescription: Very short string intended to be displayed to the + user e.g. while reporting progress. apt will e.g. use this string in + the last line to indicate progress of e.g. the download of a specific + item. +* Description: A preferable human understandable and readable identifier + of which file is acquired exactly. Mainly used for progress reporting + and error messages. apt will e.g. use this string in the Get/Hit/Err + progress lines. + +Additional optional properties: +* flat{URI,Description}: APT supports two types of repositories: + dists-style repositories which are the default and by far the most + common which are named after the fact that the files are in an + elaborated directory structure. In contrast a flat-style repositories + lumps all files together in one directory. Support for these flat + repositories exists mainly for legacy purposes only. It is therefore + recommend to not set these values. +* Optional: The default value is 'true' and should be kept at this + value. If enabled the acquire system will skip the download if the + file isn't mentioned in the Release file. Otherwise this is treated as + a hard error and the update process fails. + + +Note that the acquire system will automatically choose to download +a compressed file if it is available and uncompress it for you, just as +it will also use pdiff patching if provided by the repository and +enabled by the user. You only have to ensure that the Release file +contains the information about the compressed files/pdiffs to make this +happen. NO properties have to be set to enable this. + +# More examples + +The stanzas for Translation-* files as well as for Sources files would +look like this: + +APT::Acquire::Targets { + deb::Translations { + URI "$(COMPONENT)/i18n/Translation-$(LANGUAGE)"; + ShortDescription "Translation-$(LANGUAGE)"; + Description "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)"; + + flatURI "$(LANGUAGE)"; + flatDescription "$(SITE) $(RELEASE) Translation-$(LANGUAGE)"; + }; + + deb-src::Sources { + URI "$(COMPONENT)/source/Sources"; + ShortDescription "Sources"; + Description "$(SITE) $(RELEASE)/$(COMPONENT) Sources"; + + flatURI "Sources"; + flatDescription "$(SITE) $(RELEASE) Sources"; + + Optional "false"; + }; +}; + +# Substitution variables + +As seen in the examples, properties can contain placeholders filled in +by the acquire system. The following variables are known; note that +unknown variables have no default value nor are they touched: They are +printed literally. + +* $(SITE): An identifier of the site we access, e.g. + "http://example.org/". +* $(RELEASE): This is usually an archive- or codename, e.g. "stable" or + "stretch". Note that flat-style repositories do not have a archive- + or codename per-se, so the value might very well be just "/" or so. +* $(COMPONENT): as given in the sources.list, e.g. "main", "non-free" or + "universe". Note that flat-style repositories again do not really + have a meaningful value here. +* $(LANGUAGE): Values are all entries (expect "none") of configuration + option Acquire::Languages, e.g. "en", "de" or "de_AT". + +These values are defined both for 'deb' as well as 'deb-src' targets. +'deb' targets additional have the variable: + +* $(ARCHITECTURE): Values are all entries of configuration option + APT::Architectures (potentially modified by sources.list options), + e.g. "amd64", "i386" or "armel". diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files new file mode 100755 index 000000000..150a50980 --- /dev/null +++ b/test/integration/test-apt-acquire-additional-files @@ -0,0 +1,54 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' +configcompression '.' 'gz' + +buildsimplenativepackage 'foo' 'amd64' '1' 'unstable' + +setupaptarchive --no-update +changetowebserver + +testsuccessequal "Get:1 http://localhost:8080 unstable InRelease [$(stat -c%s aptarchive/dists/unstable/InRelease) B] +Get:2 http://localhost:8080 unstable/main Sources [$(stat -c%s aptarchive/dists/unstable/main/source/Sources.gz) B] +Get:3 http://localhost:8080 unstable/main amd64 Packages [$(stat -c%s aptarchive/dists/unstable/main/binary-amd64/Packages.gz) B] +Get:4 http://localhost:8080 unstable/main Translation-en [$(stat -c%s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B] +Reading package lists..." aptget update + +testempty find rootdir/var/lib/apt/lists -name '*Contents*' + +cat > rootdir/etc/apt/apt.conf.d/content-target.conf < rootdir/etc/apt/apt.conf.d/content-target.conf < Date: Tue, 9 Jun 2015 15:15:33 +0200 Subject: replace ULONG_MAX with c++ style std::numeric_limits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason travis seems to be unhappy about it claiming it is not defined. Well, lets not think to deeply about it… Git-Dch: Ignore --- methods/rred.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/methods/rred.cc b/methods/rred.cc index 12cf2b4a5..54123ab9c 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -405,12 +405,12 @@ class Patch { size_t s, e; errno = 0; s = strtoul(buffer, &m, 10); - if (unlikely(m == buffer || s == ULONG_MAX || errno != 0)) + if (unlikely(m == buffer || s == std::numeric_limits::max() || errno != 0)) return _error->Error("Parsing patchfile %s failed: Expected an effected line start", f.Name().c_str()); else if (*m == ',') { ++m; e = strtol(m, &c, 10); - if (unlikely(m == c || e == ULONG_MAX || errno != 0)) + if (unlikely(m == c || e == std::numeric_limits::max() || errno != 0)) return _error->Error("Parsing patchfile %s failed: Expected an effected line end", f.Name().c_str()); if (unlikely(e < s)) return _error->Error("Parsing patchfile %s failed: Effected lines end %lu is before start %lu", f.Name().c_str(), e, s); -- cgit v1.2.3 From 59148d9630bbbd53c6aa10da0fcdbd579797502a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 10 Jun 2015 19:22:41 +0200 Subject: abstract the code to iterate over all targets a bit We have two places in the code which need to iterate over targets and do certain things with it. The first one is actually creating these targets for download and the second instance pepares certain targets for reading. Git-Dch: Ignore --- apt-pkg/deb/debmetaindex.cc | 197 +++++++++++---------- test/integration/framework | 7 +- test/integration/test-apt-acquire-additional-files | 33 ++++ 3 files changed, 142 insertions(+), 95 deletions(-) diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 8fef05ab0..c35f3b0a4 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -90,10 +90,11 @@ debReleaseIndex::~debReleaseIndex() { delete *S; } -vector * debReleaseIndex::ComputeIndexTargets() const +template +void foreachTarget(std::string const URI, std::string const Dist, + std::map > const &ArchEntries, + CallC Call) { - vector * IndexTargets = new vector ; - bool const flatArchive = (Dist[Dist.length() - 1] == '/'); std::string baseURI = URI; if (flatArchive) @@ -108,7 +109,7 @@ vector * debReleaseIndex::ComputeIndexTargets() const std::vector lang = APT::Configuration::getLanguages(true); if (lang.empty()) lang.push_back("none"); - map >::const_iterator const src = ArchEntries.find("source"); + map >::const_iterator const src = ArchEntries.find("source"); if (src != ArchEntries.end()) { std::vector const targets = _config->FindVector("APT::Acquire::Targets::deb-src", "", true); @@ -123,8 +124,8 @@ vector * debReleaseIndex::ComputeIndexTargets() const if (URI.empty()) continue; - vector const SectionEntries = src->second; - for (vector::const_iterator I = SectionEntries.begin(); + vector const SectionEntries = src->second; + for (vector::const_iterator I = SectionEntries.begin(); I != SectionEntries.end(); ++I) { for (vector::const_iterator l = lang.begin(); l != lang.end(); ++l) @@ -139,27 +140,7 @@ vector * debReleaseIndex::ComputeIndexTargets() const { "$(LANGUAGE)", &(*l) }, { NULL, NULL } }; - std::string const name = SubstVar(URI, subst); - IndexTarget * Target; - if (IsOptional == true) - { - Target = new OptionalIndexTarget( - name, - SubstVar(ShortDesc, subst), - SubstVar(LongDesc, subst), - baseURI + name - ); - } - else - { - Target = new IndexTarget( - name, - SubstVar(ShortDesc, subst), - SubstVar(LongDesc, subst), - baseURI + name - ); - } - IndexTargets->push_back(Target); + Call(baseURI, *T, URI, ShortDesc, LongDesc, IsOptional, subst); if (URI.find("$(LANGUAGE)") == std::string::npos) break; @@ -171,10 +152,6 @@ vector * debReleaseIndex::ComputeIndexTargets() const } } - // Only source release - if (IndexTargets->empty() == false && ArchEntries.size() == 1) - return IndexTargets; - std::vector const targets = _config->FindVector("APT::Acquire::Targets::deb", "", true); for (std::vector::const_iterator T = targets.begin(); T != targets.end(); ++T) { @@ -187,13 +164,13 @@ vector * debReleaseIndex::ComputeIndexTargets() const if (URI.empty()) continue; - for (map >::const_iterator a = ArchEntries.begin(); + for (map >::const_iterator a = ArchEntries.begin(); a != ArchEntries.end(); ++a) { if (a->first == "source") continue; - for (vector ::const_iterator I = a->second.begin(); + for (vector ::const_iterator I = a->second.begin(); I != a->second.end(); ++I) { for (vector::const_iterator l = lang.begin(); l != lang.end(); ++l) @@ -209,27 +186,7 @@ vector * debReleaseIndex::ComputeIndexTargets() const { "$(ARCHITECTURE)", &(a->first) }, { NULL, NULL } }; - std::string const name = SubstVar(URI, subst); - IndexTarget * Target; - if (IsOptional == true) - { - Target = new OptionalIndexTarget( - name, - SubstVar(ShortDesc, subst), - SubstVar(LongDesc, subst), - baseURI + name - ); - } - else - { - Target = new IndexTarget( - name, - SubstVar(ShortDesc, subst), - SubstVar(LongDesc, subst), - baseURI + name - ); - } - IndexTargets->push_back(Target); + Call(baseURI, *T, URI, ShortDesc, LongDesc, IsOptional, subst); if (URI.find("$(LANGUAGE)") == std::string::npos) break; @@ -243,9 +200,51 @@ vector * debReleaseIndex::ComputeIndexTargets() const break; } } +} + + +struct ComputeIndexTargetsClass +{ + vector * const IndexTargets; + + void operator()(std::string const &baseURI, std::string const &/*TargetName*/, + std::string const &URI, std::string const &ShortDesc, std::string const &LongDesc, + bool const IsOptional, struct SubstVar const * const subst) + { + std::string const name = SubstVar(URI, subst); + IndexTarget * Target; + if (IsOptional == true) + { + Target = new OptionalIndexTarget( + name, + SubstVar(ShortDesc, subst), + SubstVar(LongDesc, subst), + baseURI + name + ); + } + else + { + Target = new IndexTarget( + name, + SubstVar(ShortDesc, subst), + SubstVar(LongDesc, subst), + baseURI + name + ); + } + IndexTargets->push_back(Target); + } - return IndexTargets; + ComputeIndexTargetsClass() : IndexTargets(new vector ) {} +}; + +vector * debReleaseIndex::ComputeIndexTargets() const +{ + ComputeIndexTargetsClass comp; + foreachTarget(URI, Dist, ArchEntries, comp); + return comp.IndexTargets; } + + /*}}}*/ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const { @@ -303,45 +302,55 @@ bool debReleaseIndex::IsTrusted() const return FileExists(VerifiedSigFile); } -vector *debReleaseIndex::GetIndexFiles() { - if (Indexes != NULL) - return Indexes; - - Indexes = new vector ; - map >::const_iterator const src = ArchEntries.find("source"); - if (src != ArchEntries.end()) { - vector const SectionEntries = src->second; - for (vector::const_iterator I = SectionEntries.begin(); - I != SectionEntries.end(); ++I) - Indexes->push_back(new debSourcesIndex (URI, Dist, (*I)->Section, IsTrusted())); - } - - // Only source release - if (Indexes->empty() == false && ArchEntries.size() == 1) - return Indexes; - - std::vector const lang = APT::Configuration::getLanguages(true); - map > sections; - for (map >::const_iterator a = ArchEntries.begin(); - a != ArchEntries.end(); ++a) { - if (a->first == "source") - continue; - for (vector::const_iterator I = a->second.begin(); - I != a->second.end(); ++I) { - Indexes->push_back(new debPackagesIndex (URI, Dist, (*I)->Section, IsTrusted(), a->first)); - sections[(*I)->Section].insert(lang.begin(), lang.end()); - } - } - - for (map >::const_iterator s = sections.begin(); - s != sections.end(); ++s) - for (set::const_iterator l = s->second.begin(); - l != s->second.end(); ++l) { - if (*l == "none") continue; - Indexes->push_back(new debTranslationsIndex(URI,Dist,s->first,(*l).c_str())); - } - - return Indexes; +struct GetIndexFilesClass +{ + vector * const Indexes; + std::string const URI; + std::string const Release; + bool const IsTrusted; + + void operator()(std::string const &/*baseURI*/, std::string const &TargetName, + std::string const &/*URI*/, std::string const &/*ShortDesc*/, std::string const &/*LongDesc*/, + bool const /*IsOptional*/, struct SubstVar const * const subst) + { + if (TargetName == "Packages") + { + Indexes->push_back(new debPackagesIndex( + URI, + Release, + SubstVar("$(COMPONENT)", subst), + IsTrusted, + SubstVar("$(ARCHITECTURE)", subst) + )); + } + else if (TargetName == "Sources") + Indexes->push_back(new debSourcesIndex( + URI, + Release, + SubstVar("$(COMPONENT)", subst), + IsTrusted + )); + else if (TargetName == "Translations") + Indexes->push_back(new debTranslationsIndex( + URI, + Release, + SubstVar("$(COMPONENT)", subst), + SubstVar("$(LANGUAGE)", subst) + )); + } + + GetIndexFilesClass(std::string const &URI, std::string const &Release, bool const IsTrusted) : + Indexes(new vector ), URI(URI), Release(Release), IsTrusted(IsTrusted) {} +}; + +std::vector *debReleaseIndex::GetIndexFiles() +{ + if (Indexes != NULL) + return Indexes; + + GetIndexFilesClass comp(URI, Dist, IsTrusted()); + foreachTarget(URI, Dist, ArchEntries, comp); + return Indexes = comp.Indexes; } void debReleaseIndex::PushSectionEntry(vector const &Archs, const debSectionEntry *Entry) { diff --git a/test/integration/framework b/test/integration/framework index 56c4a1216..110758e82 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1531,6 +1531,11 @@ aptautotest() { } aptautotest_aptget_update() { + local TESTCALL="$1" + while [ -n "$2" ]; do + if [ "$2" = '--print-uris' ]; then return; fi # simulation mode + shift + done if ! test -d "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists"; then return; fi testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:755" testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:755" @@ -1538,7 +1543,7 @@ aptautotest_aptget_update() { for file in $(find "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" -type f ! -name 'lock'); do testfilestats "$file" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" done - if [ "$1" = 'testsuccess' ]; then + if [ "$TESTCALL" = 'testsuccess' ]; then # failure cases can retain partial files and such testempty find "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/partial" -mindepth 1 ! \( -name 'lock' -o -name '*.FAILED' \) fi diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files index 150a50980..0e59233e9 100755 --- a/test/integration/test-apt-acquire-additional-files +++ b/test/integration/test-apt-acquire-additional-files @@ -6,6 +6,9 @@ TESTDIR=$(readlink -f $(dirname $0)) setupenvironment configarchitecture 'amd64' + +# note that in --print-uri we talk about .bz2 because that is the default. +# This doesn't mean it is actually attempt to download it. configcompression '.' 'gz' buildsimplenativepackage 'foo' 'amd64' '1' 'unstable' @@ -13,6 +16,11 @@ buildsimplenativepackage 'foo' 'amd64' '1' 'unstable' setupaptarchive --no-update changetowebserver +testequal "'http://localhost:8080/dists/unstable/InRelease' localhost:8080_dists_unstable_InRelease 0 +'http://localhost:8080/dists/unstable/main/source/Sources.bz2' localhost:8080_dists_unstable_main_source_Sources 0 +'http://localhost:8080/dists/unstable/main/binary-amd64/Packages.bz2' localhost:8080_dists_unstable_main_binary-amd64_Packages 0 +'http://localhost:8080/dists/unstable/main/i18n/Translation-en.bz2' localhost:8080_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris + testsuccessequal "Get:1 http://localhost:8080 unstable InRelease [$(stat -c%s aptarchive/dists/unstable/InRelease) B] Get:2 http://localhost:8080 unstable/main Sources [$(stat -c%s aptarchive/dists/unstable/main/source/Sources.gz) B] Get:3 http://localhost:8080 unstable/main amd64 Packages [$(stat -c%s aptarchive/dists/unstable/main/binary-amd64/Packages.gz) B] @@ -29,6 +37,12 @@ APT::Acquire::Targets::deb::Contents { }; EOF +testequal "'http://localhost:8080/dists/unstable/InRelease' localhost:8080_dists_unstable_InRelease 0 +'http://localhost:8080/dists/unstable/main/source/Sources.bz2' localhost:8080_dists_unstable_main_source_Sources 0 +'http://localhost:8080/dists/unstable/main/binary-amd64/Packages.bz2' localhost:8080_dists_unstable_main_binary-amd64_Packages 0 +'http://localhost:8080/dists/unstable/main/i18n/Translation-en.bz2' localhost:8080_dists_unstable_main_i18n_Translation-en 0 +'http://localhost:8080/dists/unstable/main/Contents-amd64.bz2' localhost:8080_dists_unstable_main_Contents-amd64 0 " aptget update --print-uris + testsuccessequal "Hit http://localhost:8080 unstable InRelease Get:1 http://localhost:8080 unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] Reading package lists..." aptget update @@ -46,9 +60,28 @@ APT::Acquire::Targets::deb::Contents { }; EOF +# the last line is utter bogus of course, but how should apt know… +testequal "'http://localhost:8080/dists/unstable/InRelease' localhost:8080_dists_unstable_InRelease 0 +'http://localhost:8080/dists/unstable/main/source/Sources.bz2' localhost:8080_dists_unstable_main_source_Sources 0 +'http://localhost:8080/dists/unstable/main/binary-amd64/Packages.bz2' localhost:8080_dists_unstable_main_binary-amd64_Packages 0 +'http://localhost:8080/dists/unstable/main/i18n/Translation-en.bz2' localhost:8080_dists_unstable_main_i18n_Translation-en 0 +'http://localhost:8080/dists/unstable/main/Contents-amd64.gz.bz2' localhost:8080_dists_unstable_main_Contents-amd64.gz 0 " aptget update --print-uris + testsuccessequal "Hit http://localhost:8080 unstable InRelease Get:1 http://localhost:8080 unstable/main amd64 Contents.gz [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] Reading package lists..." aptget update testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' find rootdir/var/lib/apt/lists -name '*Contents*' testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' 'aptarchive/dists/unstable/main/Contents-amd64.gz' + +rm -f rootdir/etc/apt/apt.conf.d/content-target.conf + +testequal "'http://localhost:8080/dists/unstable/InRelease' localhost:8080_dists_unstable_InRelease 0 +'http://localhost:8080/dists/unstable/main/source/Sources.bz2' localhost:8080_dists_unstable_main_source_Sources 0 +'http://localhost:8080/dists/unstable/main/binary-amd64/Packages.bz2' localhost:8080_dists_unstable_main_binary-amd64_Packages 0 +'http://localhost:8080/dists/unstable/main/i18n/Translation-en.bz2' localhost:8080_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris + +testsuccessequal "Hit http://localhost:8080 unstable InRelease +Reading package lists..." aptget update + +testempty find rootdir/var/lib/apt/lists -name '*Contents*' -- cgit v1.2.3 From d3a869e35503638e3483228fbfc95b7143568ad0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 10 Jun 2015 21:24:47 +0200 Subject: store all targets data in IndexTarget struct We still need an API for the targets, so slowly prepare the IndexTargets to let them take this job. Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 15 ++- apt-pkg/acquire-item.h | 31 ++---- apt-pkg/deb/debmetaindex.cc | 114 ++++++++++----------- apt-pkg/init.cc | 12 +-- doc/acquire-additional-files.txt | 29 +++--- test/integration/test-apt-acquire-additional-files | 4 +- 6 files changed, 97 insertions(+), 108 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index a1357fb15..e92ccc08b 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -382,6 +382,15 @@ bool pkgAcqDiffIndex::TransactionState(TransactionStates const state) } /*}}}*/ +// IndexTarget - Constructor /*{{{*/ +IndexTarget::IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, + std::string const &LongDesc, std::string const &URI, bool const IsOptional, + std::map const &Options) : + URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey), IsOptional(IsOptional), Options(Options) +{ +} + /*}}}*/ + class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ /* The sole purpose of this class is having an item which does nothing to reach its done state to prevent cleanup deleting the mentioned file. @@ -955,7 +964,7 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/ if (TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey) == false) { // optional targets that we do not have in the Release file are skipped - if ((*Target)->IsOptional()) + if ((*Target)->IsOptional) continue; Status = StatAuthError; @@ -2388,7 +2397,7 @@ string pkgAcqIndex::Custom600Headers() const if (stat(Final.c_str(),&Buf) == 0) msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); - if(Target->IsOptional()) + if(Target->IsOptional) msg += "\nFail-Ignore: true"; return msg; @@ -2410,7 +2419,7 @@ void pkgAcqIndex::Failed(string const &Message,pkgAcquire::MethodConfig const * } } - if(Target->IsOptional() && GetExpectedHashes().empty() && Stage == STAGE_DOWNLOAD) + if(Target->IsOptional && GetExpectedHashes().empty() && Stage == STAGE_DOWNLOAD) Status = StatDone; else TransactionManager->AbortTransaction(); diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 38a7a8662..a2571e1cd 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -28,6 +28,7 @@ #include #include +#include #ifndef APT_8_CLEANER_HEADERS #include @@ -49,7 +50,7 @@ class pkgSourceList; class IndexTarget; class pkgAcqMetaBase; -class APT_HIDDEN IndexTarget /*{{{*/ +class IndexTarget /*{{{*/ /** \brief Information about an index file. */ { public: @@ -63,30 +64,18 @@ class APT_HIDDEN IndexTarget /*{{{*/ std::string const ShortDesc; /** \brief The key by which this index file should be - * looked up within the meta signature file. - */ + looked up within the meta index file. */ std::string const MetaKey; - virtual bool IsOptional() const { - return false; - } + /** \brief Is it okay if the file isn't found in the meta index */ + bool const IsOptional; - IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, - std::string const &LongDesc, std::string const &URI) : - URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey) {} -}; - /*}}}*/ -class APT_HIDDEN OptionalIndexTarget : public IndexTarget /*{{{*/ -/** \brief Information about an optional index file. */ -{ - public: - virtual bool IsOptional() const { - return true; - } + /** \brief Target specific options defined by the implementation */ + std::map const Options; - OptionalIndexTarget(std::string const &MetaKey, std::string const &ShortDesc, - std::string const &LongDesc, std::string const &URI) : - IndexTarget(MetaKey, ShortDesc, LongDesc, URI) {} + IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, + std::string const &LongDesc, std::string const &URI, bool const IsOptional, + std::map const &Options); }; /*}}}*/ class pkgAcquire::Item : public WeakPointable /*{{{*/ diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index c35f3b0a4..f038f12f5 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -116,12 +116,12 @@ void foreachTarget(std::string const URI, std::string const Dist, for (std::vector::const_iterator T = targets.begin(); T != targets.end(); ++T) { #define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb-src::") + *T + "::" + (X)) - std::string const URI = APT_T_CONFIG(flatArchive ? "flatURI" : "URI"); + std::string const MetaKey = APT_T_CONFIG(flatArchive ? "flatMetaKey" : "MetaKey"); std::string const ShortDesc = APT_T_CONFIG("ShortDescription"); std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb-src::") + *T + "::Optional", true); #undef APT_T_CONFIG - if (URI.empty()) + if (MetaKey.empty()) continue; vector const SectionEntries = src->second; @@ -130,23 +130,24 @@ void foreachTarget(std::string const URI, std::string const Dist, { for (vector::const_iterator l = lang.begin(); l != lang.end(); ++l) { - if (*l == "none" && URI.find("$(LANGUAGE)") != std::string::npos) + if (*l == "none" && MetaKey.find("$(LANGUAGE)") != std::string::npos) continue; - struct SubstVar subst[] = { - { "$(SITE)", &Site }, - { "$(RELEASE)", &Release }, - { "$(COMPONENT)", &((*I)->Section) }, - { "$(LANGUAGE)", &(*l) }, - { NULL, NULL } - }; - Call(baseURI, *T, URI, ShortDesc, LongDesc, IsOptional, subst); - - if (URI.find("$(LANGUAGE)") == std::string::npos) + std::map Options; + Options.insert(std::make_pair("SITE", Site)); + Options.insert(std::make_pair("RELEASE", Release)); + Options.insert(std::make_pair("COMPONENT", (*I)->Section)); + Options.insert(std::make_pair("LANGUAGE", *l)); + Options.insert(std::make_pair("ARCHITECTURE", "source")); + Options.insert(std::make_pair("BASE_URI", baseURI)); + Options.insert(std::make_pair("CREATED_BY", *T)); + Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options); + + if (MetaKey.find("$(LANGUAGE)") == std::string::npos) break; } - if (URI.find("$(COMPONENT)") == std::string::npos) + if (MetaKey.find("$(COMPONENT)") == std::string::npos) break; } } @@ -156,12 +157,12 @@ void foreachTarget(std::string const URI, std::string const Dist, for (std::vector::const_iterator T = targets.begin(); T != targets.end(); ++T) { #define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb::") + *T + "::" + (X)) - std::string const URI = APT_T_CONFIG(flatArchive ? "flatURI" : "URI"); + std::string const MetaKey = APT_T_CONFIG(flatArchive ? "flatMetaKey" : "MetaKey"); std::string const ShortDesc = APT_T_CONFIG("ShortDescription"); std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb::") + *T + "::Optional", true); #undef APT_T_CONFIG - if (URI.empty()) + if (MetaKey.empty()) continue; for (map >::const_iterator a = ArchEntries.begin(); @@ -175,28 +176,28 @@ void foreachTarget(std::string const URI, std::string const Dist, for (vector::const_iterator l = lang.begin(); l != lang.end(); ++l) { - if (*l == "none" && URI.find("$(LANGUAGE)") != std::string::npos) + if (*l == "none" && MetaKey.find("$(LANGUAGE)") != std::string::npos) continue; - struct SubstVar subst[] = { - { "$(SITE)", &Site }, - { "$(RELEASE)", &Release }, - { "$(COMPONENT)", &((*I)->Section) }, - { "$(LANGUAGE)", &(*l) }, - { "$(ARCHITECTURE)", &(a->first) }, - { NULL, NULL } - }; - Call(baseURI, *T, URI, ShortDesc, LongDesc, IsOptional, subst); - - if (URI.find("$(LANGUAGE)") == std::string::npos) + std::map Options; + Options.insert(std::make_pair("SITE", Site)); + Options.insert(std::make_pair("RELEASE", Release)); + Options.insert(std::make_pair("COMPONENT", (*I)->Section)); + Options.insert(std::make_pair("LANGUAGE", *l)); + Options.insert(std::make_pair("ARCHITECTURE", a->first)); + Options.insert(std::make_pair("BASE_URI", baseURI)); + Options.insert(std::make_pair("CREATED_BY", *T)); + Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options); + + if (MetaKey.find("$(LANGUAGE)") == std::string::npos) break; } - if (URI.find("$(COMPONENT)") == std::string::npos) + if (MetaKey.find("$(COMPONENT)") == std::string::npos) break; } - if (URI.find("$(ARCHITECTURE)") == std::string::npos) + if (MetaKey.find("$(ARCHITECTURE)") == std::string::npos) break; } } @@ -207,30 +208,23 @@ struct ComputeIndexTargetsClass { vector * const IndexTargets; - void operator()(std::string const &baseURI, std::string const &/*TargetName*/, - std::string const &URI, std::string const &ShortDesc, std::string const &LongDesc, - bool const IsOptional, struct SubstVar const * const subst) + void operator()(std::string MetaKey, std::string ShortDesc, std::string LongDesc, + bool const IsOptional, std::map Options) { - std::string const name = SubstVar(URI, subst); - IndexTarget * Target; - if (IsOptional == true) - { - Target = new OptionalIndexTarget( - name, - SubstVar(ShortDesc, subst), - SubstVar(LongDesc, subst), - baseURI + name - ); - } - else + for (std::map::const_iterator O = Options.begin(); O != Options.end(); ++O) { - Target = new IndexTarget( - name, - SubstVar(ShortDesc, subst), - SubstVar(LongDesc, subst), - baseURI + name - ); + MetaKey = SubstVar(MetaKey, std::string("$(") + O->first + ")", O->second); + ShortDesc = SubstVar(ShortDesc, std::string("$(") + O->first + ")", O->second); + LongDesc = SubstVar(LongDesc, std::string("$(") + O->first + ")", O->second); } + IndexTarget * Target = new IndexTarget( + MetaKey, + ShortDesc, + LongDesc, + Options.find("BASE_URI")->second + MetaKey, + IsOptional, + Options + ); IndexTargets->push_back(Target); } @@ -256,7 +250,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const // special case for --print-uris vector const * const targets = ComputeIndexTargets(); -#define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X)) +#define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X), false, std::map()) pkgAcqMetaBase * const TransactionManager = new pkgAcqMetaClearSig(Owner, APT_TARGET("InRelease"), APT_TARGET("Release"), APT_TARGET("Release.gpg"), targets, iR); @@ -309,33 +303,33 @@ struct GetIndexFilesClass std::string const Release; bool const IsTrusted; - void operator()(std::string const &/*baseURI*/, std::string const &TargetName, - std::string const &/*URI*/, std::string const &/*ShortDesc*/, std::string const &/*LongDesc*/, - bool const /*IsOptional*/, struct SubstVar const * const subst) + void operator()(std::string const &/*URI*/, std::string const &/*ShortDesc*/, std::string const &/*LongDesc*/, + bool const /*IsOptional*/, std::map Options) { + std::string const TargetName = Options.find("CREATED_BY")->second; if (TargetName == "Packages") { Indexes->push_back(new debPackagesIndex( URI, Release, - SubstVar("$(COMPONENT)", subst), + Options.find("COMPONENT")->second, IsTrusted, - SubstVar("$(ARCHITECTURE)", subst) + Options.find("ARCHITECTURE")->second )); } else if (TargetName == "Sources") Indexes->push_back(new debSourcesIndex( URI, Release, - SubstVar("$(COMPONENT)", subst), + Options.find("COMPONENT")->second, IsTrusted )); else if (TargetName == "Translations") Indexes->push_back(new debTranslationsIndex( URI, Release, - SubstVar("$(COMPONENT)", subst), - SubstVar("$(LANGUAGE)", subst) + Options.find("COMPONENT")->second, + Options.find("LANGUAGE")->second )); } diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 50ea2b49e..e2239a906 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -101,19 +101,19 @@ bool pkgInitConfig(Configuration &Cnf) // The default user we drop to in the methods Cnf.CndSet("APT::Sandbox::User", "_apt"); - Cnf.CndSet("APT::Acquire::Targets::deb::Packages::URI", "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages"); - Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatURI", "Packages"); + Cnf.CndSet("APT::Acquire::Targets::deb::Packages::MetaKey", "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages"); + Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatMetaKey", "Packages"); Cnf.CndSet("APT::Acquire::Targets::deb::Packages::ShortDescription", "Packages"); Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Description", "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages"); Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatDescription", "$(SITE) $(RELEASE) Packages"); Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Optional", false); - Cnf.CndSet("APT::Acquire::Targets::deb::Translations::URI", "$(COMPONENT)/i18n/Translation-$(LANGUAGE)"); - Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatURI", "$(LANGUAGE)"); + Cnf.CndSet("APT::Acquire::Targets::deb::Translations::MetaKey", "$(COMPONENT)/i18n/Translation-$(LANGUAGE)"); + Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatMetaKey", "$(LANGUAGE)"); Cnf.CndSet("APT::Acquire::Targets::deb::Translations::ShortDescription", "Translation-$(LANGUAGE)"); Cnf.CndSet("APT::Acquire::Targets::deb::Translations::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)"); Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatDescription", "$(SITE) $(RELEASE) Translation-$(LANGUAGE)"); - Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::URI", "$(COMPONENT)/source/Sources"); - Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatURI", "Sources"); + Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::MetaKey", "$(COMPONENT)/source/Sources"); + Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatMetaKey", "Sources"); Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::ShortDescription", "Sources"); Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Sources"); Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatDescription", "$(SITE) $(RELEASE) Sources"); diff --git a/doc/acquire-additional-files.txt b/doc/acquire-additional-files.txt index 5a07c2bec..ab833440b 100644 --- a/doc/acquire-additional-files.txt +++ b/doc/acquire-additional-files.txt @@ -33,11 +33,11 @@ instructing the Acquire system to download the Packages files would look like this (see also apt.conf(5) manpage for configuration file syntax): APT::Acquire::Targets::deb::Packages { - URI "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages"; + MetaKey "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages"; ShortDescription "Packages"; Description "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages"; - flatURI "Packages"; + flatMetaKey "Packages"; flatDescription "$(SITE) $(RELEASE) Packages"; Optional "false"; @@ -47,18 +47,18 @@ All files which should be downloaded (nicknamed 'Targets') are mentioned below the APT::Acquire::Targets scope. 'deb' is here the type of the sources.list entry the file should be acquired for. The only other supported value is hence 'deb-src'. Beware: You can't specify multiple -types here and you can't download the same URI for multiple types! +types here and you can't download the same MetaKey form multiple types! After the type you can pick any valid and unique string which preferable refers to the file it downloads (In the example we picked 'Packages'). This string is never shown or used. All targets have three main properties you can define: -* URI: The identifier of the file to be downloaded as used in the +* MetaKey: The identifier of the file to be downloaded as used in the Release file. It is also the relative location of the file from the Release file. You can neither download from a different server - entirely (absolute URI) nor should you try to access directories above - the Release file (e.g. "../../"). + entirely (absolute URI) nor access directories above the Release file + (e.g. "../../"). * ShortDescription: Very short string intended to be displayed to the user e.g. while reporting progress. apt will e.g. use this string in the last line to indicate progress of e.g. the download of a specific @@ -69,7 +69,7 @@ All targets have three main properties you can define: progress lines. Additional optional properties: -* flat{URI,Description}: APT supports two types of repositories: +* flat{MetaKey,Description}: APT supports two types of repositories: dists-style repositories which are the default and by far the most common which are named after the fact that the files are in an elaborated directory structure. In contrast a flat-style repositories @@ -96,20 +96,20 @@ look like this: APT::Acquire::Targets { deb::Translations { - URI "$(COMPONENT)/i18n/Translation-$(LANGUAGE)"; + MetaKey "$(COMPONENT)/i18n/Translation-$(LANGUAGE)"; ShortDescription "Translation-$(LANGUAGE)"; Description "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)"; - flatURI "$(LANGUAGE)"; + flatMetaKey "$(LANGUAGE)"; flatDescription "$(SITE) $(RELEASE) Translation-$(LANGUAGE)"; }; deb-src::Sources { - URI "$(COMPONENT)/source/Sources"; + MetaKey "$(COMPONENT)/source/Sources"; ShortDescription "Sources"; Description "$(SITE) $(RELEASE)/$(COMPONENT) Sources"; - flatURI "Sources"; + flatMetaKey "Sources"; flatDescription "$(SITE) $(RELEASE) Sources"; Optional "false"; @@ -133,10 +133,7 @@ printed literally. have a meaningful value here. * $(LANGUAGE): Values are all entries (expect "none") of configuration option Acquire::Languages, e.g. "en", "de" or "de_AT". - -These values are defined both for 'deb' as well as 'deb-src' targets. -'deb' targets additional have the variable: - * $(ARCHITECTURE): Values are all entries of configuration option APT::Architectures (potentially modified by sources.list options), - e.g. "amd64", "i386" or "armel". + e.g. "amd64", "i386" or "armel" for the 'deb' type. In type 'deb-src' + this variable has the value "source". diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files index 0e59233e9..4a6845f40 100755 --- a/test/integration/test-apt-acquire-additional-files +++ b/test/integration/test-apt-acquire-additional-files @@ -31,7 +31,7 @@ testempty find rootdir/var/lib/apt/lists -name '*Contents*' cat > rootdir/etc/apt/apt.conf.d/content-target.conf < rootdir/etc/apt/apt.conf.d/content-target.conf < Date: Wed, 10 Jun 2015 22:10:48 +0200 Subject: stop using IndexTarget pointers which are never freed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creating and passing around a bunch of pointers of IndexTargets (and of a vector of pointers of IndexTargets) is probably done to avoid the 'costly' copy of container, but we are really not in a timecritical operation here and move semantics will help us even further in the future. On the other hand we never do a proper cleanup of these pointers, which is very dirty, even if structures aren't that big… The changes will effecting many items only effect our own hidden class, so we can do that without fearing breaking interfaces or anything. Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 167 ++++++++++++++++++++++---------------------- apt-pkg/acquire-item.h | 46 ++++++------ apt-pkg/deb/debmetaindex.cc | 16 ++--- apt-pkg/deb/debmetaindex.h | 2 +- 4 files changed, 113 insertions(+), 118 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index e92ccc08b..05ea9c069 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -191,7 +191,7 @@ HashStringList pkgAcqIndexMergeDiffs::GetExpectedHashes() const if (State == StateFetchDiff) return patch.download_hashes; else if (State == StateApplyDiff) - return GetExpectedHashesFor(Target->MetaKey); + return GetExpectedHashesFor(Target.MetaKey); return HashStringList(); } @@ -266,20 +266,20 @@ std::string pkgAcqDiffIndex::GetFinalFilename() const } std::string pkgAcqIndex::GetFinalFilename() const { - std::string const FinalFile = GetFinalFileNameFromURI(Target->URI); - return GetCompressedFileName(Target->URI, FinalFile, CurrentCompressionExtension); + std::string const FinalFile = GetFinalFileNameFromURI(Target.URI); + return GetCompressedFileName(Target.URI, FinalFile, CurrentCompressionExtension); } std::string pkgAcqMetaSig::GetFinalFilename() const { - return GetFinalFileNameFromURI(Target->URI); + return GetFinalFileNameFromURI(Target.URI); } std::string pkgAcqBaseIndex::GetFinalFilename() const { - return GetFinalFileNameFromURI(Target->URI); + return GetFinalFileNameFromURI(Target.URI); } std::string pkgAcqMetaBase::GetFinalFilename() const { - return GetFinalFileNameFromURI(DataTarget.URI); + return GetFinalFileNameFromURI(Target.URI); } std::string pkgAcqArchive::GetFinalFilename() const { @@ -289,17 +289,17 @@ std::string pkgAcqArchive::GetFinalFilename() const // pkgAcqTransactionItem::GetMetaKey and specialisations for child classes /*{{{*/ std::string pkgAcqTransactionItem::GetMetaKey() const { - return Target->MetaKey; + return Target.MetaKey; } std::string pkgAcqIndex::GetMetaKey() const { if (Stage == STAGE_DECOMPRESS_AND_VERIFY || CurrentCompressionExtension == "uncompressed") - return Target->MetaKey; - return Target->MetaKey + "." + CurrentCompressionExtension; + return Target.MetaKey; + return Target.MetaKey + "." + CurrentCompressionExtension; } std::string pkgAcqDiffIndex::GetMetaKey() const { - return Target->MetaKey + ".diff/Index"; + return Target.MetaKey + ".diff/Index"; } /*}}}*/ //pkgAcqTransactionItem::TransactionState and specialisations for child classes /*{{{*/ @@ -373,7 +373,7 @@ bool pkgAcqDiffIndex::TransactionState(TransactionStates const state) case TransactionCommit: break; case TransactionAbort: - std::string const Partial = GetPartialFileNameFromURI(Target->URI); + std::string const Partial = GetPartialFileNameFromURI(Target.URI); unlink(Partial.c_str()); break; } @@ -396,16 +396,16 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ reach its done state to prevent cleanup deleting the mentioned file. Handy in cases in which we know we have the file already, like IMS-Hits. */ { - IndexTarget const * const Target; + IndexTarget const Target; public: - virtual std::string DescURI() const {return Target->URI;}; + virtual std::string DescURI() const {return Target.URI;}; virtual HashStringList GetExpectedHashes() const {return HashStringList();}; - NoActionItem(pkgAcquire * const Owner, IndexTarget const * const Target) : + NoActionItem(pkgAcquire * const Owner, IndexTarget const Target) : pkgAcquire::Item(Owner), Target(Target) { Status = StatDone; - DestFile = GetFinalFileNameFromURI(Target->URI); + DestFile = GetFinalFileNameFromURI(Target.URI); } }; /*}}}*/ @@ -669,7 +669,7 @@ std::string pkgAcquire::Item::HashSum() const /*{{{*/ /*}}}*/ pkgAcqTransactionItem::pkgAcqTransactionItem(pkgAcquire * const Owner, /*{{{*/ - pkgAcqMetaBase * const TransactionManager, IndexTarget const * const Target) : + pkgAcqMetaBase * const TransactionManager, IndexTarget const Target) : pkgAcquire::Item(Owner), Target(Target), TransactionManager(TransactionManager) { if (TransactionManager != this) @@ -689,10 +689,10 @@ HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const Met // AcqMetaBase - Constructor /*{{{*/ pkgAcqMetaBase::pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - std::vector const * const IndexTargets, + std::vector const IndexTargets, IndexTarget const &DataTarget, indexRecords * const MetaIndexParser) -: pkgAcqTransactionItem(Owner, TransactionManager, NULL), DataTarget(DataTarget), +: pkgAcqTransactionItem(Owner, TransactionManager, DataTarget), MetaIndexParser(MetaIndexParser), LastMetaIndexParser(NULL), IndexTargets(IndexTargets), AuthPass(false), IMSHit(false) { @@ -953,31 +953,30 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/ // at this point the real Items are loaded in the fetcher ExpectedAdditionalItems = 0; - vector ::const_iterator Target; - for (Target = IndexTargets->begin(); - Target != IndexTargets->end(); + for (std::vector ::const_iterator Target = IndexTargets.begin(); + Target != IndexTargets.end(); ++Target) { bool trypdiff = _config->FindB("Acquire::PDiffs", true); if (verify == true) { - if (TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey) == false) + if (TransactionManager->MetaIndexParser->Exists(Target->MetaKey) == false) { // optional targets that we do not have in the Release file are skipped - if ((*Target)->IsOptional) + if (Target->IsOptional) continue; Status = StatAuthError; - strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str()); + strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), Target->MetaKey.c_str()); return; } - if (RealFileExists(GetFinalFileNameFromURI((*Target)->URI))) + if (RealFileExists(GetFinalFileNameFromURI(Target->URI))) { if (TransactionManager->LastMetaIndexParser != NULL) { - HashStringList const newFile = GetExpectedHashesFromFor(TransactionManager->MetaIndexParser, (*Target)->MetaKey); - HashStringList const oldFile = GetExpectedHashesFromFor(TransactionManager->LastMetaIndexParser, (*Target)->MetaKey); + HashStringList const newFile = GetExpectedHashesFromFor(TransactionManager->MetaIndexParser, Target->MetaKey); + HashStringList const oldFile = GetExpectedHashesFromFor(TransactionManager->LastMetaIndexParser, Target->MetaKey); if (newFile == oldFile) { // we have the file already, no point in trying to acquire it again @@ -990,15 +989,15 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/ trypdiff = false; // no file to patch // check if we have patches available - trypdiff &= TransactionManager->MetaIndexParser->Exists((*Target)->MetaKey + ".diff/Index"); + trypdiff &= TransactionManager->MetaIndexParser->Exists(Target->MetaKey + ".diff/Index"); } // if we have no file to patch, no point in trying - trypdiff &= RealFileExists(GetFinalFileNameFromURI((*Target)->URI)); + trypdiff &= RealFileExists(GetFinalFileNameFromURI(Target->URI)); // no point in patching from local sources if (trypdiff) { - std::string const proto = (*Target)->URI.substr(0, strlen("file:/")); + std::string const proto = Target->URI.substr(0, strlen("file:/")); if (proto == "file:/" || proto == "copy:/" || proto == "cdrom:") trypdiff = false; } @@ -1060,7 +1059,7 @@ bool pkgAcqMetaBase::VerifyVendor(string const &Message) /*{{{*/ // the download progress display (e.g. 7d 3h 42min 1s) _("Release file for %s is expired (invalid since %s). " "Updates for this repository will not be applied."), - DataTarget.URI.c_str(), TimeToStr(invalid_since).c_str()); + Target.URI.c_str(), TimeToStr(invalid_since).c_str()); if (ErrorText.empty()) ErrorText = errmsg; return _error->Error("%s", errmsg.c_str()); @@ -1111,14 +1110,14 @@ bool pkgAcqMetaBase::VerifyVendor(string const &Message) /*{{{*/ pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/ IndexTarget const &ClearsignedTarget, IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget, - const vector* const IndexTargets, + std::vector const IndexTargets, indexRecords * const MetaIndexParser) : pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets, MetaIndexParser), ClearsignedTarget(ClearsignedTarget), DetachedDataTarget(DetachedDataTarget), DetachedSigTarget(DetachedSigTarget) { // index targets + (worst case:) Release/Release.gpg - ExpectedAdditionalItems = IndexTargets->size() + 2; + ExpectedAdditionalItems = IndexTargets.size() + 2; TransactionManager->Add(this); } /*}}}*/ @@ -1167,8 +1166,8 @@ void pkgAcqMetaClearSig::Done(std::string const &Message, // We got an InRelease file IMSHit, but we haven't one, which means // we had a valid Release/Release.gpg combo stepping in, which we have // to 'acquire' now to ensure list cleanup isn't removing them - new NoActionItem(Owner, &DetachedDataTarget); - new NoActionItem(Owner, &DetachedSigTarget); + new NoActionItem(Owner, DetachedDataTarget); + new NoActionItem(Owner, DetachedSigTarget); } } } @@ -1251,7 +1250,7 @@ pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire * const Owner, /*{{{*/ pkgAcqMetaBase * const TransactionManager, IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget, - vector const * const IndexTargets, + vector const IndexTargets, indexRecords * const MetaIndexParser) : pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser), DetachedSigTarget(DetachedSigTarget) @@ -1269,7 +1268,7 @@ pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire * const Owner, /*{{{*/ Desc.URI = DataTarget.URI; // we expect more item - ExpectedAdditionalItems = IndexTargets->size(); + ExpectedAdditionalItems = IndexTargets.size(); QueueURI(Desc); } /*}}}*/ @@ -1284,7 +1283,7 @@ void pkgAcqMetaIndex::Done(string const &Message, /*{{{*/ // we have a Release file, now download the Signature, all further // verify/queue for additional downloads will be done in the // pkgAcqMetaSig::Done() code - new pkgAcqMetaSig(Owner, TransactionManager, &DetachedSigTarget, this); + new pkgAcqMetaSig(Owner, TransactionManager, DetachedSigTarget, this); } } /*}}}*/ @@ -1297,7 +1296,7 @@ void pkgAcqMetaIndex::Failed(string const &Message, _error->Warning(_("The repository '%s' does not have a Release file. " "This is deprecated, please contact the owner of the " - "repository."), DataTarget.Description.c_str()); + "repository."), Target.Description.c_str()); // No Release file was present so fall // back to queueing Packages files without verification @@ -1325,18 +1324,18 @@ void pkgAcqMetaIndex::Finished() /*{{{*/ /*}}}*/ std::string pkgAcqMetaIndex::DescURI() const /*{{{*/ { - return DataTarget.URI; + return Target.URI; } /*}}}*/ // AcqMetaSig::AcqMetaSig - Constructor /*{{{*/ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target, + IndexTarget const Target, pkgAcqMetaIndex * const MetaIndex) : pkgAcqTransactionItem(Owner, TransactionManager, Target), MetaIndex(MetaIndex) { - DestFile = GetPartialFileNameFromURI(Target->URI); + DestFile = GetPartialFileNameFromURI(Target.URI); // remove any partial downloaded sig-file in partial/. // it may confuse proxies and is too small to warrant a @@ -1349,10 +1348,10 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner, << TransactionManager << std::endl; // Create the item - Desc.Description = Target->Description; + Desc.Description = Target.Description; Desc.Owner = this; - Desc.ShortDesc = Target->ShortDesc; - Desc.URI = Target->URI; + Desc.ShortDesc = Target.ShortDesc; + Desc.URI = Target.URI; // If we got a hit for Release, we will get one for Release.gpg too (or obscure errors), // so we skip the download step and go instantly to verification @@ -1420,7 +1419,7 @@ void pkgAcqMetaSig::Failed(string const &Message,pkgAcquire::MethodConfig const { std::string downgrade_msg; strprintf(downgrade_msg, _("The repository '%s' is no longer signed."), - MetaIndex->DataTarget.Description.c_str()); + MetaIndex->Target.Description.c_str()); if(_config->FindB("Acquire::AllowDowngradeToInsecureRepositories")) { // meh, the users wants to take risks (we still mark the packages @@ -1442,7 +1441,7 @@ void pkgAcqMetaSig::Failed(string const &Message,pkgAcquire::MethodConfig const else _error->Warning(_("The data from '%s' is not signed. Packages " "from that repository can not be authenticated."), - MetaIndex->DataTarget.Description.c_str()); + MetaIndex->Target.Description.c_str()); // ensures that a Release.gpg file in the lists/ is removed by the transaction TransactionManager->TransactionStageRemoval(this, DestFile); @@ -1495,7 +1494,7 @@ void pkgAcqMetaSig::Failed(string const &Message,pkgAcquire::MethodConfig const // AcqBaseIndex - Constructor /*{{{*/ pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target) + IndexTarget const Target) : pkgAcqTransactionItem(Owner, TransactionManager, Target) { } @@ -1510,15 +1509,15 @@ pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner, */ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target) + IndexTarget const Target) : pkgAcqBaseIndex(Owner, TransactionManager, Target) { Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); Desc.Owner = this; - Desc.Description = Target->Description + ".diff/Index"; - Desc.ShortDesc = Target->ShortDesc; - Desc.URI = Target->URI + ".diff/Index"; + Desc.Description = Target.Description + ".diff/Index"; + Desc.ShortDesc = Target.ShortDesc; + Desc.URI = Target.URI + ".diff/Index"; DestFile = GetPartialFileNameFromURI(Desc.URI); @@ -1599,8 +1598,8 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ return false; } - std::string const CurrentPackagesFile = GetFinalFileNameFromURI(Target->URI); - HashStringList const TargetFileHashes = GetExpectedHashesFor(Target->MetaKey); + std::string const CurrentPackagesFile = GetFinalFileNameFromURI(Target.URI); + HashStringList const TargetFileHashes = GetExpectedHashesFor(Target.MetaKey); if (TargetFileHashes.usable() == false || ServerHashes != TargetFileHashes) { if (Debug == true) @@ -1614,7 +1613,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ HashStringList LocalHashes; // try avoiding calculating the hash here as this is costly if (TransactionManager->LastMetaIndexParser != NULL) - LocalHashes = GetExpectedHashesFromFor(TransactionManager->LastMetaIndexParser, Target->MetaKey); + LocalHashes = GetExpectedHashesFromFor(TransactionManager->LastMetaIndexParser, Target.MetaKey); if (LocalHashes.usable() == false) { FileFd fd(CurrentPackagesFile, FileFd::ReadOnly); @@ -1910,29 +1909,29 @@ void pkgAcqDiffIndex::Done(string const &Message,HashStringList const &Hashes, / */ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target, + IndexTarget const Target, vector const &diffs) : pkgAcqBaseIndex(Owner, TransactionManager, Target), available_patches(diffs) { - DestFile = GetPartialFileNameFromURI(Target->URI); + DestFile = GetPartialFileNameFromURI(Target.URI); Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); Desc.Owner = this; - Description = Target->Description; - Desc.ShortDesc = Target->ShortDesc; + Description = Target.Description; + Desc.ShortDesc = Target.ShortDesc; if(available_patches.empty() == true) { // we are done (yeah!), check hashes against the final file - DestFile = GetFinalFileNameFromURI(Target->URI); + DestFile = GetFinalFileNameFromURI(Target.URI); Finish(true); } else { // patching needs to be bootstrapped with the 'old' version - std::string const PartialFile = GetPartialFileNameFromURI(Target->URI); + std::string const PartialFile = GetPartialFileNameFromURI(Target.URI); if (RealFileExists(PartialFile) == false) { if (symlink(GetFinalFilename().c_str(), PartialFile.c_str()) != 0) @@ -1956,7 +1955,7 @@ void pkgAcqIndexDiffs::Failed(string const &Message,pkgAcquire::MethodConfig con if(Debug) std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << " with " << Message << std::endl << "Falling back to normal index file acquire" << std::endl; - DestFile = GetPartialFileNameFromURI(Target->URI); + DestFile = GetPartialFileNameFromURI(Target.URI); RenameOnError(PDiffError); std::string const patchname = GetDiffsPatchFileName(DestFile); if (RealFileExists(patchname)) @@ -1999,7 +1998,7 @@ void pkgAcqIndexDiffs::Finish(bool allDone) bool pkgAcqIndexDiffs::QueueNextDiff() /*{{{*/ { // calc sha1 of the just patched file - std::string const FinalFile = GetPartialFileNameFromURI(Target->URI); + std::string const FinalFile = GetPartialFileNameFromURI(Target.URI); if(!FileExists(FinalFile)) { @@ -2015,7 +2014,7 @@ bool pkgAcqIndexDiffs::QueueNextDiff() /*{{{*/ if(Debug) std::clog << "QueueNextDiff: " << FinalFile << " (" << LocalHashes.find(NULL)->toStr() << ")" << std::endl; - HashStringList const TargetFileHashes = GetExpectedHashesFor(Target->MetaKey); + HashStringList const TargetFileHashes = GetExpectedHashesFor(Target.MetaKey); if (unlikely(LocalHashes.usable() == false || TargetFileHashes.usable() == false)) { Failed("Local/Expected hashes are not usable", NULL); @@ -2049,9 +2048,9 @@ bool pkgAcqIndexDiffs::QueueNextDiff() /*{{{*/ } // queue the right diff - Desc.URI = Target->URI + ".diff/" + available_patches[0].file + ".gz"; + Desc.URI = Target.URI + ".diff/" + available_patches[0].file + ".gz"; Desc.Description = Description + " " + available_patches[0].file + string(".pdiff"); - DestFile = GetPartialFileNameFromURI(Target->URI + ".diff/" + available_patches[0].file); + DestFile = GetPartialFileNameFromURI(Target.URI + ".diff/" + available_patches[0].file); if(Debug) std::clog << "pkgAcqIndexDiffs::QueueNextDiff(): " << Desc.URI << std::endl; @@ -2069,7 +2068,7 @@ void pkgAcqIndexDiffs::Done(string const &Message, HashStringList const &Hashes, Item::Done(Message, Hashes, Cnf); - std::string const FinalFile = GetPartialFileNameFromURI(Target->URI); + std::string const FinalFile = GetPartialFileNameFromURI(Target.URI); std::string const PatchFile = GetDiffsPatchFileName(FinalFile); // success in downloading a diff, enter ApplyDiff state @@ -2132,7 +2131,7 @@ std::string pkgAcqIndexDiffs::Custom600Headers() const /*{{{*/ // AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor /*{{{*/ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target, + IndexTarget const Target, DiffInfo const &patch, std::vector const * const allPatches) : pkgAcqBaseIndex(Owner, TransactionManager, Target), @@ -2141,13 +2140,13 @@ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); Desc.Owner = this; - Description = Target->Description; - Desc.ShortDesc = Target->ShortDesc; + Description = Target.Description; + Desc.ShortDesc = Target.ShortDesc; - Desc.URI = Target->URI + ".diff/" + patch.file + ".gz"; + Desc.URI = Target.URI + ".diff/" + patch.file + ".gz"; Desc.Description = Description + " " + patch.file + string(".pdiff"); - DestFile = GetPartialFileNameFromURI(Target->URI + ".diff/" + patch.file); + DestFile = GetPartialFileNameFromURI(Target.URI + ".diff/" + patch.file); if(Debug) std::clog << "pkgAcqIndexMergeDiffs: " << Desc.URI << std::endl; @@ -2174,7 +2173,7 @@ void pkgAcqIndexMergeDiffs::Failed(string const &Message,pkgAcquire::MethodConfi State = StateErrorDiff; if (Debug) std::clog << "Falling back to normal index file acquire" << std::endl; - DestFile = GetPartialFileNameFromURI(Target->URI); + DestFile = GetPartialFileNameFromURI(Target.URI); RenameOnError(PDiffError); std::string const patchname = GetMergeDiffsPatchFileName(DestFile, patch.file); if (RealFileExists(patchname)) @@ -2190,7 +2189,7 @@ void pkgAcqIndexMergeDiffs::Done(string const &Message, HashStringList const &Ha Item::Done(Message, Hashes, Cnf); - string const FinalFile = GetPartialFileNameFromURI(Target->URI); + string const FinalFile = GetPartialFileNameFromURI(Target.URI); if (State == StateFetchDiff) { Rename(DestFile, GetMergeDiffsPatchFileName(FinalFile, patch.file)); @@ -2241,7 +2240,7 @@ void pkgAcqIndexMergeDiffs::Done(string const &Message, HashStringList const &Ha for (std::vector::const_iterator I = allPatches->begin(); I != allPatches->end(); ++I) { - std::string const PartialFile = GetPartialFileNameFromURI(Target->URI); + std::string const PartialFile = GetPartialFileNameFromURI(Target.URI); std::string const patch = GetMergeDiffsPatchFileName(PartialFile, (*I)->patch.file); unlink(patch.c_str()); } @@ -2276,12 +2275,12 @@ std::string pkgAcqIndexMergeDiffs::Custom600Headers() const /*{{{*/ // AcqIndex::AcqIndex - Constructor /*{{{*/ pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target) + IndexTarget const Target) : pkgAcqBaseIndex(Owner, TransactionManager, Target) { // autoselect the compression method AutoSelectCompression(); - Init(Target->URI, Target->Description, Target->ShortDesc); + Init(Target.URI, Target.Description, Target.ShortDesc); if(_config->FindB("Debug::Acquire::Transaction", false) == true) std::clog << "New pkgIndex with TransactionManager " @@ -2293,12 +2292,12 @@ void pkgAcqIndex::AutoSelectCompression() { std::vector types = APT::Configuration::getCompressionTypes(); CompressionExtensions = ""; - if (TransactionManager->MetaIndexParser != NULL && TransactionManager->MetaIndexParser->Exists(Target->MetaKey)) + if (TransactionManager->MetaIndexParser != NULL && TransactionManager->MetaIndexParser->Exists(Target.MetaKey)) { for (std::vector::const_iterator t = types.begin(); t != types.end(); ++t) { - std::string CompressedMetaKey = string(Target->MetaKey).append(".").append(*t); + std::string CompressedMetaKey = string(Target.MetaKey).append(".").append(*t); if (*t == "uncompressed" || TransactionManager->MetaIndexParser->Exists(CompressedMetaKey) == true) CompressionExtensions.append(*t).append(" "); @@ -2397,7 +2396,7 @@ string pkgAcqIndex::Custom600Headers() const if (stat(Final.c_str(),&Buf) == 0) msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); - if(Target->IsOptional) + if(Target.IsOptional) msg += "\nFail-Ignore: true"; return msg; @@ -2413,13 +2412,13 @@ void pkgAcqIndex::Failed(string const &Message,pkgAcquire::MethodConfig const * { if (CompressionExtensions.empty() == false) { - Init(Target->URI, Desc.Description, Desc.ShortDesc); + Init(Target.URI, Desc.Description, Desc.ShortDesc); Status = StatIdle; return; } } - if(Target->IsOptional && GetExpectedHashes().empty() && Stage == STAGE_DOWNLOAD) + if(Target.IsOptional && GetExpectedHashes().empty() && Stage == STAGE_DOWNLOAD) Status = StatDone; else TransactionManager->AbortTransaction(); @@ -2430,7 +2429,7 @@ void pkgAcqIndex::ReverifyAfterIMS() { // update destfile to *not* include the compression extension when doing // a reverify (as its uncompressed on disk already) - DestFile = GetCompressedFileName(Target->URI, GetPartialFileNameFromURI(Target->URI), CurrentCompressionExtension); + DestFile = GetCompressedFileName(Target.URI, GetPartialFileNameFromURI(Target.URI), CurrentCompressionExtension); // copy FinalFile into partial/ so that we check the hash again string FinalFile = GetFinalFilename(); @@ -2509,7 +2508,7 @@ void pkgAcqIndex::StageDownloadDone(string const &Message, HashStringList const // If we have compressed indexes enabled, queue for hash verification if (_config->FindB("Acquire::GzipIndexes",false)) { - DestFile = GetPartialFileNameFromURI(Target->URI + '.' + CurrentCompressionExtension); + DestFile = GetPartialFileNameFromURI(Target.URI + '.' + CurrentCompressionExtension); EraseFileName = ""; Stage = STAGE_DECOMPRESS_AND_VERIFY; Desc.URI = "copy:" + FileName; diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index a2571e1cd..790d1f3d8 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -55,23 +55,23 @@ class IndexTarget /*{{{*/ { public: /** \brief A URI from which the index file can be downloaded. */ - std::string const URI; + std::string URI; /** \brief A description of the index file. */ - std::string const Description; + std::string Description; /** \brief A shorter description of the index file. */ - std::string const ShortDesc; + std::string ShortDesc; /** \brief The key by which this index file should be looked up within the meta index file. */ - std::string const MetaKey; + std::string MetaKey; /** \brief Is it okay if the file isn't found in the meta index */ - bool const IsOptional; + bool IsOptional; /** \brief Target specific options defined by the implementation */ - std::map const Options; + std::map Options; IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, std::string const &LongDesc, std::string const &URI, bool const IsOptional, @@ -374,7 +374,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ /** \brief baseclass for the indexes files to manage them all together */ { protected: - IndexTarget const * const Target; + IndexTarget const Target; HashStringList GetExpectedHashesFor(std::string const MetaKey) const; bool QueueURI(pkgAcquire::ItemDesc &Item); @@ -392,13 +392,13 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ }; virtual bool TransactionState(TransactionStates const state); - virtual std::string DescURI() const { return Target->URI; } + virtual std::string DescURI() const { return Target.URI; } virtual HashStringList GetExpectedHashes() const; virtual std::string GetMetaKey() const; virtual bool HashesRequired() const; - pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const * const Target); + pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target); virtual ~pkgAcqTransactionItem(); friend class pkgAcqMetaBase; @@ -412,7 +412,6 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ protected: std::vector Transaction; - IndexTarget const DataTarget; public: /** \brief A package-system-specific parser for the meta-index file. */ indexRecords *MetaIndexParser; @@ -422,7 +421,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ /** \brief The index files which should be looked up in the meta-index * and then downloaded. */ - const std::vector* const IndexTargets; + std::vector const IndexTargets; /** \brief If \b true, the index's signature is currently being verified. */ @@ -504,7 +503,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ virtual std::string GetFinalFilename() const; pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - std::vector const * const IndexTargets, + std::vector const IndexTargets, IndexTarget const &DataTarget, indexRecords* const MetaIndexParser); }; @@ -541,7 +540,7 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase /** \brief Create a new pkgAcqMetaIndex. */ pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget, - const std::vector* const IndexTargets, indexRecords * const MetaIndexParser); + std::vector const IndexTargets, indexRecords * const MetaIndexParser); friend class pkgAcqMetaSig; }; @@ -577,7 +576,7 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem pkgAcquire::MethodConfig const * const Cnf); /** \brief Create a new pkgAcqMetaSig. */ - pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const * const Target, + pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target, pkgAcqMetaIndex * const MetaIndex); virtual ~pkgAcqMetaSig(); }; @@ -602,7 +601,7 @@ public: IndexTarget const &ClearsignedTarget, IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget, - std::vector const * const IndexTargets, + std::vector const IndexTargets, indexRecords * const MetaIndexParser); virtual ~pkgAcqMetaClearSig(); }; @@ -617,7 +616,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem virtual std::string GetFinalFilename() const; pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target); + IndexTarget const Target); }; /*}}}*/ /** \brief An item that is responsible for fetching an index file of {{{ @@ -653,7 +652,7 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex virtual void Failed(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf); virtual void Done(std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const Cnf); - virtual std::string DescURI() const {return Target->URI + "Index";}; + virtual std::string DescURI() const {return Target.URI + "Index";}; virtual std::string Custom600Headers() const; virtual std::string GetMetaKey() const; @@ -680,7 +679,7 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex * \param ShortDesc A short description of the list file to download. */ pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target); + IndexTarget const Target); private: APT_HIDDEN void QueueOnIMSHit() const; }; @@ -756,7 +755,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex virtual void Done(std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const Cnf); virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return Target->URI + "Index";}; + virtual std::string DescURI() const {return Target.URI + "Index";}; virtual HashStringList GetExpectedHashes() const; virtual bool HashesRequired() const; @@ -778,8 +777,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex * check if it was the last one to complete the download step */ pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target, - DiffInfo const &patch, + IndexTarget const Target, DiffInfo const &patch, std::vector const * const allPatches); }; /*}}}*/ @@ -869,7 +867,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex virtual void Done(std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const Cnf); virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return Target->URI + "IndexDiffs";}; + virtual std::string DescURI() const {return Target.URI + "IndexDiffs";}; virtual HashStringList GetExpectedHashes() const; virtual bool HashesRequired() const; @@ -892,7 +890,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex * that depends on it. */ pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target, + IndexTarget const Target, std::vector const &diffs=std::vector()); }; /*}}}*/ @@ -969,7 +967,7 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex virtual std::string GetMetaKey() const; pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const * const Target); + IndexTarget const Target); void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc); diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index f038f12f5..44d66a725 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -93,7 +93,7 @@ debReleaseIndex::~debReleaseIndex() { template void foreachTarget(std::string const URI, std::string const Dist, std::map > const &ArchEntries, - CallC Call) + CallC &Call) { bool const flatArchive = (Dist[Dist.length() - 1] == '/'); std::string baseURI = URI; @@ -206,7 +206,7 @@ void foreachTarget(std::string const URI, std::string const Dist, struct ComputeIndexTargetsClass { - vector * const IndexTargets; + vector IndexTargets; void operator()(std::string MetaKey, std::string ShortDesc, std::string LongDesc, bool const IsOptional, std::map Options) @@ -217,7 +217,7 @@ struct ComputeIndexTargetsClass ShortDesc = SubstVar(ShortDesc, std::string("$(") + O->first + ")", O->second); LongDesc = SubstVar(LongDesc, std::string("$(") + O->first + ")", O->second); } - IndexTarget * Target = new IndexTarget( + IndexTarget Target( MetaKey, ShortDesc, LongDesc, @@ -225,13 +225,11 @@ struct ComputeIndexTargetsClass IsOptional, Options ); - IndexTargets->push_back(Target); + IndexTargets.push_back(Target); } - - ComputeIndexTargetsClass() : IndexTargets(new vector ) {} }; -vector * debReleaseIndex::ComputeIndexTargets() const +std::vector debReleaseIndex::ComputeIndexTargets() const { ComputeIndexTargetsClass comp; foreachTarget(URI, Dist, ArchEntries, comp); @@ -249,7 +247,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const iR->SetTrusted(false); // special case for --print-uris - vector const * const targets = ComputeIndexTargets(); + std::vector const targets = ComputeIndexTargets(); #define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X), false, std::map()) pkgAcqMetaBase * const TransactionManager = new pkgAcqMetaClearSig(Owner, APT_TARGET("InRelease"), APT_TARGET("Release"), APT_TARGET("Release.gpg"), @@ -257,7 +255,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const #undef APT_TARGET if (GetAll) { - for (vector ::const_iterator Target = targets->begin(); Target != targets->end(); ++Target) + for (std::vector::const_iterator Target = targets.begin(); Target != targets.end(); ++Target) new pkgAcqIndex(Owner, TransactionManager, *Target); } diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index e1c1d91ef..4e630cf5d 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -46,7 +46,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; - std::vector * ComputeIndexTargets() const; + std::vector ComputeIndexTargets() const; std::string MetaIndexInfo(const char *Type) const; std::string MetaIndexFile(const char *Types) const; -- cgit v1.2.3 From 261727f05ca7ff7d9d6d9b8927cb5c6ad293ebce Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 10 Jun 2015 23:53:36 +0200 Subject: rename Calculate- to GetIndexTargets and use it as official API We need a general way to get from a sources.list entry to IndexTargets and with this change we can move from pkgSourceList over the list of metaIndexes it includes to the IndexTargets each metaIndex can have. Git-Dch: Ignore --- apt-pkg/deb/debmetaindex.cc | 37 +++++++++++++++---------------------- apt-pkg/deb/debmetaindex.h | 5 ++++- apt-pkg/metaindex.h | 6 ++---- 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 44d66a725..e1f86d20f 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -229,7 +229,7 @@ struct ComputeIndexTargetsClass } }; -std::vector debReleaseIndex::ComputeIndexTargets() const +std::vector debReleaseIndex::GetIndexTargets() const { ComputeIndexTargetsClass comp; foreachTarget(URI, Dist, ArchEntries, comp); @@ -247,7 +247,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const iR->SetTrusted(false); // special case for --print-uris - std::vector const targets = ComputeIndexTargets(); + std::vector const targets = GetIndexTargets(); #define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X), false, std::map()) pkgAcqMetaBase * const TransactionManager = new pkgAcqMetaClearSig(Owner, APT_TARGET("InRelease"), APT_TARGET("Release"), APT_TARGET("Release.gpg"), @@ -396,6 +396,7 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type map::const_iterator const trusted = Options.find("trusted"); + debReleaseIndex *Deb = NULL; for (vector::const_iterator I = List.begin(); I != List.end(); ++I) { @@ -403,34 +404,23 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type if (strcmp((*I)->GetType(), "deb") != 0) continue; - debReleaseIndex *Deb = (debReleaseIndex *) (*I); - if (trusted != Options.end()) - Deb->SetTrusted(StringToBool(trusted->second, false)); - /* This check insures that there will be only one Release file queued for all the Packages files and Sources files it corresponds to. */ - if (Deb->GetURI() == URI && Deb->GetDist() == Dist) + if ((*I)->GetURI() == URI && (*I)->GetDist() == Dist) { - if (IsSrc == true) - Deb->PushSectionEntry("source", new debReleaseIndex::debSectionEntry(Section, IsSrc)); - else - { - if (Dist[Dist.size() - 1] == '/') - Deb->PushSectionEntry("any", new debReleaseIndex::debSectionEntry(Section, IsSrc)); - else - Deb->PushSectionEntry(Archs, new debReleaseIndex::debSectionEntry(Section, IsSrc)); - } - return true; + Deb = dynamic_cast(*I); + if (Deb != NULL) + break; } } // No currently created Release file indexes this entry, so we create a new one. - debReleaseIndex *Deb; - if (trusted != Options.end()) - Deb = new debReleaseIndex(URI, Dist, StringToBool(trusted->second, false)); - else + if (Deb == NULL) + { Deb = new debReleaseIndex(URI, Dist); + List.push_back(Deb); + } if (IsSrc == true) Deb->PushSectionEntry ("source", new debReleaseIndex::debSectionEntry(Section, IsSrc)); @@ -441,7 +431,10 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type else Deb->PushSectionEntry (Archs, new debReleaseIndex::debSectionEntry(Section, IsSrc)); } - List.push_back(Deb); + + if (trusted != Options.end()) + Deb->SetTrusted(StringToBool(trusted->second, false)); + return true; } }; diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 4e630cf5d..0b1b08432 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -46,7 +46,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; - std::vector ComputeIndexTargets() const; + virtual std::vector GetIndexTargets() const; std::string MetaIndexInfo(const char *Type) const; std::string MetaIndexFile(const char *Types) const; @@ -78,6 +78,9 @@ class APT_HIDDEN debDebFileMetaIndex : public metaIndex virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) const { return true; } + virtual std::vector GetIndexTargets() const { + return std::vector(); + } virtual std::vector *GetIndexFiles() { return Indexes; } diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 6c3d2880b..4e5de8be0 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -22,6 +22,7 @@ using std::string; #endif class pkgAcquire; +class IndexTarget; class metaIndex { @@ -40,16 +41,13 @@ class metaIndex virtual const char* GetType() const {return Type;} // interface to to query it -#if APT_PKG_ABI >= 413 /** \return the path of the local file (or "" if its not available) */ virtual std::string LocalFileName() const; -#else - std::string LocalFileName() const; -#endif // Interface for acquire virtual std::string ArchiveURI(std::string const& File) const = 0; virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0; + virtual std::vector GetIndexTargets() const = 0; virtual std::vector *GetIndexFiles() = 0; virtual bool IsTrusted() const = 0; -- cgit v1.2.3 From 1da3b7b8e15b642135b54684e70a0c271471f07a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 11 Jun 2015 10:56:31 +0200 Subject: show URI.Path in all acquire item descriptions It is a rather strange sight that index items use SiteOnly which strips the Path, while e.g. deb files are downloaded with NoUserPassword which does not. Important to note here is that for the file transport Path is pretty important as there is no Host which would be displayed by Site, which always resulted in "interesting" unspecific errors for "file:". Adding a 'middle' ground between the two which does show the Path but potentially modifies it (it strips a pending / at the end if existing) solves this "file:" issue, syncs the output and in the end helps to identify which file is meant exactly in progress output and co as a single site can have multiple repositories in different paths. --- apt-pkg/contrib/strutl.cc | 15 ++++++--- apt-pkg/contrib/strutl.h | 1 + apt-pkg/deb/debindexfile.cc | 10 +++--- apt-pkg/deb/debmetaindex.cc | 4 +-- test/integration/test-apt-cache | 2 +- test/integration/test-apt-cli-show | 2 +- .../integration/test-apt-get-update-unauth-warning | 12 +++---- .../test-apt-translation-has-no-packages | 2 +- test/integration/test-apt-update-nofallback | 6 ++-- test/integration/test-apt-update-rollback | 6 ++-- .../test-bug-543966-downgrade-below-1000-pin | 2 +- .../test-bug-595691-empty-and-broken-archive-files | 5 +-- .../test-cve-2013-1051-InRelease-parsing | 2 +- test/integration/test-policy-pinning | 8 ++--- test/integration/test-releasefile-verification | 4 +-- .../test-ubuntu-bug-1098738-apt-get-source-md5sum | 28 ++++++++-------- test/libapt/uri_test.cc | 39 ++++++++++++++++++++++ 17 files changed, 98 insertions(+), 50 deletions(-) diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 0db4c57b2..5731b5a2b 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1637,8 +1637,6 @@ URI::operator string() } /*}}}*/ // URI::SiteOnly - Return the schema and site for the URI /*{{{*/ -// --------------------------------------------------------------------- -/* */ string URI::SiteOnly(const string &URI) { ::URI U(URI); @@ -1648,9 +1646,18 @@ string URI::SiteOnly(const string &URI) return U; } /*}}}*/ +// URI::ArchiveOnly - Return the schema, site and cleaned path for the URI /*{{{*/ +string URI::ArchiveOnly(const string &URI) +{ + ::URI U(URI); + U.User.clear(); + U.Password.clear(); + if (U.Path.empty() == false && U.Path[U.Path.length() - 1] == '/') + U.Path.erase(U.Path.length() - 1); + return U; +} + /*}}}*/ // URI::NoUserPassword - Return the schema, site and path for the URI /*{{{*/ -// --------------------------------------------------------------------- -/* */ string URI::NoUserPassword(const string &URI) { ::URI U(URI); diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index d64270aaf..01bbfef72 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -167,6 +167,7 @@ class URI inline void operator =(const std::string &From) {CopyFrom(From);} inline bool empty() {return Access.empty();}; static std::string SiteOnly(const std::string &URI); + static std::string ArchiveOnly(const std::string &URI); static std::string NoUserPassword(const std::string &URI); URI(std::string Path) {CopyFrom(Path);} diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 185248619..20bf5ae50 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -57,7 +57,7 @@ string debSourcesIndex::SourceInfo(pkgSrcRecords::Parser const &Record, pkgSrcRecords::File const &File) const { string Res; - Res = ::URI::NoUserPassword(URI) + ' '; + Res = ::URI::ArchiveOnly(URI) + ' '; if (Dist[Dist.size() - 1] == '/') { if (Dist != "/") @@ -116,7 +116,7 @@ string debSourcesIndex::Describe(bool Short) const /* */ string debSourcesIndex::Info(const char *Type) const { - string Info = ::URI::NoUserPassword(URI) + ' '; + string Info = ::URI::ArchiveOnly(URI) + ' '; if (Dist[Dist.size() - 1] == '/') { if (Dist != "/") @@ -210,7 +210,7 @@ debPackagesIndex::debPackagesIndex(string const &URI, string const &Dist, string /* This is a shorter version that is designed to be < 60 chars or so */ string debPackagesIndex::ArchiveInfo(pkgCache::VerIterator Ver) const { - string Res = ::URI::NoUserPassword(URI) + ' '; + string Res = ::URI::ArchiveOnly(URI) + ' '; if (Dist[Dist.size() - 1] == '/') { if (Dist != "/") @@ -248,7 +248,7 @@ string debPackagesIndex::Describe(bool Short) const /* */ string debPackagesIndex::Info(const char *Type) const { - string Info = ::URI::NoUserPassword(URI) + ' '; + string Info = ::URI::ArchiveOnly(URI) + ' '; if (Dist[Dist.size() - 1] == '/') { if (Dist != "/") @@ -473,7 +473,7 @@ string debTranslationsIndex::Describe(bool Short) const /* */ string debTranslationsIndex::Info(const char *Type) const { - string Info = ::URI::NoUserPassword(URI) + ' '; + string Info = ::URI::ArchiveOnly(URI) + ' '; if (Dist[Dist.size() - 1] == '/') { if (Dist != "/") diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index e1f86d20f..d4e340be0 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -25,7 +25,7 @@ using namespace std; string debReleaseIndex::MetaIndexInfo(const char *Type) const { - string Info = ::URI::SiteOnly(URI) + ' '; + string Info = ::URI::ArchiveOnly(URI) + ' '; if (Dist[Dist.size() - 1] == '/') { if (Dist != "/") @@ -105,7 +105,7 @@ void foreachTarget(std::string const URI, std::string const Dist, else baseURI += "dists/" + Dist + "/"; std::string const Release = (Dist == "/") ? "" : Dist; - std::string const Site = ::URI::SiteOnly(URI); + std::string const Site = ::URI::ArchiveOnly(URI); std::vector lang = APT::Configuration::getLanguages(true); if (lang.empty()) lang.push_back("none"); diff --git a/test/integration/test-apt-cache b/test/integration/test-apt-cache index f3db8024f..97dc0f939 100755 --- a/test/integration/test-apt-cache +++ b/test/integration/test-apt-cache @@ -50,7 +50,7 @@ testsuccessequal 'bar' aptcache pkgnames bar testsuccessequal 'fancy foo' aptcache pkgnames f -testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive/ unstable/main amd64 Packages" aptcache madison foo +testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages" aptcache madison foo ### depends diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show index 43072cf03..5f4ef1b48 100755 --- a/test/integration/test-apt-cli-show +++ b/test/integration/test-apt-cli-show @@ -32,7 +32,7 @@ Maintainer: Joe Sixpack Installed-Size: 43.0 kB Download-Size: unknown APT-Manual-Installed: yes -APT-Sources: file:$APTARCHIVE/ unstable/main i386 Packages +APT-Sources: file:$APTARCHIVE unstable/main i386 Packages Description: Some description That has multiple lines " apt show foo diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 81c01ba3e..ada7f7a26 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -19,11 +19,11 @@ APTARCHIVE=$(readlink -f ./aptarchive) rm -f $APTARCHIVE/dists/unstable/*Release* # update without authenticated files leads to warning -testfailureequal "Ign file: unstable InRelease +testfailureequal "Ign file:$APTARCHIVE unstable InRelease File not found -Err file: unstable Release +Err file:$APTARCHIVE unstable Release File not found -W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. +W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories # no package foo @@ -32,12 +32,12 @@ testequal 'lock partial' ls rootdir/var/lib/apt/lists # allow override -testwarningequal "Ign file: unstable InRelease +testwarningequal "Ign file:$APTARCHIVE unstable InRelease File not found -Ign file: unstable Release +Ign file:$APTARCHIVE unstable Release File not found Reading package lists... -W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories +W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories # ensure we can not install the package testfailureequal "WARNING: The following packages cannot be authenticated! foo diff --git a/test/integration/test-apt-translation-has-no-packages b/test/integration/test-apt-translation-has-no-packages index 440fd30cf..cf5b56243 100755 --- a/test/integration/test-apt-translation-has-no-packages +++ b/test/integration/test-apt-translation-has-no-packages @@ -38,4 +38,4 @@ testsuccessequal "foo: Candidate: 1.0 Version table: 1.0 0 - 500 file:$APTARCHIVE/ unstable/main amd64 Packages" aptcache policy foo + 500 file:$APTARCHIVE unstable/main amd64 Packages" aptcache policy foo diff --git a/test/integration/test-apt-update-nofallback b/test/integration/test-apt-update-nofallback index f132bcf8e..2ded73122 100755 --- a/test/integration/test-apt-update-nofallback +++ b/test/integration/test-apt-update-nofallback @@ -33,7 +33,7 @@ EOF assert_update_is_refused_and_last_good_state_used() { - testfailuremsg "E: The repository 'file: unstable Release' is no longer signed." aptget update + testfailuremsg "E: The repository 'file:${APTARCHIVE} unstable Release' is no longer signed." aptget update assert_repo_is_intact } @@ -171,7 +171,7 @@ test_inrelease_to_invalid_inrelease() sed -i 's/^Codename:.*/Codename: evil!/' $APTARCHIVE/dists/unstable/InRelease inject_evil_package - testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) + testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:${APTARCHIVE} unstable InRelease: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) W: Failed to fetch file:${APTARCHIVE}/dists/unstable/InRelease The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) @@ -195,7 +195,7 @@ test_release_gpg_to_invalid_release_release_gpg() echo "Some evil data" >> $APTARCHIVE/dists/unstable/Release inject_evil_package - testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable Release: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) + testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:${APTARCHIVE} unstable Release: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) W: Failed to fetch file:${APTARCHIVE}/dists/unstable/Release.gpg The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) diff --git a/test/integration/test-apt-update-rollback b/test/integration/test-apt-update-rollback index 6ecf322b2..70619dd08 100755 --- a/test/integration/test-apt-update-rollback +++ b/test/integration/test-apt-update-rollback @@ -78,7 +78,7 @@ test_inrelease_to_valid_release() { rm $APTARCHIVE/dists/unstable/Release.gpg # update fails - testfailureequal "E: The repository 'file: unstable Release' is no longer signed." aptget update -qq + testfailureequal "E: The repository 'file:${APTARCHIVE} unstable Release' is no longer signed." aptget update -qq # test that security downgrade was not successful testfileequal lists.before "$(listcurrentlistsdirectory)" @@ -101,7 +101,7 @@ test_inrelease_to_release_reverts_all() { break_repository_sources_index '+1hour' # ensure error - testfailureequal "E: The repository 'file: unstable Release' is no longer signed." aptget update -qq # -o Debug::acquire::transaction=1 + testfailureequal "E: The repository 'file:${APTARCHIVE} unstable Release' is no longer signed." aptget update -qq # -o Debug::acquire::transaction=1 # ensure that the Packages file is also rolled back testfileequal lists.before "$(listcurrentlistsdirectory)" @@ -144,7 +144,7 @@ test_inrelease_to_unauth_inrelease() { signreleasefiles 'Marvin Paranoid' - testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file: unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2 + testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:${APTARCHIVE} unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2 W: Failed to fetch file:$APTARCHIVE/dists/unstable/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2 diff --git a/test/integration/test-bug-543966-downgrade-below-1000-pin b/test/integration/test-bug-543966-downgrade-below-1000-pin index e59231608..180393867 100755 --- a/test/integration/test-bug-543966-downgrade-below-1000-pin +++ b/test/integration/test-bug-543966-downgrade-below-1000-pin @@ -13,7 +13,7 @@ insertinstalledpackage 'base-files' 'all' '5.0.0-1' setupaptarchive STATUS=$(readlink -f rootdir/var/lib/dpkg/status) -APTARCHIVE="$(readlink -f aptarchive)/" +APTARCHIVE="$(readlink -f aptarchive)" testsuccessequal "base-files: Installed: 5.0.0-1 diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index 486b8ba02..b42212f5e 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -49,6 +49,7 @@ createemptyfile() { } testoverfile() { + local APTARCHIVE="$(readlink -f ./aptarchive)" forcecompressor "$1" createemptyfile 'en' @@ -63,9 +64,9 @@ testoverfile() { testaptgetupdate 'Reading package lists...' "empty archive Packages.$COMPRESS over file" createemptyfile 'Packages' - testaptgetupdate "Err file: Packages + testaptgetupdate "Err file:$APTARCHIVE Packages Empty files can't be valid archives -W: Failed to fetch ${COMPRESSOR}:$(readlink -f aptarchive/Packages.$COMPRESS) Empty files can't be valid archives +W: Failed to fetch ${COMPRESSOR}:${APTARCHIVE}/Packages.$COMPRESS Empty files can't be valid archives E: Some index files failed to download. They have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over file" } diff --git a/test/integration/test-cve-2013-1051-InRelease-parsing b/test/integration/test-cve-2013-1051-InRelease-parsing index d99174553..933cbbd92 100755 --- a/test/integration/test-cve-2013-1051-InRelease-parsing +++ b/test/integration/test-cve-2013-1051-InRelease-parsing @@ -12,7 +12,7 @@ insertpackage 'stable' 'good-pkg' 'all' '1.0' setupaptarchive changetowebserver -ARCHIVE='http://localhost:8080/' +ARCHIVE='http://localhost:8080' msgtest 'Initial apt-get update should work with' 'InRelease' testsuccess --nomsg aptget update diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index 2675b51bc..9cd54264b 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -20,7 +20,7 @@ testequalpolicy() { testsuccessequal "Package files: $(echo "$SP" | awk '{ printf("%3s\n",$0) }') ${STATUS} release a=now - $(echo "$AP" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ Packages + $(echo "$AP" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} Packages release c= Pinned packages:" aptcache policy $* } @@ -105,11 +105,11 @@ testequalpolicycoolstuff() { local BPO1ARCHIVE="" local BPO2ARCHIVE="" if [ ! "$7" = "2.0~bpo2" ]; then - BPO1ARCHIVE=" $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages" + BPO1ARCHIVE=" $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main i386 Packages" else BPO2ARCHIVE=" 2.0~bpo2 $PB - $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ backports/main i386 Packages" + $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main i386 Packages" SB="$(echo "$SB" | tail -n 1)" shift fi @@ -121,7 +121,7 @@ testequalpolicycoolstuff() { $IB 2.0~bpo1 $PB ${BPO1ARCHIVE}$SB $IS 1.0 $PB - $(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE}/ stable/main i386 Packages$SS" \ + $(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} stable/main i386 Packages$SS" \ aptcache policy coolstuff -o Policy=${INSTALLED}-${CANDIDATE}-${AB}-${AS}-${PB} $* } diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index 469ed34d2..e8419524c 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -41,7 +41,7 @@ The following NEW packages will be installed: apt 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. After this operation, 5370 kB of additional disk space will be used. -Get:1 http://localhost:8080/ apt 0.7.25.3 +Get:1 http://localhost:8080 apt 0.7.25.3 Download complete and in download only mode' aptget install apt -dy } @@ -54,7 +54,7 @@ The following NEW packages will be installed: apt 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. After this operation, 5808 kB of additional disk space will be used. -Get:1 http://localhost:8080/ apt 0.8.0~pre1 +Get:1 http://localhost:8080 apt 0.8.0~pre1 Download complete and in download only mode' aptget install apt -dy } diff --git a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum index 555d8fcaa..6abb5d12a 100755 --- a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum +++ b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum @@ -148,8 +148,8 @@ testok() { testsuccessequal "Reading package lists... Building dependency tree... Need to get 6 B of source archives. -Get:1 http://localhost:8080/ $1 1.0 (dsc) [3 B] -Get:2 http://localhost:8080/ $1 1.0 (tar) [3 B] +Get:1 http://localhost:8080 $1 1.0 (dsc) [3 B] +Get:2 http://localhost:8080 $1 1.0 (tar) [3 B] Download complete and in download only mode" aptget source -d "$@" msgtest 'Files were successfully downloaded for' "$1" testsuccess --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz @@ -175,11 +175,11 @@ testmismatch() { testfailureequal "Reading package lists... Building dependency tree... Need to get 6 B of source archives. -Get:1 http://localhost:8080/ $1 1.0 (dsc) [3 B] -Err http://localhost:8080/ $1 1.0 (dsc) +Get:1 http://localhost:8080 $1 1.0 (dsc) [3 B] +Err http://localhost:8080 $1 1.0 (dsc) Hash Sum mismatch -Get:2 http://localhost:8080/ $1 1.0 (tar) [3 B] -Err http://localhost:8080/ $1 1.0 (tar) +Get:2 http://localhost:8080 $1 1.0 (tar) [3 B] +Err http://localhost:8080 $1 1.0 (tar) Hash Sum mismatch E: Failed to fetch http://localhost:8080/${1}_1.0.dsc Hash Sum mismatch @@ -203,8 +203,8 @@ Download complete and in download only mode" aptget source -d "$@" -o Acquire::F testsuccessequal "Reading package lists... Building dependency tree... Need to get 6 B of source archives. -Get:1 http://localhost:8080/ $1 1.0 (dsc) [3 B] -Get:2 http://localhost:8080/ $1 1.0 (tar) [3 B] +Get:1 http://localhost:8080 $1 1.0 (dsc) [3 B] +Get:2 http://localhost:8080 $1 1.0 (tar) [3 B] Download complete and in download only mode" aptget source --allow-unauthenticated -d "$@" -o Acquire::ForceHash=ROT26 msgtest 'Files were downloaded unauthenticated as user allowed it' "$1" testsuccess --nomsg test -e ${1}_1.0.dsc -a -e ${1}_1.0.tar.gz @@ -240,9 +240,9 @@ testok pkg-mixed-ok testfailureequal 'Reading package lists... Building dependency tree... Need to get 6 B of source archives. -Get:1 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (tar) [3 B] -Get:2 http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (dsc) [3 B] -Err http://localhost:8080/ pkg-mixed-sha1-bad 1.0 (dsc) +Get:1 http://localhost:8080 pkg-mixed-sha1-bad 1.0 (tar) [3 B] +Get:2 http://localhost:8080 pkg-mixed-sha1-bad 1.0 (dsc) [3 B] +Err http://localhost:8080 pkg-mixed-sha1-bad 1.0 (dsc) Hash Sum mismatch E: Failed to fetch http://localhost:8080/pkg-mixed-sha1-bad_1.0.dsc Hash Sum mismatch @@ -252,10 +252,10 @@ testsuccess --nomsg test ! -e pkg-mixed-sha1-bad_1.0.dsc -a -e pkg-mixed-sha1-ba testfailureequal 'Reading package lists... Building dependency tree... Need to get 6 B of source archives. -Get:1 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (tar) [3 B] -Err http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (tar) +Get:1 http://localhost:8080 pkg-mixed-sha2-bad 1.0 (tar) [3 B] +Err http://localhost:8080 pkg-mixed-sha2-bad 1.0 (tar) Hash Sum mismatch -Get:2 http://localhost:8080/ pkg-mixed-sha2-bad 1.0 (dsc) [3 B] +Get:2 http://localhost:8080 pkg-mixed-sha2-bad 1.0 (dsc) [3 B] E: Failed to fetch http://localhost:8080/pkg-mixed-sha2-bad_1.0.tar.gz Hash Sum mismatch E: Failed to fetch some archives.' aptget source -d pkg-mixed-sha2-bad diff --git a/test/libapt/uri_test.cc b/test/libapt/uri_test.cc index 5d5ae9679..fe6015e65 100644 --- a/test/libapt/uri_test.cc +++ b/test/libapt/uri_test.cc @@ -13,6 +13,9 @@ TEST(URITest, BasicHTTP) EXPECT_EQ("www.debian.org", U.Host); EXPECT_EQ("/temp/test", U.Path); EXPECT_EQ("http://www.debian.org:90/temp/test", (std::string)U); + EXPECT_EQ("http://www.debian.org:90", URI::SiteOnly(U)); + EXPECT_EQ("http://www.debian.org:90/temp/test", URI::ArchiveOnly(U)); + EXPECT_EQ("http://www.debian.org:90/temp/test", URI::NoUserPassword(U)); // Login data U = URI("http://jgg:foo@ualberta.ca/blah"); EXPECT_EQ("http", U.Access); @@ -22,6 +25,9 @@ TEST(URITest, BasicHTTP) EXPECT_EQ("ualberta.ca", U.Host); EXPECT_EQ("/blah", U.Path); EXPECT_EQ("http://jgg:foo@ualberta.ca/blah", (std::string)U); + EXPECT_EQ("http://ualberta.ca", URI::SiteOnly(U)); + EXPECT_EQ("http://ualberta.ca/blah", URI::ArchiveOnly(U)); + EXPECT_EQ("http://ualberta.ca/blah", URI::NoUserPassword(U)); } TEST(URITest, SingeSlashFile) { @@ -33,6 +39,9 @@ TEST(URITest, SingeSlashFile) EXPECT_EQ("", U.Host); EXPECT_EQ("/usr/bin/foo", U.Path); EXPECT_EQ("file:/usr/bin/foo", (std::string)U); + EXPECT_EQ("file:", URI::SiteOnly(U)); + EXPECT_EQ("file:/usr/bin/foo", URI::ArchiveOnly(U)); + EXPECT_EQ("file:/usr/bin/foo", URI::NoUserPassword(U)); } TEST(URITest, BasicCDROM) { @@ -44,6 +53,9 @@ TEST(URITest, BasicCDROM) EXPECT_EQ("Moo Cow Rom", U.Host); EXPECT_EQ("/debian", U.Path); EXPECT_EQ("cdrom://Moo Cow Rom/debian", (std::string)U); + EXPECT_EQ("cdrom://Moo Cow Rom", URI::SiteOnly(U)); + EXPECT_EQ("cdrom://Moo Cow Rom/debian", URI::ArchiveOnly(U)); + EXPECT_EQ("cdrom://Moo Cow Rom/debian", URI::NoUserPassword(U)); } TEST(URITest, RelativeGzip) { @@ -55,6 +67,9 @@ TEST(URITest, RelativeGzip) EXPECT_EQ(".", U.Host); EXPECT_EQ("/bar/cow", U.Path); EXPECT_EQ("gzip://./bar/cow", (std::string)U); + EXPECT_EQ("gzip://.", URI::SiteOnly(U)); + EXPECT_EQ("gzip://./bar/cow", URI::ArchiveOnly(U)); + EXPECT_EQ("gzip://./bar/cow", URI::NoUserPassword(U)); } TEST(URITest, NoSlashFTP) { @@ -66,6 +81,9 @@ TEST(URITest, NoSlashFTP) EXPECT_EQ("ftp.fr.debian.org", U.Host); EXPECT_EQ("/debian/pool/main/x/xtel/xtel_3.2.1-15_i386.deb", U.Path); EXPECT_EQ("ftp://ftp.fr.debian.org/debian/pool/main/x/xtel/xtel_3.2.1-15_i386.deb", (std::string)U); + EXPECT_EQ("ftp://ftp.fr.debian.org", URI::SiteOnly(U)); + EXPECT_EQ("ftp://ftp.fr.debian.org/debian/pool/main/x/xtel/xtel_3.2.1-15_i386.deb", URI::ArchiveOnly(U)); + EXPECT_EQ("ftp://ftp.fr.debian.org/debian/pool/main/x/xtel/xtel_3.2.1-15_i386.deb", URI::NoUserPassword(U)); } TEST(URITest, RFC2732) { @@ -77,6 +95,9 @@ TEST(URITest, RFC2732) EXPECT_EQ("1080::8:800:200C:417A", U.Host); EXPECT_EQ("/foo", U.Path); EXPECT_EQ("http://[1080::8:800:200C:417A]/foo", (std::string)U); + EXPECT_EQ("http://[1080::8:800:200C:417A]", URI::SiteOnly(U)); + EXPECT_EQ("http://[1080::8:800:200C:417A]/foo", URI::ArchiveOnly(U)); + EXPECT_EQ("http://[1080::8:800:200C:417A]/foo", URI::NoUserPassword(U)); // with port U = URI("http://[::FFFF:129.144.52.38]:80/index.html"); EXPECT_EQ("http", U.Access); @@ -86,6 +107,9 @@ TEST(URITest, RFC2732) EXPECT_EQ("::FFFF:129.144.52.38", U.Host); EXPECT_EQ("/index.html", U.Path); EXPECT_EQ("http://[::FFFF:129.144.52.38]:80/index.html", (std::string)U); + EXPECT_EQ("http://[::FFFF:129.144.52.38]:80", URI::SiteOnly(U)); + EXPECT_EQ("http://[::FFFF:129.144.52.38]:80/index.html", URI::ArchiveOnly(U)); + EXPECT_EQ("http://[::FFFF:129.144.52.38]:80/index.html", URI::NoUserPassword(U)); // extra colon U = URI("http://[::FFFF:129.144.52.38:]:80/index.html"); EXPECT_EQ("http", U.Access); @@ -95,6 +119,9 @@ TEST(URITest, RFC2732) EXPECT_EQ("::FFFF:129.144.52.38:", U.Host); EXPECT_EQ("/index.html", U.Path); EXPECT_EQ("http://[::FFFF:129.144.52.38:]:80/index.html", (std::string)U); + EXPECT_EQ("http://[::FFFF:129.144.52.38:]:80", URI::SiteOnly(U)); + EXPECT_EQ("http://[::FFFF:129.144.52.38:]:80/index.html", URI::ArchiveOnly(U)); + EXPECT_EQ("http://[::FFFF:129.144.52.38:]:80/index.html", URI::NoUserPassword(U)); // extra colon port U = URI("http://[::FFFF:129.144.52.38:]/index.html"); EXPECT_EQ("http", U.Access); @@ -104,6 +131,9 @@ TEST(URITest, RFC2732) EXPECT_EQ("::FFFF:129.144.52.38:", U.Host); EXPECT_EQ("/index.html", U.Path); EXPECT_EQ("http://[::FFFF:129.144.52.38:]/index.html", (std::string)U); + EXPECT_EQ("http://[::FFFF:129.144.52.38:]", URI::SiteOnly(U)); + EXPECT_EQ("http://[::FFFF:129.144.52.38:]/index.html", URI::ArchiveOnly(U)); + EXPECT_EQ("http://[::FFFF:129.144.52.38:]/index.html", URI::NoUserPassword(U)); // My Evil Corruption of RFC 2732 to handle CDROM names! // Fun for the whole family! */ U = URI("cdrom:[The Debian 1.2 disk, 1/2 R1:6]/debian/"); @@ -114,6 +144,9 @@ TEST(URITest, RFC2732) EXPECT_EQ("The Debian 1.2 disk, 1/2 R1:6", U.Host); EXPECT_EQ("/debian/", U.Path); EXPECT_EQ("cdrom://[The Debian 1.2 disk, 1/2 R1:6]/debian/", (std::string)U); + EXPECT_EQ("cdrom://[The Debian 1.2 disk, 1/2 R1:6]", URI::SiteOnly(U)); + EXPECT_EQ("cdrom://[The Debian 1.2 disk, 1/2 R1:6]/debian", URI::ArchiveOnly(U)); + EXPECT_EQ("cdrom://[The Debian 1.2 disk, 1/2 R1:6]/debian/", URI::NoUserPassword(U)); // no brackets U = URI("cdrom:Foo Bar Cow/debian/"); EXPECT_EQ("cdrom", U.Access); @@ -123,9 +156,15 @@ TEST(URITest, RFC2732) EXPECT_EQ("Foo Bar Cow", U.Host); EXPECT_EQ("/debian/", U.Path); EXPECT_EQ("cdrom://Foo Bar Cow/debian/", (std::string)U); + EXPECT_EQ("cdrom://Foo Bar Cow", URI::SiteOnly(U)); + EXPECT_EQ("cdrom://Foo Bar Cow/debian", URI::ArchiveOnly(U)); + EXPECT_EQ("cdrom://Foo Bar Cow/debian/", URI::NoUserPassword(U)); // percent encoded U = URI("ftp://foo:b%40r@example.org"); EXPECT_EQ("foo", U.User); EXPECT_EQ("b@r", U.Password); EXPECT_EQ("ftp://foo:b%40r@example.org/", (std::string) U); + EXPECT_EQ("ftp://example.org", URI::SiteOnly(U)); + EXPECT_EQ("ftp://example.org", URI::ArchiveOnly(U)); + EXPECT_EQ("ftp://example.org/", URI::NoUserPassword(U)); } -- cgit v1.2.3 From e3c1cfc767f17f5e9b2cd99f2658db3d6ac8edd9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 11 Jun 2015 11:38:04 +0200 Subject: use IndexTarget to get to IndexFile Removes a bunch of duplicated code in the deb-specific parts. Especially the Description part is now handled centrally by IndexTarget instead of being duplicated to the derivations of IndexFile. Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 9 -- apt-pkg/acquire-item.h | 31 +--- apt-pkg/deb/debindexfile.cc | 381 ++++---------------------------------------- apt-pkg/deb/debindexfile.h | 84 ++-------- apt-pkg/deb/debmetaindex.cc | 56 ++----- apt-pkg/indexfile.cc | 87 +++++++++- apt-pkg/indexfile.h | 58 ++++++- 7 files changed, 197 insertions(+), 509 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 05ea9c069..d4191f00e 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -382,15 +382,6 @@ bool pkgAcqDiffIndex::TransactionState(TransactionStates const state) } /*}}}*/ -// IndexTarget - Constructor /*{{{*/ -IndexTarget::IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, - std::string const &LongDesc, std::string const &URI, bool const IsOptional, - std::map const &Options) : - URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey), IsOptional(IsOptional), Options(Options) -{ -} - /*}}}*/ - class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ /* The sole purpose of this class is having an item which does nothing to reach its done state to prevent cleanup deleting the mentioned file. diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 790d1f3d8..b6d569737 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -21,6 +21,7 @@ #define PKGLIB_ACQUIRE_ITEM_H #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #ifndef APT_8_CLEANER_HEADERS -#include #include #include #include @@ -47,37 +47,8 @@ class indexRecords; class pkgRecords; class pkgSourceList; -class IndexTarget; class pkgAcqMetaBase; -class IndexTarget /*{{{*/ -/** \brief Information about an index file. */ -{ - public: - /** \brief A URI from which the index file can be downloaded. */ - std::string URI; - - /** \brief A description of the index file. */ - std::string Description; - - /** \brief A shorter description of the index file. */ - std::string ShortDesc; - - /** \brief The key by which this index file should be - looked up within the meta index file. */ - std::string MetaKey; - - /** \brief Is it okay if the file isn't found in the meta index */ - bool IsOptional; - - /** \brief Target specific options defined by the implementation */ - std::map Options; - - IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, - std::string const &LongDesc, std::string const &URI, bool const IsOptional, - std::map const &Options); -}; - /*}}}*/ class pkgAcquire::Item : public WeakPointable /*{{{*/ /** \brief Represents the process by which a pkgAcquire object should * retrieve a file or a collection of files. diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 20bf5ae50..3e60423ff 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -44,8 +44,8 @@ using std::string; // SourcesIndex::debSourcesIndex - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -debSourcesIndex::debSourcesIndex(string URI,string Dist,string Section,bool Trusted) : - pkgIndexFile(Trusted), URI(URI), Dist(Dist), Section(Section) +debSourcesIndex::debSourcesIndex(IndexTarget const &Target,bool const Trusted) : + pkgIndexTargetFile(Target, Trusted) { } /*}}}*/ @@ -56,16 +56,9 @@ debSourcesIndex::debSourcesIndex(string URI,string Dist,string Section,bool Trus string debSourcesIndex::SourceInfo(pkgSrcRecords::Parser const &Record, pkgSrcRecords::File const &File) const { - string Res; - Res = ::URI::ArchiveOnly(URI) + ' '; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Res += Dist; - } - else - Res += Dist + '/' + Section; - + string Res = Target.Description; + Res.erase(Target.Description.rfind(' ')); + Res += " "; Res += Record.Package(); Res += " "; @@ -80,129 +73,19 @@ string debSourcesIndex::SourceInfo(pkgSrcRecords::Parser const &Record, /* */ pkgSrcRecords::Parser *debSourcesIndex::CreateSrcParser() const { - string SourcesURI = _config->FindDir("Dir::State::lists") + - URItoFileName(IndexURI("Sources")); - - std::vector types = APT::Configuration::getCompressionTypes(); - for (std::vector::const_iterator t = types.begin(); t != types.end(); ++t) - { - string p; - p = SourcesURI + '.' + *t; - if (FileExists(p)) - return new debSrcRecordParser(p, this); - } + string const SourcesURI = IndexFileName(); if (FileExists(SourcesURI)) return new debSrcRecordParser(SourcesURI, this); return NULL; } /*}}}*/ -// SourcesIndex::Describe - Give a descriptive path to the index /*{{{*/ -// --------------------------------------------------------------------- -/* */ -string debSourcesIndex::Describe(bool Short) const -{ - char S[300]; - if (Short == true) - snprintf(S,sizeof(S),"%s",Info("Sources").c_str()); - else - snprintf(S,sizeof(S),"%s (%s)",Info("Sources").c_str(), - IndexFile("Sources").c_str()); - - return S; -} - /*}}}*/ -// SourcesIndex::Info - One liner describing the index URI /*{{{*/ -// --------------------------------------------------------------------- -/* */ -string debSourcesIndex::Info(const char *Type) const -{ - string Info = ::URI::ArchiveOnly(URI) + ' '; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Info += Dist; - } - else - Info += Dist + '/' + Section; - Info += " "; - Info += Type; - return Info; -} - /*}}}*/ -// SourcesIndex::Index* - Return the URI to the index files /*{{{*/ -// --------------------------------------------------------------------- -/* */ -string debSourcesIndex::IndexFile(const char *Type) const -{ - string s = URItoFileName(IndexURI(Type)); - - std::vector types = APT::Configuration::getCompressionTypes(); - for (std::vector::const_iterator t = types.begin(); t != types.end(); ++t) - { - string p = s + '.' + *t; - if (FileExists(p)) - return p; - } - return s; -} - -string debSourcesIndex::IndexURI(const char *Type) const -{ - string Res; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Res = URI + Dist; - else - Res = URI; - } - else - Res = URI + "dists/" + Dist + '/' + Section + - "/source/"; - - Res += Type; - return Res; -} - /*}}}*/ -// SourcesIndex::Exists - Check if the index is available /*{{{*/ -// --------------------------------------------------------------------- -/* */ -bool debSourcesIndex::Exists() const -{ - return FileExists(IndexFile("Sources")); -} - /*}}}*/ -// SourcesIndex::Size - Return the size of the index /*{{{*/ -// --------------------------------------------------------------------- -/* */ -unsigned long debSourcesIndex::Size() const -{ - unsigned long size = 0; - - /* we need to ignore errors here; if the lists are absent, just return 0 */ - _error->PushToStack(); - - FileFd f(IndexFile("Sources"), FileFd::ReadOnly, FileFd::Extension); - if (!f.Failed()) - size = f.Size(); - - if (_error->PendingError() == true) - size = 0; - _error->RevertToStack(); - - return size; -} - /*}}}*/ // PackagesIndex::debPackagesIndex - Contructor /*{{{*/ // --------------------------------------------------------------------- /* */ -debPackagesIndex::debPackagesIndex(string const &URI, string const &Dist, string const &Section, - bool const &Trusted, string const &Arch) : - pkgIndexFile(Trusted), URI(URI), Dist(Dist), Section(Section), Architecture(Arch) +debPackagesIndex::debPackagesIndex(IndexTarget const &Target, bool const Trusted) : + pkgIndexTargetFile(Target, Trusted) { - if (Architecture == "native") - Architecture = _config->Find("APT::Architecture"); } /*}}}*/ // PackagesIndex::ArchiveInfo - Short version of the archive url /*{{{*/ @@ -210,135 +93,40 @@ debPackagesIndex::debPackagesIndex(string const &URI, string const &Dist, string /* This is a shorter version that is designed to be < 60 chars or so */ string debPackagesIndex::ArchiveInfo(pkgCache::VerIterator Ver) const { - string Res = ::URI::ArchiveOnly(URI) + ' '; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Res += Dist; - } - else - Res += Dist + '/' + Section; - + std::string const Dist = Target.Option("RELEASE"); + string Res = Target.Option("SITE") + " " + Dist; + std::string const Component = Target.Option("COMPONENT"); + if (Component.empty() == false) + Res += "/" + Component; + Res += " "; Res += Ver.ParentPkg().Name(); Res += " "; - if (Dist[Dist.size() - 1] != '/') + if (Dist.empty() == false && Dist[Dist.size() - 1] != '/') Res.append(Ver.Arch()).append(" "); Res += Ver.VerStr(); return Res; } /*}}}*/ -// PackagesIndex::Describe - Give a descriptive path to the index /*{{{*/ -// --------------------------------------------------------------------- -/* This should help the user find the index in the sources.list and - in the filesystem for problem solving */ -string debPackagesIndex::Describe(bool Short) const -{ - char S[300]; - if (Short == true) - snprintf(S,sizeof(S),"%s",Info("Packages").c_str()); - else - snprintf(S,sizeof(S),"%s (%s)",Info("Packages").c_str(), - IndexFile("Packages").c_str()); - return S; -} - /*}}}*/ -// PackagesIndex::Info - One liner describing the index URI /*{{{*/ -// --------------------------------------------------------------------- -/* */ -string debPackagesIndex::Info(const char *Type) const -{ - string Info = ::URI::ArchiveOnly(URI) + ' '; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Info += Dist; - } - else - Info += Dist + '/' + Section; - Info += " "; - if (Dist[Dist.size() - 1] != '/') - Info += Architecture + " "; - Info += Type; - return Info; -} - /*}}}*/ -// PackagesIndex::Index* - Return the URI to the index files /*{{{*/ -// --------------------------------------------------------------------- -/* */ -string debPackagesIndex::IndexFile(const char *Type) const -{ - string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type)); - - std::vector types = APT::Configuration::getCompressionTypes(); - for (std::vector::const_iterator t = types.begin(); t != types.end(); ++t) - { - string p = s + '.' + *t; - if (FileExists(p)) - return p; - } - return s; -} -string debPackagesIndex::IndexURI(const char *Type) const -{ - string Res; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Res = URI + Dist; - else - Res = URI; - } - else - Res = URI + "dists/" + Dist + '/' + Section + - "/binary-" + Architecture + '/'; - - Res += Type; - return Res; -} - /*}}}*/ -// PackagesIndex::Exists - Check if the index is available /*{{{*/ -// --------------------------------------------------------------------- -/* */ -bool debPackagesIndex::Exists() const -{ - return FileExists(IndexFile("Packages")); -} - /*}}}*/ -// PackagesIndex::Size - Return the size of the index /*{{{*/ -// --------------------------------------------------------------------- -/* This is really only used for progress reporting. */ -unsigned long debPackagesIndex::Size() const -{ - unsigned long size = 0; - - /* we need to ignore errors here; if the lists are absent, just return 0 */ - _error->PushToStack(); - - FileFd f(IndexFile("Packages"), FileFd::ReadOnly, FileFd::Extension); - if (!f.Failed()) - size = f.Size(); - - if (_error->PendingError() == true) - size = 0; - _error->RevertToStack(); - - return size; -} - /*}}}*/ // PackagesIndex::Merge - Load the index file into a cache /*{{{*/ // --------------------------------------------------------------------- /* */ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { - string PackageFile = IndexFile("Packages"); + string const PackageFile = IndexFileName(); FileFd Pkg(PackageFile,FileFd::ReadOnly, FileFd::Extension); - debListParser Parser(&Pkg, Architecture); + debListParser Parser(&Pkg, Target.Option("ARCHITECTURE")); if (_error->PendingError() == true) return _error->Error("Problem opening %s",PackageFile.c_str()); if (Prog != NULL) - Prog->SubProgress(0,Info("Packages")); + Prog->SubProgress(0, Target.Description); + + + std::string const URI = Target.Option("REPO_URI"); + std::string Dist = Target.Option("RELEASE"); + if (Dist.empty()) + Dist = "/"; ::URI Tmp(URI); if (Gen.SelectFile(PackageFile,Tmp.Host,*this) == false) return _error->Error("Problem with SelectFile %s",PackageFile.c_str()); @@ -370,7 +158,7 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (_error->PendingError() == true) return false; - Parser.LoadReleaseInfo(File,Rel,Section); + Parser.LoadReleaseInfo(File, Rel, Target.Option("COMPONENT")); } return true; @@ -381,7 +169,7 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const /* */ pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const { - string FileName = IndexFile("Packages"); + string const FileName = IndexFileName(); pkgCache::PkgFileIterator File = Cache.FileBegin(); for (; File.end() == false; ++File) { @@ -411,113 +199,13 @@ pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const /*}}}*/ // TranslationsIndex::debTranslationsIndex - Contructor /*{{{*/ -// --------------------------------------------------------------------- -/* */ -debTranslationsIndex::debTranslationsIndex(std::string const &URI, std::string const &Dist, - std::string const &Section, std::string const &Translation) : - pkgIndexFile(true), URI(URI), Dist(Dist), Section(Section), - Language(Translation) +debTranslationsIndex::debTranslationsIndex(IndexTarget const &Target) : + pkgIndexTargetFile(Target, true) {} /*}}}*/ -// TranslationIndex::Trans* - Return the URI to the translation files /*{{{*/ -// --------------------------------------------------------------------- -/* */ -string debTranslationsIndex::IndexFile(const char *Type) const -{ - string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type)); - - std::vector types = APT::Configuration::getCompressionTypes(); - for (std::vector::const_iterator t = types.begin(); t != types.end(); ++t) - { - string p = s + '.' + *t; - if (FileExists(p)) - return p; - } - return s; -} -string debTranslationsIndex::IndexURI(const char *Type) const -{ - string Res; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Res = URI + Dist; - else - Res = URI; - } - else - Res = URI + "dists/" + Dist + '/' + Section + - "/i18n/Translation-"; - - Res += Type; - return Res; -} - /*}}}*/ -// TranslationsIndex::Describe - Give a descriptive path to the index /*{{{*/ -// --------------------------------------------------------------------- -/* This should help the user find the index in the sources.list and - in the filesystem for problem solving */ -string debTranslationsIndex::Describe(bool Short) const -{ - std::string S; - if (Short == true) - strprintf(S,"%s",Info(TranslationFile().c_str()).c_str()); - else - strprintf(S,"%s (%s)",Info(TranslationFile().c_str()).c_str(), - IndexFile(Language.c_str()).c_str()); - return S; -} - /*}}}*/ -// TranslationsIndex::Info - One liner describing the index URI /*{{{*/ -// --------------------------------------------------------------------- -/* */ -string debTranslationsIndex::Info(const char *Type) const -{ - string Info = ::URI::ArchiveOnly(URI) + ' '; - if (Dist[Dist.size() - 1] == '/') - { - if (Dist != "/") - Info += Dist; - } - else - Info += Dist + '/' + Section; - Info += " "; - Info += Type; - return Info; -} - /*}}}*/ bool debTranslationsIndex::HasPackages() const /*{{{*/ { - return FileExists(IndexFile(Language.c_str())); -} - /*}}}*/ -// TranslationsIndex::Exists - Check if the index is available /*{{{*/ -// --------------------------------------------------------------------- -/* */ -bool debTranslationsIndex::Exists() const -{ - return FileExists(IndexFile(Language.c_str())); -} - /*}}}*/ -// TranslationsIndex::Size - Return the size of the index /*{{{*/ -// --------------------------------------------------------------------- -/* This is really only used for progress reporting. */ -unsigned long debTranslationsIndex::Size() const -{ - unsigned long size = 0; - - /* we need to ignore errors here; if the lists are absent, just return 0 */ - _error->PushToStack(); - - FileFd f(IndexFile(Language.c_str()), FileFd::ReadOnly, FileFd::Extension); - if (!f.Failed()) - size = f.Size(); - - if (_error->PendingError() == true) - size = 0; - _error->RevertToStack(); - - return size; + return Exists(); } /*}}}*/ // TranslationsIndex::Merge - Load the index file into a cache /*{{{*/ @@ -526,7 +214,7 @@ unsigned long debTranslationsIndex::Size() const bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { // Check the translation file, if in use - string TranslationFile = IndexFile(Language.c_str()); + string const TranslationFile = IndexFileName(); if (FileExists(TranslationFile)) { FileFd Trans(TranslationFile,FileFd::ReadOnly, FileFd::Extension); @@ -535,7 +223,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const return false; if (Prog != NULL) - Prog->SubProgress(0, Info(TranslationFile.c_str())); + Prog->SubProgress(0, Target.Description); if (Gen.SelectFile(TranslationFile,string(),*this) == false) return _error->Error("Problem with SelectFile %s",TranslationFile.c_str()); @@ -556,8 +244,8 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const /* */ pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) const { - string FileName = IndexFile(Language.c_str()); - + string FileName = IndexFileName(); + pkgCache::PkgFileIterator File = Cache.FileBegin(); for (; File.end() == false; ++File) { @@ -580,10 +268,11 @@ pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) con return pkgCache::PkgFileIterator(Cache); } return File; - } + } return File; } /*}}}*/ + // StatusIndex::debStatusIndex - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 1e5882071..dd3f212b2 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -30,19 +30,16 @@ class pkgCacheGenerator; class APT_HIDDEN debStatusIndex : public pkgIndexFile { - /** \brief dpointer placeholder (for later in case we need it) */ - void *d; - protected: std::string File; public: virtual const Type *GetType() const APT_CONST; - + // Interface for acquire virtual std::string Describe(bool /*Short*/) const {return File;}; - + // Interface for the Cache Generator virtual bool Exists() const; virtual bool HasPackages() const {return true;}; @@ -54,91 +51,42 @@ class APT_HIDDEN debStatusIndex : public pkgIndexFile debStatusIndex(std::string File); virtual ~debStatusIndex(); }; - -class APT_HIDDEN debPackagesIndex : public pkgIndexFile -{ - /** \brief dpointer placeholder (for later in case we need it) */ - void *d; - - std::string URI; - std::string Dist; - std::string Section; - std::string Architecture; - - APT_HIDDEN std::string Info(const char *Type) const; - APT_HIDDEN std::string IndexFile(const char *Type) const; - APT_HIDDEN std::string IndexURI(const char *Type) const; +class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile +{ public: - + virtual const Type *GetType() const APT_CONST; // Stuff for accessing files on remote items virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const; - virtual std::string ArchiveURI(std::string File) const {return URI + File;}; - - // Interface for acquire - virtual std::string Describe(bool Short) const; - + // Interface for the Cache Generator - virtual bool Exists() const; virtual bool HasPackages() const {return true;}; - virtual unsigned long Size() const; virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; - debPackagesIndex(std::string const &URI, std::string const &Dist, std::string const &Section, - bool const &Trusted, std::string const &Arch = "native"); + debPackagesIndex(IndexTarget const &Target, bool const Trusted); virtual ~debPackagesIndex(); }; -class APT_HIDDEN debTranslationsIndex : public pkgIndexFile +class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile { - /** \brief dpointer placeholder (for later in case we need it) */ - void *d; - - std::string const URI; - std::string const Dist; - std::string const Section; - std::string const Language; - - APT_HIDDEN std::string Info(const char *Type) const; - APT_HIDDEN std::string IndexFile(const char *Type) const; - APT_HIDDEN std::string IndexURI(const char *Type) const; - - APT_HIDDEN std::string TranslationFile() const {return std::string("Translation-").append(Language);}; - public: virtual const Type *GetType() const APT_CONST; - // Interface for acquire - virtual std::string Describe(bool Short) const; - // Interface for the Cache Generator - virtual bool Exists() const; virtual bool HasPackages() const; - virtual unsigned long Size() const; virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; - debTranslationsIndex(std::string const &URI,std::string const &Dist,std::string const &Section, std::string const &Language); + debTranslationsIndex(IndexTarget const &Target); virtual ~debTranslationsIndex(); }; -class APT_HIDDEN debSourcesIndex : public pkgIndexFile +class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile { - /** \brief dpointer placeholder (for later in case we need it) */ - void *d; - - std::string URI; - std::string Dist; - std::string Section; - - APT_HIDDEN std::string Info(const char *Type) const; - APT_HIDDEN std::string IndexFile(const char *Type) const; - APT_HIDDEN std::string IndexURI(const char *Type) const; - public: virtual const Type *GetType() const APT_CONST; @@ -146,20 +94,14 @@ class APT_HIDDEN debSourcesIndex : public pkgIndexFile // Stuff for accessing files on remote items virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, pkgSrcRecords::File const &File) const; - virtual std::string ArchiveURI(std::string File) const {return URI + File;}; - - // Interface for acquire - virtual std::string Describe(bool Short) const; // Interface for the record parsers virtual pkgSrcRecords::Parser *CreateSrcParser() const; - + // Interface for the Cache Generator - virtual bool Exists() const; virtual bool HasPackages() const {return false;}; - virtual unsigned long Size() const; - - debSourcesIndex(std::string URI,std::string Dist,std::string Section,bool Trusted); + + debSourcesIndex(IndexTarget const &Target, bool const Trusted); virtual ~debSourcesIndex(); }; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index d4e340be0..9108a5097 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -140,6 +140,7 @@ void foreachTarget(std::string const URI, std::string const Dist, Options.insert(std::make_pair("LANGUAGE", *l)); Options.insert(std::make_pair("ARCHITECTURE", "source")); Options.insert(std::make_pair("BASE_URI", baseURI)); + Options.insert(std::make_pair("REPO_URI", URI)); Options.insert(std::make_pair("CREATED_BY", *T)); Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options); @@ -186,6 +187,7 @@ void foreachTarget(std::string const URI, std::string const Dist, Options.insert(std::make_pair("LANGUAGE", *l)); Options.insert(std::make_pair("ARCHITECTURE", a->first)); Options.insert(std::make_pair("BASE_URI", baseURI)); + Options.insert(std::make_pair("REPO_URI", URI)); Options.insert(std::make_pair("CREATED_BY", *T)); Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options); @@ -294,55 +296,25 @@ bool debReleaseIndex::IsTrusted() const return FileExists(VerifiedSigFile); } -struct GetIndexFilesClass +std::vector *debReleaseIndex::GetIndexFiles() { - vector * const Indexes; - std::string const URI; - std::string const Release; - bool const IsTrusted; + if (Indexes != NULL) + return Indexes; - void operator()(std::string const &/*URI*/, std::string const &/*ShortDesc*/, std::string const &/*LongDesc*/, - bool const /*IsOptional*/, std::map Options) + Indexes = new std::vector(); + std::vector const Targets = GetIndexTargets(); + bool const istrusted = IsTrusted(); + for (std::vector::const_iterator T = Targets.begin(); T != Targets.end(); ++T) { - std::string const TargetName = Options.find("CREATED_BY")->second; + std::string const TargetName = T->Options.find("CREATED_BY")->second; if (TargetName == "Packages") - { - Indexes->push_back(new debPackagesIndex( - URI, - Release, - Options.find("COMPONENT")->second, - IsTrusted, - Options.find("ARCHITECTURE")->second - )); - } + Indexes->push_back(new debPackagesIndex(*T, istrusted)); else if (TargetName == "Sources") - Indexes->push_back(new debSourcesIndex( - URI, - Release, - Options.find("COMPONENT")->second, - IsTrusted - )); + Indexes->push_back(new debSourcesIndex(*T, istrusted)); else if (TargetName == "Translations") - Indexes->push_back(new debTranslationsIndex( - URI, - Release, - Options.find("COMPONENT")->second, - Options.find("LANGUAGE")->second - )); + Indexes->push_back(new debTranslationsIndex(*T)); } - - GetIndexFilesClass(std::string const &URI, std::string const &Release, bool const IsTrusted) : - Indexes(new vector ), URI(URI), Release(Release), IsTrusted(IsTrusted) {} -}; - -std::vector *debReleaseIndex::GetIndexFiles() -{ - if (Indexes != NULL) - return Indexes; - - GetIndexFilesClass comp(URI, Dist, IsTrusted()); - foreachTarget(URI, Dist, ArchEntries, comp); - return Indexes = comp.Indexes; + return Indexes; } void debReleaseIndex::PushSectionEntry(vector const &Archs, const debSectionEntry *Entry) { diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index 89615cb41..bbcd9246c 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -10,8 +10,10 @@ // Include Files /*{{{*/ #include +#include #include #include +#include #include #include #include @@ -48,27 +50,26 @@ pkgIndexFile::Type *pkgIndexFile::Type::GetType(const char *Type) if (strcmp(GlobalList[I]->Label,Type) == 0) return GlobalList[I]; return 0; +} + /*}}}*/ +pkgIndexFile::pkgIndexFile(bool Trusted) : /*{{{*/ + Trusted(Trusted) +{ } /*}}}*/ // IndexFile::ArchiveInfo - Stub /*{{{*/ -// --------------------------------------------------------------------- -/* */ std::string pkgIndexFile::ArchiveInfo(pkgCache::VerIterator /*Ver*/) const { return std::string(); } /*}}}*/ // IndexFile::FindInCache - Stub /*{{{*/ -// --------------------------------------------------------------------- -/* */ pkgCache::PkgFileIterator pkgIndexFile::FindInCache(pkgCache &Cache) const { return pkgCache::PkgFileIterator(Cache); } /*}}}*/ // IndexFile::SourceIndex - Stub /*{{{*/ -// --------------------------------------------------------------------- -/* */ std::string pkgIndexFile::SourceInfo(pkgSrcRecords::Parser const &/*Record*/, pkgSrcRecords::File const &/*File*/) const { @@ -110,3 +111,77 @@ APT_DEPRECATED std::string pkgIndexFile::LanguageCode() { return APT::Configuration::getLanguages()[0]; } /*}}}*/ + +// IndexTarget - Constructor /*{{{*/ +IndexTarget::IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, + std::string const &LongDesc, std::string const &URI, bool const IsOptional, + std::map const &Options) : + URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey), IsOptional(IsOptional), Options(Options) +{ +} + /*}}}*/ +std::string IndexTarget::Option(std::string const &Key) const /*{{{*/ +{ + std::map::const_iterator const M = Options.find(Key); + if (M == Options.end()) + return ""; + return M->second; +} + /*}}}*/ + +pkgIndexTargetFile::pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted) :/*{{{*/ + pkgIndexFile(Trusted), Target(Target) +{ +} + /*}}}*/ +std::string pkgIndexTargetFile::ArchiveURI(std::string File) const/*{{{*/ +{ + return Target.Option("REPO_URI") + File; +} + /*}}}*/ +std::string pkgIndexTargetFile::Describe(bool Short) const /*{{{*/ +{ + if (Short) + return Target.Description; + return Target.Description + " (" + IndexFileName() + ")"; +} + /*}}}*/ +std::string pkgIndexTargetFile::IndexFileName() const /*{{{*/ +{ + std::string const s =_config->FindDir("Dir::State::lists") + URItoFileName(Target.URI); + if (FileExists(s)) + return s; + + std::vector types = APT::Configuration::getCompressionTypes(); + for (std::vector::const_iterator t = types.begin(); t != types.end(); ++t) + { + std::string p = s + '.' + *t; + if (FileExists(p)) + return p; + } + return s; +} + /*}}}*/ +unsigned long pkgIndexTargetFile::Size() const /*{{{*/ +{ + unsigned long size = 0; + + /* we need to ignore errors here; if the lists are absent, just return 0 */ + _error->PushToStack(); + + FileFd f(IndexFileName(), FileFd::ReadOnly, FileFd::Extension); + if (!f.Failed()) + size = f.Size(); + + if (_error->PendingError() == true) + size = 0; + _error->RevertToStack(); + + return size; +} + /*}}}*/ +bool pkgIndexTargetFile::Exists() const /*{{{*/ +{ + return FileExists(IndexFileName()); +} + /*}}}*/ diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 817165f08..e6e429c2c 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -28,6 +28,7 @@ #include #include +#include #include #ifndef APT_8_CLEANER_HEADERS @@ -40,17 +41,48 @@ class pkgAcquire; class pkgCacheGenerator; class OpProgress; +class IndexTarget /*{{{*/ +/** \brief Information about an index file. */ +{ + public: + /** \brief A URI from which the index file can be downloaded. */ + std::string URI; + + /** \brief A description of the index file. */ + std::string Description; + + /** \brief A shorter description of the index file. */ + std::string ShortDesc; + + /** \brief The key by which this index file should be + looked up within the meta index file. */ + std::string MetaKey; + + /** \brief Is it okay if the file isn't found in the meta index */ + bool IsOptional; + + /** \brief Target specific options defined by the implementation */ + std::map Options; + + IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, + std::string const &LongDesc, std::string const &URI, bool const IsOptional, + std::map const &Options); + + std::string Option(std::string const &Key) const; +}; + /*}}}*/ + class pkgIndexFile { protected: bool Trusted; - + public: class Type { public: - + // Global list of Items supported static Type **GlobalList; static unsigned long GlobalListLen; @@ -70,7 +102,7 @@ class pkgIndexFile virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const; virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, pkgSrcRecords::File const &File) const; - virtual std::string Describe(bool Short = false) const = 0; + virtual std::string Describe(bool Short = false) const = 0; // Interface for acquire virtual std::string ArchiveURI(std::string /*File*/) const {return std::string();}; @@ -95,9 +127,25 @@ class pkgIndexFile static std::string LanguageCode(); bool IsTrusted() const { return Trusted; }; - - pkgIndexFile(bool Trusted): Trusted(Trusted) {}; + + pkgIndexFile(bool Trusted); virtual ~pkgIndexFile() {}; }; +class pkgIndexTargetFile : public pkgIndexFile +{ +protected: + IndexTarget const Target; + + std::string IndexFileName() const; + +public: + virtual std::string ArchiveURI(std::string File) const; + virtual std::string Describe(bool Short = false) const; + virtual bool Exists() const; + virtual unsigned long Size() const; + + pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted); +}; + #endif -- cgit v1.2.3 From 001c76fe204e17916a6c8b351ff30b67d32cb779 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 11 Jun 2015 11:59:16 +0200 Subject: use an enum instead of strings as IndexTarget::Option interface Strings are easy to typo and we can keep the extensibility we require here with a simple enum we can append to without endangering ABI. Git-Dch: Ignore --- apt-pkg/deb/debindexfile.cc | 14 +++++++------- apt-pkg/deb/debmetaindex.cc | 2 +- apt-pkg/indexfile.cc | 18 ++++++++++++++++-- apt-pkg/indexfile.h | 16 ++++++++++++++-- 4 files changed, 38 insertions(+), 12 deletions(-) diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 3e60423ff..7aad65c0e 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -93,9 +93,9 @@ debPackagesIndex::debPackagesIndex(IndexTarget const &Target, bool const Trusted /* This is a shorter version that is designed to be < 60 chars or so */ string debPackagesIndex::ArchiveInfo(pkgCache::VerIterator Ver) const { - std::string const Dist = Target.Option("RELEASE"); - string Res = Target.Option("SITE") + " " + Dist; - std::string const Component = Target.Option("COMPONENT"); + std::string const Dist = Target.Option(IndexTarget::RELEASE); + string Res = Target.Option(IndexTarget::SITE) + " " + Dist; + std::string const Component = Target.Option(IndexTarget::COMPONENT); if (Component.empty() == false) Res += "/" + Component; @@ -115,7 +115,7 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { string const PackageFile = IndexFileName(); FileFd Pkg(PackageFile,FileFd::ReadOnly, FileFd::Extension); - debListParser Parser(&Pkg, Target.Option("ARCHITECTURE")); + debListParser Parser(&Pkg, Target.Option(IndexTarget::ARCHITECTURE)); if (_error->PendingError() == true) return _error->Error("Problem opening %s",PackageFile.c_str()); @@ -123,8 +123,8 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const Prog->SubProgress(0, Target.Description); - std::string const URI = Target.Option("REPO_URI"); - std::string Dist = Target.Option("RELEASE"); + std::string const URI = Target.Option(IndexTarget::REPO_URI); + std::string Dist = Target.Option(IndexTarget::RELEASE); if (Dist.empty()) Dist = "/"; ::URI Tmp(URI); @@ -158,7 +158,7 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (_error->PendingError() == true) return false; - Parser.LoadReleaseInfo(File, Rel, Target.Option("COMPONENT")); + Parser.LoadReleaseInfo(File, Rel, Target.Option(IndexTarget::COMPONENT)); } return true; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 9108a5097..c05e7cdae 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -306,7 +306,7 @@ std::vector *debReleaseIndex::GetIndexFiles() bool const istrusted = IsTrusted(); for (std::vector::const_iterator T = Targets.begin(); T != Targets.end(); ++T) { - std::string const TargetName = T->Options.find("CREATED_BY")->second; + std::string const TargetName = T->Option(IndexTarget::CREATED_BY); if (TargetName == "Packages") Indexes->push_back(new debPackagesIndex(*T, istrusted)); else if (TargetName == "Sources") diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index bbcd9246c..72d35ddcc 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -120,8 +120,22 @@ IndexTarget::IndexTarget(std::string const &MetaKey, std::string const &ShortDes { } /*}}}*/ -std::string IndexTarget::Option(std::string const &Key) const /*{{{*/ +std::string IndexTarget::Option(OptionKeys const EnumKey) const /*{{{*/ { + std::string Key; + switch (EnumKey) + { +#define APT_CASE(X) case X: Key = #X; break + APT_CASE(SITE); + APT_CASE(RELEASE); + APT_CASE(COMPONENT); + APT_CASE(LANGUAGE); + APT_CASE(ARCHITECTURE); + APT_CASE(BASE_URI); + APT_CASE(REPO_URI); + APT_CASE(CREATED_BY); +#undef APT_CASE + } std::map::const_iterator const M = Options.find(Key); if (M == Options.end()) return ""; @@ -136,7 +150,7 @@ pkgIndexTargetFile::pkgIndexTargetFile(IndexTarget const &Target, bool const Tru /*}}}*/ std::string pkgIndexTargetFile::ArchiveURI(std::string File) const/*{{{*/ { - return Target.Option("REPO_URI") + File; + return Target.Option(IndexTarget::REPO_URI) + File; } /*}}}*/ std::string pkgIndexTargetFile::Describe(bool Short) const /*{{{*/ diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index e6e429c2c..c38cf0bf0 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -61,14 +61,26 @@ class IndexTarget /*{{{*/ /** \brief Is it okay if the file isn't found in the meta index */ bool IsOptional; - /** \brief Target specific options defined by the implementation */ + /** \brief options with which this target was created + Prefer the usage of #Option if at all possible. + Beware: Not all of these options are intended for public use */ std::map Options; IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, std::string const &LongDesc, std::string const &URI, bool const IsOptional, std::map const &Options); - std::string Option(std::string const &Key) const; + enum OptionKeys { + SITE, + RELEASE, + COMPONENT, + LANGUAGE, + ARCHITECTURE, + BASE_URI, + REPO_URI, + CREATED_BY, + }; + std::string Option(OptionKeys const Key) const; }; /*}}}*/ -- cgit v1.2.3 From 8881b11eacd735148d087c8c0f53827cb537b582 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 11 Jun 2015 16:40:45 +0200 Subject: implement 'apt-get files' to access index targets Downloading additional files is only half the job. We still need a way to allow external tools to know where the files are they requested for download given that we don't want them to choose their own location. 'apt-get files' is our answer to this showing by default in a deb822 format information about each IndexTarget with the potential to filter the records based on lines and an option to change the output format. The command serves also as an example on how to get to this information via libapt. --- apt-pkg/deb/debmetaindex.cc | 17 +++-- apt-pkg/indexfile.cc | 18 ++++- apt-pkg/indexfile.h | 3 + apt-private/private-cmndline.cc | 4 + cmdline/apt-get.cc | 87 ++++++++++++++++++++++ doc/acquire-additional-files.txt | 87 +++++++++++++++++++++- doc/apt-get.8.xml | 15 ++++ test/integration/test-apt-acquire-additional-files | 2 + 8 files changed, 223 insertions(+), 10 deletions(-) diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index c05e7cdae..8e4c2be2d 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -136,11 +136,14 @@ void foreachTarget(std::string const URI, std::string const Dist, std::map Options; Options.insert(std::make_pair("SITE", Site)); Options.insert(std::make_pair("RELEASE", Release)); - Options.insert(std::make_pair("COMPONENT", (*I)->Section)); - Options.insert(std::make_pair("LANGUAGE", *l)); + if (MetaKey.find("$(COMPONENT)") != std::string::npos) + Options.insert(std::make_pair("COMPONENT", (*I)->Section)); + if (MetaKey.find("$(LANGUAGE)") != std::string::npos) + Options.insert(std::make_pair("LANGUAGE", *l)); Options.insert(std::make_pair("ARCHITECTURE", "source")); Options.insert(std::make_pair("BASE_URI", baseURI)); Options.insert(std::make_pair("REPO_URI", URI)); + Options.insert(std::make_pair("TARGET_OF", "deb-src")); Options.insert(std::make_pair("CREATED_BY", *T)); Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options); @@ -183,11 +186,15 @@ void foreachTarget(std::string const URI, std::string const Dist, std::map Options; Options.insert(std::make_pair("SITE", Site)); Options.insert(std::make_pair("RELEASE", Release)); - Options.insert(std::make_pair("COMPONENT", (*I)->Section)); - Options.insert(std::make_pair("LANGUAGE", *l)); - Options.insert(std::make_pair("ARCHITECTURE", a->first)); + if (MetaKey.find("$(COMPONENT)") != std::string::npos) + Options.insert(std::make_pair("COMPONENT", (*I)->Section)); + if (MetaKey.find("$(LANGUAGE)") != std::string::npos) + Options.insert(std::make_pair("LANGUAGE", *l)); + if (MetaKey.find("$(ARCHITECTURE)") != std::string::npos) + Options.insert(std::make_pair("ARCHITECTURE", a->first)); Options.insert(std::make_pair("BASE_URI", baseURI)); Options.insert(std::make_pair("REPO_URI", URI)); + Options.insert(std::make_pair("TARGET_OF", "deb")); Options.insert(std::make_pair("CREATED_BY", *T)); Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options); diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index 72d35ddcc..33fb48e35 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -133,8 +133,10 @@ std::string IndexTarget::Option(OptionKeys const EnumKey) const /*{{{*/ APT_CASE(ARCHITECTURE); APT_CASE(BASE_URI); APT_CASE(REPO_URI); + APT_CASE(TARGET_OF); APT_CASE(CREATED_BY); #undef APT_CASE + case FILENAME: return _config->FindDir("Dir::State::lists") + URItoFileName(URI); } std::map::const_iterator const M = Options.find(Key); if (M == Options.end()) @@ -142,6 +144,20 @@ std::string IndexTarget::Option(OptionKeys const EnumKey) const /*{{{*/ return M->second; } /*}}}*/ +std::string IndexTarget::Format(std::string format) const /*{{{*/ +{ + for (std::map::const_iterator O = Options.begin(); O != Options.end(); ++O) + { + format = SubstVar(format, std::string("$(") + O->first + ")", O->second); + } + format = SubstVar(format, "$(METAKEY)", MetaKey); + format = SubstVar(format, "$(SHORTDESC)", ShortDesc); + format = SubstVar(format, "$(DESCRIPTION)", Description); + format = SubstVar(format, "$(URI)", URI); + format = SubstVar(format, "$(FILENAME)", Option(IndexTarget::FILENAME)); + return format; +} + /*}}}*/ pkgIndexTargetFile::pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted) :/*{{{*/ pkgIndexFile(Trusted), Target(Target) @@ -162,7 +178,7 @@ std::string pkgIndexTargetFile::Describe(bool Short) const /*{{{*/ /*}}}*/ std::string pkgIndexTargetFile::IndexFileName() const /*{{{*/ { - std::string const s =_config->FindDir("Dir::State::lists") + URItoFileName(Target.URI); + std::string const s = Target.Option(IndexTarget::FILENAME); if (FileExists(s)) return s; diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index c38cf0bf0..220c415ac 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -79,8 +79,11 @@ class IndexTarget /*{{{*/ BASE_URI, REPO_URI, CREATED_BY, + TARGET_OF, + FILENAME, }; std::string Option(OptionKeys const Key) const; + std::string Format(std::string format) const; }; /*}}}*/ diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 41aab81f6..458051bf2 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -163,6 +163,10 @@ static bool addArgumentsAPTGet(std::vector &Args, char const // once sbuild is fixed, this option can be removed addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0); } + else if (CmdMatches("files")) + { + addArg(0,"format","APT::Get::Files::Format", CommandLine::HasArg); + } else if (CmdMatches("clean", "autoclean", "check", "download", "changelog") || CmdMatches("markauto", "unmarkauto")) // deprecated commands ; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index c1f78523c..0fff2db58 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -86,6 +86,7 @@ #include #include #include +#include #include #include #include @@ -1602,6 +1603,91 @@ static bool DoChangelog(CommandLine &CmdL) return true; } /*}}}*/ +// DoFiles - Lists all IndexTargets /*{{{*/ +static std::string format_key(std::string key) +{ + // deb822 is case-insensitive, but the human eye prefers candy + std::transform(key.begin(), key.end(), key.begin(), ::tolower); + key[0] = ::toupper(key[0]); + size_t found = key.find("_uri"); + if (found != std::string::npos) + key.replace(found, 4, "-URI"); + while ((found = key.find('_')) != std::string::npos) + { + key[found] = '-'; + key[found + 1] = ::toupper(key[found + 1]); + } + return key; +} +static bool DoFiles(CommandLine &CmdL) +{ + pkgCacheFile CacheFile; + pkgSourceList *SrcList = CacheFile.GetSourceList(); + + if (SrcList == NULL) + return false; + + std::string const Format = _config->Find("APT::Get::Files::Format"); + bool Filtered = CmdL.FileSize() > 1; + for (pkgSourceList::const_iterator S = SrcList->begin(); S != SrcList->end(); ++S) + { + std::vector const targets = (*S)->GetIndexTargets(); + std::map AddOptions; + AddOptions.insert(std::make_pair("TRUSTED", ((*S)->IsTrusted() ? "yes" : "no"))); + + for (std::vector::const_iterator T = targets.begin(); T != targets.end(); ++T) + { + std::ostringstream stanza; + if (Filtered || Format.empty()) + { + stanza << "MetaKey: " << T->MetaKey << "\n" + << "ShortDesc: " << T->ShortDesc << "\n" + << "Description: " << T->Description << "\n" + << "URI: " << T->URI << "\n" + << "Filename: " << T->Option(IndexTarget::FILENAME) << "\n" + << "Optional: " << (T->IsOptional ? "yes" : "no") << "\n"; + for (std::map::const_iterator O = AddOptions.begin(); O != AddOptions.end(); ++O) + stanza << format_key(O->first) << ": " << O->second << "\n"; + for (std::map::const_iterator O = T->Options.begin(); O != T->Options.end(); ++O) + stanza << format_key(O->first) << ": " << O->second << "\n"; + stanza << "\n"; + + if (Filtered) + { + // that is a bit crude, but good enough for now + bool found = true; + std::string haystack = std::string("\n") + stanza.str() + "\n"; + std::transform(haystack.begin(), haystack.end(), haystack.begin(), ::tolower); + size_t const filesize = CmdL.FileSize() - 1; + for (size_t i = 0; i != filesize; ++i) + { + std::string needle = std::string("\n") + CmdL.FileList[i + 1] + "\n"; + std::transform(needle.begin(), needle.end(), needle.begin(), ::tolower); + if (haystack.find(needle) != std::string::npos) + continue; + found = false; + break; + } + if (found == false) + continue; + } + } + + if (Format.empty()) + cout << stanza.str(); + else + { + std::string out = T->Format(Format); + for (std::map::const_iterator O = AddOptions.begin(); O != AddOptions.end(); ++O) + out = SubstVar(out, std::string("$(") + O->first + ")", O->second); + cout << out << std::endl; + } + } + } + + return true; +} + /*}}}*/ // ShowHelp - Show a help screen /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -1716,6 +1802,7 @@ int main(int argc,const char *argv[]) /*{{{*/ {"source",&DoSource}, {"download",&DoDownload}, {"changelog",&DoChangelog}, + {"files",&DoFiles}, {"moo",&DoMoo}, {"help",&ShowHelp}, {0,0}}; diff --git a/doc/acquire-additional-files.txt b/doc/acquire-additional-files.txt index ab833440b..a47dac2d4 100644 --- a/doc/acquire-additional-files.txt +++ b/doc/acquire-additional-files.txt @@ -47,11 +47,13 @@ All files which should be downloaded (nicknamed 'Targets') are mentioned below the APT::Acquire::Targets scope. 'deb' is here the type of the sources.list entry the file should be acquired for. The only other supported value is hence 'deb-src'. Beware: You can't specify multiple -types here and you can't download the same MetaKey form multiple types! +types here and you can't download the same (evaluated) MetaKey from +multiple types! After the type you can pick any valid and unique string which preferable refers to the file it downloads (In the example we picked 'Packages'). -This string is never shown or used. +This string is used as identifier for the target class and accessible as +'Created-By' e.g. in the "apt-get files" output as detailed below. All targets have three main properties you can define: * MetaKey: The identifier of the file to be downloaded as used in the @@ -123,11 +125,12 @@ by the acquire system. The following variables are known; note that unknown variables have no default value nor are they touched: They are printed literally. -* $(SITE): An identifier of the site we access, e.g. - "http://example.org/". +* $(SITE): An identifier of the site we access as seen in sources.list, + e.g. "http://example.org/debian" or "file:/path/to/a/repository". * $(RELEASE): This is usually an archive- or codename, e.g. "stable" or "stretch". Note that flat-style repositories do not have a archive- or codename per-se, so the value might very well be just "/" or so. + Again, as seen in the sources.list. * $(COMPONENT): as given in the sources.list, e.g. "main", "non-free" or "universe". Note that flat-style repositories again do not really have a meaningful value here. @@ -137,3 +140,79 @@ printed literally. APT::Architectures (potentially modified by sources.list options), e.g. "amd64", "i386" or "armel" for the 'deb' type. In type 'deb-src' this variable has the value "source". + +Note that while more variables might exist in the implementation, these +are to be considered undefined and their usage strongly discouraged. If +you have a need for another variable contact us instead. + +# Accessing files + +Do NOT hardcode specific file locations, names or compression types in +your application! You will notice that the configuration options give +you no choice over where the downloaded files will be stored. This is by +design so multiple applications can download and use the same file +rather than each and every one of them potentially downloads and uses +its own copy somewhere on disk. + +"apt-get files" can be used to get the location as well as other +information about all files downloaded (aka: you will see Packages, +Sources and Translation-* files here as well). Provide a line of the +default output format as parameter to filter out all entries which do +not have such a line. With --format, you can further more define your +own output style. The variables are what you see in the output, just all +uppercase and wrapped in $(), as in the configuration file. + +To get all the filenames of all Translation-en files you can e.g. call: + apt-get files --format '$(FILENAME)' "Created-By: Translations" "Language: en" + +Accessing this information via libapt is done by reading the +sources.lists (pkgSourceList), iterating over the metaIndex objects this +creates and calling GetIndexTargets() on them. See the sourcecode of +"apt-get files" for a complete example. + +Remarks on the available fields: +* MetaKey, ShortDesc, Description, Site, Release: as defined + by the configuration and described further above. +* Created-By: configuration entity responsible for this target +* Target-Of: type of the sources.list entry +* URI, Repo-URI: avoid using. Contains potentially username/password. + Prefer 'Site', especially for display. +* Filename: The mentioned file doesn't need to exist, e.g. because the + file wasn't downloaded yet – or it does exist compressed. libapt users + are encouraged to use FileFd to open such files as it can handle + decompression transparently. +* Trusted: As of the last 'apt-get update' call denoting if e.g. apt-get + would print the unauthenticated warning while installing packages + mentioned in this file (example assumes Packages file) [Not really + a property of the target itself, but of the metaIndex]. +* Optional: Decodes the option of the same name from the configuration. + Note that it is using 'yes' and 'no' instead of 'true' and 'false'. +* Language, Architecture, Component: as defined further above, but with + the catch that they might be missing if they don't effect the target + (aka: They weren't used while evaluating the MetaKey template). + +Again, additional fields might be visible in certain implementation, but +you should avoid using them and instead talk to us about a portable +implementation. + +# Multiple application requiring the same files + +It is highly encouraged that applications talk to each other and to us +about which files they require. It is usually best to have a common +package ship the configuration needed to get the files, but specific +needs might require specific solutions. Again: talk to us. + +# Acquiring files not mentioned in the Release file + +You can't. This is by design as these files couldn't be verified to not +be modified in transit, corrupted by the download process or simple if +they are present at all on the server, which would require apt to probe +for them. APT did this in the past for legacy reasons, we do not intend +to go back to these dark times. + +This is also why you can't request files from a different server. It +would have the additional problem that this server might not even be +accessible (e.g. proxy settings) or that local sources (file:/, cdrom:/) +start requesting online files… + +In other words: We would be opening Pandora's box. diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index a372a0d30..da077afa7 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -243,6 +243,21 @@ + + Displays by default a deb822 formatted listing of + information about all data files apt-get + update would download. Supports a + option to modify the output format as + well as accepts lines of the default output to filter the records + by. The command is mainly used as an interface for external tools + working with APT to get information as well as filenames for + downloaded files so they can use them as well instead of + downloading them again on their own. Detailed documentation is + omitted here and can instead be found in the source tree in + doc/acquire-additional-files.txt. + + + diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files index 4a6845f40..971cfac2e 100755 --- a/test/integration/test-apt-acquire-additional-files +++ b/test/integration/test-apt-acquire-additional-files @@ -48,6 +48,7 @@ Get:1 http://localhost:8080 unstable/main amd64 Contents [$(stat -c%s aptarchive Reading package lists..." aptget update testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64' find rootdir/var/lib/apt/lists -name '*Contents*' +testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64)" aptget files --format '$(FILENAME)' 'Created-By: Contents' testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64' 'aptarchive/dists/unstable/main/Contents-amd64' # no automatic uncompress based on the name please, @@ -72,6 +73,7 @@ Get:1 http://localhost:8080 unstable/main amd64 Contents.gz [$(stat -c%s aptarch Reading package lists..." aptget update testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' find rootdir/var/lib/apt/lists -name '*Contents*' +testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz)" aptget files --format '$(FILENAME)' 'Created-By: Contents' testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' 'aptarchive/dists/unstable/main/Contents-amd64.gz' rm -f rootdir/etc/apt/apt.conf.d/content-target.conf -- cgit v1.2.3 From b07aeb1a6e24825e534167a737043441e871de9f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 12 Jun 2015 02:08:53 +0200 Subject: store Release files data in the Cache We used to read the Release file for each Packages file and store the data in the PackageFile struct even through potentially many Packages (and Translation-*) files could use the same data. The point of the exercise isn't the duplicated data through. Having the Release files as first-class citizens in the Cache allows us to properly track their state as well as allows us to use the information also for files which aren't in the cache, but where we know to which Release file they belong (Sources are an example for this). This modifies the pkgCache structs, especially the PackagesFile struct which depending on how libapt users access the data in these structs can mean huge breakage or no visible change. As a single data point: aptitude seems to be fine with this. Even if there is breakage it is trivial to fix in a backportable way while avoiding breakage for everyone would be a huge pain for us. Note that not all PackageFile structs have a corresponding ReleaseFile. In particular the dpkg/status file as well as *.deb files have not. As these have only a Archive property need, the Component property takes over this duty and the ReleaseFile remains zero. This is also the reason why it isn't needed nor particularily recommended to change from PackagesFile to ReleaseFile blindly. Sticking with the earlier is usually the better option. --- apt-pkg/acquire-item.cc | 6 +- apt-pkg/cacheiterators.h | 46 ++++++- apt-pkg/clean.cc | 2 +- apt-pkg/deb/debindexfile.cc | 42 ++----- apt-pkg/deb/debindexfile.h | 1 - apt-pkg/deb/deblistparser.cc | 37 ------ apt-pkg/deb/deblistparser.h | 6 +- apt-pkg/deb/debmetaindex.cc | 124 ++++++++++++++++++- apt-pkg/deb/debmetaindex.h | 6 + apt-pkg/deb/dpkgpm.cc | 4 +- apt-pkg/depcache.cc | 6 +- apt-pkg/edsp.cc | 2 +- apt-pkg/edsp/edspindexfile.cc | 5 +- apt-pkg/edsp/edsplistparser.cc | 4 +- apt-pkg/edsp/edsplistparser.h | 4 +- apt-pkg/metaindex.cc | 17 +++ apt-pkg/metaindex.h | 6 + apt-pkg/pkgcache.cc | 77 ++++++++---- apt-pkg/pkgcache.h | 75 ++++++++++-- apt-pkg/pkgcachegen.cc | 226 +++++++++++++++++++++++++++-------- apt-pkg/pkgcachegen.h | 10 +- apt-pkg/policy.cc | 15 ++- apt-pkg/versionmatch.cc | 45 +++---- apt-pkg/versionmatch.h | 4 +- cmdline/apt-cache.cc | 11 +- test/integration/framework | 9 +- test/integration/test-policy-pinning | 2 +- 27 files changed, 573 insertions(+), 219 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index d4191f00e..d6e9ccbe0 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -2568,7 +2568,7 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire * const Owner,pkgSourceList * const Sour // Skip not source sources, they do not have file fields. for (; Vf.end() == false; ++Vf) { - if ((Vf.File()->Flags & pkgCache::Flag::NotSource) != 0) + if (Vf.File().Flagged(pkgCache::Flag::NotSource)) continue; break; } @@ -2636,14 +2636,14 @@ bool pkgAcqArchive::QueueNext() { pkgCache::PkgFileIterator const PkgF = Vf.File(); // Ignore not source sources - if ((PkgF->Flags & pkgCache::Flag::NotSource) != 0) + if (PkgF.Flagged(pkgCache::Flag::NotSource)) continue; // Try to cross match against the source list pkgIndexFile *Index; if (Sources->FindIndex(PkgF, Index) == false) continue; - LocalSource = (PkgF->Flags & pkgCache::Flag::LocalSource) == pkgCache::Flag::LocalSource; + LocalSource = PkgF.Flagged(pkgCache::Flag::LocalSource); // only try to get a trusted package from another source if that source // is also trusted diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index fe798799c..301da6fc4 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -367,27 +367,61 @@ class pkgCache::PrvIterator : public Iterator { } }; /*}}}*/ -// Package file /*{{{*/ -class pkgCache::PkgFileIterator : public Iterator { +// Release file /*{{{*/ +class pkgCache::RlsFileIterator : public Iterator { protected: - inline PackageFile* OwnerPointer() const { - return (Owner != 0) ? Owner->PkgFileP : 0; + inline ReleaseFile* OwnerPointer() const { + return (Owner != 0) ? Owner->RlsFileP : 0; } public: // Iteration - void operator ++(int) {if (S != Owner->PkgFileP) S = Owner->PkgFileP + S->NextFile;} + void operator ++(int) {if (S != Owner->RlsFileP) S = Owner->RlsFileP + S->NextFile;} inline void operator ++() {operator ++(0);} // Accessors inline const char *FileName() const {return S->FileName == 0?0:Owner->StrP + S->FileName;} inline const char *Archive() const {return S->Archive == 0?0:Owner->StrP + S->Archive;} - inline const char *Component() const {return S->Component == 0?0:Owner->StrP + S->Component;} inline const char *Version() const {return S->Version == 0?0:Owner->StrP + S->Version;} inline const char *Origin() const {return S->Origin == 0?0:Owner->StrP + S->Origin;} inline const char *Codename() const {return S->Codename ==0?0:Owner->StrP + S->Codename;} inline const char *Label() const {return S->Label == 0?0:Owner->StrP + S->Label;} inline const char *Site() const {return S->Site == 0?0:Owner->StrP + S->Site;} + inline bool Flagged(pkgCache::Flag::ReleaseFileFlags const flag) const {return (S->Flags & flag) == flag; } + + bool IsOk(); + std::string RelStr(); + + // Constructors + inline RlsFileIterator() : Iterator() {} + inline RlsFileIterator(pkgCache &Owner) : Iterator(Owner, Owner.RlsFileP) {} + inline RlsFileIterator(pkgCache &Owner,ReleaseFile *Trg) : Iterator(Owner, Trg) {} +}; + /*}}}*/ +// Package file /*{{{*/ +class pkgCache::PkgFileIterator : public Iterator { + protected: + inline PackageFile* OwnerPointer() const { + return (Owner != 0) ? Owner->PkgFileP : 0; + } + + public: + // Iteration + void operator ++(int) {if (S != Owner->PkgFileP) S = Owner->PkgFileP + S->NextFile;} + inline void operator ++() {operator ++(0);} + + // Accessors + inline const char *FileName() const {return S->FileName == 0?0:Owner->StrP + S->FileName;} + inline pkgCache::RlsFileIterator ReleaseFile() const {return RlsFileIterator(*Owner, Owner->RlsFileP + S->Release);} + inline const char *Archive() const {return S->Release == 0 ? Component() : ReleaseFile().Archive();} + inline const char *Version() const {return S->Release == 0 ? NULL : ReleaseFile().Version();} + inline const char *Origin() const {return S->Release == 0 ? NULL : ReleaseFile().Origin();} + inline const char *Codename() const {return S->Release == 0 ? NULL : ReleaseFile().Codename();} + inline const char *Label() const {return S->Release == 0 ? NULL : ReleaseFile().Label();} + inline const char *Site() const {return S->Release == 0 ? NULL : ReleaseFile().Site();} + inline bool Flagged(pkgCache::Flag::ReleaseFileFlags const flag) const {return S->Release== 0 ? false : ReleaseFile().Flagged(flag);} + inline bool Flagged(pkgCache::Flag::PkgFFlags const flag) const {return (S->Flags & flag) == flag;} + inline const char *Component() const {return S->Component == 0?0:Owner->StrP + S->Component;} inline const char *Architecture() const {return S->Architecture == 0?0:Owner->StrP + S->Architecture;} inline const char *IndexType() const {return S->IndexType == 0?0:Owner->StrP + S->IndexType;} diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc index 6edce5b6d..0fca60ba9 100644 --- a/apt-pkg/clean.cc +++ b/apt-pkg/clean.cc @@ -106,7 +106,7 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache) J.end() == false; ++J) { if (CleanInstalled == true && - (J.File()->Flags & pkgCache::Flag::NotSource) != 0) + J.File().Flagged(pkgCache::Flag::NotSource)) continue; IsFetchable = true; break; diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 7aad65c0e..3a79cbc58 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -128,7 +128,7 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (Dist.empty()) Dist = "/"; ::URI Tmp(URI); - if (Gen.SelectFile(PackageFile,Tmp.Host,*this) == false) + if (Gen.SelectFile(PackageFile, *this, Target.Option(IndexTarget::COMPONENT)) == false) return _error->Error("Problem with SelectFile %s",PackageFile.c_str()); // Store the IMS information @@ -136,31 +136,10 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const pkgCacheGenerator::Dynamic DynFile(File); File->Size = Pkg.FileSize(); File->mtime = Pkg.ModificationTime(); - + if (Gen.MergeList(Parser) == false) return _error->Error("Problem with MergeList %s",PackageFile.c_str()); - // Check the release file - string ReleaseFile = debReleaseIndex(URI,Dist).MetaIndexFile("InRelease"); - bool releaseExists = false; - if (FileExists(ReleaseFile) == true) - releaseExists = true; - else - ReleaseFile = debReleaseIndex(URI,Dist).MetaIndexFile("Release"); - - if (releaseExists == true || FileExists(ReleaseFile) == true) - { - FileFd Rel; - // Beware: The 'Release' file might be clearsigned in case the - // signature for an 'InRelease' file couldn't be checked - if (OpenMaybeClearSignedFile(ReleaseFile, Rel) == false) - return false; - - if (_error->PendingError() == true) - return false; - Parser.LoadReleaseInfo(File, Rel, Target.Option(IndexTarget::COMPONENT)); - } - return true; } /*}}}*/ @@ -221,17 +200,17 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const debTranslationsParser TransParser(&Trans); if (_error->PendingError() == true) return false; - + if (Prog != NULL) Prog->SubProgress(0, Target.Description); - if (Gen.SelectFile(TranslationFile,string(),*this) == false) + if (Gen.SelectFile(TranslationFile, *this, Target.Option(IndexTarget::COMPONENT), pkgCache::Flag::NotSource) == false) return _error->Error("Problem with SelectFile %s",TranslationFile.c_str()); // Store the IMS information pkgCache::PkgFileIterator TransFile = Gen.GetCurFile(); TransFile->Size = Trans.FileSize(); TransFile->mtime = Trans.ModificationTime(); - + if (Gen.MergeList(TransParser) == false) return _error->Error("Problem with MergeList %s",TranslationFile.c_str()); } @@ -305,18 +284,17 @@ bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (Prog != NULL) Prog->SubProgress(0,File); - if (Gen.SelectFile(File,string(),*this,pkgCache::Flag::NotSource) == false) + if (Gen.SelectFile(File, *this, "now", pkgCache::Flag::NotSource) == false) return _error->Error("Problem with SelectFile %s",File.c_str()); // Store the IMS information pkgCache::PkgFileIterator CFile = Gen.GetCurFile(); + pkgCacheGenerator::Dynamic DynFile(CFile); CFile->Size = Pkg.FileSize(); CFile->mtime = Pkg.ModificationTime(); - map_stringitem_t const storage = Gen.StoreString(pkgCacheGenerator::MIXED, "now"); - CFile->Archive = storage; - + if (Gen.MergeList(Parser) == false) - return _error->Error("Problem with MergeList %s",File.c_str()); + return _error->Error("Problem with MergeList %s",File.c_str()); return true; } /*}}}*/ @@ -431,7 +409,7 @@ bool debDebPkgFileIndex::Merge(pkgCacheGenerator& Gen, OpProgress* Prog) const // and give it to the list parser debDebFileParser Parser(DebControl, DebFile); - if(Gen.SelectFile(DebFile, "local", *this, pkgCache::Flag::LocalSource) == false) + if(Gen.SelectFile(DebFile, *this, "now", pkgCache::Flag::LocalSource) == false) return _error->Error("Problem with SelectFile %s", DebFile.c_str()); pkgCache::PkgFileIterator File = Gen.GetCurFile(); diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index dd3f212b2..6b8c78e5a 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -45,7 +45,6 @@ class APT_HIDDEN debStatusIndex : public pkgIndexFile virtual bool HasPackages() const {return true;}; virtual unsigned long Size() const; virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog, unsigned long const Flag) const; virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; debStatusIndex(std::string File); diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index b80b57bc4..c5e77b0ff 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -951,43 +951,6 @@ bool debListParser::Step() return false; } /*}}}*/ -// ListParser::LoadReleaseInfo - Load the release information /*{{{*/ -// --------------------------------------------------------------------- -/* */ -bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI, - FileFd &File, string component) -{ - // apt-secure does no longer download individual (per-section) Release - // file. to provide Component pinning we use the section name now - map_stringitem_t const storage = StoreString(pkgCacheGenerator::MIXED, component); - FileI->Component = storage; - - pkgTagFile TagFile(&File, File.Size()); - pkgTagSection Section; - if (_error->PendingError() == true || TagFile.Step(Section) == false) - return false; - - std::string data; - #define APT_INRELEASE(TYPE, TAG, STORE) \ - data = Section.FindS(TAG); \ - if (data.empty() == false) \ - { \ - map_stringitem_t const storage = StoreString(pkgCacheGenerator::TYPE, data); \ - STORE = storage; \ - } - APT_INRELEASE(MIXED, "Suite", FileI->Archive) - APT_INRELEASE(MIXED, "Component", FileI->Component) - APT_INRELEASE(VERSIONNUMBER, "Version", FileI->Version) - APT_INRELEASE(MIXED, "Origin", FileI->Origin) - APT_INRELEASE(MIXED, "Codename", FileI->Codename) - APT_INRELEASE(MIXED, "Label", FileI->Label) - #undef APT_INRELEASE - Section.FindFlag("NotAutomatic", FileI->Flags, pkgCache::Flag::NotAutomatic); - Section.FindFlag("ButAutomaticUpgrades", FileI->Flags, pkgCache::Flag::ButAutomaticUpgrades); - - return !_error->PendingError(); -} - /*}}}*/ // ListParser::GetPrio - Convert the priority from a string /*{{{*/ // --------------------------------------------------------------------- /* */ diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 6279d8399..420d5ff08 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -80,9 +80,9 @@ class APT_HIDDEN debListParser : public pkgCacheGenerator::ListParser virtual map_filesize_t Size() {return Section.size();}; virtual bool Step(); - - bool LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,FileFd &File, - std::string section); + + bool LoadReleaseInfo(pkgCache::RlsFileIterator &FileI,FileFd &File, + std::string const §ion); APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop, std::string &Package,std::string &Ver,unsigned int &Op); diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 8e4c2be2d..994b95849 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -10,10 +11,12 @@ #include #include #include -#include #include +#include +#include +#include +#include -#include #include #include #include @@ -21,6 +24,11 @@ #include #include +#include +#include +#include +#include + using namespace std; string debReleaseIndex::MetaIndexInfo(const char *Type) const @@ -37,6 +45,10 @@ string debReleaseIndex::MetaIndexInfo(const char *Type) const Info += Type; return Info; } +std::string debReleaseIndex::Describe() const +{ + return MetaIndexInfo("Release"); +} string debReleaseIndex::MetaIndexFile(const char *Type) const { @@ -339,6 +351,114 @@ debReleaseIndex::debSectionEntry::debSectionEntry (string const &Section, bool const &IsSrc): Section(Section), IsSrc(IsSrc) {} +static bool ReleaseFileName(debReleaseIndex const * const That, std::string &ReleaseFile) +{ + ReleaseFile = That->MetaIndexFile("InRelease"); + bool releaseExists = false; + if (FileExists(ReleaseFile) == true) + releaseExists = true; + else + { + ReleaseFile = That->MetaIndexFile("Release"); + if (FileExists(ReleaseFile)) + releaseExists = true; + } + return releaseExists; +} + +bool debReleaseIndex::Merge(pkgCacheGenerator &Gen,OpProgress * /*Prog*/) const/*{{{*/ +{ + std::string ReleaseFile; + bool const releaseExists = ReleaseFileName(this, ReleaseFile); + + ::URI Tmp(URI); + if (Gen.SelectReleaseFile(ReleaseFile, Tmp.Host) == false) + return _error->Error("Problem with SelectReleaseFile %s", ReleaseFile.c_str()); + + if (releaseExists == false) + return true; + + FileFd Rel; + // Beware: The 'Release' file might be clearsigned in case the + // signature for an 'InRelease' file couldn't be checked + if (OpenMaybeClearSignedFile(ReleaseFile, Rel) == false) + return false; + if (_error->PendingError() == true) + return false; + + // Store the IMS information + pkgCache::RlsFileIterator File = Gen.GetCurRlsFile(); + pkgCacheGenerator::Dynamic DynFile(File); + // Rel can't be used as this is potentially a temporary file + struct stat Buf; + if (stat(ReleaseFile.c_str(), &Buf) != 0) + return _error->Errno("fstat", "Unable to stat file %s", ReleaseFile.c_str()); + File->Size = Buf.st_size; + File->mtime = Buf.st_mtime; + + pkgTagFile TagFile(&Rel, Rel.Size()); + pkgTagSection Section; + if (_error->PendingError() == true || TagFile.Step(Section) == false) + return false; + + std::string data; + #define APT_INRELEASE(TYPE, TAG, STORE) \ + data = Section.FindS(TAG); \ + if (data.empty() == false) \ + { \ + map_stringitem_t const storage = Gen.StoreString(pkgCacheGenerator::TYPE, data); \ + STORE = storage; \ + } + APT_INRELEASE(MIXED, "Suite", File->Archive) + APT_INRELEASE(VERSIONNUMBER, "Version", File->Version) + APT_INRELEASE(MIXED, "Origin", File->Origin) + APT_INRELEASE(MIXED, "Codename", File->Codename) + APT_INRELEASE(MIXED, "Label", File->Label) + #undef APT_INRELEASE + Section.FindFlag("NotAutomatic", File->Flags, pkgCache::Flag::NotAutomatic); + Section.FindFlag("ButAutomaticUpgrades", File->Flags, pkgCache::Flag::ButAutomaticUpgrades); + + return !_error->PendingError(); +} + /*}}}*/ +// ReleaseIndex::FindInCache - Find this index /*{{{*/ +pkgCache::RlsFileIterator debReleaseIndex::FindInCache(pkgCache &Cache) const +{ + std::string ReleaseFile; + bool const releaseExists = ReleaseFileName(this, ReleaseFile); + + pkgCache::RlsFileIterator File = Cache.RlsFileBegin(); + for (; File.end() == false; ++File) + { + if (File->FileName == 0 || ReleaseFile != File.FileName()) + continue; + + // empty means the file does not exist by "design" + if (releaseExists == false && File->Size == 0) + return File; + + struct stat St; + if (stat(File.FileName(),&St) != 0) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "ReleaseIndex::FindInCache - stat failed on " << File.FileName() << std::endl; + return pkgCache::RlsFileIterator(Cache); + } + if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "ReleaseIndex::FindInCache - size (" << St.st_size << " <> " << File->Size + << ") or mtime (" << St.st_mtime << " <> " << File->mtime + << ") doesn't match for " << File.FileName() << std::endl; + return pkgCache::RlsFileIterator(Cache); + } + return File; + } + + return File; +} + /*}}}*/ + class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type { protected: diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 0b1b08432..7e9942710 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -20,6 +20,8 @@ class pkgAcquire; class pkgIndexFile; class debDebPkgFileIndex; class IndexTarget; +class pkgCacheGenerator; +class OpProgress; class APT_HIDDEN debReleaseIndex : public metaIndex { public: @@ -48,6 +50,10 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; virtual std::vector GetIndexTargets() const; + virtual std::string Describe() const; + virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache) const; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; + std::string MetaIndexInfo(const char *Type) const; std::string MetaIndexFile(const char *Types) const; std::string MetaIndexURI(const char *Type) const; diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index a7a66c75d..6ee939edd 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -205,8 +205,10 @@ pkgCache::VerIterator FindNowVersion(const pkgCache::PkgIterator &Pkg) for (Ver = Pkg.VersionList(); Ver.end() == false; ++Ver) for (pkgCache::VerFileIterator Vf = Ver.FileList(); Vf.end() == false; ++Vf) for (pkgCache::PkgFileIterator F = Vf.File(); F.end() == false; ++F) - if (F->Archive != 0 && strcmp(F.Archive(), "now") == 0) + { + if (F.Archive() != 0 && strcmp(F.Archive(), "now") == 0) return Ver; + } return Ver; } /*}}}*/ diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index b73c336db..36e1ac9ec 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1685,13 +1685,13 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator const &Pk for (VerFileIterator J = I.FileList(); J.end() == false; ++J) { - if ((J.File()->Flags & Flag::NotSource) != 0) + if (J.File().Flagged(Flag::NotSource)) continue; /* Stash the highest version of a not-automatic source, we use it if there is nothing better */ - if ((J.File()->Flags & Flag::NotAutomatic) != 0 || - (J.File()->Flags & Flag::ButAutomaticUpgrades) != 0) + if (J.File().Flagged(Flag::NotAutomatic) || + J.File().Flagged(Flag::ButAutomaticUpgrades)) { if (Last.end() == true) Last = I; diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 3c6a7e30f..41cc2cdfe 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -129,7 +129,7 @@ void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgI signed short const p = Cache.GetPolicy().GetPriority(File); if (Pin < p) Pin = p; - if ((File->Flags & pkgCache::Flag::NotSource) != pkgCache::Flag::NotSource) { + if (File.Flagged(pkgCache::Flag::NotSource) == false) { string Release = File.RelStr(); if (!Release.empty()) Releases.insert(Release); diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index d00536362..43dd44a79 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -49,15 +49,14 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (Prog != NULL) Prog->SubProgress(0,File); - if (Gen.SelectFile(File,std::string(),*this) == false) + if (Gen.SelectFile(File, *this, "edsp") == false) return _error->Error("Problem with SelectFile %s",File.c_str()); // Store the IMS information pkgCache::PkgFileIterator CFile = Gen.GetCurFile(); + pkgCacheGenerator::Dynamic DynFile(CFile); CFile->Size = Pkg.FileSize(); CFile->mtime = Pkg.ModificationTime(); - map_stringitem_t const storage = Gen.StoreString(pkgCacheGenerator::MIXED, "edsp::scenario"); - CFile->Archive = storage; if (Gen.MergeList(Parser) == false) return _error->Error("Problem with MergeList %s",File.c_str()); diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index 212dc7840..d62abe709 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -86,8 +86,8 @@ bool edspListParser::ParseStatus(pkgCache::PkgIterator &Pkg, } /*}}}*/ // ListParser::LoadReleaseInfo - Load the release information /*{{{*/ -APT_CONST bool edspListParser::LoadReleaseInfo(pkgCache::PkgFileIterator & /*FileI*/, - FileFd & /*File*/, std::string /*component*/) +APT_CONST bool edspListParser::LoadReleaseInfo(pkgCache::RlsFileIterator & /*FileI*/, + FileFd & /*File*/, std::string const &/*component*/) { return true; } diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index 86cd77606..abe2ef139 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -34,8 +34,8 @@ class APT_HIDDEN edspListParser : public debListParser virtual MD5SumValue Description_md5(); virtual unsigned short VersionHash(); - bool LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,FileFd &File, - std::string section); + bool LoadReleaseInfo(pkgCache::RlsFileIterator &FileI,FileFd &File, + std::string const §ion); edspListParser(FileFd *File, std::string const &Arch = ""); diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 31a8ec009..35ab6c53b 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -1,4 +1,5 @@ // Include Files /*{{{*/ +#include #include #include @@ -22,6 +23,22 @@ std::string metaIndex::LocalFileName() const } #endif +std::string metaIndex::Describe() const +{ + return "Release"; +} + +pkgCache::RlsFileIterator metaIndex::FindInCache(pkgCache &Cache) const +{ + return pkgCache::RlsFileIterator(Cache); +} + +bool metaIndex::Merge(pkgCacheGenerator &Gen,OpProgress *) const +{ + return Gen.SelectReleaseFile("", ""); +} + + metaIndex::metaIndex(std::string const &URI, std::string const &Dist, char const * const Type) : Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false) diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 4e5de8be0..20c879a89 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -23,6 +23,8 @@ using std::string; class pkgAcquire; class IndexTarget; +class pkgCacheGenerator; +class OpProgress; class metaIndex { @@ -51,6 +53,10 @@ class metaIndex virtual std::vector *GetIndexFiles() = 0; virtual bool IsTrusted() const = 0; + virtual std::string Describe() const; + virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache) const; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; + metaIndex(std::string const &URI, std::string const &Dist, char const * const Type); virtual ~metaIndex(); diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 864ae0f60..9fe382108 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -61,6 +61,7 @@ pkgCache::Header::Header() HeaderSz = sizeof(pkgCache::Header); GroupSz = sizeof(pkgCache::Group); PackageSz = sizeof(pkgCache::Package); + ReleaseFileSz = sizeof(pkgCache::ReleaseFile); PackageFileSz = sizeof(pkgCache::PackageFile); VersionSz = sizeof(pkgCache::Version); DescriptionSz = sizeof(pkgCache::Description); @@ -74,6 +75,7 @@ pkgCache::Header::Header() VersionCount = 0; DescriptionCount = 0; DependsCount = 0; + ReleaseFileCount = 0; PackageFileCount = 0; VerFileCount = 0; DescFileCount = 0; @@ -82,6 +84,7 @@ pkgCache::Header::Header() MaxDescFileSize = 0; FileList = 0; + RlsFileList = 0; #if APT_PKG_ABI < 413 APT_IGNORE_DEPRECATED(StringList = 0;) #endif @@ -102,6 +105,7 @@ bool pkgCache::Header::CheckSizes(Header &Against) const if (HeaderSz == Against.HeaderSz && GroupSz == Against.GroupSz && PackageSz == Against.PackageSz && + ReleaseFileSz == Against.ReleaseFileSz && PackageFileSz == Against.PackageFileSz && VersionSz == Against.VersionSz && DescriptionSz == Against.DescriptionSz && @@ -140,6 +144,7 @@ bool pkgCache::ReMap(bool const &Errorchecks) PkgP = (Package *)Map.Data(); VerFileP = (VerFile *)Map.Data(); DescFileP = (DescFile *)Map.Data(); + RlsFileP = (ReleaseFile *)Map.Data(); PkgFileP = (PackageFile *)Map.Data(); VerP = (Version *)Map.Data(); DescP = (Description *)Map.Data(); @@ -814,7 +819,7 @@ APT_PURE bool pkgCache::VerIterator::Downloadable() const { VerFileIterator Files = FileList(); for (; Files.end() == false; ++Files) - if ((Files.File()->Flags & pkgCache::Flag::NotSource) != pkgCache::Flag::NotSource) + if (Files.File().Flagged(pkgCache::Flag::NotSource) == false) return true; return false; } @@ -828,7 +833,7 @@ APT_PURE bool pkgCache::VerIterator::Automatic() const VerFileIterator Files = FileList(); for (; Files.end() == false; ++Files) // Do not check ButAutomaticUpgrades here as it is kind of automatic… - if ((Files.File()->Flags & pkgCache::Flag::NotAutomatic) != pkgCache::Flag::NotAutomatic) + if (Files.File().Flagged(pkgCache::Flag::NotAutomatic) == false) return true; return false; } @@ -861,27 +866,27 @@ string pkgCache::VerIterator::RelStr() const for (pkgCache::VerFileIterator I = this->FileList(); I.end() == false; ++I) { // Do not print 'not source' entries' - pkgCache::PkgFileIterator File = I.File(); - if ((File->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource) + pkgCache::PkgFileIterator const File = I.File(); + if (File.Flagged(pkgCache::Flag::NotSource)) continue; // See if we have already printed this out.. bool Seen = false; for (pkgCache::VerFileIterator J = this->FileList(); I != J; ++J) { - pkgCache::PkgFileIterator File2 = J.File(); - if (File2->Label == 0 || File->Label == 0) + pkgCache::PkgFileIterator const File2 = J.File(); + if (File2.Label() == 0 || File.Label() == 0) continue; if (strcmp(File.Label(),File2.Label()) != 0) continue; - if (File2->Version == File->Version) + if (File2.Version() == File.Version()) { Seen = true; break; } - if (File2->Version == 0 || File->Version == 0) + if (File2.Version() == 0 || File.Version() == 0) break; if (strcmp(File.Version(),File2.Version()) == 0) Seen = true; @@ -895,12 +900,12 @@ string pkgCache::VerIterator::RelStr() const else First = false; - if (File->Label != 0) + if (File.Label() != 0) Res = Res + File.Label() + ':'; - if (File->Archive != 0) + if (File.Archive() != 0) { - if (File->Version == 0) + if (File.Version() == 0) Res += File.Archive(); else Res = Res + File.Version() + '/' + File.Archive(); @@ -908,7 +913,7 @@ string pkgCache::VerIterator::RelStr() const else { // No release file, print the host name that this came from - if (File->Site == 0 || File.Site()[0] == 0) + if (File.Site() == 0 || File.Site()[0] == 0) Res += "localhost"; else Res += File.Site(); @@ -931,12 +936,12 @@ const char * pkgCache::VerIterator::MultiArchType() const return "none"; } /*}}}*/ -// PkgFileIterator::IsOk - Checks if the cache is in sync with the file /*{{{*/ +// RlsFileIterator::IsOk - Checks if the cache is in sync with the file /*{{{*/ // --------------------------------------------------------------------- /* This stats the file and compares its stats with the ones that were - stored during generation. Date checks should probably also be + stored during generation. Date checks should probably also be included here. */ -bool pkgCache::PkgFileIterator::IsOk() +bool pkgCache::RlsFileIterator::IsOk() { struct stat Buf; if (stat(FileName(),&Buf) != 0) @@ -948,10 +953,8 @@ bool pkgCache::PkgFileIterator::IsOk() return true; } /*}}}*/ -// PkgFileIterator::RelStr - Return the release string /*{{{*/ -// --------------------------------------------------------------------- -/* */ -string pkgCache::PkgFileIterator::RelStr() +// RlsFileIterator::RelStr - Return the release string /*{{{*/ +string pkgCache::RlsFileIterator::RelStr() { string Res; if (Version() != 0) @@ -964,8 +967,40 @@ string pkgCache::PkgFileIterator::RelStr() Res = Res + (Res.empty() == true?"n=":",n=") + Codename(); if (Label() != 0) Res = Res + (Res.empty() == true?"l=":",l=") + Label(); - if (Component() != 0) - Res = Res + (Res.empty() == true?"c=":",c=") + Component(); + return Res; +} + /*}}}*/ +// PkgFileIterator::IsOk - Checks if the cache is in sync with the file /*{{{*/ +// --------------------------------------------------------------------- +/* This stats the file and compares its stats with the ones that were + stored during generation. Date checks should probably also be + included here. */ +bool pkgCache::PkgFileIterator::IsOk() +{ + struct stat Buf; + if (stat(FileName(),&Buf) != 0) + return false; + + if (Buf.st_size != (signed)S->Size || Buf.st_mtime != S->mtime) + return false; + + return true; +} + /*}}}*/ +string pkgCache::PkgFileIterator::RelStr() /*{{{*/ +{ + std::string Res; + if (ReleaseFile() == 0) + { + if (Component() != 0) + Res = Res + (Res.empty() == true?"a=":",a=") + Component(); + } + else + { + Res = ReleaseFile().RelStr(); + if (Component() != 0) + Res = Res + (Res.empty() == true?"c=":",c=") + Component(); + } if (Architecture() != 0) Res = Res + (Res.empty() == true?"b=":",b=") + Architecture(); return Res; diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index b4d56611a..696b3b94d 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -133,6 +133,7 @@ class pkgCache /*{{{*/ struct Header; struct Group; struct Package; + struct ReleaseFile; struct PackageFile; struct Version; struct Description; @@ -150,6 +151,7 @@ class pkgCache /*{{{*/ class DescIterator; class DepIterator; class PrvIterator; + class RlsFileIterator; class PkgFileIterator; class VerFileIterator; class DescFileIterator; @@ -192,9 +194,11 @@ class pkgCache /*{{{*/ enum PkgFlags {Auto=(1<<0),Essential=(1<<3),Important=(1<<4)}; enum PkgFFlags { NotSource=(1<<0), /*!< packages can't be fetched from here, e.g. dpkg/status file */ - NotAutomatic=(1<<1), /*!< archive has a default pin of 1 */ - ButAutomaticUpgrades=(1<<2), /*!< (together with the previous) archive has a default pin of 100 */ - LocalSource=(1<<3), /*!< local sources can't and will not be verified by hashes */ + LocalSource=(1<<1), /*!< local sources can't and will not be verified by hashes */ + }; + enum ReleaseFileFlags { + NotAutomatic=(1<<0), /*!< archive has a default pin of 1 */ + ButAutomaticUpgrades=(1<<1), /*!< (together with the previous) archive has a default pin of 100 */ }; }; @@ -215,6 +219,7 @@ class pkgCache /*{{{*/ Package *PkgP; VerFile *VerFileP; DescFile *DescFileP; + ReleaseFile *RlsFileP; PackageFile *PkgFileP; Version *VerP; Description *DescP; @@ -247,6 +252,8 @@ class pkgCache /*{{{*/ inline PkgIterator PkgEnd(); inline PkgFileIterator FileBegin(); inline PkgFileIterator FileEnd(); + inline RlsFileIterator RlsFileBegin(); + inline RlsFileIterator RlsFileEnd(); inline bool MultiArchCache() const { return MultiArchEnabled; } inline char const * NativeArch(); @@ -296,6 +303,7 @@ struct pkgCache::Header unsigned short HeaderSz; unsigned short GroupSz; unsigned short PackageSz; + unsigned short ReleaseFileSz; unsigned short PackageFileSz; unsigned short VersionSz; unsigned short DescriptionSz; @@ -314,6 +322,7 @@ struct pkgCache::Header map_id_t VersionCount; map_id_t DescriptionCount; map_id_t DependsCount; + map_fileid_t ReleaseFileCount; map_fileid_t PackageFileCount; map_fileid_t VerFileCount; map_fileid_t DescFileCount; @@ -324,6 +333,9 @@ struct pkgCache::Header The PackageFile structures are singly linked lists that represent all package files that have been merged into the cache. */ map_pointer_t FileList; + /** \brief index of the first ReleaseFile structure */ + map_pointer_t RlsFileList; + #if APT_PKG_ABI < 413 APT_DEPRECATED map_pointer_t StringList; #endif @@ -482,15 +494,14 @@ struct pkgCache::Package unsigned long Flags; }; /*}}}*/ -// Package File structure /*{{{*/ -/** \brief stores information about the files used to generate the cache +// Release File structure /*{{{*/ +/** \brief stores information about the release files used to generate the cache - Package files are referenced by Version structures to be able to know - after the generation still from which Packages file includes this Version - as we need this information later on e.g. for pinning. */ -struct pkgCache::PackageFile + PackageFiles reference ReleaseFiles as we need to keep record of which + version belongs to which release e.g. for pinning. */ +struct pkgCache::ReleaseFile { - /** \brief physical disk file that this PackageFile represents */ + /** \brief physical disk file that this ReleaseFile represents */ map_stringitem_t FileName; /** \brief the release information @@ -498,13 +509,47 @@ struct pkgCache::PackageFile release information means. */ map_stringitem_t Archive; map_stringitem_t Codename; - map_stringitem_t Component; map_stringitem_t Version; map_stringitem_t Origin; map_stringitem_t Label; - map_stringitem_t Architecture; /** \brief The site the index file was fetched from */ map_stringitem_t Site; + + /** \brief Size of the file + + Used together with the modification time as a + simple check to ensure that the Packages + file has not been altered since Cache generation. */ + map_filesize_t Size; + /** \brief Modification time for the file */ + time_t mtime; + + /** @TODO document PackageFile::Flags */ + unsigned long Flags; + + // Linked list + /** \brief Link to the next ReleaseFile in the Cache */ + map_pointer_t NextFile; + /** \brief unique sequel ID */ + should_be_map_fileid_t ID; +}; + /*}}}*/ +// Package File structure /*{{{*/ +/** \brief stores information about the files used to generate the cache + + Package files are referenced by Version structures to be able to know + after the generation still from which Packages file includes this Version + as we need this information later on e.g. for pinning. */ +struct pkgCache::PackageFile +{ + /** \brief physical disk file that this PackageFile represents */ + map_stringitem_t FileName; + /** \brief the release information */ + map_pointer_t Release; + + map_stringitem_t Component; + map_stringitem_t Architecture; + /** \brief indicates what sort of index file this is @TODO enumerate at least the possible indexes */ @@ -744,6 +789,11 @@ inline pkgCache::PkgFileIterator pkgCache::FileBegin() {return PkgFileIterator(*this,PkgFileP + HeaderP->FileList);} inline pkgCache::PkgFileIterator pkgCache::FileEnd() {return PkgFileIterator(*this,PkgFileP);} +inline pkgCache::RlsFileIterator pkgCache::RlsFileBegin() + {return RlsFileIterator(*this,RlsFileP + HeaderP->RlsFileList);} +inline pkgCache::RlsFileIterator pkgCache::RlsFileEnd() + {return RlsFileIterator(*this,RlsFileP);} + // Oh I wish for Real Name Space Support class pkgCache::Namespace /*{{{*/ @@ -755,6 +805,7 @@ class pkgCache::Namespace /*{{{*/ typedef pkgCache::DescIterator DescIterator; typedef pkgCache::DepIterator DepIterator; typedef pkgCache::PrvIterator PrvIterator; + typedef pkgCache::RlsFileIterator RlsFileIterator; typedef pkgCache::PkgFileIterator PkgFileIterator; typedef pkgCache::VerFileIterator VerFileIterator; typedef pkgCache::Version Version; diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index ba454f057..2d0e3960d 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -54,10 +54,8 @@ using std::string; /* We set the dirty flag and make sure that is written to the disk */ pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) : Map(*pMap), Cache(pMap,false), Progress(Prog), - FoundFileDeps(0) + CurrentRlsFile(NULL), CurrentFile(NULL), FoundFileDeps(0) { - CurrentFile = 0; - if (_error->PendingError() == true) return; @@ -145,6 +143,7 @@ void pkgCacheGenerator::ReMap(void const * const oldMap, void const * const newM Cache.ReMap(false); CurrentFile += (pkgCache::PackageFile const * const) newMap - (pkgCache::PackageFile const * const) oldMap; + CurrentRlsFile += (pkgCache::ReleaseFile const * const) newMap - (pkgCache::ReleaseFile const * const) oldMap; for (std::vector::const_iterator i = Dynamic::toReMap.begin(); i != Dynamic::toReMap.end(); ++i) @@ -167,6 +166,9 @@ void pkgCacheGenerator::ReMap(void const * const oldMap, void const * const newM for (std::vector::const_iterator i = Dynamic::toReMap.begin(); i != Dynamic::toReMap.end(); ++i) (*i)->ReMap(oldMap, newMap); + for (std::vector::const_iterator i = Dynamic::toReMap.begin(); + i != Dynamic::toReMap.end(); ++i) + (*i)->ReMap(oldMap, newMap); } /*}}}*/ // CacheGenerator::WriteStringInMap /*{{{*/ map_stringitem_t pkgCacheGenerator::WriteStringInMap(const char *String, @@ -1072,13 +1074,47 @@ bool pkgCacheGenerator::ListParser::SameVersion(unsigned short const Hash,/*{{{* return Hash == Ver->Hash; } /*}}}*/ +// CacheGenerator::SelectReleaseFile - Select the current release file the indexes belong to /*{{{*/ +bool pkgCacheGenerator::SelectReleaseFile(const string &File,const string &Site, + unsigned long Flags) +{ + if (File.empty() && Site.empty()) + { + CurrentRlsFile = NULL; + return true; + } + + // Get some space for the structure + map_pointer_t const idxFile = AllocateInMap(sizeof(*CurrentRlsFile)); + if (unlikely(idxFile == 0)) + return false; + CurrentRlsFile = Cache.RlsFileP + idxFile; + + // Fill it in + map_stringitem_t const idxFileName = WriteStringInMap(File); + map_stringitem_t const idxSite = StoreString(MIXED, Site); + if (unlikely(idxFileName == 0 || idxSite == 0)) + return false; + CurrentRlsFile->FileName = idxFileName; + CurrentRlsFile->Site = idxSite; + CurrentRlsFile->NextFile = Cache.HeaderP->RlsFileList; + CurrentRlsFile->Flags = Flags; + CurrentRlsFile->ID = Cache.HeaderP->ReleaseFileCount; + RlsFileName = File; + Cache.HeaderP->RlsFileList = CurrentRlsFile - Cache.RlsFileP; + Cache.HeaderP->ReleaseFileCount++; + + return true; +} + /*}}}*/ // CacheGenerator::SelectFile - Select the current file being parsed /*{{{*/ // --------------------------------------------------------------------- /* This is used to select which file is to be associated with all newly added versions. The caller is responsible for setting the IMS fields. */ -bool pkgCacheGenerator::SelectFile(const string &File,const string &Site, - const pkgIndexFile &Index, - unsigned long Flags) +bool pkgCacheGenerator::SelectFile(std::string const &File, + pkgIndexFile const &Index, + std::string const &Component, + unsigned long const Flags) { // Get some space for the structure map_pointer_t const idxFile = AllocateInMap(sizeof(*CurrentFile)); @@ -1088,18 +1124,24 @@ bool pkgCacheGenerator::SelectFile(const string &File,const string &Site, // Fill it in map_stringitem_t const idxFileName = WriteStringInMap(File); - map_stringitem_t const idxSite = StoreString(MIXED, Site); - if (unlikely(idxFileName == 0 || idxSite == 0)) + if (unlikely(idxFileName == 0)) return false; CurrentFile->FileName = idxFileName; - CurrentFile->Site = idxSite; CurrentFile->NextFile = Cache.HeaderP->FileList; - CurrentFile->Flags = Flags; CurrentFile->ID = Cache.HeaderP->PackageFileCount; map_stringitem_t const idxIndexType = StoreString(MIXED, Index.GetType()->Label); if (unlikely(idxIndexType == 0)) return false; CurrentFile->IndexType = idxIndexType; + map_stringitem_t const component = StoreString(pkgCacheGenerator::MIXED, Component); + if (unlikely(component == 0)) + return false; + CurrentFile->Component = component; + CurrentFile->Flags = Flags; + if (CurrentRlsFile != NULL) + CurrentFile->Release = CurrentRlsFile - Cache.RlsFileP; + else + CurrentFile->Release = 0; PkgFileName = File; Cache.HeaderP->FileList = CurrentFile - Cache.PkgFileP; Cache.HeaderP->PackageFileCount++; @@ -1174,35 +1216,59 @@ static bool CheckValidity(const string &CacheFile, _error->Discard(); return false; } - + + SPtrArray RlsVisited = new bool[Cache.HeaderP->ReleaseFileCount]; + memset(RlsVisited,0,sizeof(*RlsVisited)*Cache.HeaderP->ReleaseFileCount); + std::vector Files; + for (pkgSourceList::const_iterator i = List.begin(); i != List.end(); ++i) + { + if (Debug == true) + std::clog << "Checking RlsFile " << (*i)->Describe() << ": "; + pkgCache::RlsFileIterator const RlsFile = (*i)->FindInCache(Cache); + if (RlsFile.end() == true) + { + if (Debug == true) + std::clog << "FindInCache returned end-Pointer" << std::endl; + return false; + } + + RlsVisited[RlsFile->ID] = true; + if (Debug == true) + std::clog << "with ID " << RlsFile->ID << " is valid" << std::endl; + + std::vector *Indexes = (*i)->GetIndexFiles(); + for (std::vector::const_iterator j = Indexes->begin(); j != Indexes->end(); ++j) + if ((*j)->HasPackages()) + Files.push_back (*j); + } + for (unsigned I = 0; I != Cache.HeaderP->ReleaseFileCount; ++I) + if (RlsVisited[I] == false) + { + if (Debug == true) + std::clog << "RlsFile with ID" << I << " wasn't visited" << std::endl; + return false; + } + + for (; Start != End; ++Start) + Files.push_back(*Start); + /* Now we check every index file, see if it is in the cache, verify the IMS data and check that it is on the disk too.. */ SPtrArray Visited = new bool[Cache.HeaderP->PackageFileCount]; memset(Visited,0,sizeof(*Visited)*Cache.HeaderP->PackageFileCount); - for (; Start != End; ++Start) + for (std::vector::const_reverse_iterator PkgFile = Files.rbegin(); PkgFile != Files.rend(); ++PkgFile) { if (Debug == true) - std::clog << "Checking PkgFile " << (*Start)->Describe() << ": "; - if ((*Start)->HasPackages() == false) - { - if (Debug == true) - std::clog << "Has NO packages" << std::endl; - continue; - } - - if ((*Start)->Exists() == false) + std::clog << "Checking PkgFile " << (*PkgFile)->Describe() << ": "; + if ((*PkgFile)->Exists() == false) { -#if 0 // mvo: we no longer give a message here (Default Sources spec) - _error->WarningE("stat",_("Couldn't stat source package list %s"), - (*Start)->Describe().c_str()); -#endif if (Debug == true) std::clog << "file doesn't exist" << std::endl; continue; } // FindInCache is also expected to do an IMS check. - pkgCache::PkgFileIterator File = (*Start)->FindInCache(Cache); + pkgCache::PkgFileIterator File = (*PkgFile)->FindInCache(Cache); if (File.end() == true) { if (Debug == true) @@ -1214,15 +1280,15 @@ static bool CheckValidity(const string &CacheFile, if (Debug == true) std::clog << "with ID " << File->ID << " is valid" << std::endl; } - + for (unsigned I = 0; I != Cache.HeaderP->PackageFileCount; I++) if (Visited[I] == false) { if (Debug == true) - std::clog << "File with ID" << I << " wasn't visited" << std::endl; + std::clog << "PkgFile with ID" << I << " wasn't visited" << std::endl; return false; } - + if (_error->PendingError() == true) { if (Debug == true) @@ -1243,9 +1309,20 @@ static bool CheckValidity(const string &CacheFile, // --------------------------------------------------------------------- /* Size is kind of an abstract notion that is only used for the progress meter */ -static map_filesize_t ComputeSize(FileIterator Start,FileIterator End) +static map_filesize_t ComputeSize(pkgSourceList const * const List, FileIterator Start,FileIterator End) { map_filesize_t TotalSize = 0; + if (List != NULL) + { + for (pkgSourceList::const_iterator i = List->begin(); i != List->end(); ++i) + { + std::vector *Indexes = (*i)->GetIndexFiles(); + for (std::vector::const_iterator j = Indexes->begin(); j != Indexes->end(); ++j) + if ((*j)->HasPackages() == true) + TotalSize += (*j)->Size(); + } + } + for (; Start < End; ++Start) { if ((*Start)->HasPackages() == false) @@ -1261,11 +1338,63 @@ static map_filesize_t ComputeSize(FileIterator Start,FileIterator End) static bool BuildCache(pkgCacheGenerator &Gen, OpProgress *Progress, map_filesize_t &CurrentSize,map_filesize_t TotalSize, + pkgSourceList const * const List, FileIterator Start, FileIterator End) { + std::vector Files; + bool const HasFileDeps = Gen.HasFileDeps(); + + if (List != NULL) + { + for (pkgSourceList::const_iterator i = List->begin(); i != List->end(); ++i) + { + if ((*i)->FindInCache(Gen.GetCache()).end() == false) + { + _error->Warning("Duplicate sources.list entry %s", + (*i)->Describe().c_str()); + continue; + } + + if ((*i)->Merge(Gen, Progress) == false) + return false; + + std::vector *Indexes = (*i)->GetIndexFiles(); + for (std::vector::const_iterator I = Indexes->begin(); I != Indexes->end(); ++I) + { + if (HasFileDeps) + Files.push_back(*I); + + if ((*I)->HasPackages() == false) + continue; + + if ((*I)->Exists() == false) + continue; + + if ((*I)->FindInCache(Gen.GetCache()).end() == false) + { + _error->Warning("Duplicate sources.list entry %s", + (*I)->Describe().c_str()); + continue; + } + + map_filesize_t Size = (*I)->Size(); + if (Progress != NULL) + Progress->OverallProgress(CurrentSize,TotalSize,Size,_("Reading package lists")); + CurrentSize += Size; + + if ((*I)->Merge(Gen,Progress) == false) + return false; + } + } + } + + Gen.SelectReleaseFile("", ""); FileIterator I; for (I = Start; I != End; ++I) { + if (HasFileDeps) + Files.push_back(*I); + if ((*I)->HasPackages() == false) continue; @@ -1288,13 +1417,13 @@ static bool BuildCache(pkgCacheGenerator &Gen, return false; } - if (Gen.HasFileDeps() == true) + if (HasFileDeps == true) { if (Progress != NULL) Progress->Done(); - TotalSize = ComputeSize(Start, End); + TotalSize = ComputeSize(List, Start, End); CurrentSize = 0; - for (I = Start; I != End; ++I) + for (std::vector::const_iterator I = Files.begin(); I != Files.end(); ++I) { map_filesize_t Size = (*I)->Size(); if (Progress != NULL) @@ -1339,6 +1468,7 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress bool const Debug = _config->FindB("Debug::pkgCacheGen", false); std::vector Files; + /* for (std::vector::const_iterator i = List.begin(); i != List.end(); ++i) @@ -1349,8 +1479,7 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress ++j) Files.push_back (*j); } - - map_filesize_t const EndOfSource = Files.size(); +*/ if (_system->AddStatusFiles(Files) == false) return false; @@ -1442,8 +1571,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress // Lets try the source cache. map_filesize_t CurrentSize = 0; map_filesize_t TotalSize = 0; - if (CheckValidity(SrcCacheFile, List, Files.begin(), - Files.begin()+EndOfSource) == true) + if (CheckValidity(SrcCacheFile, List, Files.end(), + Files.end()) == true) { if (Debug == true) std::clog << "srcpkgcache.bin is valid - populate MMap with it." << std::endl; @@ -1455,28 +1584,28 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress SCacheF.Size()) == false) return false; - TotalSize = ComputeSize(Files.begin()+EndOfSource,Files.end()); + TotalSize = ComputeSize(NULL, Files.begin(), Files.end()); // Build the status cache pkgCacheGenerator Gen(Map.Get(),Progress); if (_error->PendingError() == true) return false; - if (BuildCache(Gen,Progress,CurrentSize,TotalSize, - Files.begin()+EndOfSource,Files.end()) == false) + if (BuildCache(Gen, Progress, CurrentSize, TotalSize, NULL, + Files.begin(),Files.end()) == false) return false; } else { if (Debug == true) std::clog << "srcpkgcache.bin is NOT valid - rebuild" << std::endl; - TotalSize = ComputeSize(Files.begin(),Files.end()); + TotalSize = ComputeSize(&List, Files.begin(),Files.end()); // Build the source cache pkgCacheGenerator Gen(Map.Get(),Progress); if (_error->PendingError() == true) return false; - if (BuildCache(Gen,Progress,CurrentSize,TotalSize, - Files.begin(),Files.begin()+EndOfSource) == false) + if (BuildCache(Gen, Progress, CurrentSize, TotalSize, &List, + Files.end(),Files.end()) == false) return false; // Write it back @@ -1503,8 +1632,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress } // Build the status cache - if (BuildCache(Gen,Progress,CurrentSize,TotalSize, - Files.begin()+EndOfSource,Files.end()) == false) + if (BuildCache(Gen, Progress, CurrentSize, TotalSize, NULL, + Files.begin(), Files.end()) == false) return false; } if (Debug == true) @@ -1536,7 +1665,6 @@ APT_DEPRECATED bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **Ou bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap) { std::vector Files; - map_filesize_t EndOfSource = Files.size(); if (_system->AddStatusFiles(Files) == false) return false; @@ -1544,7 +1672,7 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O map_filesize_t CurrentSize = 0; map_filesize_t TotalSize = 0; - TotalSize = ComputeSize(Files.begin()+EndOfSource,Files.end()); + TotalSize = ComputeSize(NULL, Files.begin(), Files.end()); // Build the status cache if (Progress != NULL) @@ -1552,8 +1680,8 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O pkgCacheGenerator Gen(Map.Get(),Progress); if (_error->PendingError() == true) return false; - if (BuildCache(Gen,Progress,CurrentSize,TotalSize, - Files.begin()+EndOfSource,Files.end()) == false) + if (BuildCache(Gen,Progress,CurrentSize,TotalSize, NULL, + Files.begin(), Files.end()) == false) return false; if (_error->PendingError() == true) diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index c4ace713d..2795d09d6 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -69,7 +69,9 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ DynamicMMap ⤅ pkgCache Cache; OpProgress *Progress; - + + std::string RlsFileName; + pkgCache::ReleaseFile *CurrentRlsFile; std::string PkgFileName; pkgCache::PackageFile *CurrentFile; @@ -100,12 +102,14 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ inline map_stringitem_t StoreString(enum StringType const type, const std::string &S) {return StoreString(type, S.c_str(),S.length());}; void DropProgress() {Progress = 0;}; - bool SelectFile(const std::string &File,const std::string &Site,pkgIndexFile const &Index, - unsigned long Flags = 0); + bool SelectFile(const std::string &File,pkgIndexFile const &Index, std::string const &Component, unsigned long Flags = 0); + bool SelectReleaseFile(const std::string &File, const std::string &Site, unsigned long Flags = 0); bool MergeList(ListParser &List,pkgCache::VerIterator *Ver = 0); inline pkgCache &GetCache() {return Cache;}; inline pkgCache::PkgFileIterator GetCurFile() {return pkgCache::PkgFileIterator(Cache,CurrentFile);}; + inline pkgCache::RlsFileIterator GetCurRlsFile() + {return pkgCache::RlsFileIterator(Cache,CurrentRlsFile);}; bool HasFileDeps() {return FoundFileDeps;}; bool MergeFileProvides(ListParser &List); diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 00693ce54..bd40ad2d9 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -63,9 +63,9 @@ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner) pkgVersionMatch vm("", pkgVersionMatch::None); for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); ++F) { - if ((F->Archive != 0 && vm.ExpressionMatches(DefRel, F.Archive()) == true) || - (F->Codename != 0 && vm.ExpressionMatches(DefRel, F.Codename()) == true) || - (F->Version != 0 && vm.ExpressionMatches(DefRel, F.Version()) == true) || + if (vm.ExpressionMatches(DefRel, F.Archive()) || + vm.ExpressionMatches(DefRel, F.Codename()) || + vm.ExpressionMatches(DefRel, F.Version()) || (DefRel.length() > 2 && DefRel[1] == '=')) found = true; } @@ -86,11 +86,11 @@ bool pkgPolicy::InitDefaults() for (pkgCache::PkgFileIterator I = Cache->FileBegin(); I != Cache->FileEnd(); ++I) { PFPriority[I->ID] = 500; - if ((I->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource) + if (I.Flagged(pkgCache::Flag::NotSource)) PFPriority[I->ID] = 100; - else if ((I->Flags & pkgCache::Flag::ButAutomaticUpgrades) == pkgCache::Flag::ButAutomaticUpgrades) + else if (I.Flagged(pkgCache::Flag::ButAutomaticUpgrades)) PFPriority[I->ID] = 100; - else if ((I->Flags & pkgCache::Flag::NotAutomatic) == pkgCache::Flag::NotAutomatic) + else if (I.Flagged(pkgCache::Flag::NotAutomatic)) PFPriority[I->ID] = 1; } @@ -170,8 +170,7 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const &Pk then it is not a candidate for installation, ever. This weeds out bogus entries that may be due to config-file states, or other. */ - if ((VF.File()->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource && - instVer == false) + if (VF.File().Flagged(pkgCache::Flag::NotSource) && instVer == false) continue; signed Prio = PFPriority[VF.File()->ID]; diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index 284098bdf..86c1b7d4a 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -137,7 +137,10 @@ pkgVersionMatch::pkgVersionMatch(string Data,MatchType Type) : Type(Type) // --------------------------------------------------------------------- /* */ bool pkgVersionMatch::MatchVer(const char *A,string B,bool Prefix) -{ +{ + if (A == NULL) + return false; + const char *Ab = A; const char *Ae = Ab + strlen(A); @@ -178,13 +181,16 @@ pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg) // This will be Ended by now. return Ver; } + /*}}}*/ #ifndef FNM_CASEFOLD #define FNM_CASEFOLD 0 #endif -bool pkgVersionMatch::ExpressionMatches(const char *pattern, const char *string) +bool pkgVersionMatch::ExpressionMatches(const char *pattern, const char *string)/*{{{*/ { + if (pattern == NULL || string == NULL) + return false; if (pattern[0] == '/') { size_t length = strlen(pattern); if (pattern[length - 1] == '/') { @@ -230,38 +236,30 @@ bool pkgVersionMatch::FileMatch(pkgCache::PkgFileIterator File) return false; if (RelVerStr.empty() == false) - if (File->Version == 0 || - (MatchVer(File.Version(),RelVerStr,RelVerPrefixMatch) == false && - ExpressionMatches(RelVerStr, File.Version()) == false)) + if (MatchVer(File.Version(),RelVerStr,RelVerPrefixMatch) == false && + ExpressionMatches(RelVerStr, File.Version()) == false) return false; if (RelOrigin.empty() == false) - if (File->Origin == 0 || !ExpressionMatches(RelOrigin,File.Origin())) + if (!ExpressionMatches(RelOrigin,File.Origin())) return false; if (RelArchive.empty() == false) - if (File->Archive == 0 || - !ExpressionMatches(RelArchive,File.Archive())) + if (!ExpressionMatches(RelArchive,File.Archive())) return false; if (RelCodename.empty() == false) - if (File->Codename == 0 || - !ExpressionMatches(RelCodename,File.Codename())) + if (!ExpressionMatches(RelCodename,File.Codename())) return false; if (RelRelease.empty() == false) - if ((File->Archive == 0 || - !ExpressionMatches(RelRelease,File.Archive())) && - (File->Codename == 0 || - !ExpressionMatches(RelRelease,File.Codename()))) + if (!ExpressionMatches(RelRelease,File.Archive()) && + !ExpressionMatches(RelRelease,File.Codename())) return false; if (RelLabel.empty() == false) - if (File->Label == 0 || - !ExpressionMatches(RelLabel,File.Label())) + if (!ExpressionMatches(RelLabel,File.Label())) return false; if (RelComponent.empty() == false) - if (File->Component == 0 || - !ExpressionMatches(RelComponent,File.Component())) + if (!ExpressionMatches(RelComponent,File.Component())) return false; if (RelArchitecture.empty() == false) - if (File->Architecture == 0 || - !ExpressionMatches(RelArchitecture,File.Architecture())) + if (!ExpressionMatches(RelArchitecture,File.Architecture())) return false; return true; } @@ -269,11 +267,14 @@ bool pkgVersionMatch::FileMatch(pkgCache::PkgFileIterator File) if (Type == Origin) { if (OrSite.empty() == false) { - if (File->Site == 0) + if (File.Site() == NULL) return false; } else // so we are talking about file:// or status file - if (strcmp(File.Site(),"") == 0 && File->Archive != 0 && strcmp(File.Archive(),"now") == 0) // skip the status file + { + pkgCache::RlsFileIterator const RlsFile = File.ReleaseFile(); + if (strcmp(File.Site(),"") == 0 && RlsFile->Archive != 0 && strcmp(RlsFile.Archive(),"now") == 0) // skip the status file return false; + } return (ExpressionMatches(OrSite, File.Site())); /* both strings match */ } diff --git a/apt-pkg/versionmatch.h b/apt-pkg/versionmatch.h index 4c8f704c8..bb950b9c7 100644 --- a/apt-pkg/versionmatch.h +++ b/apt-pkg/versionmatch.h @@ -70,8 +70,8 @@ class pkgVersionMatch enum MatchType {None = 0,Version,Release,Origin} Type; bool MatchVer(const char *A,std::string B,bool Prefix) APT_PURE; - bool ExpressionMatches(const char *pattern, const char *string); - bool ExpressionMatches(const std::string& pattern, const char *string); + static bool ExpressionMatches(const char *pattern, const char *string); + static bool ExpressionMatches(const std::string& pattern, const char *string); bool FileMatch(pkgCache::PkgFileIterator File); pkgCache::VerIterator Find(pkgCache::PkgIterator Pkg); diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 690b03bcc..3b8ebc96d 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -413,17 +413,21 @@ static bool Stats(CommandLine &) stritems.insert(Prv->ProvideVersion); } } - for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); ++F) + for (pkgCache::RlsFileIterator F = Cache->RlsFileBegin(); F != Cache->RlsFileEnd(); ++F) { stritems.insert(F->FileName); stritems.insert(F->Archive); stritems.insert(F->Codename); - stritems.insert(F->Component); stritems.insert(F->Version); stritems.insert(F->Origin); stritems.insert(F->Label); - stritems.insert(F->Architecture); stritems.insert(F->Site); + } + for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); ++F) + { + stritems.insert(F->FileName); + stritems.insert(F->Architecture); + stritems.insert(F->Component); stritems.insert(F->IndexType); } unsigned long Size = 0; @@ -446,6 +450,7 @@ static bool Stats(CommandLine &) APT_CACHESIZE(VersionCount, VersionSz) + APT_CACHESIZE(DescriptionCount, DescriptionSz) + APT_CACHESIZE(DependsCount, DependencySz) + + APT_CACHESIZE(ReleaseFileCount, ReleaseFileSz) + APT_CACHESIZE(PackageFileCount, PackageFileSz) + APT_CACHESIZE(VerFileCount, VerFileSz) + APT_CACHESIZE(DescFileCount, DescFileSz) + diff --git a/test/integration/framework b/test/integration/framework index 110758e82..7b03c09ef 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -137,7 +137,14 @@ dpkgcheckbuilddeps() { command dpkg-checkbuilddeps --admindir=${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg "$@" } gdb() { - local CMD="$1" + local CMD + case "$1" in + aptget) CMD="apt-get";; + aptcache) CMD="apt-cache";; + aptmark) CMD="apt-mark";; + apthelper) CMD="apt-helper";; + *) CMD="$1";; + esac shift runapt command gdb --quiet -ex run "${BUILDDIRECTORY}/$CMD" --args "${BUILDDIRECTORY}/$CMD" "$@" } diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index 9cd54264b..9f7f457ae 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -22,7 +22,7 @@ testequalpolicy() { release a=now $(echo "$AP" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} Packages release c= -Pinned packages:" aptcache policy $* +Pinned packages:" aptcache policy "$@" } testglobalpolicy() { -- cgit v1.2.3 From 3fd89e62e985c89b1f9a545ab72c20987b756aff Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 12 Jun 2015 12:06:29 +0200 Subject: implement default apt-get file --release-info mode Selecting targets based on the Release they belong to isn't to unrealistic. In fact, it is assumed to be the most used case so it is made the default especially as this allows to bundle another thing we have to be careful with: Filenames and only showing targets we have acquired. Closes: 752702 --- apt-pkg/deb/debmetaindex.cc | 4 +- apt-pkg/deb/debmetaindex.h | 2 +- apt-pkg/indexfile.cc | 12 ++++ apt-pkg/indexfile.h | 1 + apt-pkg/metaindex.cc | 2 +- apt-pkg/metaindex.h | 2 +- apt-pkg/pkgcachegen.cc | 4 +- apt-private/private-cmndline.cc | 1 + cmdline/apt-get.cc | 26 ++++++++- doc/acquire-additional-files.txt | 65 +++++++++++++--------- test/integration/test-apt-acquire-additional-files | 6 ++ 11 files changed, 88 insertions(+), 37 deletions(-) diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 994b95849..b328fcea8 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -422,7 +422,7 @@ bool debReleaseIndex::Merge(pkgCacheGenerator &Gen,OpProgress * /*Prog*/) const/ } /*}}}*/ // ReleaseIndex::FindInCache - Find this index /*{{{*/ -pkgCache::RlsFileIterator debReleaseIndex::FindInCache(pkgCache &Cache) const +pkgCache::RlsFileIterator debReleaseIndex::FindInCache(pkgCache &Cache, bool const ModifyCheck) const { std::string ReleaseFile; bool const releaseExists = ReleaseFileName(this, ReleaseFile); @@ -434,7 +434,7 @@ pkgCache::RlsFileIterator debReleaseIndex::FindInCache(pkgCache &Cache) const continue; // empty means the file does not exist by "design" - if (releaseExists == false && File->Size == 0) + if (ModifyCheck == false || (releaseExists == false && File->Size == 0)) return File; struct stat St; diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 7e9942710..b448ecc53 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -51,7 +51,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { virtual std::vector GetIndexTargets() const; virtual std::string Describe() const; - virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache) const; + virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const; virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; std::string MetaIndexInfo(const char *Type) const; diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index 33fb48e35..605bbeb47 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -137,6 +137,18 @@ std::string IndexTarget::Option(OptionKeys const EnumKey) const /*{{{*/ APT_CASE(CREATED_BY); #undef APT_CASE case FILENAME: return _config->FindDir("Dir::State::lists") + URItoFileName(URI); + case EXISTING_FILENAME: + std::string const filename = Option(FILENAME); + std::vector const types = APT::Configuration::getCompressionTypes(); + for (std::vector::const_iterator t = types.begin(); t != types.end(); ++t) + { + if (t->empty()) + continue; + std::string const file = (*t == "uncompressed") ? filename : (filename + "." + *t); + if (FileExists(file)) + return file; + } + return ""; } std::map::const_iterator const M = Options.find(Key); if (M == Options.end()) diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 220c415ac..042e5c2f7 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -81,6 +81,7 @@ class IndexTarget /*{{{*/ CREATED_BY, TARGET_OF, FILENAME, + EXISTING_FILENAME, }; std::string Option(OptionKeys const Key) const; std::string Format(std::string format) const; diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 35ab6c53b..3c1b696bd 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -28,7 +28,7 @@ std::string metaIndex::Describe() const return "Release"; } -pkgCache::RlsFileIterator metaIndex::FindInCache(pkgCache &Cache) const +pkgCache::RlsFileIterator metaIndex::FindInCache(pkgCache &Cache, bool const) const { return pkgCache::RlsFileIterator(Cache); } diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 20c879a89..e1810fb27 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -54,7 +54,7 @@ class metaIndex virtual bool IsTrusted() const = 0; virtual std::string Describe() const; - virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache) const; + virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const; virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; metaIndex(std::string const &URI, std::string const &Dist, diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 2d0e3960d..9db4ef41f 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1224,7 +1224,7 @@ static bool CheckValidity(const string &CacheFile, { if (Debug == true) std::clog << "Checking RlsFile " << (*i)->Describe() << ": "; - pkgCache::RlsFileIterator const RlsFile = (*i)->FindInCache(Cache); + pkgCache::RlsFileIterator const RlsFile = (*i)->FindInCache(Cache, true); if (RlsFile.end() == true) { if (Debug == true) @@ -1348,7 +1348,7 @@ static bool BuildCache(pkgCacheGenerator &Gen, { for (pkgSourceList::const_iterator i = List->begin(); i != List->end(); ++i) { - if ((*i)->FindInCache(Gen.GetCache()).end() == false) + if ((*i)->FindInCache(Gen.GetCache(), false).end() == false) { _error->Warning("Duplicate sources.list entry %s", (*i)->Describe().c_str()); diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 458051bf2..11e88b1e7 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -166,6 +166,7 @@ static bool addArgumentsAPTGet(std::vector &Args, char const else if (CmdMatches("files")) { addArg(0,"format","APT::Get::Files::Format", CommandLine::HasArg); + addArg(0,"release-info","APT::Get::Files::ReleaseInfo", 0); } else if (CmdMatches("clean", "autoclean", "check", "download", "changelog") || CmdMatches("markauto", "unmarkauto")) // deprecated commands diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0fff2db58..a4cd3c377 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1628,15 +1628,34 @@ static bool DoFiles(CommandLine &CmdL) return false; std::string const Format = _config->Find("APT::Get::Files::Format"); + bool const ReleaseInfo = _config->FindB("APT::Get::Files::ReleaseInfo", true); bool Filtered = CmdL.FileSize() > 1; for (pkgSourceList::const_iterator S = SrcList->begin(); S != SrcList->end(); ++S) { std::vector const targets = (*S)->GetIndexTargets(); std::map AddOptions; - AddOptions.insert(std::make_pair("TRUSTED", ((*S)->IsTrusted() ? "yes" : "no"))); + if (ReleaseInfo) + { + AddOptions.insert(std::make_pair("TRUSTED", ((*S)->IsTrusted() ? "yes" : "no"))); + pkgCache &Cache = *CacheFile.GetPkgCache(); + pkgCache::RlsFileIterator const RlsFile = (*S)->FindInCache(Cache, false); + if (RlsFile.end()) + continue; +#define APT_RELEASE(X,Y) if (RlsFile.Y() != NULL) AddOptions.insert(std::make_pair(X, RlsFile.Y())) + APT_RELEASE("CODENAME", Codename); + APT_RELEASE("SUITE", Archive); + APT_RELEASE("VERSION", Version); + APT_RELEASE("ORIGIN", Origin); + APT_RELEASE("LABEL", Label); +#undef APT_RELEASE + } for (std::vector::const_iterator T = targets.begin(); T != targets.end(); ++T) { + std::string filename = T->Option(ReleaseInfo ? IndexTarget::EXISTING_FILENAME : IndexTarget::FILENAME); + if (filename.empty()) + continue; + std::ostringstream stanza; if (Filtered || Format.empty()) { @@ -1644,7 +1663,7 @@ static bool DoFiles(CommandLine &CmdL) << "ShortDesc: " << T->ShortDesc << "\n" << "Description: " << T->Description << "\n" << "URI: " << T->URI << "\n" - << "Filename: " << T->Option(IndexTarget::FILENAME) << "\n" + << "Filename: " << filename << "\n" << "Optional: " << (T->IsOptional ? "yes" : "no") << "\n"; for (std::map::const_iterator O = AddOptions.begin(); O != AddOptions.end(); ++O) stanza << format_key(O->first) << ": " << O->second << "\n"; @@ -1677,7 +1696,8 @@ static bool DoFiles(CommandLine &CmdL) cout << stanza.str(); else { - std::string out = T->Format(Format); + std::string out = SubstVar(Format, "$(FILENAME)", filename); + out = T->Format(out); for (std::map::const_iterator O = AddOptions.begin(); O != AddOptions.end(); ++O) out = SubstVar(out, std::string("$(") + O->first + ")", O->second); cout << out << std::endl; diff --git a/doc/acquire-additional-files.txt b/doc/acquire-additional-files.txt index a47dac2d4..f9a16318d 100644 --- a/doc/acquire-additional-files.txt +++ b/doc/acquire-additional-files.txt @@ -18,12 +18,6 @@ might want to use and would therefore need to be downloaded as well This file describes the configuration scheme such a frontend can use to instruct the Acquire system to download those additional files. -Note that you can't download files from other sources. It must be files -in the same repository and below the Release file. The Release file must -also contain hashes for the file itself as well as for the compressed -file if wanted, otherwise a download isn't even tried! - - # The Configuration Stanza The Acquire system uses the same configuration settings to implement the @@ -81,15 +75,17 @@ Additional optional properties: * Optional: The default value is 'true' and should be kept at this value. If enabled the acquire system will skip the download if the file isn't mentioned in the Release file. Otherwise this is treated as - a hard error and the update process fails. + a hard error and the update process fails. Note that failures while + downloading (e.g. 404 or hash verification errors) are failures, + regardless of this setting. -Note that the acquire system will automatically choose to download -a compressed file if it is available and uncompress it for you, just as -it will also use pdiff patching if provided by the repository and -enabled by the user. You only have to ensure that the Release file -contains the information about the compressed files/pdiffs to make this -happen. NO properties have to be set to enable this. +The acquire system will automatically choose to download a compressed +file if it is available and uncompress it for you, just as it will also +use pdiff patching if provided by the repository and enabled by the +user. You only have to ensure that the Release file contains the +information about the compressed files/pdiffs to make this happen. +NO properties have to be set to enable this. # More examples @@ -123,10 +119,12 @@ APT::Acquire::Targets { As seen in the examples, properties can contain placeholders filled in by the acquire system. The following variables are known; note that unknown variables have no default value nor are they touched: They are -printed literally. +printed as-is. * $(SITE): An identifier of the site we access as seen in sources.list, - e.g. "http://example.org/debian" or "file:/path/to/a/repository". + e.g. "http://example.org/debian" or "file:/path/to/a/repository". You + can't use this field in {,flat}MetaKey, it is for description proposes + only. * $(RELEASE): This is usually an archive- or codename, e.g. "stable" or "stretch". Note that flat-style repositories do not have a archive- or codename per-se, so the value might very well be just "/" or so. @@ -143,7 +141,7 @@ printed literally. Note that while more variables might exist in the implementation, these are to be considered undefined and their usage strongly discouraged. If -you have a need for another variable contact us instead. +you have a need for other variables contact us. # Accessing files @@ -170,29 +168,42 @@ sources.lists (pkgSourceList), iterating over the metaIndex objects this creates and calling GetIndexTargets() on them. See the sourcecode of "apt-get files" for a complete example. -Remarks on the available fields: +Note that by default targets are not listed if they weren't downloaded. +If you want to see all targets, you can use the --no-release-info, which +also removes the Codename, Suite, Version, Origin, Label and Trusted +fields from the output as these also display data which needs to be +downloaded first and could hence be inaccurate [on the pro-side: This +mode is faster as it doesn't require a valid binary cache to operate]. +The most notable difference perhaps is in the Filename field through: By +default it indicates an existing file, potentially compressed (Hint: +libapt users can use FileFd to open compressed files transparently). In +the --no-release-info mode the indicated file doesn't need to exist and +it will always refer to an uncompressed file, even if the index would be +(or is) stored compressed. + +Remarks on fields only available in (default) --release-info mode: +* Trusted: Denotes with a 'yes' or 'no' if the data in this file is + authenticated by a trustchain rooted in a trusted gpg key. You should + be careful with untrusted data and warn the user if you use it. +* Codename, Suite, Version, Origin and Label are fields from the Release + file, are only present if they are present in the Release file and + contain the same data. + +Remarks on other available fields: * MetaKey, ShortDesc, Description, Site, Release: as defined by the configuration and described further above. * Created-By: configuration entity responsible for this target * Target-Of: type of the sources.list entry * URI, Repo-URI: avoid using. Contains potentially username/password. Prefer 'Site', especially for display. -* Filename: The mentioned file doesn't need to exist, e.g. because the - file wasn't downloaded yet – or it does exist compressed. libapt users - are encouraged to use FileFd to open such files as it can handle - decompression transparently. -* Trusted: As of the last 'apt-get update' call denoting if e.g. apt-get - would print the unauthenticated warning while installing packages - mentioned in this file (example assumes Packages file) [Not really - a property of the target itself, but of the metaIndex]. * Optional: Decodes the option of the same name from the configuration. Note that it is using 'yes' and 'no' instead of 'true' and 'false'. * Language, Architecture, Component: as defined further above, but with the catch that they might be missing if they don't effect the target (aka: They weren't used while evaluating the MetaKey template). -Again, additional fields might be visible in certain implementation, but -you should avoid using them and instead talk to us about a portable +Again, additional fields might be visible in certain implementations, +but you should avoid using them and instead talk to us about a portable implementation. # Multiple application requiring the same files diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files index 971cfac2e..ffb9f3135 100755 --- a/test/integration/test-apt-acquire-additional-files +++ b/test/integration/test-apt-acquire-additional-files @@ -37,6 +37,12 @@ APT::Acquire::Targets::deb::Contents { }; EOF +testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64)" aptget files --no-release-info --format '$(FILENAME)' 'Created-By: Contents' +testempty aptget files --format '$(FILENAME)' 'Created-By: Contents' +# lets fake the existence of a compressed Contents file +touch ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz +testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz)" aptget files --format '$(FILENAME)' 'Created-By: Contents' + testequal "'http://localhost:8080/dists/unstable/InRelease' localhost:8080_dists_unstable_InRelease 0 'http://localhost:8080/dists/unstable/main/source/Sources.bz2' localhost:8080_dists_unstable_main_source_Sources 0 'http://localhost:8080/dists/unstable/main/binary-amd64/Packages.bz2' localhost:8080_dists_unstable_main_binary-amd64_Packages 0 -- cgit v1.2.3 From e185d8b3e39e3840f439cab7d5d265fd96d84c6f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 12 Jun 2015 14:42:17 +0200 Subject: populate the Architecture field for PackageFiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is mainly visible in the policy, so that you can now pin by b= and let it only effect Packages files of this architecture and hence the packages coming from it (which do not need to be from this architecture, but very likely are in a normal repository setup). If you should pin by architecture in this way is a different question… Closes: 687255 --- apt-pkg/deb/debindexfile.cc | 8 ++++---- apt-pkg/edsp/edspindexfile.cc | 2 +- apt-pkg/pkgcachegen.cc | 10 ++++++++++ apt-pkg/pkgcachegen.h | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 3a79cbc58..f089cda81 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -128,7 +128,7 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (Dist.empty()) Dist = "/"; ::URI Tmp(URI); - if (Gen.SelectFile(PackageFile, *this, Target.Option(IndexTarget::COMPONENT)) == false) + if (Gen.SelectFile(PackageFile, *this, Target.Option(IndexTarget::ARCHITECTURE), Target.Option(IndexTarget::COMPONENT)) == false) return _error->Error("Problem with SelectFile %s",PackageFile.c_str()); // Store the IMS information @@ -203,7 +203,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (Prog != NULL) Prog->SubProgress(0, Target.Description); - if (Gen.SelectFile(TranslationFile, *this, Target.Option(IndexTarget::COMPONENT), pkgCache::Flag::NotSource) == false) + if (Gen.SelectFile(TranslationFile, *this, "", Target.Option(IndexTarget::COMPONENT), pkgCache::Flag::NotSource) == false) return _error->Error("Problem with SelectFile %s",TranslationFile.c_str()); // Store the IMS information @@ -284,7 +284,7 @@ bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (Prog != NULL) Prog->SubProgress(0,File); - if (Gen.SelectFile(File, *this, "now", pkgCache::Flag::NotSource) == false) + if (Gen.SelectFile(File, *this, "", "now", pkgCache::Flag::NotSource) == false) return _error->Error("Problem with SelectFile %s",File.c_str()); // Store the IMS information @@ -409,7 +409,7 @@ bool debDebPkgFileIndex::Merge(pkgCacheGenerator& Gen, OpProgress* Prog) const // and give it to the list parser debDebFileParser Parser(DebControl, DebFile); - if(Gen.SelectFile(DebFile, *this, "now", pkgCache::Flag::LocalSource) == false) + if(Gen.SelectFile(DebFile, *this, "", "now", pkgCache::Flag::LocalSource) == false) return _error->Error("Problem with SelectFile %s", DebFile.c_str()); pkgCache::PkgFileIterator File = Gen.GetCurFile(); diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index 43dd44a79..a2ec0a19b 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -49,7 +49,7 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (Prog != NULL) Prog->SubProgress(0,File); - if (Gen.SelectFile(File, *this, "edsp") == false) + if (Gen.SelectFile(File, *this, "", "edsp") == false) return _error->Error("Problem with SelectFile %s",File.c_str()); // Store the IMS information diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 9db4ef41f..ea0205944 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1113,6 +1113,7 @@ bool pkgCacheGenerator::SelectReleaseFile(const string &File,const string &Site, added versions. The caller is responsible for setting the IMS fields. */ bool pkgCacheGenerator::SelectFile(std::string const &File, pkgIndexFile const &Index, + std::string const &Architecture, std::string const &Component, unsigned long const Flags) { @@ -1133,6 +1134,15 @@ bool pkgCacheGenerator::SelectFile(std::string const &File, if (unlikely(idxIndexType == 0)) return false; CurrentFile->IndexType = idxIndexType; + if (Architecture.empty()) + CurrentFile->Architecture = 0; + else + { + map_stringitem_t const arch = StoreString(pkgCacheGenerator::MIXED, Architecture); + if (unlikely(arch == 0)) + return false; + CurrentFile->Architecture = arch; + } map_stringitem_t const component = StoreString(pkgCacheGenerator::MIXED, Component); if (unlikely(component == 0)) return false; diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 2795d09d6..ade93795b 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -102,7 +102,7 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ inline map_stringitem_t StoreString(enum StringType const type, const std::string &S) {return StoreString(type, S.c_str(),S.length());}; void DropProgress() {Progress = 0;}; - bool SelectFile(const std::string &File,pkgIndexFile const &Index, std::string const &Component, unsigned long Flags = 0); + bool SelectFile(const std::string &File,pkgIndexFile const &Index, std::string const &Architecture, std::string const &Component, unsigned long Flags = 0); bool SelectReleaseFile(const std::string &File, const std::string &Site, unsigned long Flags = 0); bool MergeList(ListParser &List,pkgCache::VerIterator *Ver = 0); inline pkgCache &GetCache() {return Cache;}; -- cgit v1.2.3 From d2cb5b153fb13d587b1ff632cab34ce0c403326e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 12 Jun 2015 15:48:00 +0200 Subject: hide Translation-* in 'apt-cache policy' output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Translation-* files are internally handled as PackageFiles which isn't super nice, but giving them their own struct is a bit overkill so let it be for the moment. They always appeared in the policy output because of this through and now that they are properly linked to a ReleaseFile they even display all the pinning information on them, but they don't contain any packages which could be pinned… No problem, but useless and potentially confusing output. Adding a 'NoPackages' flag which can be set on those files and be used in applications seems like a simple way to fix this display issue. --- apt-pkg/deb/debindexfile.cc | 2 +- apt-pkg/pkgcache.h | 1 + cmdline/apt-cache.cc | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index f089cda81..944cbe0bf 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -203,7 +203,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (Prog != NULL) Prog->SubProgress(0, Target.Description); - if (Gen.SelectFile(TranslationFile, *this, "", Target.Option(IndexTarget::COMPONENT), pkgCache::Flag::NotSource) == false) + if (Gen.SelectFile(TranslationFile, *this, "", Target.Option(IndexTarget::COMPONENT), pkgCache::Flag::NotSource | pkgCache::Flag::NoPackages) == false) return _error->Error("Problem with SelectFile %s",TranslationFile.c_str()); // Store the IMS information diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 696b3b94d..3cc85f1e8 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -195,6 +195,7 @@ class pkgCache /*{{{*/ enum PkgFFlags { NotSource=(1<<0), /*!< packages can't be fetched from here, e.g. dpkg/status file */ LocalSource=(1<<1), /*!< local sources can't and will not be verified by hashes */ + NoPackages=(1<<2), /*!< the file includes no package records itself, but additions like Translations */ }; enum ReleaseFileFlags { NotAutomatic=(1<<0), /*!< archive has a default pin of 1 */ diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 3b8ebc96d..c2f6dbd5c 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1638,6 +1638,8 @@ static bool Policy(CommandLine &CmdL) cout << _("Package files:") << endl; for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F.end() == false; ++F) { + if (F.Flagged(pkgCache::Flag::NoPackages)) + continue; // Locate the associated index files so we can derive a description pkgIndexFile *Indx; if (SrcList->FindIndex(F,Indx) == false && -- cgit v1.2.3 From d56e2917f27a722b54685de13aeb1bb7592fc61b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 13 Jun 2015 11:13:45 +0200 Subject: provide a public interface for acquiring changelogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provided is a specialized acquire item which given a version can figure out the correct URI to try by itself and if not provides an error message alongside with static methods to get just the URI it would try to download if it should just be displayed or similar such. The URI is constructed as follows: Release files can provide an URI template in the "Changelogs" field, otherwise we lookup a configuration item based on the "Label" or "Origin" of the Release file to get a (hopefully known) default value for now. This template should contain the string CHANGEPATH which is replaced with the information about the version we want the changelog for (e.g. main/a/apt/apt_1.1). This middleway was choosen as this path part was consistent over the three known implementations (+1 defunct), while the rest of the URI varies widely between them. The benefit of this construct is that it is now easy to get changelogs for Debian packages on Ubuntu and vice versa – even at the moment where the Changelogs field is present nowhere. Strictly better than what apt-get had before as it would even fail to get changelogs from security… Now it will notice that security identifies as Origin: Debian and pick this setting (assuming again that no Changelogs field exists). If on the other hand security would ship its changelogs in a different location we could set it via the Label option overruling Origin. Closes: 687147, 739854, 784027, 787190 --- apt-pkg/acquire-item.cc | 211 +++++++++++++++++++++ apt-pkg/acquire-item.h | 114 +++++++++++ apt-pkg/init.cc | 4 + cmdline/apt-get.cc | 204 ++++---------------- doc/apt-get.8.xml | 16 +- doc/apt.conf.5.xml | 27 +++ doc/examples/configure-index | 11 +- test/integration/framework | 24 ++- test/integration/test-apt-get-changelog | 104 +++++++--- .../test-bug-722207-print-uris-even-if-very-quiet | 3 +- test/integration/test-bug-738785-switch-protocol | 7 +- vendor/ubuntu/apt.conf-01-vendor-ubuntu | 6 - 12 files changed, 507 insertions(+), 224 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index d6e9ccbe0..4bf4e62f8 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -2836,6 +2837,216 @@ std::string pkgAcqArchive::ShortDesc() const /*{{{*/ } /*}}}*/ +// AcqChangelog::pkgAcqChangelog - Constructors /*{{{*/ +pkgAcqChangelog::pkgAcqChangelog(pkgAcquire * const Owner, pkgCache::VerIterator const &Ver, + std::string const &DestDir, std::string const &DestFilename) : + pkgAcquire::Item(Owner), d(NULL), SrcName(Ver.SourcePkgName()), SrcVersion(Ver.SourceVerStr()) +{ + Desc.URI = URI(Ver); + Init(DestDir, DestFilename); +} +// some parameters are char* here as they come likely from char* interfaces – which can also return NULL +pkgAcqChangelog::pkgAcqChangelog(pkgAcquire * const Owner, pkgCache::RlsFileIterator const &RlsFile, + char const * const Component, char const * const SrcName, char const * const SrcVersion, + const string &DestDir, const string &DestFilename) : + pkgAcquire::Item(Owner), d(NULL), SrcName(SrcName), SrcVersion(SrcVersion) +{ + Desc.URI = URI(RlsFile, Component, SrcName, SrcVersion); + Init(DestDir, DestFilename); +} +pkgAcqChangelog::pkgAcqChangelog(pkgAcquire * const Owner, + std::string const &URI, char const * const SrcName, char const * const SrcVersion, + const string &DestDir, const string &DestFilename) : + pkgAcquire::Item(Owner), d(NULL), SrcName(SrcName), SrcVersion(SrcVersion) +{ + Desc.URI = URI; + Init(DestDir, DestFilename); +} +void pkgAcqChangelog::Init(std::string const &DestDir, std::string const &DestFilename) +{ + if (Desc.URI.empty()) + { + Status = StatError; + // TRANSLATOR: %s=%s is sourcename=sourceversion, e.g. apt=1.1 + strprintf(ErrorText, _("Changelog unavailable for %s=%s"), SrcName.c_str(), SrcVersion.c_str()); + // Let the error message print something sensible rather than "Failed to fetch /" + if (DestFilename.empty()) + DestFile = SrcName + ".changelog"; + else + DestFile = DestFilename; + Desc.URI = "changelog:/" + DestFile; + return; + } + + if (DestDir.empty()) + { + std::string const systemTemp = GetTempDir(); + char tmpname[100]; + snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX", systemTemp.c_str()); + if (NULL == mkdtemp(tmpname)) + { + _error->Errno("mkdtemp", "mkdtemp failed in changelog acquire of %s %s", SrcName.c_str(), SrcVersion.c_str()); + Status = StatError; + return; + } + DestFile = TemporaryDirectory = tmpname; + } + else + DestFile = DestDir; + + if (DestFilename.empty()) + DestFile = flCombine(DestFile, SrcName + ".changelog"); + else + DestFile = flCombine(DestFile, DestFilename); + + Desc.ShortDesc = "Changelog"; + strprintf(Desc.Description, "%s %s %s Changelog", URI::SiteOnly(Desc.URI).c_str(), SrcName.c_str(), SrcVersion.c_str()); + Desc.Owner = this; + QueueURI(Desc); + + if (Status == StatDone) // this happens if we queue the same changelog two times + { + Complete = true; + for (pkgAcquire::UriIterator I = Owner->UriBegin(); I != Owner->UriEnd(); ++I) + if (I->URI == Desc.URI) + if (DestFile != I->Owner->DestFile) + if (symlink(I->Owner->DestFile.c_str(), DestFile.c_str()) != 0) + { + ; // ignore error, there isn't anthing we could do to handle the edgecase of an edgecase + } + } +} + /*}}}*/ +std::string pkgAcqChangelog::URI(pkgCache::VerIterator const &Ver) /*{{{*/ +{ + char const * const SrcName = Ver.SourcePkgName(); + char const * const SrcVersion = Ver.SourceVerStr(); + pkgCache::PkgFileIterator PkgFile; + // find the first source for this version which promises a changelog + for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; ++VF) + { + pkgCache::PkgFileIterator const PF = VF.File(); + if (PF.Flagged(pkgCache::Flag::NotSource) || PF->Release == 0) + continue; + PkgFile = PF; + pkgCache::RlsFileIterator const RF = PF.ReleaseFile(); + std::string const uri = URI(RF, PF.Component(), SrcName, SrcVersion); + if (uri.empty()) + continue; + return uri; + } + return ""; +} +std::string pkgAcqChangelog::URITemplate(pkgCache::RlsFileIterator const &Rls) +{ + if (Rls.end() == true || (Rls->Label == 0 && Rls->Origin == 0)) + return ""; + std::string const serverConfig = "Acquire::Changelogs::URI"; + std::string server; +#define APT_EMPTY_SERVER \ + if (server.empty() == false) \ + { \ + if (server != "no") \ + return server; \ + return ""; \ + } +#define APT_CHECK_SERVER(X, Y) \ + if (Rls->X != 0) \ + { \ + std::string const specialServerConfig = serverConfig + "::" + Y + #X + "::" + Rls.X(); \ + server = _config->Find(specialServerConfig); \ + APT_EMPTY_SERVER \ + } + // this way e.g. Debian-Security can fallback to Debian + APT_CHECK_SERVER(Label, "Override::") + APT_CHECK_SERVER(Origin, "Override::") + + if (RealFileExists(Rls.FileName())) + { + _error->PushToStack(); + FileFd rf; + /* This can be costly. A caller wanting to get millions of URIs might + want to do this on its own once and use Override settings. + We don't do this here as Origin/Label are not as unique as they + should be so this could produce request order-dependent anomalies */ + if (OpenMaybeClearSignedFile(Rls.FileName(), rf) == true) + { + pkgTagFile TagFile(&rf, rf.Size()); + pkgTagSection Section; + if (TagFile.Step(Section) == true) + server = Section.FindS("Changelogs"); + } + _error->RevertToStack(); + APT_EMPTY_SERVER + } + + APT_CHECK_SERVER(Label, "") + APT_CHECK_SERVER(Origin, "") +#undef APT_CHECK_SERVER +#undef APT_EMPTY_SERVER + return ""; +} +std::string pkgAcqChangelog::URI(pkgCache::RlsFileIterator const &Rls, + char const * const Component, char const * const SrcName, + char const * const SrcVersion) +{ + return URI(URITemplate(Rls), Component, SrcName, SrcVersion); +} +std::string pkgAcqChangelog::URI(std::string const &Template, + char const * const Component, char const * const SrcName, + char const * const SrcVersion) +{ + if (Template.find("CHANGEPATH") == std::string::npos) + return ""; + + // the path is: COMPONENT/SRC/SRCNAME/SRCNAME_SRCVER, e.g. main/a/apt/1.1 or contrib/liba/libapt/2.0 + std::string Src = SrcName; + std::string path = APT::String::Startswith(SrcName, "lib") ? Src.substr(0, 4) : Src.substr(0,1); + path.append("/").append(Src).append("/"); + path.append(Src).append("_").append(StripEpoch(SrcVersion)); + // we omit component for releases without one (= flat-style repositories) + if (Component != NULL && strlen(Component) != 0) + path = std::string(Component) + "/" + path; + + return SubstVar(Template, "CHANGEPATH", path); +} + /*}}}*/ +// AcqChangelog::Failed - Failure handler /*{{{*/ +void pkgAcqChangelog::Failed(string const &Message, pkgAcquire::MethodConfig const * const Cnf) +{ + Item::Failed(Message,Cnf); + + std::string errText; + // TRANSLATOR: %s=%s is sourcename=sourceversion, e.g. apt=1.1 + strprintf(errText, _("Changelog unavailable for %s=%s"), SrcName.c_str(), SrcVersion.c_str()); + + // Error is probably something techy like 404 Not Found + if (ErrorText.empty()) + ErrorText = errText; + else + ErrorText = errText + " (" + ErrorText + ")"; + return; +} + /*}}}*/ +// AcqChangelog::Done - Item downloaded OK /*{{{*/ +void pkgAcqChangelog::Done(string const &Message,HashStringList const &CalcHashes, + pkgAcquire::MethodConfig const * const Cnf) +{ + Item::Done(Message,CalcHashes,Cnf); + + Complete = true; +} + /*}}}*/ +pkgAcqChangelog::~pkgAcqChangelog() /*{{{*/ +{ + if (TemporaryDirectory.empty() == false) + { + unlink(DestFile.c_str()); + rmdir(TemporaryDirectory.c_str()); + } +} + /*}}}*/ + // AcqFile::pkgAcqFile - Constructor /*{{{*/ pkgAcqFile::pkgAcqFile(pkgAcquire * const Owner,string const &URI, HashStringList const &Hashes, unsigned long long const Size,string const &Dsc,string const &ShortDesc, diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index b6d569737..606fd4173 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -1031,6 +1031,120 @@ class pkgAcqArchive : public pkgAcquire::Item std::string &StoreFilename); }; /*}}}*/ +/** \brief Retrieve the changelog for the given version {{{ + * + * Downloads the changelog to a temporary file it will also remove again + * while it is deconstructed or downloads it to a named location. + */ +class pkgAcqChangelog : public pkgAcquire::Item +{ + void *d; + std::string TemporaryDirectory; + std::string const SrcName; + std::string const SrcVersion; + + public: + // we will never have hashes for changelogs. + // If you need verified ones, download the deb and extract the changelog. + virtual HashStringList GetExpectedHashes() const { return HashStringList(); } + virtual bool HashesRequired() const { return false; } + + // Specialized action members + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Done(std::string const &Message, HashStringList const &CalcHashes, + pkgAcquire::MethodConfig const * const Cnf); + virtual std::string DescURI() const {return Desc.URI;}; + + /** returns the URI to the changelog of this version + * + * @param Ver is the version to get the changelog for + * @return the URI which will be used to acquire the changelog + */ + static std::string URI(pkgCache::VerIterator const &Ver); + + /** returns the URI to the changelog of this version + * + * \param Rls is the Release file the package comes from + * \param Component in which the package resides, can be empty + * \param SrcName is the source package name + * \param SrcVersion is the source package version + * @return the URI which will be used to acquire the changelog + */ + static std::string URI(pkgCache::RlsFileIterator const &Rls, + char const * const Component, char const * const SrcName, + char const * const SrcVersion); + + /** returns the URI to the changelog of this version + * + * \param Template URI where CHANGEPATH has to be filled in + * \param Component in which the package resides, can be empty + * \param SrcName is the source package name + * \param SrcVersion is the source package version + * @return the URI which will be used to acquire the changelog + */ + static std::string URI(std::string const &Template, + char const * const Component, char const * const SrcName, + char const * const SrcVersion); + + /** returns the URI template for this release file + * + * \param Rls is a Release file + * @return the URI template to use for this release file + */ + static std::string URITemplate(pkgCache::RlsFileIterator const &Rls); + + /** \brief Create a new pkgAcqChangelog object. + * + * \param Owner The pkgAcquire object with which this object is + * associated. + * \param Ver is the version to get the changelog for + * \param DestDir The directory the file should be downloaded into. + * Will be an autocreated (and cleaned up) temporary directory if not set. + * \param DestFilename The filename the file should have in #DestDir + * Defaults to sourcepackagename.changelog if not set. + */ + pkgAcqChangelog(pkgAcquire * const Owner, pkgCache::VerIterator const &Ver, + std::string const &DestDir="", std::string const &DestFilename=""); + + /** \brief Create a new pkgAcqChangelog object. + * + * \param Owner The pkgAcquire object with which this object is + * associated. + * \param Rls is the Release file the package comes from + * \param Component in which the package resides, can be empty + * \param SrcName is the source package name + * \param SrcVersion is the source package version + * \param DestDir The directory the file should be downloaded into. + * Will be an autocreated (and cleaned up) temporary directory if not set. + * \param DestFilename The filename the file should have in #DestDir + * Defaults to sourcepackagename.changelog if not set. + */ + pkgAcqChangelog(pkgAcquire * const Owner, pkgCache::RlsFileIterator const &Rls, + char const * const Component, char const * const SrcName, char const * const SrcVersion, + std::string const &DestDir="", std::string const &DestFilename=""); + + /** \brief Create a new pkgAcqChangelog object. + * + * \param Owner The pkgAcquire object with which this object is + * associated. + * \param URI is to be used to get the changelog + * \param SrcName is the source package name + * \param SrcVersion is the source package version + * \param DestDir The directory the file should be downloaded into. + * Will be an autocreated (and cleaned up) temporary directory if not set. + * \param DestFilename The filename the file should have in #DestDir + * Defaults to sourcepackagename.changelog if not set. + */ + pkgAcqChangelog(pkgAcquire * const Owner, std::string const &URI, + char const * const SrcName, char const * const SrcVersion, + std::string const &DestDir="", std::string const &DestFilename=""); + + virtual ~pkgAcqChangelog(); + +private: + APT_HIDDEN void Init(std::string const &DestDir, std::string const &DestFilename); +}; + /*}}}*/ /** \brief Retrieve an arbitrary file to the current directory. {{{ * * The file is retrieved even if it is accessed via a URL type that diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index e2239a906..96966b249 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -119,6 +119,10 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatDescription", "$(SITE) $(RELEASE) Sources"); Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::Optional", false); + Cnf.CndSet("Acquire::Changelogs::URI::Origin::Debian", "http://metadata.ftp-master.debian.org/changelogs/CHANGEPATH_changelog"); + Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ubuntu", "http://changelogs.ubuntu.com/changelogs/pool/CHANGEPATH/changelog"); + Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ultimedia", "http://packages.ultimediaos.com/changelogs/pool/CHANGEPATH/changelog.txt"); + bool Res = true; // Read an alternate config file diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index a4cd3c377..184b51d23 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1410,196 +1410,70 @@ static bool DoBuildDep(CommandLine &CmdL) return true; } /*}}}*/ -// GetChangelogPath - return a path pointing to a changelog file or dir /*{{{*/ -// --------------------------------------------------------------------- -/* This returns a "path" string for the changelog url construction. - * Please note that its not complete, it either needs a "/changelog" - * appended (for the packages.debian.org/changelogs site) or a - * ".changelog" (for third party sites that store the changelog in the - * pool/ next to the deb itself) - * Example return: "pool/main/a/apt/apt_0.8.8ubuntu3" - */ -static string GetChangelogPath(CacheFile &Cache, - pkgCache::VerIterator Ver) -{ - pkgRecords Recs(Cache); - pkgRecords::Parser &rec=Recs.Lookup(Ver.FileList()); - string path = flNotFile(rec.FileName()); -#if APT_PKG_ABI >= 413 - path.append(Ver.SourcePkgName()); - path.append("_"); - path.append(StripEpoch(Ver.SourceVerStr())); -#else - string srcpkg = rec.SourcePkg().empty() ? Ver.ParentPkg().Name() : rec.SourcePkg(); - string ver = Ver.VerStr(); - // if there is a source version it always wins - if (rec.SourceVer() != "") - ver = rec.SourceVer(); - path += srcpkg + "_" + StripEpoch(ver); -#endif - return path; -} - /*}}}*/ -// GuessThirdPartyChangelogUri - return url /*{{{*/ -// --------------------------------------------------------------------- -/* Contruct a changelog file path for third party sites that do not use - * packages.debian.org/changelogs - * This simply uses the ArchiveURI() of the source pkg and looks for - * a .changelog file there, Example for "mediabuntu": - * apt-get changelog mplayer-doc: - * http://packages.medibuntu.org/pool/non-free/m/mplayer/mplayer_1.0~rc4~try1.dsfg1-1ubuntu1+medibuntu1.changelog - */ -static bool GuessThirdPartyChangelogUri(CacheFile &Cache, - pkgCache::VerIterator Ver, - string &out_uri) -{ - // get the binary deb server path - pkgCache::VerFileIterator Vf = Ver.FileList(); - if (Vf.end() == true) - return false; - pkgCache::PkgFileIterator F = Vf.File(); - pkgIndexFile *index; - pkgSourceList *SrcList = Cache.GetSourceList(); - if(SrcList->FindIndex(F, index) == false) - return false; - - // get archive uri for the binary deb - string path_without_dot_changelog = GetChangelogPath(Cache, Ver); - out_uri = index->ArchiveURI(path_without_dot_changelog + ".changelog"); - - // now strip away the filename and add srcpkg_srcver.changelog - return true; -} - /*}}}*/ -// DownloadChangelog - Download the changelog /*{{{*/ -// --------------------------------------------------------------------- -static bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher, - pkgCache::VerIterator Ver, string targetfile) -/* Download a changelog file for the given package version to - * targetfile. This will first try the server from Apt::Changelogs::Server - * (http://packages.debian.org/changelogs by default) and if that gives - * a 404 tries to get it from the archive directly (see - * GuessThirdPartyChangelogUri for details how) - */ -{ - // make the server root configurable - string const server = _config->Find("Apt::Changelogs::Server", - "http://packages.debian.org/changelogs"); - string const path = GetChangelogPath(CacheFile, Ver); - string changelog_uri; - if (APT::String::Endswith(server, "/") == true) - strprintf(changelog_uri, "%s%s/changelog", server.c_str(), path.c_str()); - else - strprintf(changelog_uri, "%s/%s/changelog", server.c_str(), path.c_str()); - if (_config->FindB("APT::Get::Print-URIs", false) == true) - { - std::cout << '\'' << changelog_uri << '\'' << std::endl; - return true; - } - pkgCache::PkgIterator const Pkg = Ver.ParentPkg(); - - string descr; - strprintf(descr, _("Changelog for %s (%s)"), Pkg.Name(), changelog_uri.c_str()); - // queue it - pkgAcquire::Item const * itm = new pkgAcqFile(&Fetcher, changelog_uri, "", 0, descr, Pkg.Name(), "ignored", targetfile); - - // Disable drop-privs if "_apt" can not write to the target dir - CheckDropPrivsMustBeDisabled(Fetcher); - - // try downloading it, if that fails, try third-party-changelogs location - // FIXME: Fetcher.Run() is "Continue" even if I get a 404?!? - Fetcher.Run(); - if (itm->Status != pkgAcquire::Item::StatDone) - { - string third_party_uri; - if (GuessThirdPartyChangelogUri(CacheFile, Ver, third_party_uri)) - { - strprintf(descr, _("Changelog for %s (%s)"), Pkg.Name(), third_party_uri.c_str()); - itm = new pkgAcqFile(&Fetcher, third_party_uri, "", 0, descr, Pkg.Name(), "ignored", targetfile); - Fetcher.Run(); - } - } - - if (itm->Status == pkgAcquire::Item::StatDone) - return true; - - // error - return _error->Error("changelog download failed"); -} - /*}}}*/ // DoChangelog - Get changelog from the command line /*{{{*/ -// --------------------------------------------------------------------- static bool DoChangelog(CommandLine &CmdL) { CacheFile Cache; if (Cache.ReadOnlyOpen() == false) return false; - + APT::CacheSetHelper helper; APT::VersionList verset = APT::VersionList::FromCommandLine(Cache, CmdL.FileList + 1, APT::CacheSetHelper::CANDIDATE, helper); if (verset.empty() == true) return false; pkgAcquire Fetcher; + AcqTextStatus Stat(std::cout, ScreenWidth,_config->FindI("quiet",0)); + Fetcher.SetLog(&Stat); - if (_config->FindB("APT::Get::Print-URIs", false) == true) + bool const downOnly = _config->FindB("APT::Get::Download-Only", false); + bool const printOnly = _config->FindB("APT::Get::Print-URIs", false); + + for (APT::VersionList::const_iterator Ver = verset.begin(); + Ver != verset.end(); + ++Ver) { - bool Success = true; - for (APT::VersionList::const_iterator Ver = verset.begin(); - Ver != verset.end(); ++Ver) - Success &= DownloadChangelog(Cache, Fetcher, Ver, ""); - return Success; + if (printOnly) + new pkgAcqChangelog(&Fetcher, Ver, "/dev/null"); + else if (downOnly) + new pkgAcqChangelog(&Fetcher, Ver, "."); + else + new pkgAcqChangelog(&Fetcher, Ver); } - AcqTextStatus Stat(std::cout, ScreenWidth,_config->FindI("quiet",0)); - Fetcher.SetLog(&Stat); + if (printOnly == false) + { + // Disable drop-privs if "_apt" can not write to the target dir + CheckDropPrivsMustBeDisabled(Fetcher); + if (_error->PendingError() == true) + return false; - bool const downOnly = _config->FindB("APT::Get::Download-Only", false); + bool Failed = false; + if (AcquireRun(Fetcher, 0, &Failed, NULL) == false || Failed == true) + return false; + } - char tmpname[100]; - const char* tmpdir = NULL; - if (downOnly == false) + if (downOnly == false || printOnly == true) { - std::string systemTemp = GetTempDir(); - snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX", - systemTemp.c_str()); - tmpdir = mkdtemp(tmpname); - if (tmpdir == NULL) - return _error->Errno("mkdtemp", "mkdtemp failed"); - - std::string const SandboxUser = _config->Find("APT::Sandbox::User"); - if (getuid() == 0 && SandboxUser.empty() == false) // if we aren't root, we can't chown, so don't try it + bool Failed = false; + for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); ++I) { - struct passwd const * const pw = getpwnam(SandboxUser.c_str()); - struct group const * const gr = getgrnam("root"); - if (pw != NULL && gr != NULL) + if (printOnly) { - // chown the tmp dir directory we use to the sandbox user - if(chown(tmpdir, pw->pw_uid, gr->gr_gid) != 0) - _error->WarningE("DoChangelog", "chown to %s:%s of directory %s failed", SandboxUser.c_str(), "root", tmpdir); + if ((*I)->ErrorText.empty() == false) + { + Failed = true; + _error->Error("%s", (*I)->ErrorText.c_str()); + } + else + cout << '\'' << (*I)->DescURI() << "' " << flNotDir((*I)->DestFile) << std::endl; } + else + DisplayFileInPager((*I)->DestFile); } + return Failed == false; } - for (APT::VersionList::const_iterator Ver = verset.begin(); - Ver != verset.end(); - ++Ver) - { - string changelogfile; - if (downOnly == false) - changelogfile.append(tmpname).append("/changelog"); - else - changelogfile.append(Ver.ParentPkg().Name()).append(".changelog"); - if (DownloadChangelog(Cache, Fetcher, Ver, changelogfile) && downOnly == false) - { - DisplayFileInPager(changelogfile); - // cleanup temp file - unlink(changelogfile.c_str()); - } - } - // clenaup tmp dir - if (tmpdir != NULL) - rmdir(tmpdir); return true; } /*}}}*/ diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index da077afa7..5b6788ed4 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -230,16 +230,12 @@ - changelog downloads a package changelog and displays - it through sensible-pager. The server name and base - directory is defined in the APT::Changelogs::Server - variable (e.g. packages.debian.org/changelogs for - Debian or changelogs.ubuntu.com/changelogs for - Ubuntu). - By default it displays the changelog for the version that is - installed. However, you can specify the same options as for - the command. - + changelog tries to download the + changelog of a package and displays it through + sensible-pager. By default it + displays the changelog for the version that is installed. + However, you can specify the same options as for the + command. diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index efe986ea8..7d5f7e9b3 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -618,6 +618,33 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; + scope + + Acquiring changelogs can only be done if an URI is known from where to get them. + Preferable the Release file indicates this in a 'Changelogs' field. If this isn't + available the Label/Origin field of the Release file is used to check if a + Acquire::Changelogs::URI::Label::LABEL or + Acquire::Changelogs::URI::Origin::ORIGIN option + exists and if so this value is taken. The value in the Release file can be overridden + with Acquire::Changelogs::URI::Override::Label::LABEL + or Acquire::Changelogs::URI::Override::Origin::ORIGIN. + + The value should be a normal URI to a text file, expect that package specific data is + replaced with the placeholder CHANGEPATH. The + value for it is: 1. if the package is from a component (e.g. main) + this is the first part otherwise it is omitted, 2. the first letter of source package name, + expect if the source package name starts with 'lib' in which case it will + be the first four letters. 3. The complete source package name. 4. the complete name again and + 5. the source version. + The first (if present), second, third and fourth part are separated by a slash ('/') + and between the fourth and fifth part is an underscore ('_'). + + The special value 'no' is available for this option indicating that + this source can't be used to acquire changelog files from. Another source will be tried + if available in this case. + + + diff --git a/doc/examples/configure-index b/doc/examples/configure-index index ef1ae056d..1339335fa 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -117,14 +117,6 @@ APT // does a ExecFork) Keep-Fds {}; - Changelogs - { - // server the provides the changelogs, the code will assume - // the changlogs are in the pool/ under a srcpkg_ver directory - // with the name "changelog" - Server "http://packages.debian.org/changelogs"; - }: - // control parameters for cron jobs by /etc/cron.daily/apt Periodic { @@ -305,6 +297,9 @@ Acquire "none"; "fr"; }; + + // Location of the changelogs with the placeholder CHANGEPATH (e.g. "main/a/apt/apt_1.1") + Changelogs::URI::Origin::Debian "http://metadata.ftp-master.debian.org/changelogs/CHANGEPATH_changelog"; }; // Directory layout diff --git a/test/integration/framework b/test/integration/framework index 7b03c09ef..1b99929e2 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -520,6 +520,12 @@ Package: $NAME" > debian/control buildsimplenativepackage() { local NAME="$1" + local NM + if [ "$(echo "$NAME" | cut -c 1-3)" = 'lib' ]; then + NM="$(echo "$NAME" | cut -c 1-4)" + else + NM="$(echo "$NAME" | cut -c 1)" + fi local ARCH="$2" local VERSION="$3" local RELEASE="${4:-unstable}" @@ -600,15 +606,15 @@ Package: $NAME" >> ${BUILDDIR}/debian/control (cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$arch) (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) local LOG="${BUILDDIR}/../${NAME}_${VERSION}_${arch}.dpkg-deb.log" - # ensure the right permissions as dpkg-deb ensists + # ensure the right permissions as dpkg-deb insists chmod 755 ${BUILDDIR}/debian/tmp/DEBIAN testsuccess --nomsg dpkg-deb -Z${COMPRESS_TYPE} --build ${BUILDDIR}/debian/tmp ${BUILDDIR}/.. echo "pool/${NAME}_${VERSION}_${arch}.deb" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.pkglist done - mkdir -p ${BUILDDIR}/../${NAME}_${VERSION} - cp ${BUILDDIR}/debian/changelog ${BUILDDIR}/../${NAME}_${VERSION}/ - cp ${BUILDDIR}/debian/changelog ${BUILDDIR}/../${NAME}_${VERSION}.changelog + local CHANGEPATH="${BUILDDIR}/../${DISTSECTION}/${NM}/${NAME}/${NAME}_${VERSION}" + mkdir -p $CHANGEPATH + cp ${BUILDDIR}/debian/changelog $CHANGEPATH rm -rf "${BUILDDIR}" msgdone "info" } @@ -876,6 +882,7 @@ getcodenamefromsuite() { } getreleaseversionfromsuite() { true; } getlabelfromsuite() { true; } +getoriginfromsuite() { true; } generatereleasefiles() { # $1 is the Date header and $2 is the ValidUntil header to be set @@ -887,16 +894,21 @@ generatereleasefiles() { local CODENAME="$(getcodenamefromsuite $SUITE)" local VERSION="$(getreleaseversionfromsuite $SUITE)" local LABEL="$(getlabelfromsuite $SUITE)" + local ORIGIN="$(getoriginfromsuite $SUITE)" if [ -n "$VERSION" ]; then VERSION="-o APT::FTPArchive::Release::Version=${VERSION}" fi if [ -n "$LABEL" ]; then LABEL="-o APT::FTPArchive::Release::Label=${LABEL}" fi + if [ -n "$ORIGIN" ]; then + ORIGIN="-o APT::FTPArchive::Release::Origin=${ORIGIN}" + fi aptftparchive -qq release $dir \ -o APT::FTPArchive::Release::Suite="${SUITE}" \ -o APT::FTPArchive::Release::Codename="${CODENAME}" \ ${LABEL} \ + ${ORIGIN} \ ${VERSION} \ | sed -e '/0 Release$/ d' > $dir/Release # remove the self reference if [ "$SUITE" = "experimental" -o "$SUITE" = "experimental2" ]; then @@ -1450,9 +1462,9 @@ testfilestats() { msgpass else echo >&2 - ls -ld >&2 "$1" + ls -ld >&2 "$1" || true echo -n >&2 "stat(1) reports for $2: " - stat --format "$2" "$1" + stat --format "$2" "$1" || true msgfail fi } diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog index 7e81c71b6..5fa8543b9 100755 --- a/test/integration/test-apt-get-changelog +++ b/test/integration/test-apt-get-changelog @@ -5,44 +5,98 @@ TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture "i386" +configarchitecture 'native' -buildsimplenativepackage 'apt' 'all' '1.0' 'stable' +buildsimplenativepackage 'foo' 'all' '1.0' 'stable' +buildsimplenativepackage 'libbar' 'all' '1.0' 'stable' + +getlabelfromsuite() { echo 'Testcases'; } +getoriginfromsuite() { echo 'Debian'; } setupaptarchive --no-update changetowebserver testsuccess aptget update -# simulate normal user with non-existent root-owned directories -rm -rf rootdir/var/cache/apt/archives/ -mkdir rootdir/var/cache/apt/archives/ -addtrap 'prefix' "chmod -f -R +w $PWD/rootdir/var/cache/apt/archives || true;" -chmod -R -w rootdir/var/cache/apt/archives +testsuccessequal "'http://metadata.ftp-master.debian.org/changelogs/main/f/foo/foo_1.0_changelog' foo.changelog +'http://metadata.ftp-master.debian.org/changelogs/main/libb/libbar/libbar_1.0_changelog' libbar.changelog" aptget changelog foo libbar --print-uris + +releasechanger() { + # modifying the Release files in lists… bad stuff. Good that this is only a test… + sed -i "s#^${1}: .*#${1}: ${2}#" $(find rootdir/var/lib/apt/lists -name '*Release') + rm -f rootdir/var/cache/apt/*.bin +} +releasechanger 'Origin' 'Ubuntu' +testsuccessequal "'http://changelogs.ubuntu.com/changelogs/pool/main/f/foo/foo_1.0/changelog' foo.changelog +'http://changelogs.ubuntu.com/changelogs/pool/main/libb/libbar/libbar_1.0/changelog' libbar.changelog" aptget changelog foo libbar --print-uris + +releasechanger 'Label' 'Debian' +testsuccessequal "'http://changelogs.ubuntu.com/changelogs/pool/main/f/foo/foo_1.0/changelog' foo.changelog +'http://changelogs.ubuntu.com/changelogs/pool/main/libb/libbar/libbar_1.0/changelog' libbar.changelog" aptget changelog foo libbar --print-uris + +testsuccessequal "'http://localhost:8080/main/f/foo/foo_1.0.changelog' foo.changelog +'http://localhost:8080/main/libb/libbar/libbar_1.0.changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Label::Debian='http://localhost:8080/CHANGEPATH.changelog' + +sed -i '/^Origin: / a\ +Changelogs: http://example.org/CHANGEPATH-changelog' $(find rootdir/var/lib/apt/lists -name '*Release') +rm -f rootdir/var/cache/apt/*.bin -echo 'Apt::Changelogs::Server "http://localhost:8080/";' > rootdir/etc/apt/apt.conf.d/changelog.conf +testsuccessequal "'http://example.org/main/f/foo/foo_1.0-changelog' foo.changelog +'http://example.org/main/libb/libbar/libbar_1.0-changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Label::Debian='http://localhost:8080/CHANGEPATH.changelog' -testsuccessequal "'http://localhost:8080/pool/apt_1.0/changelog'" aptget changelog apt --print-uris +testsuccessequal "'http://localhost:8080/main/f/foo/foo_1.0.changelog' foo.changelog +'http://localhost:8080/main/libb/libbar/libbar_1.0.changelog' libbar.changelog" aptget changelog foo libbar --print-uris -o Acquire::Changelogs::URI::Override::Label::Debian='http://localhost:8080/CHANGEPATH.changelog' -testsuccessequal "'http://localhost:8080/pool/apt_1.0/changelog' -'http://localhost:8080/pool/apt_1.0/changelog'" aptget changelog apt apt --print-uris +releasechanger 'Changelogs' 'no' +testequal 'E: Failed to fetch changelog:/foo.changelog Changelog unavailable for foo=1.0 +' aptget changelog foo -qq -d + +sed -i '/^Changelogs: / d' $(find rootdir/var/lib/apt/lists -name '*Release') +releasechanger 'Label' 'Testcases' + +echo 'Acquire::Changelogs::URI::Label::Testcases "http://localhost:8080/CHANGEPATH/change.txt";' > rootdir/etc/apt/apt.conf.d/changelog.conf +testsuccessequal "'http://localhost:8080/main/f/foo/foo_1.0/change.txt' foo.changelog +'http://localhost:8080/main/libb/libbar/libbar_1.0/change.txt' libbar.changelog" aptget changelog foo libbar --print-uris + +echo 'Acquire::Changelogs::URI::Label::Testcases "http://localhost:8080/pool/CHANGEPATH/changelog";' > rootdir/etc/apt/apt.conf.d/changelog.conf +testsuccessequal "'http://localhost:8080/pool/main/f/foo/foo_1.0/changelog' foo.changelog" aptget changelog foo --print-uris cd downloaded -testsuccess aptget changelog apt -qq -testfileequal '../rootdir/tmp/testsuccess.output' "$(cat ../aptarchive/pool/apt_1.0/changelog)" +testsuccess aptget changelog foo -qq +testfileequal '../rootdir/tmp/testsuccess.output' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)" + +testsuccess aptget changelog foo libbar -qq +testfileequal '../rootdir/tmp/testsuccess.output' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog) +$(cat ../aptarchive/pool/main/libb/libbar/libbar_1.0/changelog)" + +testsuccess aptget changelog foo -d +testfilestats 'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" +testfileequal 'foo.changelog' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)" +rm -f foo.changelog -testsuccess aptget changelog apt -d -testfileequal 'apt.changelog' "$(cat ../aptarchive/pool/apt_1.0/changelog)" -testfilestats 'apt.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" -rm -f apt.changelog ../aptarchive/pool/apt_1.0/changelog +testsuccess aptget changelog libbar foo -d +testfilestats 'libbar.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" +testfilestats 'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" +testfileequal 'libbar.changelog' "$(cat ../aptarchive/pool/main/libb/libbar/libbar_1.0/changelog)" +testfileequal 'foo.changelog' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)" +rm -f libbar.changelog foo.changelog -testequal "$(cat ../aptarchive/pool/apt_1.0.changelog)" aptget changelog apt \ - -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' +# as such bogus, but can happen with multiple binaries from the same source +testsuccessequal "'http://localhost:8080/pool/main/f/foo/foo_1.0/changelog' foo.changelog +'http://localhost:8080/pool/main/f/foo/foo_1.0/changelog' foo.changelog" aptget changelog foo foo --print-uris +testsuccess aptget changelog foo foo -qq +testfileequal '../rootdir/tmp/testsuccess.output' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog) +$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)" +testsuccess aptget changelog foo foo -d +testfilestats 'foo.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" +testfileequal 'foo.changelog' "$(cat ../aptarchive/pool/main/f/foo/foo_1.0/changelog)" +rm -f foo.changelog -testsuccess aptget changelog apt -d -testfileequal 'apt.changelog' "$(cat ../aptarchive/pool/apt_1.0.changelog)" -testfilestats 'apt.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" -rm -f apt.changelog ../aptarchive/pool/apt_1.0.changelog +# no CHANGEPATH in the URI +testequal 'E: Failed to fetch changelog:/foo.changelog Changelog unavailable for foo=1.0 +' aptget changelog foo -qq -d -o Acquire::Changelogs::URI::Label::Testcases='http://localhost:8080/change.txt' +testfailure test -e foo.changelog -testequal 'E: changelog download failed' aptget changelog apt -qq -d -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' -testfailure test -e apt.changelog +testequal 'E: Failed to fetch http://localhost:8080/does/not/exist/main/f/foo/foo_1.0/change.txt Changelog unavailable for foo=1.0 (404 Not Found) +' aptget changelog foo -qq -d -o Acquire::Changelogs::URI::Label::Testcases='http://localhost:8080/does/not/exist/CHANGEPATH/change.txt' +testfailure test -e foo.changelog diff --git a/test/integration/test-bug-722207-print-uris-even-if-very-quiet b/test/integration/test-bug-722207-print-uris-even-if-very-quiet index 2cad929cc..e51d72ccd 100755 --- a/test/integration/test-bug-722207-print-uris-even-if-very-quiet +++ b/test/integration/test-bug-722207-print-uris-even-if-very-quiet @@ -12,6 +12,7 @@ insertpackage 'unstable' 'apt' 'all' '2' insertsource 'unstable' 'apt' 'all' '2' insertsource 'unstable' 'apt2' 'all' '1' +getoriginfromsuite() { echo 'Debian'; } setupaptarchive APTARCHIVE=$(readlink -f ./aptarchive) @@ -22,7 +23,7 @@ testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.d testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget download apt -qq --print-uris testsuccessequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e 'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt -qq --print-uris -testsuccessequal "'http://packages.debian.org/changelogs/pool/main/apt/apt_2/changelog'" aptget changelog apt -qq --print-uris +testsuccessequal "'http://metadata.ftp-master.debian.org/changelogs/main/a/apt/apt_2_changelog' apt.changelog" aptget changelog apt -qq --print-uris testsuccessequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e 'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e diff --git a/test/integration/test-bug-738785-switch-protocol b/test/integration/test-bug-738785-switch-protocol index f6336ffe3..539080200 100755 --- a/test/integration/test-bug-738785-switch-protocol +++ b/test/integration/test-bug-738785-switch-protocol @@ -10,6 +10,7 @@ configarchitecture "i386" buildsimplenativepackage 'apt' 'all' '1.0' 'stable' # setup http redirecting to https +getlabelfromsuite() { echo 'Testcases'; } setupaptarchive --no-update changetowebserver -o 'aptwebserver::redirect::replace::/redirectme/=https://localhost:4433/' \ -o 'aptwebserver::redirect::replace::/downgrademe/=http://localhost:8080/' \ @@ -20,10 +21,10 @@ sed -i -e 's#:4433/#:8080/redirectme#' -e 's# https:# http:#' rootdir/etc/apt/so testsuccess aptget update -o Debug::Acquire::http=1 -o Debug::Acquire::https=1 -o Debug::pkgAcquire::Worker=1 msgtest 'Test that the webserver does not answer' 'http requests' -downloadfile 'http://localhost:8080/pool/apt_1.0/changelog' changelog >/dev/null 2>&1 && msgfail || msgpass +downloadfile 'http://localhost:8080/pool/main/a/apt/apt_1.0/changelog' changelog >/dev/null 2>&1 && msgfail || msgpass -echo 'Apt::Changelogs::Server "http://localhost:8080/redirectme";' > rootdir/etc/apt/apt.conf.d/changelog.conf -testsuccessequal "'http://localhost:8080/redirectme/pool/apt_1.0/changelog'" aptget changelog apt --print-uris +echo 'Acquire::Changelogs::URI::Label::Testcases "http://localhost:8080/redirectme/pool/CHANGEPATH/changelog";' > rootdir/etc/apt/apt.conf.d/changelog.conf +testsuccessequal "'http://localhost:8080/redirectme/pool/main/a/apt/apt_1.0/changelog' apt.changelog" aptget changelog apt --print-uris cd downloaded testsuccess aptget changelog apt -d diff --git a/vendor/ubuntu/apt.conf-01-vendor-ubuntu b/vendor/ubuntu/apt.conf-01-vendor-ubuntu index c4092ff44..e69de29bb 100644 --- a/vendor/ubuntu/apt.conf-01-vendor-ubuntu +++ b/vendor/ubuntu/apt.conf-01-vendor-ubuntu @@ -1,6 +0,0 @@ -// Server information for apt-changelog -APT { - Changelogs { - Server "http://changelogs.ubuntu.com/changelogs"; - }; -}; -- cgit v1.2.3 From 9f697f69cf1adaced476598cfe08ab03c76c5d18 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 15 Jun 2015 12:51:22 +0200 Subject: ensure valid or remove destination file in file method 'file' isn't using the destination file per-se, but returns another name via "Filename" header. It still should deal with destination files as they could exist (pkgAcqFile e.g. creates links in that location) and are potentially bogus. --- methods/file.cc | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/methods/file.cc b/methods/file.cc index 353e54bd5..5d5fffa67 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -48,8 +48,24 @@ bool FileMethod::Fetch(FetchItem *Itm) if (Get.Host.empty() == false) return _error->Error(_("Invalid URI, local URIS must not start with //")); - // See if the file exists struct stat Buf; + // deal with destination files which might linger around + if (lstat(Itm->DestFile.c_str(), &Buf) == 0) + { + if ((Buf.st_mode & S_IFREG) != 0) + { + if (Itm->LastModified == Buf.st_mtime && Itm->LastModified != 0) + { + HashStringList const hsl = Itm->ExpectedHashes; + if (Itm->ExpectedHashes.VerifyFile(File)) + Res.IMSHit = true; + } + } + } + if (Res.IMSHit != true) + unlink(Itm->DestFile.c_str()); + + // See if the file exists if (stat(File.c_str(),&Buf) == 0) { Res.Size = Buf.st_size; @@ -65,6 +81,8 @@ bool FileMethod::Fetch(FetchItem *Itm) } // See if the uncompressed file exists and reuse it + FetchResult AltRes; + AltRes.Filename.clear(); std::vector extensions = APT::Configuration::getCompressorExtensions(); for (std::vector::const_iterator ext = extensions.begin(); ext != extensions.end(); ++ext) { @@ -73,29 +91,33 @@ bool FileMethod::Fetch(FetchItem *Itm) std::string const unfile = File.substr(0, File.length() - ext->length() - 1); if (stat(unfile.c_str(),&Buf) == 0) { - FetchResult AltRes; AltRes.Size = Buf.st_size; AltRes.Filename = unfile; AltRes.LastModified = Buf.st_mtime; AltRes.IMSHit = false; if (Itm->LastModified == Buf.st_mtime && Itm->LastModified != 0) AltRes.IMSHit = true; - - URIDone(Res,&AltRes); - return true; + break; } // no break here as we could have situations similar to '.gz' vs '.tar.gz' here } } - if (Res.Filename.empty() == true) + if (Res.Filename.empty() == false) + { + Hashes Hash(Itm->ExpectedHashes); + FileFd Fd(Res.Filename, FileFd::ReadOnly); + Hash.AddFD(Fd); + Res.TakeHashes(Hash); + } + + if (AltRes.Filename.empty() == false) + URIDone(Res,&AltRes); + else if (Res.Filename.empty() == false) + URIDone(Res); + else return _error->Error(_("File not found")); - Hashes Hash(Itm->ExpectedHashes); - FileFd Fd(Res.Filename, FileFd::ReadOnly); - Hash.AddFD(Fd); - Res.TakeHashes(Hash); - URIDone(Res); return true; } /*}}}*/ -- cgit v1.2.3 From 08ea7806458de0995414eaae852e0a5985875642 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 15 Jun 2015 13:16:43 +0200 Subject: deal better with acquiring the same URI multiple times This is an unlikely event for indexes and co, but it can happen quiet easily e.g. for changelogs where you want to get the changelogs for multiple binary package(version)s which happen to all be built from a single source. The interesting part is that the Acquire system actually detected this already and set the item requesting the URI again to StatDone - expect that this is hardly sufficient: an Item must be Complete=true as well to be considered truely done and that is only the tip of the ::Done handling iceberg. So instead of this StatDone hack we allow QItems to be owned by multiple items and notify all owners about everything now, so that for the point of each item they got it downloaded just for them. --- apt-pkg/acquire-item.cc | 25 +- apt-pkg/acquire-item.h | 1 + apt-pkg/acquire-worker.cc | 280 +++++++++++++-------- apt-pkg/acquire-worker.h | 3 + apt-pkg/acquire.cc | 126 ++++++++-- apt-pkg/acquire.h | 44 +++- .../test-acquire-same-file-multiple-times | 80 ++++++ test/integration/test-apt-get-download | 2 +- 8 files changed, 409 insertions(+), 152 deletions(-) create mode 100755 test/integration/test-acquire-same-file-multiple-times diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 4bf4e62f8..dc4f61b56 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -438,6 +438,11 @@ APT_PURE pkgAcquire * pkgAcquire::Item::GetOwner() const /*{{{*/ return Owner; } /*}}}*/ +pkgAcquire::ItemDesc &pkgAcquire::Item::GetItemDesc() /*{{{*/ +{ + return Desc; +} + /*}}}*/ APT_CONST bool pkgAcquire::Item::IsTrusted() const /*{{{*/ { return false; @@ -840,7 +845,7 @@ bool pkgAcqMetaBase::CheckDownloadDone(pkgAcqTransactionItem * const I, const st return false; } - if (FileName != I->DestFile) + if (FileName != I->DestFile && RealFileExists(I->DestFile) == false) { I->Local = true; I->Desc.URI = "copy:" + FileName; @@ -2482,7 +2487,7 @@ void pkgAcqIndex::StageDownloadDone(string const &Message, HashStringList const // Methods like e.g. "file:" will give us a (compressed) FileName that is // not the "DestFile" we set, in this case we uncompress from the local file - if (FileName != DestFile) + if (FileName != DestFile && RealFileExists(DestFile) == false) Local = true; else EraseFileName = FileName; @@ -2760,7 +2765,7 @@ void pkgAcqArchive::Done(string const &Message, HashStringList const &Hashes, } // Reference filename - if (FileName != DestFile) + if (DestFile != FileName && RealFileExists(DestFile) == false) { StoreFilename = DestFile = FileName; Local = true; @@ -2903,18 +2908,6 @@ void pkgAcqChangelog::Init(std::string const &DestDir, std::string const &DestFi strprintf(Desc.Description, "%s %s %s Changelog", URI::SiteOnly(Desc.URI).c_str(), SrcName.c_str(), SrcVersion.c_str()); Desc.Owner = this; QueueURI(Desc); - - if (Status == StatDone) // this happens if we queue the same changelog two times - { - Complete = true; - for (pkgAcquire::UriIterator I = Owner->UriBegin(); I != Owner->UriEnd(); ++I) - if (I->URI == Desc.URI) - if (DestFile != I->Owner->DestFile) - if (symlink(I->Owner->DestFile.c_str(), DestFile.c_str()) != 0) - { - ; // ignore error, there isn't anthing we could do to handle the edgecase of an edgecase - } - } } /*}}}*/ std::string pkgAcqChangelog::URI(pkgCache::VerIterator const &Ver) /*{{{*/ @@ -3107,7 +3100,7 @@ void pkgAcqFile::Done(string const &Message,HashStringList const &CalcHashes, return; // We have to copy it into place - if (FileName != DestFile) + if (RealFileExists(DestFile.c_str()) == false) { Local = true; if (_config->FindB("Acquire::Source-Symlinks",true) == false || diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 606fd4173..9dbacc1ea 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -249,6 +249,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ /** \return the acquire process with which this item is associated. */ pkgAcquire *GetOwner() const; + pkgAcquire::ItemDesc &GetItemDesc(); /** \return \b true if this object is being fetched from a trusted source. */ virtual bool IsTrusted() const; diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 099a1f87d..d6318a21b 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -258,18 +258,27 @@ bool pkgAcquire::Worker::RunMessages() ItemDone(); - pkgAcquire::Item *Owner = Itm->Owner; - pkgAcquire::ItemDesc Desc = *Itm; - // Change the status so that it can be dequeued - Owner->Status = pkgAcquire::Item::StatIdle; + for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) + { + pkgAcquire::Item *Owner = *O; + Owner->Status = pkgAcquire::Item::StatIdle; + } // Mark the item as done (taking care of all queues) // and then put it in the main queue again + std::vector const ItmOwners = Itm->Owners; OwnerQ->ItemDone(Itm); - OwnerQ->Owner->Enqueue(Desc); + Itm = NULL; + for (pkgAcquire::Queue::QItem::owner_iterator O = ItmOwners.begin(); O != ItmOwners.end(); ++O) + { + pkgAcquire::Item *Owner = *O; + pkgAcquire::ItemDesc desc = Owner->GetItemDesc(); + desc.URI = NewURI; + OwnerQ->Owner->Enqueue(desc); - if (Log != 0) - Log->Done(Desc); + if (Log != 0) + Log->Done(Owner->GetItemDesc()); + } break; } @@ -286,14 +295,18 @@ bool pkgAcquire::Worker::RunMessages() CurrentSize = 0; TotalSize = strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10); ResumePoint = strtoull(LookupTag(Message,"Resume-Point","0").c_str(), NULL, 10); - Itm->Owner->Start(Message, TotalSize); - - // Display update before completion - if (Log != 0 && Log->MorePulses == true) - Log->Pulse(Itm->Owner->GetOwner()); + for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) + { + (*O)->Start(Message, TotalSize); - if (Log != 0) - Log->Fetch(*Itm); + // Display update before completion + if (Log != 0) + { + if (Log->MorePulses == true) + Log->Pulse((*O)->GetOwner()); + Log->Fetch((*O)->GetItemDesc()); + } + } break; } @@ -307,105 +320,110 @@ bool pkgAcquire::Worker::RunMessages() break; } - pkgAcquire::Item *Owner = Itm->Owner; - pkgAcquire::ItemDesc Desc = *Itm; - - if (RealFileExists(Owner->DestFile)) - ChangeOwnerAndPermissionOfFile("201::URIDone", Owner->DestFile.c_str(), "root", "root", 0644); + PrepareFiles("201::URIDone", Itm); // Display update before completion if (Log != 0 && Log->MorePulses == true) - Log->Pulse(Owner->GetOwner()); + for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) + Log->Pulse((*O)->GetOwner()); - OwnerQ->ItemDone(Itm); - - HashStringList const ExpectedHashes = Owner->GetExpectedHashes(); - // see if we got hashes to verify + std::string const filename = LookupTag(Message, "Filename", Itm->Owner->DestFile.c_str()); HashStringList ReceivedHashes; - for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) { - std::string const tagname = std::string(*type) + "-Hash"; - std::string const hashsum = LookupTag(Message, tagname.c_str()); - if (hashsum.empty() == false) - ReceivedHashes.push_back(HashString(*type, hashsum)); - } - // not all methods always sent Hashes our way - if (ExpectedHashes.usable() == true && ReceivedHashes.usable() == false) - { - std::string const filename = LookupTag(Message, "Filename", Owner->DestFile.c_str()); - if (filename.empty() == false && RealFileExists(filename)) + // see if we got hashes to verify + for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) { - Hashes calc(ExpectedHashes); - FileFd file(filename, FileFd::ReadOnly, FileFd::None); - calc.AddFD(file); - ReceivedHashes = calc.GetHashStringList(); + std::string const tagname = std::string(*type) + "-Hash"; + std::string const hashsum = LookupTag(Message, tagname.c_str()); + if (hashsum.empty() == false) + ReceivedHashes.push_back(HashString(*type, hashsum)); + } + // not all methods always sent Hashes our way + if (ReceivedHashes.usable() == false) + { + HashStringList const ExpectedHashes = Itm->GetExpectedHashes(); + if (ExpectedHashes.usable() == true && RealFileExists(filename)) + { + Hashes calc(ExpectedHashes); + FileFd file(filename, FileFd::ReadOnly, FileFd::None); + calc.AddFD(file); + ReceivedHashes = calc.GetHashStringList(); + } } } - if(_config->FindB("Debug::pkgAcquire::Auth", false) == true) - { - std::clog << "201 URI Done: " << Owner->DescURI() << endl - << "ReceivedHash:" << endl; - for (HashStringList::const_iterator hs = ReceivedHashes.begin(); hs != ReceivedHashes.end(); ++hs) - std::clog << "\t- " << hs->toStr() << std::endl; - std::clog << "ExpectedHash:" << endl; - for (HashStringList::const_iterator hs = ExpectedHashes.begin(); hs != ExpectedHashes.end(); ++hs) - std::clog << "\t- " << hs->toStr() << std::endl; - std::clog << endl; - } + // only local files can refer other filenames and counting them as fetched would be unfair + if (Log != NULL && filename != Itm->Owner->DestFile) + Log->Fetched(ReceivedHashes.FileSize(),atoi(LookupTag(Message,"Resume-Point","0").c_str())); + + std::vector const ItmOwners = Itm->Owners; + OwnerQ->ItemDone(Itm); + Itm = NULL; - // decide if what we got is what we expected - bool consideredOkay = false; bool const isIMSHit = StringToBool(LookupTag(Message,"IMS-Hit"),false) || StringToBool(LookupTag(Message,"Alt-IMS-Hit"),false); - if (ExpectedHashes.usable()) + + for (pkgAcquire::Queue::QItem::owner_iterator O = ItmOwners.begin(); O != ItmOwners.end(); ++O) { - if (ReceivedHashes.usable() == false) + pkgAcquire::Item * const Owner = *O; + HashStringList const ExpectedHashes = Owner->GetExpectedHashes(); + if(_config->FindB("Debug::pkgAcquire::Auth", false) == true) { - /* IMS-Hits can't be checked here as we will have uncompressed file, - but the hashes for the compressed file. What we have was good through - so all we have to ensure later is that we are not stalled. */ - consideredOkay = isIMSHit; + std::clog << "201 URI Done: " << Owner->DescURI() << endl + << "ReceivedHash:" << endl; + for (HashStringList::const_iterator hs = ReceivedHashes.begin(); hs != ReceivedHashes.end(); ++hs) + std::clog << "\t- " << hs->toStr() << std::endl; + std::clog << "ExpectedHash:" << endl; + for (HashStringList::const_iterator hs = ExpectedHashes.begin(); hs != ExpectedHashes.end(); ++hs) + std::clog << "\t- " << hs->toStr() << std::endl; + std::clog << endl; } - else if (ReceivedHashes == ExpectedHashes) - consideredOkay = true; - else - consideredOkay = false; - } - else if (Owner->HashesRequired() == true) - consideredOkay = false; - else - consideredOkay = true; + // decide if what we got is what we expected + bool consideredOkay = false; + if (ExpectedHashes.usable()) + { + if (ReceivedHashes.usable() == false) + { + /* IMS-Hits can't be checked here as we will have uncompressed file, + but the hashes for the compressed file. What we have was good through + so all we have to ensure later is that we are not stalled. */ + consideredOkay = isIMSHit; + } + else if (ReceivedHashes == ExpectedHashes) + consideredOkay = true; + else + consideredOkay = false; - if (consideredOkay == true) - { - Owner->Done(Message, ReceivedHashes, Config); - ItemDone(); + } + else if (Owner->HashesRequired() == true) + consideredOkay = false; + else + consideredOkay = true; - // Log that we are done - if (Log != 0) + if (consideredOkay == true) { - if (isIMSHit) + Owner->Done(Message, ReceivedHashes, Config); + + // Log that we are done + if (Log != 0) { - /* Hide 'hits' for local only sources - we also manage to - hide gets */ - if (Config->LocalOnly == false) - Log->IMSHit(Desc); + if (isIMSHit) + Log->IMSHit(Owner->GetItemDesc()); + else + Log->Done(Owner->GetItemDesc()); } - else - Log->Done(Desc); } - } - else - { - Owner->Status = pkgAcquire::Item::StatAuthError; - Owner->Failed(Message,Config); - ItemDone(); + else + { + Owner->Status = pkgAcquire::Item::StatAuthError; + Owner->Failed(Message,Config); - if (Log != 0) - Log->Fail(Desc); + if (Log != 0) + Log->Fail(Owner->GetItemDesc()); + } } + ItemDone(); break; } @@ -419,30 +437,32 @@ bool pkgAcquire::Worker::RunMessages() break; } + PrepareFiles("400::URIFailure", Itm); + // Display update before completion if (Log != 0 && Log->MorePulses == true) - Log->Pulse(Itm->Owner->GetOwner()); - - pkgAcquire::Item *Owner = Itm->Owner; - pkgAcquire::ItemDesc Desc = *Itm; - - if (RealFileExists(Owner->DestFile)) - ChangeOwnerAndPermissionOfFile("400::URIFailure", Owner->DestFile.c_str(), "root", "root", 0644); + for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) + Log->Pulse((*O)->GetOwner()); + std::vector const ItmOwners = Itm->Owners; OwnerQ->ItemDone(Itm); + Itm = NULL; - // set some status - if(LookupTag(Message,"FailReason") == "Timeout" || - LookupTag(Message,"FailReason") == "TmpResolveFailure" || - LookupTag(Message,"FailReason") == "ResolveFailure" || - LookupTag(Message,"FailReason") == "ConnectionRefused") - Owner->Status = pkgAcquire::Item::StatTransientNetworkError; + for (pkgAcquire::Queue::QItem::owner_iterator O = ItmOwners.begin(); O != ItmOwners.end(); ++O) + { + // set some status + if(LookupTag(Message,"FailReason") == "Timeout" || + LookupTag(Message,"FailReason") == "TmpResolveFailure" || + LookupTag(Message,"FailReason") == "ResolveFailure" || + LookupTag(Message,"FailReason") == "ConnectionRefused") + (*O)->Status = pkgAcquire::Item::StatTransientNetworkError; - Owner->Failed(Message,Config); - ItemDone(); + (*O)->Failed(Message,Config); - if (Log != 0) - Log->Fail(Desc); + if (Log != 0) + Log->Fail((*O)->GetItemDesc()); + } + ItemDone(); break; } @@ -578,16 +598,24 @@ bool pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem *Item) Message.reserve(300); Message += "URI: " + Item->URI; Message += "\nFilename: " + Item->Owner->DestFile; - HashStringList const hsl = Item->Owner->GetExpectedHashes(); + + HashStringList const hsl = Item->GetExpectedHashes(); for (HashStringList::const_iterator hs = hsl.begin(); hs != hsl.end(); ++hs) Message += "\nExpected-" + hs->HashType() + ": " + hs->HashValue(); - if(Item->Owner->FileSize > 0) + + if (hsl.FileSize() == 0) { - string MaximumSize; - strprintf(MaximumSize, "%llu", Item->Owner->FileSize); - Message += "\nMaximum-Size: " + MaximumSize; + unsigned long long FileSize = Item->GetMaximumSize(); + if(FileSize > 0) + { + string MaximumSize; + strprintf(MaximumSize, "%llu", FileSize); + Message += "\nMaximum-Size: " + MaximumSize; + } } - Message += Item->Owner->Custom600Headers(); + + Item->SyncDestinationFiles(); + Message += Item->Custom600Headers(); Message += "\n\n"; if (RealFileExists(Item->Owner->DestFile)) @@ -686,3 +714,33 @@ void pkgAcquire::Worker::ItemDone() Status = string(); } /*}}}*/ +void pkgAcquire::Worker::PrepareFiles(char const * const caller, pkgAcquire::Queue::QItem const * const Itm)/*{{{*/ +{ + if (RealFileExists(Itm->Owner->DestFile)) + { + ChangeOwnerAndPermissionOfFile(caller, Itm->Owner->DestFile.c_str(), "root", "root", 0644); + std::string const filename = Itm->Owner->DestFile; + for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) + { + pkgAcquire::Item const * const Owner = *O; + if (Owner->DestFile == filename) + continue; + unlink(Owner->DestFile.c_str()); + if (link(filename.c_str(), Owner->DestFile.c_str()) != 0) + { + // diferent mounts can't happen for us as we download to lists/ by default, + // but if the system is reused by others the locations can potentially be on + // different disks, so use symlink as poor-men replacement. + // FIXME: Real copying as last fallback, but that is costly, so offload to a method preferable + if (symlink(filename.c_str(), Owner->DestFile.c_str()) != 0) + _error->Error("Can't create (sym)link of file %s to %s", filename.c_str(), Owner->DestFile.c_str()); + } + } + } + else + { + for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) + unlink((*O)->DestFile.c_str()); + } +} + /*}}}*/ diff --git a/apt-pkg/acquire-worker.h b/apt-pkg/acquire-worker.h index db8889c8e..3a3ef706d 100644 --- a/apt-pkg/acquire-worker.h +++ b/apt-pkg/acquire-worker.h @@ -326,6 +326,9 @@ class pkgAcquire::Worker : public WeakPointable * \b false, also rudely interrupts the worker with a SIGINT. */ virtual ~Worker(); + +private: + APT_HIDDEN void PrepareFiles(char const * const caller, pkgAcquire::Queue::QItem const * const Itm); }; /** @} */ diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 0c815c005..14c8863dc 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -682,7 +683,8 @@ bool pkgAcquire::Queue::Enqueue(ItemDesc &Item) for (; *I != 0; I = &(*I)->Next) if (Item.URI == (*I)->URI) { - Item.Owner->Status = Item::StatDone; + (*I)->Owners.push_back(Item.Owner); + Item.Owner->Status = (*I)->Owner->Status; return false; } @@ -705,13 +707,13 @@ bool pkgAcquire::Queue::Dequeue(Item *Owner) { if (Owner->Status == pkgAcquire::Item::StatFetching) return _error->Error("Tried to dequeue a fetching object"); - + bool Res = false; - + QItem **I = &Items; for (; *I != 0;) { - if ((*I)->Owner == Owner) + if (Owner == (*I)->Owner) { QItem *Jnk= *I; *I = (*I)->Next; @@ -722,7 +724,7 @@ bool pkgAcquire::Queue::Dequeue(Item *Owner) else I = &(*I)->Next; } - + return Res; } /*}}}*/ @@ -799,9 +801,12 @@ pkgAcquire::Queue::QItem *pkgAcquire::Queue::FindItem(string URI,pkgAcquire::Wor bool pkgAcquire::Queue::ItemDone(QItem *Itm) { PipeDepth--; - if (Itm->Owner->Status == pkgAcquire::Item::StatFetching) - Itm->Owner->Status = pkgAcquire::Item::StatDone; - + for (QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) + { + if ((*O)->Status == pkgAcquire::Item::StatFetching) + (*O)->Status = pkgAcquire::Item::StatDone; + } + if (Itm->Owner->QueueCounter <= 1) Owner->Dequeue(Itm->Owner); else @@ -809,7 +814,7 @@ bool pkgAcquire::Queue::ItemDone(QItem *Itm) Dequeue(Itm->Owner); Owner->Bump(); } - + return Cycle(); } /*}}}*/ @@ -824,7 +829,7 @@ bool pkgAcquire::Queue::Cycle() if (PipeDepth < 0) return _error->Error("Pipedepth failure"); - + // Look for a queable item QItem *I = Items; while (PipeDepth < (signed)MaxPipeDepth) @@ -832,18 +837,19 @@ bool pkgAcquire::Queue::Cycle() for (; I != 0; I = I->Next) if (I->Owner->Status == pkgAcquire::Item::StatIdle) break; - + // Nothing to do, queue is idle. if (I == 0) return true; - + I->Worker = Workers; - I->Owner->Status = pkgAcquire::Item::StatFetching; + for (QItem::owner_iterator O = I->Owners.begin(); O != I->Owners.end(); ++O) + (*O)->Status = pkgAcquire::Item::StatFetching; PipeDepth++; if (Workers->QueueItem(I) == false) return false; } - + return true; } /*}}}*/ @@ -855,6 +861,94 @@ void pkgAcquire::Queue::Bump() Cycle(); } /*}}}*/ +HashStringList pkgAcquire::Queue::QItem::GetExpectedHashes() const /*{{{*/ +{ + /* each Item can have multiple owners and each owner might have different + hashes, even if that is unlikely in practice and if so at least some + owners will later fail. There is one situation through which is not a + failure and still needs this handling: Two owners who expect the same + file, but one owner only knows the SHA1 while the other only knows SHA256. */ + HashStringList superhsl; + for (pkgAcquire::Queue::QItem::owner_iterator O = Owners.begin(); O != Owners.end(); ++O) + { + HashStringList const hsl = (*O)->GetExpectedHashes(); + if (hsl.usable() == false) + continue; + if (superhsl.usable() == false) + superhsl = hsl; + else + { + // we merge both lists - if we find disagreement send no hashes + HashStringList::const_iterator hs = hsl.begin(); + for (; hs != hsl.end(); ++hs) + if (superhsl.push_back(*hs) == false) + break; + if (hs != hsl.end()) + { + superhsl.clear(); + break; + } + } + } + return superhsl; +} + /*}}}*/ +APT_PURE unsigned long long pkgAcquire::Queue::QItem::GetMaximumSize() const /*{{{*/ +{ + unsigned long long Maximum = std::numeric_limits::max(); + for (pkgAcquire::Queue::QItem::owner_iterator O = Owners.begin(); O != Owners.end(); ++O) + { + if ((*O)->FileSize == 0) + continue; + Maximum = std::min(Maximum, (*O)->FileSize); + } + if (Maximum == std::numeric_limits::max()) + return 0; + return Maximum; +} + /*}}}*/ +void pkgAcquire::Queue::QItem::SyncDestinationFiles() const /*{{{*/ +{ + /* ensure that the first owner has the best partial file of all and + the rest have (potentially dangling) symlinks to it so that + everything (like progress reporting) finds it easily */ + std::string superfile = Owner->DestFile; + off_t supersize = 0; + for (pkgAcquire::Queue::QItem::owner_iterator O = Owners.begin(); O != Owners.end(); ++O) + { + if ((*O)->DestFile == superfile) + continue; + struct stat file; + if (lstat((*O)->DestFile.c_str(),&file) == 0) + { + if ((file.st_mode & S_IFREG) == 0) + unlink((*O)->DestFile.c_str()); + else if (supersize < file.st_size) + { + supersize = file.st_size; + unlink(superfile.c_str()); + rename((*O)->DestFile.c_str(), superfile.c_str()); + } + else + unlink((*O)->DestFile.c_str()); + if (symlink(superfile.c_str(), (*O)->DestFile.c_str()) != 0) + { + ; // not a problem per-se and no real alternative + } + } + } +} + /*}}}*/ +std::string pkgAcquire::Queue::QItem::Custom600Headers() const /*{{{*/ +{ + /* The others are relatively easy to merge, but this one? + Lets not merge and see how far we can run with it… + Likely, nobody will ever notice as all the items will + be of the same class and hence generate the same headers. */ + return Owner->Custom600Headers(); +} + /*}}}*/ + // AcquireStatus::pkgAcquireStatus - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -914,9 +1008,9 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner) { CurrentBytes += I->CurrentSize; ResumeSize += I->ResumePoint; - + // Files with unknown size always have 100% completion - if (I->CurrentItem->Owner->FileSize == 0 && + if (I->CurrentItem->Owner->FileSize == 0 && I->CurrentItem->Owner->Complete == false) TotalBytes += I->CurrentSize; } diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index fc90624e1..02031dafd 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -68,9 +68,10 @@ #include #include +#include -#include #include +#include #include #include @@ -390,13 +391,13 @@ class pkgAcquire */ struct pkgAcquire::ItemDesc : public WeakPointable { - /** \brief The URI from which to download this item. */ + /** \brief URI from which to download this item. */ std::string URI; - /** brief A description of this item. */ + /** \brief description of this item. */ std::string Description; - /** brief A shorter description of this item. */ + /** \brief shorter description of this item. */ std::string ShortDesc; - /** brief The underlying item which is to be downloaded. */ + /** \brief underlying item which is to be downloaded. */ Item *Owner; }; /*}}}*/ @@ -419,13 +420,26 @@ class pkgAcquire::Queue protected: /** \brief A single item placed in this queue. */ - struct QItem : pkgAcquire::ItemDesc + struct QItem : public WeakPointable { /** \brief The next item in the queue. */ QItem *Next; /** \brief The worker associated with this item, if any. */ pkgAcquire::Worker *Worker; + /** \brief The URI from which to download this item. */ + std::string URI; + /** \brief A description of this item. */ + std::string Description; + /** \brief A shorter description of this item. */ + std::string ShortDesc; + /** \brief The underlying items interested in the download */ + std::vector Owners; + // both, backward compatibility and easy access as syncing is interal + Item * Owner; + + typedef std::vector::const_iterator owner_iterator; + /** \brief Assign the ItemDesc portion of this QItem from * another ItemDesc */ @@ -434,10 +448,24 @@ class pkgAcquire::Queue URI = I.URI; Description = I.Description; ShortDesc = I.ShortDesc; + Owners.clear(); + Owners.push_back(I.Owner); Owner = I.Owner; }; + + /** @return the sum of all expected hashes by all owners */ + HashStringList GetExpectedHashes() const; + + /** @return smallest maximum size of all owners */ + unsigned long long GetMaximumSize() const; + + /** \brief get partial files in order */ + void SyncDestinationFiles() const; + + /** @return the custom headers to use for this item */ + std::string Custom600Headers() const; }; - + /** \brief The name of this queue. */ std::string Name; @@ -590,7 +618,7 @@ class pkgAcquire::UriIterator } }; - inline pkgAcquire::ItemDesc const *operator ->() const {return CurItem;}; + inline pkgAcquire::Queue::QItem const *operator ->() const {return CurItem;}; inline bool operator !=(UriIterator const &rhs) const {return rhs.CurQ != CurQ || rhs.CurItem != CurItem;}; inline bool operator ==(UriIterator const &rhs) const {return rhs.CurQ == CurQ && rhs.CurItem == CurItem;}; diff --git a/test/integration/test-acquire-same-file-multiple-times b/test/integration/test-acquire-same-file-multiple-times new file mode 100755 index 000000000..d329a39cb --- /dev/null +++ b/test/integration/test-acquire-same-file-multiple-times @@ -0,0 +1,80 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +TESTFILE="$TESTDIR/framework" +cp $TESTFILE aptarchive/foo +APTARCHIVE="$(readlink -f ./aptarchive)" + +filedown() { + msgtest 'Downloading the same URI twice over file' "$1" + testsuccess --nomsg apthelper download-file file:///$APTARCHIVE/foo ./downloaded/foo1 '' file:///$APTARCHIVE/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 + cp rootdir/tmp/testsuccess.output download.log + #cat download.log + testsuccess cmp $TESTFILE ./downloaded/foo1 + testsuccess cmp ./downloaded/foo1 ./downloaded/foo2 + #testequal '1' grep -c '200%20URI%20Start' ./download.log + testequal '1' grep -c '201%20URI%20Done' ./download.log + rm -f ./downloaded/foo1 ./downloaded/foo2 +} + +testrun() { + $1 'no partial' + cp $TESTFILE ./downloaded/foo1 + $1 'complete partial 1' + cp $TESTFILE ./downloaded/foo2 + $1 'complete partial 2' + cp $TESTFILE ./downloaded/foo1 + cp $TESTFILE ./downloaded/foo2 + $1 'complete partial 1+2' + dd if=$TESTFILE of=./downloaded/foo1 bs=500 count=1 2>/dev/null + $1 'partial partial 1' + dd if=$TESTFILE of=./downloaded/foo2 bs=500 count=1 2>/dev/null + $1 'partial partial 2' + dd if=$TESTFILE of=./downloaded/foo1 bs=500 count=1 2>/dev/null + dd if=$TESTFILE of=./downloaded/foo2 bs=500 count=1 2>/dev/null + $1 'partial partial 1+2' +} +testrun 'filedown' + +changetowebserver -o aptwebserver::redirect::replace::/foo2=/foo + +httpdown() { + msgtest 'Downloading the same URI to different files' 'twice over http' + testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 + cp rootdir/tmp/testsuccess.output download.log + testsuccess cmp $TESTDIR/framework ./downloaded/foo1 + testsuccess cmp ./downloaded/foo1 ./downloaded/foo2 + testequal '1' grep -c '200%20URI%20Start' ./download.log + testequal '1' grep -c '201%20URI%20Done' ./download.log + rm -f ./downloaded/foo1 ./downloaded/foo2 +} +testrun 'httpdown' + +httpredirectdown() { + msgtest 'Redirect leads' 'first URI to the second URI' + testsuccess --nomsg apthelper download-file http://localhost:8080/foo2 ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 + cp rootdir/tmp/testsuccess.output download.log + testsuccess cmp $TESTDIR/framework ./downloaded/foo1 + testsuccess cmp ./downloaded/foo1 ./downloaded/foo2 + testequal '1' grep -c '200%20URI%20Start' ./download.log + testequal '1' grep -c '103%20Redirect' ./download.log + testequal '1' grep -c '201%20URI%20Done' ./download.log + rm -f ./downloaded/foo1 ./downloaded/foo2 +} +testrun 'httpredirectdown' + +httpsamedown() { + msgtest 'Downloading two files via the same URI to' 'the same file' + testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo1 '' -o Debug::pkgAcquire::Worker=1 + cp rootdir/tmp/testsuccess.output download.log + testsuccess cmp $TESTDIR/framework ./downloaded/foo1 + testequal '1' grep -c '200%20URI%20Start' ./download.log + testequal '1' grep -c '201%20URI%20Done' ./download.log + rm -f ./downloaded/foo1 +} +testrun 'httpsamedown' diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download index 6503bbd1c..fa0b65672 100755 --- a/test/integration/test-apt-get-download +++ b/test/integration/test-apt-get-download @@ -38,7 +38,7 @@ testdownload() { APT="${APT}/${3}" fi msgtest "Test download of package file $1 with" "$APT" - testsuccess --nomsg aptget download ${APT} + testsuccess --nomsg aptget download ${APT} -o Debug::pkgAcquire::Worker=1 -o Debug::pkgAcquire::Auth=1 testsuccess test -f "$1" rm -f "$1" } -- cgit v1.2.3 From ff86d7df6a53ff6283de4b9a858c1dad98ed887f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 15 Jun 2015 13:36:11 +0200 Subject: call URIStart in cdrom and file method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All other methods call it, so they should follow along even if the work they do afterwards is hardly breathtaking and usually results in a URIDone pretty soon, but the acquire system tells the individual item about this via a virtual method call, so even through none of our existing items contains any critical code in these, maybe one day they might. Consistency at least once… Which is also why this has a good sideeffect: file: and cdrom: requests appear now in the 'apt-get update' output. Finally - it never made sense to hide them for me. Okay, I guess it made before the new hit behavior, but now that you can actually see the difference in an update it makes sense to see if a file: repository changed or not as well. --- apt-pkg/acquire-item.cc | 13 ++++--------- apt-pkg/acquire-worker.cc | 1 - methods/cdrom.cc | 3 ++- methods/file.cc | 18 ++++++++++-------- test/integration/test-apt-cdrom | 6 ++++-- test/integration/test-apt-get-update-unauth-warning | 7 +++++++ test/integration/test-apt-progress-fd | 6 ++++-- .../test-bug-595691-empty-and-broken-archive-files | 20 ++++---------------- .../test-bug-596498-trusted-unsigned-repo | 8 +++++++- 9 files changed, 42 insertions(+), 40 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index dc4f61b56..50936b627 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -519,19 +519,14 @@ void pkgAcquire::Item::Done(string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const /*Cnf*/) { // We just downloaded something.. - string FileName = LookupTag(Message,"Filename"); UsedMirror = LookupTag(Message,"UsedMirror"); - unsigned long long const downloadedSize = Hashes.FileSize(); - if (downloadedSize != 0) + if (FileSize == 0) { - if (Complete == false && !Local && FileName == DestFile) + unsigned long long const downloadedSize = Hashes.FileSize(); + if (downloadedSize != 0) { - if (Owner->Log != 0) - Owner->Log->Fetched(Hashes.FileSize(),atoi(LookupTag(Message,"Resume-Point","0").c_str())); + FileSize = downloadedSize; } - - if (FileSize == 0) - FileSize= downloadedSize; } Status = StatDone; ErrorText = string(); diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index d6318a21b..ef195d44b 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -362,7 +362,6 @@ bool pkgAcquire::Worker::RunMessages() bool const isIMSHit = StringToBool(LookupTag(Message,"IMS-Hit"),false) || StringToBool(LookupTag(Message,"Alt-IMS-Hit"),false); - for (pkgAcquire::Queue::QItem::owner_iterator O = ItmOwners.begin(); O != ItmOwners.end(); ++O) { pkgAcquire::Item * const Owner = *O; diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 10cb29f66..67265cfa3 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -260,7 +260,8 @@ bool CDROMMethod::Fetch(FetchItem *Itm) struct stat Buf; if (stat(Res.Filename.c_str(),&Buf) != 0) return _error->Error(_("File not found")); - + + URIStart(Res); if (NewID.empty() == false) CurrentID = NewID; Res.LastModified = Buf.st_mtime; diff --git a/methods/file.cc b/methods/file.cc index 5d5fffa67..5c76ec122 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -58,7 +58,10 @@ bool FileMethod::Fetch(FetchItem *Itm) { HashStringList const hsl = Itm->ExpectedHashes; if (Itm->ExpectedHashes.VerifyFile(File)) + { + Res.Filename = Itm->DestFile; Res.IMSHit = true; + } } } } @@ -78,7 +81,14 @@ bool FileMethod::Fetch(FetchItem *Itm) if (filesize != 0 && filesize == Res.Size) Res.IMSHit = true; } + + Hashes Hash(Itm->ExpectedHashes); + FileFd Fd(File, FileFd::ReadOnly); + Hash.AddFD(Fd); + Res.TakeHashes(Hash); } + if (Res.IMSHit == false) + URIStart(Res); // See if the uncompressed file exists and reuse it FetchResult AltRes; @@ -103,14 +113,6 @@ bool FileMethod::Fetch(FetchItem *Itm) } } - if (Res.Filename.empty() == false) - { - Hashes Hash(Itm->ExpectedHashes); - FileFd Fd(Res.Filename, FileFd::ReadOnly); - Hash.AddFD(Fd); - Res.TakeHashes(Hash); - } - if (AltRes.Filename.empty() == false) URIDone(Res,&AltRes); else if (Res.Filename.empty() == false) diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 34b35f745..6a218ffb8 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -136,13 +136,15 @@ aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && mv rootdir/media/cdrom-unmounted rootdir/media/cdrom-ejected msgmsg "ensure an update doesn't mess with cdrom sources" testsuccess aptget update -testfileequal rootdir/tmp/testsuccess.output 'Reading package lists...' +testfileequal rootdir/tmp/testsuccess.output 'Hit cdrom://Debian APT Testdisk 0.8.15 stable InRelease +Reading package lists...' mv rootdir/media/cdrom-ejected rootdir/media/cdrom-unmounted testcdromusage msgmsg 'and again to check that it withstands the temptation even if it could mount' testsuccess aptget update -testfileequal rootdir/tmp/testsuccess.output 'Reading package lists...' +testfileequal rootdir/tmp/testsuccess.output 'Hit cdrom://Debian APT Testdisk 0.8.15 stable InRelease +Reading package lists...' testcdromusage msgmsg 'Check that nothing touched our' 'CD-ROM' diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index ada7f7a26..1f4a14e23 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -9,6 +9,7 @@ TESTDIR=$(readlink -f $(dirname $0)) setupenvironment configarchitecture "i386" +configcompression '.' 'gz' # a "normal" package with source and binary buildsimplenativepackage 'foo' 'all' '2.0' @@ -31,11 +32,17 @@ testsuccessequal 'Listing...' apt list foo testequal 'lock partial' ls rootdir/var/lib/apt/lists +filesize() { + stat -c%s "$(aptget files --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz" +} # allow override testwarningequal "Ign file:$APTARCHIVE unstable InRelease File not found Ign file:$APTARCHIVE unstable Release File not found +Get:1 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B] +Get:2 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B] +Get:3 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B] Reading package lists... W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories # ensure we can not install the package diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd index 0c11aba7e..99b4ea050 100755 --- a/test/integration/test-apt-progress-fd +++ b/test/integration/test-apt-progress-fd @@ -16,6 +16,7 @@ setupaptarchive exec 3> apt-progress.log testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing:0:Installing testing (amd64) @@ -32,6 +33,7 @@ pmstatus:dpkg-exec:83.3333:Running dpkg' exec 3> apt-progress.log testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing:0:Installing testing (amd64) @@ -48,6 +50,7 @@ pmstatus:dpkg-exec:83.3333:Running dpkg' exec 3> apt-progress.log testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing:0:Installing testing (amd64) @@ -73,9 +76,8 @@ pmstatus:dpkg-exec:75:Running dpkg' # install non-native and ensure we get proper progress info exec 3> apt-progress.log testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3 - -# and compare testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing2:0:Installing testing2 (i386) diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index b42212f5e..3042d116d 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -27,9 +27,6 @@ testaptgetupdate() { createemptyarchive() { find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete - if [ "en" = "$1" ]; then - echo -n "" | $COMPRESSOR_CMD > aptarchive/Packages.$COMPRESS - fi touch aptarchive/Packages echo -n "" | $COMPRESSOR_CMD > aptarchive/${1}.$COMPRESS generatereleasefiles @@ -39,9 +36,6 @@ createemptyarchive() { createemptyfile() { find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete - if [ "en" = "$1" ]; then - echo -n "" | $COMPRESSOR_CMD > aptarchive/Packages.$COMPRESS - fi touch aptarchive/Packages aptarchive/${1}.$COMPRESS generatereleasefiles signreleasefiles @@ -52,19 +46,13 @@ testoverfile() { local APTARCHIVE="$(readlink -f ./aptarchive)" forcecompressor "$1" - createemptyfile 'en' - testaptgetupdate 'Reading package lists...' "empty file en.$COMPRESS over file" - - createemptyarchive 'en' - testaptgetupdate 'Reading package lists...' "empty archive en.$COMPRESS over file" - createemptyarchive 'Packages' - # FIXME: Why omits the file transport the Packages Get line? - #Get:3 file: Packages [] - testaptgetupdate 'Reading package lists...' "empty archive Packages.$COMPRESS over file" + testaptgetupdate "Get: file:$APTARCHIVE Packages [] +Reading package lists..." "empty archive Packages.$COMPRESS over file" createemptyfile 'Packages' - testaptgetupdate "Err file:$APTARCHIVE Packages + testaptgetupdate "Get: file:$APTARCHIVE Packages +Err file:$APTARCHIVE Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:${APTARCHIVE}/Packages.$COMPRESS Empty files can't be valid archives diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index 4eb77b9a4..1ff0f1d8d 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -15,13 +15,17 @@ aptgetupdate() { ${1:-testwarning} aptget update --allow-insecure-repositories } -PKGTEXT="$(aptget install cool --assume-no -d | head -n 7)" +PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)" +DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)" +PKGTEXT="$(echo "$PKGTEXT" | head -n 7)" DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list' testsuccessequal "$PKGTEXT +$DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d testsuccessequal "$PKGTEXT +$DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE @@ -47,10 +51,12 @@ testsuccessequal "$PKGTEXT WARNING: The following packages cannot be authenticated! cool Authentication warning overridden. +$DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE aptgetupdate testsuccessequal "$PKGTEXT +$DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d -- cgit v1.2.3 From 1eb1836f4b5397497bd34f0cf516e6e4e73117bf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 15 Jun 2015 16:41:43 +0200 Subject: show item ID in Hit, Ign and Err lines as well Again, consistency is the main sellingpoint here, but this way it is now also easier to explain that some files move through different stages and lines are printed for them hence multiple times: That is a bit hard to believe if the number is changing all the time, but now that it keeps consistent. --- apt-pkg/acquire-item.cc | 2 +- apt-private/acqprogress.cc | 38 +++++++++++++++----- apt-private/acqprogress.h | 3 +- po/apt-all.pot | 12 ++++--- po/ar.po | 18 ++++++---- po/ast.po | 20 ++++++----- po/bg.po | 20 ++++++----- po/bs.po | 8 ++--- po/ca.po | 20 ++++++----- po/cs.po | 20 ++++++----- po/cy.po | 20 ++++++----- po/da.po | 20 ++++++----- po/de.po | 20 ++++++----- po/dz.po | 20 ++++++----- po/el.po | 20 ++++++----- po/es.po | 20 ++++++----- po/eu.po | 20 ++++++----- po/fi.po | 20 ++++++----- po/fr.po | 20 ++++++----- po/gl.po | 20 ++++++----- po/he.po | 12 ++++--- po/hu.po | 20 ++++++----- po/it.po | 21 +++++++----- po/ja.po | 20 ++++++----- po/km.po | 20 ++++++----- po/ko.po | 20 ++++++----- po/ku.po | 16 +++++---- po/lt.po | 20 ++++++----- po/mr.po | 20 ++++++----- po/nb.po | 20 ++++++----- po/ne.po | 20 ++++++----- po/nl.po | 20 ++++++----- po/nn.po | 20 ++++++----- po/pl.po | 20 ++++++----- po/pt.po | 20 ++++++----- po/pt_BR.po | 20 ++++++----- po/ro.po | 20 ++++++----- po/ru.po | 20 ++++++----- po/sk.po | 20 ++++++----- po/sl.po | 20 ++++++----- po/sv.po | 20 ++++++----- po/th.po | 20 ++++++----- po/tl.po | 20 ++++++----- po/tr.po | 20 ++++++----- po/uk.po | 20 ++++++----- po/vi.po | 20 ++++++----- po/zh_CN.po | 20 ++++++----- po/zh_TW.po | 20 ++++++----- test/integration/test-apt-acquire-additional-files | 10 +++--- test/integration/test-apt-cdrom | 4 +-- .../integration/test-apt-get-update-unauth-warning | 14 ++++---- test/integration/test-apt-update-ims | 36 +++++++++---------- test/integration/test-apt-update-not-modified | 40 +++++++++++----------- .../test-bug-595691-empty-and-broken-archive-files | 14 ++++---- test/integration/test-bug-602412-dequote-redirect | 2 +- test/integration/test-pdiff-usage | 2 +- .../test-ubuntu-bug-1098738-apt-get-source-md5sum | 8 ++--- 57 files changed, 618 insertions(+), 422 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 50936b627..5460280ec 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -405,7 +405,7 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ // Acquire::Item::Item - Constructor /*{{{*/ APT_IGNORE_DEPRECATED_PUSH pkgAcquire::Item::Item(pkgAcquire * const Owner) : - FileSize(0), PartialSize(0), Mode(0), Complete(false), Local(false), + FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false), QueueCounter(0), ExpectedAdditionalItems(0), Owner(Owner) { Owner->Add(this); diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc index 0c606e48e..dc92e3b2a 100644 --- a/apt-private/acqprogress.cc +++ b/apt-private/acqprogress.cc @@ -49,6 +49,16 @@ void AcqTextStatus::Start() ID = 1; } /*}}}*/ +void AcqTextStatus::AssignItemID(pkgAcquire::ItemDesc &Itm) /*{{{*/ +{ + /* In theory calling it from Fetch() would be enough, but to be + safe we call it from IMSHit and Fail as well. + Also, an Item can pass through multiple stages, so ensure + that it keeps the same number */ + if (Itm.Owner->ID == 0) + Itm.Owner->ID = ID++; +} + /*}}}*/ // AcqTextStatus::IMSHit - Called when an item got a HIT response /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -57,9 +67,11 @@ void AcqTextStatus::IMSHit(pkgAcquire::ItemDesc &Itm) if (Quiet > 1) return; + AssignItemID(Itm); clearLastLine(); - out << _("Hit ") << Itm.Description; + // TRANSLATOR: Very short word to be displayed before unchanged files in 'apt-get update' + ioprintf(out, _("Hit:%lu %s"), Itm.Owner->ID, Itm.Description.c_str()); out << std::endl; Update = true; } @@ -72,15 +84,16 @@ void AcqTextStatus::Fetch(pkgAcquire::ItemDesc &Itm) Update = true; if (Itm.Owner->Complete == true) return; - - Itm.Owner->ID = ID++; + AssignItemID(Itm); if (Quiet > 1) return; clearLastLine(); - out << _("Get:") << Itm.Owner->ID << ' ' << Itm.Description; + // TRANSLATOR: Very short word to be displayed for files processed in 'apt-get update' + // Potentially replaced later by "Hit:", "Ign:" or "Err:" if something (bad) happens + ioprintf(out, _("Get:%lu %s"), Itm.Owner->ID, Itm.Description.c_str()); if (Itm.Owner->FileSize != 0) out << " [" << SizeToStr(Itm.Owner->FileSize) << "B]"; out << std::endl; @@ -89,9 +102,10 @@ void AcqTextStatus::Fetch(pkgAcquire::ItemDesc &Itm) // AcqTextStatus::Done - Completed a download /*{{{*/ // --------------------------------------------------------------------- /* We don't display anything... */ -void AcqTextStatus::Done(pkgAcquire::ItemDesc &/*Itm*/) +void AcqTextStatus::Done(pkgAcquire::ItemDesc &Itm) { Update = true; + AssignItemID(Itm); } /*}}}*/ // AcqTextStatus::Fail - Called when an item fails to download /*{{{*/ @@ -106,19 +120,25 @@ void AcqTextStatus::Fail(pkgAcquire::ItemDesc &Itm) if (Itm.Owner->Status == pkgAcquire::Item::StatIdle) return; + AssignItemID(Itm); clearLastLine(); if (Itm.Owner->Status == pkgAcquire::Item::StatDone) { - out << _("Ign ") << Itm.Description << std::endl; + // TRANSLATOR: Very short word to be displayed for files in 'apt-get update' + // which failed to download, but the error is ignored (compare "Err:") + ioprintf(out, _("Ign:%lu %s"), Itm.Owner->ID, Itm.Description.c_str()); if (Itm.Owner->ErrorText.empty() == false && _config->FindB("Acquire::Progress::Ignore::ShowErrorText", false) == true) - out << " " << Itm.Owner->ErrorText << std::endl; + out << std::endl << " " << Itm.Owner->ErrorText; + out << std::endl; } else { - out << _("Err ") << Itm.Description << std::endl; - out << " " << Itm.Owner->ErrorText << std::endl; + // TRANSLATOR: Very short word to be displayed for files in 'apt-get update' + // which failed to download and the error is critical (compare "Ign:") + ioprintf(out, _("Err:%lu %s"), Itm.Owner->ID, Itm.Description.c_str()); + out << std::endl << " " << Itm.Owner->ErrorText << std::endl; } Update = true; diff --git a/apt-private/acqprogress.h b/apt-private/acqprogress.h index 7cf990c65..cbb06fbec 100644 --- a/apt-private/acqprogress.h +++ b/apt-private/acqprogress.h @@ -23,7 +23,8 @@ class APT_PUBLIC AcqTextStatus : public pkgAcquireStatus unsigned long ID; unsigned long Quiet; - void clearLastLine(); + APT_HIDDEN void clearLastLine(); + APT_HIDDEN void AssignItemID(pkgAcquire::ItemDesc &Itm); public: diff --git a/po/apt-all.pot b/po/apt-all.pot index b68d801ea..73b033876 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -1529,19 +1529,23 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " +#, c-format +msgid "Hit:%lu %s" msgstr "" #: apt-private/acqprogress.cc:88 -msgid "Get:" +#, c-format +msgid "Get:%lu %s" msgstr "" #: apt-private/acqprogress.cc:119 -msgid "Ign " +#, c-format +msgid "Ign:%lu %s" msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " +#, c-format +msgid "Err:%lu %s" msgstr "" #: apt-private/acqprogress.cc:150 diff --git a/po/ar.po b/po/ar.po index e2b179d0e..3e71fef80 100644 --- a/po/ar.po +++ b/po/ar.po @@ -1555,20 +1555,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " +#, c-format +msgid "Hit:%lu %s" msgstr "" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "جلب:" +#, c-format +msgid "Get:%lu %s" +msgstr "جلب:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "تجاهل" +#, c-format +msgid "Ign:%lu %s" +msgstr "تجاهل:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "خطأ" +#, c-format +msgid "Err:%lu %s" +msgstr "خطأ:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/ast.po b/po/ast.po index 1efbbc1d2..1995c12f6 100644 --- a/po/ast.po +++ b/po/ast.po @@ -1684,20 +1684,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Oxe " +#, c-format +msgid "Hit:%lu %s" +msgstr "Oxe:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Des:" +#, c-format +msgid "Get:%lu %s" +msgstr "Des:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/bg.po b/po/bg.po index bbe6df3ae..7dff005e6 100644 --- a/po/bg.po +++ b/po/bg.po @@ -1720,20 +1720,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Поп " +#, c-format +msgid "Hit:%lu %s" +msgstr "Поп:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Изт:" +#, c-format +msgid "Get:%lu %s" +msgstr "Изт:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Игн " +#, c-format +msgid "Ign:%lu %s" +msgstr "Игн:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Грш " +#, c-format +msgid "Err:%lu %s" +msgstr "Грш:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/bs.po b/po/bs.po index 9cd1adc85..abb9a570a 100644 --- a/po/bs.po +++ b/po/bs.po @@ -1555,19 +1555,19 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " +msgid "Hit:%lu %s" msgstr "" #: apt-private/acqprogress.cc:88 -msgid "Get:" +msgid "Get:%lu %s" msgstr "" #: apt-private/acqprogress.cc:119 -msgid "Ign " +msgid "Ign:%lu %s" msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " +msgid "Err:%lu %s" msgstr "" #: apt-private/acqprogress.cc:150 diff --git a/po/ca.po b/po/ca.po index cdb3ceeb8..065ad0ea7 100644 --- a/po/ca.po +++ b/po/ca.po @@ -1708,20 +1708,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Obj " +#, c-format +msgid "Hit:%lu %s" +msgstr "Obj:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Bai:" +#, c-format +msgid "Get:%lu %s" +msgstr "Bai:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/cs.po b/po/cs.po index 76fc37b6b..3f6bcb4a7 100644 --- a/po/cs.po +++ b/po/cs.po @@ -1734,20 +1734,24 @@ msgid "Full Text Search" msgstr "Fulltextové hledání" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Cíl " +#, c-format +msgid "Hit:%lu %s" +msgstr "Cíl:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Mám:" +#, c-format +msgid "Get:%lu %s" +msgstr "Mám:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/cy.po b/po/cy.po index e29221cd1..b05bc7c59 100644 --- a/po/cy.po +++ b/po/cy.po @@ -1706,20 +1706,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Presennol " +#, c-format +msgid "Hit:%lu %s" +msgstr "Presennol:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Cyrchu:" +#, c-format +msgid "Get:%lu %s" +msgstr "Cyrchu:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Anwybyddu " +#, c-format +msgid "Ign:%lu %s" +msgstr "Anwybyddu:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Gwall " +#, c-format +msgid "Err:%lu %s" +msgstr "Gwall:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/da.po b/po/da.po index 53d3de059..d6b8e07a1 100644 --- a/po/da.po +++ b/po/da.po @@ -1749,20 +1749,24 @@ msgid "Full Text Search" msgstr "Fuldtekst-søgning" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Havde " +#, c-format +msgid "Hit:%lu %s" +msgstr "Havde:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Henter:" +#, c-format +msgid "Get:%lu %s" +msgstr "Henter:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ignorerer " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ignorerer:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Fejl " +#, c-format +msgid "Err:%lu %s" +msgstr "Fejl:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/de.po b/po/de.po index 85b0cb7ac..d4ca0d5a0 100644 --- a/po/de.po +++ b/po/de.po @@ -1810,20 +1810,24 @@ msgid "Full Text Search" msgstr "Volltextsuche" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "OK " +#, c-format +msgid "Hit:%lu %s" +msgstr "OK:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Holen: " +#, c-format +msgid "Get:%lu %s" +msgstr "Holen:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ign:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Fehl " +#, c-format +msgid "Err:%lu %s" +msgstr "Fehl:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/dz.po b/po/dz.po index 8d1e57b35..a4c50d245 100644 --- a/po/dz.po +++ b/po/dz.po @@ -1674,20 +1674,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "ཨེབ།" +#, c-format +msgid "Hit:%lu %s" +msgstr "ཨེབ།:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "ལེན:" +#, c-format +msgid "Get:%lu %s" +msgstr "ལེན:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "ཨེལ་ཇི་ཨེན:" +#, c-format +msgid "Ign:%lu %s" +msgstr "ཨེལ་ཇི་ཨེན:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "ཨི་ཨར་ཨར།" +#, c-format +msgid "Err:%lu %s" +msgstr "ཨི་ཨར་ཨར།:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/el.po b/po/el.po index e0750b61e..98e1f31c9 100644 --- a/po/el.po +++ b/po/el.po @@ -1695,20 +1695,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Hit " +#, c-format +msgid "Hit:%lu %s" +msgstr "Hit:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Φέρε:" +#, c-format +msgid "Get:%lu %s" +msgstr "Φέρε:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Αγνόησε " +#, c-format +msgid "Ign:%lu %s" +msgstr "Αγνόησε:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Σφάλμα " +#, c-format +msgid "Err:%lu %s" +msgstr "Σφάλμα:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/es.po b/po/es.po index e094ccafa..a2a9a71e9 100644 --- a/po/es.po +++ b/po/es.po @@ -1820,20 +1820,24 @@ msgid "Full Text Search" msgstr "Buscar en todo el texto" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Obj " +#, c-format +msgid "Hit:%lu %s" +msgstr "Obj:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Des:" +#, c-format +msgid "Get:%lu %s" +msgstr "Des:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/eu.po b/po/eu.po index e268f6059..f1e90411a 100644 --- a/po/eu.po +++ b/po/eu.po @@ -1678,20 +1678,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Atzituta " +#, c-format +msgid "Hit:%lu %s" +msgstr "Atzituta:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Hartu:" +#, c-format +msgid "Get:%lu %s" +msgstr "Hartu:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ez ikusi " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ez ikusi:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/fi.po b/po/fi.po index d58fb9b04..c40ed8e9e 100644 --- a/po/fi.po +++ b/po/fi.po @@ -1669,20 +1669,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Löytyi " +#, c-format +msgid "Hit:%lu %s" +msgstr "Löytyi:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Nouda:" +#, c-format +msgid "Get:%lu %s" +msgstr "Nouda:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Siv " +#, c-format +msgid "Ign:%lu %s" +msgstr "Siv:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Vrhe " +#, c-format +msgid "Err:%lu %s" +msgstr "Vrhe:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/fr.po b/po/fr.po index cb9d82856..ecb752f5e 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1774,20 +1774,24 @@ msgid "Full Text Search" msgstr "Recherche en texte intégral" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Atteint " +#, c-format +msgid "Hit:%lu %s" +msgstr "Atteint:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Réception de : " +#, c-format +msgid "Get:%lu %s" +msgstr "Réception de:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ign:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "Err:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/gl.po b/po/gl.po index d6bb1e92e..2adaa302a 100644 --- a/po/gl.po +++ b/po/gl.po @@ -1706,20 +1706,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Teño " +#, c-format +msgid "Hit:%lu %s" +msgstr "Teño:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Rcb:" +#, c-format +msgid "Get:%lu %s" +msgstr "Rcb:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/he.po b/po/he.po index b3ef8f831..ab7b50745 100644 --- a/po/he.po +++ b/po/he.po @@ -1188,19 +1188,23 @@ msgid "" msgstr "" #: cmdline/acqprogress.cc:55 -msgid "Hit " +#, c-format +msgid "Hit:%lu %s" msgstr "" #: cmdline/acqprogress.cc:79 -msgid "Get:" +#, c-format +msgid "Get:%lu %s" msgstr "" #: cmdline/acqprogress.cc:110 -msgid "Ign " +#, c-format +msgid "Ign:%lu %s" msgstr "" #: cmdline/acqprogress.cc:114 -msgid "Err " +#, c-format +msgid "Err:%lu %s" msgstr "" #: cmdline/acqprogress.cc:135 diff --git a/po/hu.po b/po/hu.po index 313f3a492..635184c75 100644 --- a/po/hu.po +++ b/po/hu.po @@ -1714,20 +1714,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Találat " +#, c-format +msgid "Hit:%lu %s" +msgstr "Találat:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Letöltés:" +#, c-format +msgid "Get:%lu %s" +msgstr "Letöltés:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Mellőz " +#, c-format +msgid "Ign:%lu %s" +msgstr "Mellőz:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Hiba " +#, c-format +msgid "Err:%lu %s" +msgstr "Hiba:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/it.po b/po/it.po index 36173e92c..178754c52 100644 --- a/po/it.po +++ b/po/it.po @@ -1766,21 +1766,24 @@ msgid "Full Text Search" msgstr "Ricerca sul testo" #: apt-private/acqprogress.cc:62 -msgid "Hit " -msgstr "Trovato " +#, c-format +msgid "Hit:%lu %s" +msgstr "Trovato:%lu %s" #: apt-private/acqprogress.cc:83 -msgid "Get:" -msgstr "Scaricamento di:" +#, c-format +msgid "Get:%lu %s" +msgstr "Scaricamento di:%lu %s" -# (ndt) questa non so cosa voglia dire #: apt-private/acqprogress.cc:113 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:120 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:143 #, c-format diff --git a/po/ja.po b/po/ja.po index 6c49f2608..f8f55f8aa 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1750,20 +1750,24 @@ msgid "Full Text Search" msgstr "全文検索" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "ヒット " +#, c-format +msgid "Hit:%lu %s" +msgstr "ヒット:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "取得:" +#, c-format +msgid "Get:%lu %s" +msgstr "取得:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "無視 " +#, c-format +msgid "Ign:%lu %s" +msgstr "無視:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "エラー " +#, c-format +msgid "Err:%lu %s" +msgstr "エラー:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/km.po b/po/km.po index 26bfe4361..8c72865f8 100644 --- a/po/km.po +++ b/po/km.po @@ -1652,20 +1652,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "វាយ​" +#, c-format +msgid "Hit:%lu %s" +msgstr "វាយ​:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "យក​ ៖" +#, c-format +msgid "Get:%lu %s" +msgstr "យក​ ៖:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/ko.po b/po/ko.po index 5479ab790..51cc27d61 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1666,20 +1666,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "기존 " +#, c-format +msgid "Hit:%lu %s" +msgstr "기존:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "받기:" +#, c-format +msgid "Get:%lu %s" +msgstr "받기:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "무시" +#, c-format +msgid "Ign:%lu %s" +msgstr "무시:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "오류 " +#, c-format +msgid "Err:%lu %s" +msgstr "오류:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/ku.po b/po/ku.po index c14ca94bd..540307937 100644 --- a/po/ku.po +++ b/po/ku.po @@ -1558,20 +1558,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " +#, c-format +msgid "Hit:%lu %s" msgstr "" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Anîn:" +#, c-format +msgid "Get:%lu %s" +msgstr "Anîn:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " +#, c-format +msgid "Ign:%lu %s" msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Çewt" +#, c-format +msgid "Err:%lu %s" +msgstr "Çewt:%lu %s" #: apt-private/acqprogress.cc:150 #, fuzzy, c-format diff --git a/po/lt.po b/po/lt.po index b85a0fbe1..1f485b28d 100644 --- a/po/lt.po +++ b/po/lt.po @@ -1577,20 +1577,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Imamas " +#, c-format +msgid "Hit:%lu %s" +msgstr "Imamas:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Gauti:" +#, c-format +msgid "Get:%lu %s" +msgstr "Gauti:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ignoruotas " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ignoruotas:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Klaida " +#, c-format +msgid "Err:%lu %s" +msgstr "Klaida:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/mr.po b/po/mr.po index 286c5d859..24e470cef 100644 --- a/po/mr.po +++ b/po/mr.po @@ -1656,20 +1656,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "दाबा" +#, c-format +msgid "Hit:%lu %s" +msgstr "दाबा:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "मिळवा:" +#, c-format +msgid "Get:%lu %s" +msgstr "मिळवा:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "आय.जी.एन." +#, c-format +msgid "Ign:%lu %s" +msgstr "आय.जी.एन.:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "दोष इ.आर.आर." +#, c-format +msgid "Err:%lu %s" +msgstr "दोष इ.आर.आर.:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/nb.po b/po/nb.po index 07247be4f..433e33909 100644 --- a/po/nb.po +++ b/po/nb.po @@ -1684,20 +1684,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Funnet " +#, c-format +msgid "Hit:%lu %s" +msgstr "Funnet:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Hent:" +#, c-format +msgid "Get:%lu %s" +msgstr "Hent:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ign:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Feil " +#, c-format +msgid "Err:%lu %s" +msgstr "Feil:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/ne.po b/po/ne.po index 54dd771b4..4c6f2d098 100644 --- a/po/ne.po +++ b/po/ne.po @@ -1652,20 +1652,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "हान्नुहोस्" +#, c-format +msgid "Hit:%lu %s" +msgstr "हान्नुहोस्:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "प्राप्त गर्नुहोस्:" +#, c-format +msgid "Get:%lu %s" +msgstr "प्राप्त गर्नुहोस्:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/nl.po b/po/nl.po index 8d226dfef..5c774fe8d 100644 --- a/po/nl.po +++ b/po/nl.po @@ -1776,20 +1776,24 @@ msgid "Full Text Search" msgstr "Volledige tekst doorzoeken" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Geraakt " +#, c-format +msgid "Hit:%lu %s" +msgstr "Geraakt:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Ophalen:" +#, c-format +msgid "Get:%lu %s" +msgstr "Ophalen:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Genegeerd " +#, c-format +msgid "Ign:%lu %s" +msgstr "Genegeerd:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Fout " +#, c-format +msgid "Err:%lu %s" +msgstr "Fout:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/nn.po b/po/nn.po index b3622b6cd..0886c266a 100644 --- a/po/nn.po +++ b/po/nn.po @@ -1668,20 +1668,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Treff " +#, c-format +msgid "Hit:%lu %s" +msgstr "Treff:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Hent:" +#, c-format +msgid "Get:%lu %s" +msgstr "Hent:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ign:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Feil " +#, c-format +msgid "Err:%lu %s" +msgstr "Feil:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/pl.po b/po/pl.po index 0dda22a47..1851fa805 100644 --- a/po/pl.po +++ b/po/pl.po @@ -1749,22 +1749,26 @@ msgstr "" # Ujednolicono z aptitude #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Stary " +#, c-format +msgid "Hit:%lu %s" +msgstr "Stary:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Pobieranie:" +#, c-format +msgid "Get:%lu %s" +msgstr "Pobieranie:%lu %s" # Wyrównane do Hit i Err. #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign. " +#, c-format +msgid "Ign:%lu %s" +msgstr "" # Wyrównane do Hit i Ign. #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Błąd " +#, c-format +msgid "Err:%lu %s" +msgstr "Błąd:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/pt.po b/po/pt.po index a4b1105f8..4f05ada82 100644 --- a/po/pt.po +++ b/po/pt.po @@ -1718,20 +1718,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Hit " +#, c-format +msgid "Hit:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Obter:" +#, c-format +msgid "Get:%lu %s" +msgstr "Obter:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/pt_BR.po b/po/pt_BR.po index 0c4d92d02..5e2abd988 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -1687,20 +1687,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Atingido " +#, c-format +msgid "Hit:%lu %s" +msgstr "Atingido:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Obter:" +#, c-format +msgid "Get:%lu %s" +msgstr "Obter:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/ro.po b/po/ro.po index 63df026ab..9b0a1494a 100644 --- a/po/ro.po +++ b/po/ro.po @@ -1695,20 +1695,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Atins " +#, c-format +msgid "Hit:%lu %s" +msgstr "Atins:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Luat:" +#, c-format +msgid "Get:%lu %s" +msgstr "Luat:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ignorat " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ignorat:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Eroare" +#, c-format +msgid "Err:%lu %s" +msgstr "Eroare:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/ru.po b/po/ru.po index 260bdd513..2028e5420 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1742,20 +1742,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "В кэше " +#, c-format +msgid "Hit:%lu %s" +msgstr "В кэше:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Получено:" +#, c-format +msgid "Get:%lu %s" +msgstr "Получено:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Игн " +#, c-format +msgid "Ign:%lu %s" +msgstr "Игн:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Ош " +#, c-format +msgid "Err:%lu %s" +msgstr "Ош:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/sk.po b/po/sk.po index 912d1fcf7..631ddd826 100644 --- a/po/sk.po +++ b/po/sk.po @@ -1716,20 +1716,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Už existuje " +#, c-format +msgid "Hit:%lu %s" +msgstr "Už existuje:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Získava sa:" +#, c-format +msgid "Get:%lu %s" +msgstr "Získava sa:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Chyba " +#, c-format +msgid "Err:%lu %s" +msgstr "Chyba:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/sl.po b/po/sl.po index 3210fa504..845fe3c5f 100644 --- a/po/sl.po +++ b/po/sl.po @@ -1717,20 +1717,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Zadetek " +#, c-format +msgid "Hit:%lu %s" +msgstr "Zadetek:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Dobi:" +#, c-format +msgid "Get:%lu %s" +msgstr "Dobi:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Prezr " +#, c-format +msgid "Ign:%lu %s" +msgstr "Prezr:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Nap " +#, c-format +msgid "Err:%lu %s" +msgstr "Nap:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/sv.po b/po/sv.po index 70f4b2d2d..52f65b598 100644 --- a/po/sv.po +++ b/po/sv.po @@ -1698,23 +1698,27 @@ msgstr "" # Måste vara tre bokstäver(?) # "Hit" = aktuell version är fortfarande giltig #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Bra " +#, c-format +msgid "Hit:%lu %s" +msgstr "Bra:%lu %s" # "Get:" = hämtar ny version #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Läs:" +#, c-format +msgid "Get:%lu %s" +msgstr "Läs:%lu %s" # "Ign" = hoppar över #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ign " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ign:%lu %s" # "Err" = fel vid hämtning #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Fel " +#, c-format +msgid "Err:%lu %s" +msgstr "Fel:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/th.po b/po/th.po index 147c3b8b8..60a468ea4 100644 --- a/po/th.po +++ b/po/th.po @@ -1696,20 +1696,24 @@ msgid "Full Text Search" msgstr "ค้นทั่วทั้งเนื้อความ" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "เจอ " +#, c-format +msgid "Hit:%lu %s" +msgstr "เจอ:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "ดึง:" +#, c-format +msgid "Get:%lu %s" +msgstr "ดึง:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "ข้าม " +#, c-format +msgid "Ign:%lu %s" +msgstr "ข้าม:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "ปัญหา " +#, c-format +msgid "Err:%lu %s" +msgstr "ปัญหา:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/tl.po b/po/tl.po index e3da79c8a..970b0b387 100644 --- a/po/tl.po +++ b/po/tl.po @@ -1677,20 +1677,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Tumama " +#, c-format +msgid "Hit:%lu %s" +msgstr "Tumama:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Kunin: " +#, c-format +msgid "Get:%lu %s" +msgstr "Kunin:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "DiPansin " +#, c-format +msgid "Ign:%lu %s" +msgstr "DiPansin:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Err " +#, c-format +msgid "Err:%lu %s" +msgstr "Err:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/tr.po b/po/tr.po index 5d9c3cee3..1e6f38903 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1753,20 +1753,24 @@ msgid "Full Text Search" msgstr "Tam Metin Arama" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Bağlandı " +#, c-format +msgid "Hit:%lu %s" +msgstr "Bağlandı:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Alınıyor: " +#, c-format +msgid "Get:%lu %s" +msgstr "Alınıyor:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Yoksay " +#, c-format +msgid "Ign:%lu %s" +msgstr "Yoksay:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Hata " +#, c-format +msgid "Err:%lu %s" +msgstr "Hata:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/uk.po b/po/uk.po index faeedf941..47976d39c 100644 --- a/po/uk.po +++ b/po/uk.po @@ -1736,20 +1736,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "В кеші " +#, c-format +msgid "Hit:%lu %s" +msgstr "В кеші:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Отр:" +#, c-format +msgid "Get:%lu %s" +msgstr "Отр:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Ігн " +#, c-format +msgid "Ign:%lu %s" +msgstr "Ігн:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Пом " +#, c-format +msgid "Err:%lu %s" +msgstr "Пом:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/vi.po b/po/vi.po index 089d8461a..2edb52f22 100644 --- a/po/vi.po +++ b/po/vi.po @@ -1752,20 +1752,24 @@ msgid "Full Text Search" msgstr "Tìm kiếm toàn văn" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "Tìm thấy " +#, c-format +msgid "Hit:%lu %s" +msgstr "Tìm thấy:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "Lấy:" +#, c-format +msgid "Get:%lu %s" +msgstr "Lấy:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "Bỏq " +#, c-format +msgid "Ign:%lu %s" +msgstr "Bỏq:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "Lỗi " +#, c-format +msgid "Err:%lu %s" +msgstr "Lỗi:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/zh_CN.po b/po/zh_CN.po index 2ff5bcf01..6e9610ac9 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1693,20 +1693,24 @@ msgid "Full Text Search" msgstr "全文搜索" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "命中 " +#, c-format +msgid "Hit:%lu %s" +msgstr "命中:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "获取:" +#, c-format +msgid "Get:%lu %s" +msgstr "获取:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "忽略 " +#, c-format +msgid "Ign:%lu %s" +msgstr "忽略:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "错误 " +#, c-format +msgid "Err:%lu %s" +msgstr "错误:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/po/zh_TW.po b/po/zh_TW.po index e35910df2..201d9d675 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -1646,20 +1646,24 @@ msgid "Full Text Search" msgstr "" #: apt-private/acqprogress.cc:66 -msgid "Hit " -msgstr "已有 " +#, c-format +msgid "Hit:%lu %s" +msgstr "已有:%lu %s" #: apt-private/acqprogress.cc:88 -msgid "Get:" -msgstr "下載:" +#, c-format +msgid "Get:%lu %s" +msgstr "下載:%lu %s" #: apt-private/acqprogress.cc:119 -msgid "Ign " -msgstr "略過 " +#, c-format +msgid "Ign:%lu %s" +msgstr "略過:%lu %s" #: apt-private/acqprogress.cc:126 -msgid "Err " -msgstr "錯誤 " +#, c-format +msgid "Err:%lu %s" +msgstr "錯誤:%lu %s" #: apt-private/acqprogress.cc:150 #, c-format diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files index ffb9f3135..3465c0a16 100755 --- a/test/integration/test-apt-acquire-additional-files +++ b/test/integration/test-apt-acquire-additional-files @@ -49,8 +49,8 @@ testequal "'http://localhost:8080/dists/unstable/InRelease' localhost:8080_dists 'http://localhost:8080/dists/unstable/main/i18n/Translation-en.bz2' localhost:8080_dists_unstable_main_i18n_Translation-en 0 'http://localhost:8080/dists/unstable/main/Contents-amd64.bz2' localhost:8080_dists_unstable_main_Contents-amd64 0 " aptget update --print-uris -testsuccessequal "Hit http://localhost:8080 unstable InRelease -Get:1 http://localhost:8080 unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] +testsuccessequal "Hit:1 http://localhost:8080 unstable InRelease +Get:2 http://localhost:8080 unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] Reading package lists..." aptget update testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64' find rootdir/var/lib/apt/lists -name '*Contents*' @@ -74,8 +74,8 @@ testequal "'http://localhost:8080/dists/unstable/InRelease' localhost:8080_dists 'http://localhost:8080/dists/unstable/main/i18n/Translation-en.bz2' localhost:8080_dists_unstable_main_i18n_Translation-en 0 'http://localhost:8080/dists/unstable/main/Contents-amd64.gz.bz2' localhost:8080_dists_unstable_main_Contents-amd64.gz 0 " aptget update --print-uris -testsuccessequal "Hit http://localhost:8080 unstable InRelease -Get:1 http://localhost:8080 unstable/main amd64 Contents.gz [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] +testsuccessequal "Hit:1 http://localhost:8080 unstable InRelease +Get:2 http://localhost:8080 unstable/main amd64 Contents.gz [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] Reading package lists..." aptget update testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' find rootdir/var/lib/apt/lists -name '*Contents*' @@ -89,7 +89,7 @@ testequal "'http://localhost:8080/dists/unstable/InRelease' localhost:8080_dists 'http://localhost:8080/dists/unstable/main/binary-amd64/Packages.bz2' localhost:8080_dists_unstable_main_binary-amd64_Packages 0 'http://localhost:8080/dists/unstable/main/i18n/Translation-en.bz2' localhost:8080_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris -testsuccessequal "Hit http://localhost:8080 unstable InRelease +testsuccessequal "Hit:1 http://localhost:8080 unstable InRelease Reading package lists..." aptget update testempty find rootdir/var/lib/apt/lists -name '*Contents*' diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 6a218ffb8..108805daa 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -136,14 +136,14 @@ aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && mv rootdir/media/cdrom-unmounted rootdir/media/cdrom-ejected msgmsg "ensure an update doesn't mess with cdrom sources" testsuccess aptget update -testfileequal rootdir/tmp/testsuccess.output 'Hit cdrom://Debian APT Testdisk 0.8.15 stable InRelease +testfileequal rootdir/tmp/testsuccess.output 'Hit:1 cdrom://Debian APT Testdisk 0.8.15 stable InRelease Reading package lists...' mv rootdir/media/cdrom-ejected rootdir/media/cdrom-unmounted testcdromusage msgmsg 'and again to check that it withstands the temptation even if it could mount' testsuccess aptget update -testfileequal rootdir/tmp/testsuccess.output 'Hit cdrom://Debian APT Testdisk 0.8.15 stable InRelease +testfileequal rootdir/tmp/testsuccess.output 'Hit:1 cdrom://Debian APT Testdisk 0.8.15 stable InRelease Reading package lists...' testcdromusage diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 1f4a14e23..5b81d56d2 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -20,9 +20,9 @@ APTARCHIVE=$(readlink -f ./aptarchive) rm -f $APTARCHIVE/dists/unstable/*Release* # update without authenticated files leads to warning -testfailureequal "Ign file:$APTARCHIVE unstable InRelease +testfailureequal "Ign:1 file:$APTARCHIVE unstable InRelease File not found -Err file:$APTARCHIVE unstable Release +Err:2 file:$APTARCHIVE unstable Release File not found W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories @@ -36,13 +36,13 @@ filesize() { stat -c%s "$(aptget files --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz" } # allow override -testwarningequal "Ign file:$APTARCHIVE unstable InRelease +testwarningequal "Ign:1 file:$APTARCHIVE unstable InRelease File not found -Ign file:$APTARCHIVE unstable Release +Ign:2 file:$APTARCHIVE unstable Release File not found -Get:1 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B] -Get:2 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B] -Get:3 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B] +Get:3 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B] +Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B] +Get:5 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B] Reading package lists... W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories # ensure we can not install the package diff --git a/test/integration/test-apt-update-ims b/test/integration/test-apt-update-ims index 7385e701a..2b662171c 100755 --- a/test/integration/test-apt-update-ims +++ b/test/integration/test-apt-update-ims @@ -43,7 +43,7 @@ runtest() { testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)" # ensure that we still do a hash check for other files on ims hit of Release - if grep -q '^Hit .* InRelease$' expected.output || ! grep -q '^Ign .* Release\(\.gpg\)\?$' expected.output; then + if grep -q '^Hit:[0-9]\+ .* InRelease$' expected.output || ! grep -q '^Ign:[0-9]\+ .* Release\(\.gpg\)\?$' expected.output; then $TEST aptget update -o Debug::Acquire::gpgv=1 cp rootdir/tmp/${TEST}.output goodsign.output testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)" @@ -55,7 +55,7 @@ runtest() { } msgmsg 'InRelease' -EXPECT='Hit http://localhost:8080 unstable InRelease +EXPECT='Hit:1 http://localhost:8080 unstable InRelease Reading package lists...' echo 'Acquire::GzipIndexes "0";' > rootdir/etc/apt/apt.conf.d/02compressindex runtest @@ -63,9 +63,9 @@ echo 'Acquire::GzipIndexes "1";' > rootdir/etc/apt/apt.conf.d/02compressindex runtest msgmsg 'Release/Release.gpg' -EXPECT='Ign http://localhost:8080 unstable InRelease +EXPECT='Ign:1 http://localhost:8080 unstable InRelease 404 Not Found -Hit http://localhost:8080 unstable Release +Hit:2 http://localhost:8080 unstable Release Reading package lists...' find aptarchive -name 'InRelease' -delete echo 'Acquire::GzipIndexes "0";' > rootdir/etc/apt/apt.conf.d/02compressindex @@ -74,10 +74,10 @@ echo 'Acquire::GzipIndexes "1";' > rootdir/etc/apt/apt.conf.d/02compressindex runtest msgmsg 'Release only' -EXPECT="Ign http://localhost:8080 unstable InRelease +EXPECT="Ign:1 http://localhost:8080 unstable InRelease 404 Not Found -Hit http://localhost:8080 unstable Release -Ign http://localhost:8080 unstable Release.gpg +Hit:2 http://localhost:8080 unstable Release +Ign:3 http://localhost:8080 unstable Release.gpg 404 Not Found Reading package lists... W: The data from 'http://localhost:8080 unstable Release' is not signed. Packages from that repository can not be authenticated." @@ -96,7 +96,7 @@ Valid-Until: $(date -d '-1 weeks' '+%a, %d %b %Y %H:%M:%S %Z')" '{}' \; signreleasefiles msgmsg 'expired InRelease' -EXPECT='Hit http://localhost:8080 unstable InRelease +EXPECT='Hit:1 http://localhost:8080 unstable InRelease E: Release file for http://localhost:8080/dists/unstable/InRelease is expired (invalid since). Updates for this repository will not be applied.' echo 'Acquire::GzipIndexes "0";' > rootdir/etc/apt/apt.conf.d/02compressindex runtest 'failure' @@ -104,9 +104,9 @@ echo 'Acquire::GzipIndexes "1";' > rootdir/etc/apt/apt.conf.d/02compressindex runtest 'failure' msgmsg 'expired Release/Release.gpg' -EXPECT='Ign http://localhost:8080 unstable InRelease +EXPECT='Ign:1 http://localhost:8080 unstable InRelease 404 Not Found -Hit http://localhost:8080 unstable Release +Hit:2 http://localhost:8080 unstable Release E: Release file for http://localhost:8080/dists/unstable/Release is expired (invalid since). Updates for this repository will not be applied.' find aptarchive -name 'InRelease' -delete echo 'Acquire::GzipIndexes "0";' > rootdir/etc/apt/apt.conf.d/02compressindex @@ -115,10 +115,10 @@ echo 'Acquire::GzipIndexes "1";' > rootdir/etc/apt/apt.conf.d/02compressindex runtest 'failure' msgmsg 'expired Release only' -EXPECT="Ign http://localhost:8080 unstable InRelease +EXPECT="Ign:1 http://localhost:8080 unstable InRelease 404 Not Found -Hit http://localhost:8080 unstable Release -Ign http://localhost:8080 unstable Release.gpg +Hit:2 http://localhost:8080 unstable Release +Ign:3 http://localhost:8080 unstable Release.gpg 404 Not Found W: The data from 'http://localhost:8080 unstable Release' is not signed. Packages from that repository can not be authenticated. E: Release file for http://localhost:8080/dists/unstable/Release is expired (invalid since). Updates for this repository will not be applied." @@ -130,13 +130,13 @@ runtest 'failure' 'warning' msgmsg 'no Release at all' -EXPECT="Ign http://localhost:8080 unstable InRelease +EXPECT="Ign:1 http://localhost:8080 unstable InRelease 404 Not Found -Ign http://localhost:8080 unstable Release +Ign:2 http://localhost:8080 unstable Release 404 Not Found -Hit http://localhost:8080 unstable/main Sources -Hit http://localhost:8080 unstable/main amd64 Packages -Hit http://localhost:8080 unstable/main Translation-en +Hit:3 http://localhost:8080 unstable/main Sources +Hit:4 http://localhost:8080 unstable/main amd64 Packages +Hit:5 http://localhost:8080 unstable/main Translation-en Reading package lists... W: The repository 'http://localhost:8080 unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." find aptarchive -name '*Release*' -delete diff --git a/test/integration/test-apt-update-not-modified b/test/integration/test-apt-update-not-modified index 32818658f..6d176a655 100755 --- a/test/integration/test-apt-update-not-modified +++ b/test/integration/test-apt-update-not-modified @@ -20,14 +20,14 @@ methodtest() { listcurrentlistsdirectory > listsdir.lst # hit again with a good cache - testsuccessequal "Hit $1 unstable InRelease + testsuccessequal "Hit:1 $1 unstable InRelease Reading package lists..." aptget update testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)" # drop an architecture, which means the file should be gone now configarchitecture 'i386' sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst - testsuccessequal "Hit $1 unstable InRelease + testsuccessequal "Hit:1 $1 unstable InRelease Reading package lists..." aptget update testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)" @@ -42,9 +42,9 @@ Architecture: amd64 Version: 1 EOF compressfile aptarchive/dists/unstable/main/binary-amd64/Packages - testfailureequal "Hit $1 unstable InRelease -Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] -Err $1 unstable/main amd64 Packages + testfailureequal "Hit:1 $1 unstable InRelease +Get:2 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] +Err:2 $1 unstable/main amd64 Packages Hash Sum mismatch W: Failed to fetch $1/dists/unstable/main/binary-amd64/Packages.gz Hash Sum mismatch @@ -54,8 +54,8 @@ E: Some index files failed to download. They have been ignored, or old ones used cp -a aptarchive/dists.good aptarchive/dists # … now everything is fine again - testsuccessequal "Hit $1 unstable InRelease -Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] + testsuccessequal "Hit:1 $1 unstable InRelease +Get:2 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] Reading package lists..." aptget update testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)" @@ -74,18 +74,18 @@ Reading package lists..." aptget update listcurrentlistsdirectory > listsdir.lst # hit again with a good cache - testsuccessequal "Ign $1 unstable InRelease + testsuccessequal "Ign:1 $1 unstable InRelease 404 Not Found -Hit $1 unstable Release +Hit:2 $1 unstable Release Reading package lists..." aptget update testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)" # drop an architecture, which means the file should be gone now configarchitecture 'i386' sed '/_binary-amd64_Packages/ d' listsdir.lst > listsdir-without-amd64.lst - testsuccessequal "Ign $1 unstable InRelease + testsuccessequal "Ign:1 $1 unstable InRelease 404 Not Found -Hit $1 unstable Release +Hit:2 $1 unstable Release Reading package lists..." aptget update testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)" @@ -100,11 +100,11 @@ Architecture: amd64 Version: 1 EOF compressfile aptarchive/dists/unstable/main/binary-amd64/Packages - testfailureequal "Ign $1 unstable InRelease + testfailureequal "Ign:1 $1 unstable InRelease 404 Not Found -Hit $1 unstable Release -Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] -Err $1 unstable/main amd64 Packages +Hit:2 $1 unstable Release +Get:4 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] +Err:4 $1 unstable/main amd64 Packages Hash Sum mismatch W: Failed to fetch $1/dists/unstable/main/binary-amd64/Packages.gz Hash Sum mismatch @@ -115,18 +115,18 @@ E: Some index files failed to download. They have been ignored, or old ones used find aptarchive/dists -name 'InRelease' -delete # … now everything is fine again - testsuccessequal "Ign $1 unstable InRelease + testsuccessequal "Ign:1 $1 unstable InRelease 404 Not Found -Hit $1 unstable Release -Get:1 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] +Hit:2 $1 unstable Release +Get:4 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable/main/binary-amd64/Packages.gz') B] Reading package lists..." aptget update testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)" webserverconfig 'aptwebserver::support::modified-since' 'false' webserverconfig 'aptwebserver::support::last-modified' 'false' - testsuccessequal "Ign $1 unstable InRelease + testsuccessequal "Ign:1 $1 unstable InRelease 404 Not Found -Get:1 $1 unstable Release [$(stat -c '%s' 'aptarchive/dists/unstable/Release') B] +Get:2 $1 unstable Release [$(stat -c '%s' 'aptarchive/dists/unstable/Release') B] Reading package lists..." aptget update webserverconfig 'aptwebserver::support::modified-since' 'true' webserverconfig 'aptwebserver::support::last-modified' 'true' diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index 3042d116d..47dd62712 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -13,7 +13,7 @@ setupflataptarchive testaptgetupdate() { rm -rf rootdir/var/lib/apt aptget update >testaptgetupdate.diff 2>&1 || true - sed -i -e '/Ign /,+1d' -e '/Release/ d' -e 's#Get:[0-9]\+ #Get: #' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff + sed -i -e '/Ign /,+1d' -e '/Release/ d' -e 's#\[[0-9]* [kMGTPY]*B\]#\[\]#' testaptgetupdate.diff GIVEN="$1" shift msgtest "Test for correctness of" "apt-get update with $*" @@ -47,12 +47,12 @@ testoverfile() { forcecompressor "$1" createemptyarchive 'Packages' - testaptgetupdate "Get: file:$APTARCHIVE Packages [] + testaptgetupdate "Get:2 file:$APTARCHIVE Packages [] Reading package lists..." "empty archive Packages.$COMPRESS over file" createemptyfile 'Packages' - testaptgetupdate "Get: file:$APTARCHIVE Packages -Err file:$APTARCHIVE Packages + testaptgetupdate "Get:2 file:$APTARCHIVE Packages +Err:2 file:$APTARCHIVE Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:${APTARCHIVE}/Packages.$COMPRESS Empty files can't be valid archives @@ -63,13 +63,13 @@ testoverhttp() { forcecompressor "$1" createemptyarchive 'Packages' - testaptgetupdate "Get: http://localhost:8080 Packages [] + testaptgetupdate "Get:2 http://localhost:8080 Packages [] Reading package lists..." "empty archive Packages.$COMPRESS over http" createemptyfile 'Packages' #FIXME: we should response with a good error message instead - testaptgetupdate "Get: http://localhost:8080 Packages -Err http://localhost:8080 Packages + testaptgetupdate "Get:2 http://localhost:8080 Packages +Err:2 http://localhost:8080 Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial/localhost:8080_Packages.${COMPRESS}) Empty files can't be valid archives diff --git a/test/integration/test-bug-602412-dequote-redirect b/test/integration/test-bug-602412-dequote-redirect index ca2378c19..b9d232f90 100755 --- a/test/integration/test-bug-602412-dequote-redirect +++ b/test/integration/test-bug-602412-dequote-redirect @@ -21,7 +21,7 @@ testrun() { testsuccess --nomsg aptget update # check that I-M-S header is kept in redirections - testsuccessequal "Hit $1 unstable InRelease + testsuccessequal "Hit:1 $1 unstable InRelease Reading package lists..." aptget update msgtest 'Test redirection works in' 'package download' diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 3295d5497..e5fe21e0f 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -98,7 +98,7 @@ SHA256-Download: msgmsg "Testcase: index is already up-to-date: $*" find rootdir/var/lib/apt/lists -name '*diff_Index' -type f -delete testsuccess aptget update "$@" - testequal 'Hit http://localhost:8080 InRelease + testequal 'Hit:1 http://localhost:8080 InRelease Reading package lists...' aptget update "$@" -o Debug::Acquire::Transaction=0 -o Debug::pkgAcquire::Diffs=0 testsuccessequal "$(cat ${PKGFILE}-new) " aptcache show apt newstuff diff --git a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum index 6abb5d12a..48a7f0562 100755 --- a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum +++ b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum @@ -176,10 +176,10 @@ testmismatch() { Building dependency tree... Need to get 6 B of source archives. Get:1 http://localhost:8080 $1 1.0 (dsc) [3 B] -Err http://localhost:8080 $1 1.0 (dsc) +Err:1 http://localhost:8080 $1 1.0 (dsc) Hash Sum mismatch Get:2 http://localhost:8080 $1 1.0 (tar) [3 B] -Err http://localhost:8080 $1 1.0 (tar) +Err:2 http://localhost:8080 $1 1.0 (tar) Hash Sum mismatch E: Failed to fetch http://localhost:8080/${1}_1.0.dsc Hash Sum mismatch @@ -242,7 +242,7 @@ Building dependency tree... Need to get 6 B of source archives. Get:1 http://localhost:8080 pkg-mixed-sha1-bad 1.0 (tar) [3 B] Get:2 http://localhost:8080 pkg-mixed-sha1-bad 1.0 (dsc) [3 B] -Err http://localhost:8080 pkg-mixed-sha1-bad 1.0 (dsc) +Err:2 http://localhost:8080 pkg-mixed-sha1-bad 1.0 (dsc) Hash Sum mismatch E: Failed to fetch http://localhost:8080/pkg-mixed-sha1-bad_1.0.dsc Hash Sum mismatch @@ -253,7 +253,7 @@ testfailureequal 'Reading package lists... Building dependency tree... Need to get 6 B of source archives. Get:1 http://localhost:8080 pkg-mixed-sha2-bad 1.0 (tar) [3 B] -Err http://localhost:8080 pkg-mixed-sha2-bad 1.0 (tar) +Err:1 http://localhost:8080 pkg-mixed-sha2-bad 1.0 (tar) Hash Sum mismatch Get:2 http://localhost:8080 pkg-mixed-sha2-bad 1.0 (dsc) [3 B] E: Failed to fetch http://localhost:8080/pkg-mixed-sha2-bad_1.0.tar.gz Hash Sum mismatch -- cgit v1.2.3 From 9d2a8a7388cf3b0bbbe92f6b0b30a533e1167f40 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 15 Jun 2015 23:06:56 +0200 Subject: condense parallel requests with the same hashes to one It shouldn't be too common, but sometimes people have multiple mirrors in the sources or otherwise repositories with the same content. Now that we gracefully can handle multiple requests to the same URI, we can also fold multiple requests with the same expected hashes into one. Note that this isn't trying to find oppertunities for merging, but just merges if it happens to encounter the oppertunity for it. This is most obvious in the new testcase actually as it needs to delay the action to give the acquire system enough time to figure out that they can be merged. --- apt-pkg/acquire.cc | 5 +- apt-private/acqprogress.cc | 6 +- test/integration/framework | 8 ++- test/integration/skip-aptwebserver | 25 ------- .../test-acquire-same-file-multiple-times | 4 +- .../test-acquire-same-repository-multiple-times | 81 ++++++++++++++++++++++ test/integration/test-apt-get-source | 42 ++++++----- test/integration/test-apt-get-source-arch | 23 +++--- test/integration/test-apt-get-source-multisources | 12 ++-- .../integration/test-apt-get-update-unauth-warning | 37 +++++++++- test/integration/test-apt-progress-fd | 4 -- test/integration/test-apt-update-ims | 18 +++++ .../test-bug-722207-print-uris-even-if-very-quiet | 12 ++-- test/integration/test-bug-738785-switch-protocol | 22 +++--- 14 files changed, 198 insertions(+), 101 deletions(-) delete mode 100755 test/integration/skip-aptwebserver create mode 100755 test/integration/test-acquire-same-repository-multiple-times diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 14c8863dc..34afab181 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -680,9 +680,12 @@ bool pkgAcquire::Queue::Enqueue(ItemDesc &Item) { QItem **I = &Items; // move to the end of the queue and check for duplicates here + HashStringList const hsl = Item.Owner->GetExpectedHashes(); for (; *I != 0; I = &(*I)->Next) - if (Item.URI == (*I)->URI) + if (Item.URI == (*I)->URI || hsl == (*I)->Owner->GetExpectedHashes()) { + if (_config->FindB("Debug::pkgAcquire::Worker",false) == true) + std::cerr << " @ Queue: Action combined for " << Item.URI << " and " << (*I)->URI << std::endl; (*I)->Owners.push_back(Item.Owner); Item.Owner->Status = (*I)->Owner->Status; return false; diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc index dc92e3b2a..f6c3d1204 100644 --- a/apt-private/acqprogress.cc +++ b/apt-private/acqprogress.cc @@ -116,14 +116,10 @@ void AcqTextStatus::Fail(pkgAcquire::ItemDesc &Itm) if (Quiet > 1) return; - // Ignore certain kinds of transient failures (bad code) - if (Itm.Owner->Status == pkgAcquire::Item::StatIdle) - return; - AssignItemID(Itm); clearLastLine(); - if (Itm.Owner->Status == pkgAcquire::Item::StatDone) + if (Itm.Owner->Status == pkgAcquire::Item::StatDone || Itm.Owner->Status == pkgAcquire::Item::StatIdle) { // TRANSLATOR: Very short word to be displayed for files in 'apt-get update' // which failed to download, but the error is ignored (compare "Err:") diff --git a/test/integration/framework b/test/integration/framework index 1b99929e2..d8f7567d9 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -245,7 +245,7 @@ setupenvironment() { echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf - echo "Dir::Bin::Methods \"${METHODSDIR}\";" >> aptconfig.conf + echo "Dir::Bin::Methods \"${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/methods\";" >> aptconfig.conf # store apt-key were we can access it, even if we run it as a different user # destroys coverage reporting though, so just do it for root for now if [ "$(id -u)" = '0' ]; then @@ -786,6 +786,8 @@ insertsource() { local SPATH="aptarchive/dists/${RELEASE}/main/source" mkdir -p $SPATH local FILE="${SPATH}/Sources" + local DSCFILE="${NAME}_${VERSION}.dsc" + local TARFILE="${NAME}_${VERSION}.tar.gz" echo "Package: $NAME Binary: $NAME Version: $VERSION @@ -793,8 +795,8 @@ Maintainer: Joe Sixpack Architecture: $ARCH" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE echo "Files: - d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.dsc - d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.tar.gz + $(echo -n "$DSCFILE" | md5sum | cut -d' ' -f 1) $(echo -n "$DSCFILE" | wc -c) $DSCFILE + $(echo -n "$TARFILE" | md5sum | cut -d' ' -f 1) $(echo -n "$TARFILE" | wc -c) $TARFILE " >> $FILE } diff --git a/test/integration/skip-aptwebserver b/test/integration/skip-aptwebserver deleted file mode 100755 index 0622941ce..000000000 --- a/test/integration/skip-aptwebserver +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -set -e - -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework - -setupenvironment -configarchitecture 'amd64' - -buildsimplenativepackage 'apt' 'all' '1.0' 'stable' - -setupaptarchive -changetowebserver - -rm -rf rootdir/var/lib/apt/lists -aptget update -qq -testequal 'Hit http://localhost stable InRelease -Hit http://localhost stable/main Sources -Hit http://localhost stable/main amd64 Packages -Hit http://localhost stable/main Translation-en -Reading package lists...' aptget update - -mv rootdir/var/lib/apt/lists/localhost* rootdir/var/lib/apt/lists/partial -aptget update - diff --git a/test/integration/test-acquire-same-file-multiple-times b/test/integration/test-acquire-same-file-multiple-times index d329a39cb..526765521 100755 --- a/test/integration/test-acquire-same-file-multiple-times +++ b/test/integration/test-acquire-same-file-multiple-times @@ -45,7 +45,7 @@ changetowebserver -o aptwebserver::redirect::replace::/foo2=/foo httpdown() { msgtest 'Downloading the same URI to different files' 'twice over http' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 + testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::http=1 cp rootdir/tmp/testsuccess.output download.log testsuccess cmp $TESTDIR/framework ./downloaded/foo1 testsuccess cmp ./downloaded/foo1 ./downloaded/foo2 @@ -57,7 +57,7 @@ testrun 'httpdown' httpredirectdown() { msgtest 'Redirect leads' 'first URI to the second URI' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo2 ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 + testsuccess --nomsg apthelper download-file http://localhost:8080/foo2 ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::http=1 cp rootdir/tmp/testsuccess.output download.log testsuccess cmp $TESTDIR/framework ./downloaded/foo1 testsuccess cmp ./downloaded/foo1 ./downloaded/foo2 diff --git a/test/integration/test-acquire-same-repository-multiple-times b/test/integration/test-acquire-same-repository-multiple-times new file mode 100755 index 000000000..bfeaf88db --- /dev/null +++ b/test/integration/test-acquire-same-repository-multiple-times @@ -0,0 +1,81 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +TESTFILE="$TESTDIR/framework" +cp $TESTFILE aptarchive/foo +APTARCHIVE="$(readlink -f ./aptarchive)" + +getcodenamefromsuite() { echo "jessie"; } +buildsimplenativepackage 'foo' 'all' '1.0' 'stable' +setupaptarchive --no-update +ln -s "${APTARCHIVE}/dists/stable" "${APTARCHIVE}/dists/jessie" +for FILE in rootdir/etc/apt/sources.list.d/*-stable-* ; do + sed 's#stable#jessie#g' $FILE > $(echo "$FILE" | sed 's#stable#jessie#g') +done + +# install a slowed down file: otherwise its to fast to reproduce combining +NEWMETHODS="$(readlink -f rootdir)/usr/lib/apt/methods" +OLDMETHODS="$(readlink -f rootdir/usr/lib/apt/methods)" +rm $NEWMETHODS +mkdir $NEWMETHODS +for METH in $(find $OLDMETHODS ! -type d); do + ln -s $OLDMETHODS/$(basename $METH) $NEWMETHODS +done +rm $NEWMETHODS/file +cat >$NEWMETHODS/file < file.lst + testequal "$(find $(readlink -f ./rootdir/var/lib/apt/lists) -name '*_dists_*' \( ! -name '*InRelease' \) -type f | sort)" cat file.lst + testsuccess aptcache policy + testequal "foo: + Installed: (none) + Candidate: 1.0 + Version table: + 1.0 0 + 500 $1:$2 jessie/main amd64 Packages + 500 $1:$2 stable/main amd64 Packages" aptcache policy foo + testfailure aptcache show foo/unstable + testsuccess aptcache show foo/stable + testsuccess aptcache show foo/jessie +} + +tworepos 'file' "$APTARCHIVE" 'no partial' +testequal '12' grep -c '200%20URI%20Start' ./download.log +testequal '12' grep -c '201%20URI%20Done' ./download.log +testequal '6' grep -c '^ @ Queue: Action combined' ./download.log +tworepos 'file' "$APTARCHIVE" 'hit' +testequal '6' grep -c '200%20URI%20Start' ./download.log +testequal '6' grep -c '201%20URI%20Done' ./download.log +testequal '0' grep -c '^ @ Queue: Action combined' ./download.log +rm -rf rootdir/var/lib/apt/lists + +changetowebserver + +tworepos 'http' '//localhost:8080' 'no partial' +testequal '10' grep -c '200%20URI%20Start' ./download.log +testequal '10' grep -c '201%20URI%20Done' ./download.log +testequal '6' grep -c '^ @ Queue: Action combined' ./download.log +tworepos 'http' '//localhost:8080' 'hit' +testequal '2' grep -c '200%20URI%20Start' ./download.log +testequal '4' grep -c '201%20URI%20Done' ./download.log +testequal '0' grep -c '^ @ Queue: Action combined' ./download.log +rm -rf rootdir/var/lib/apt/lists diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index 9db24370f..22f01b997 100755 --- a/test/integration/test-apt-get-source +++ b/test/integration/test-apt-get-source @@ -34,43 +34,40 @@ APTARCHIVE=$(readlink -f ./aptarchive) # normal operation gets highest version number HEADER="Reading package lists... Building dependency tree..." +DOWNLOAD1="Need to get 0 B/25 B of source archives. +'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 MD5Sum:b998e085e36cf162e6a33c2801318fef +'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 MD5Sum:d46b9a02af8487cbeb49165540c88184" +DOWNLOAD2="Need to get 0 B/25 B of source archives. +'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 11 MD5Sum:c0de572c6f8aa576c8ff78c81132ed55 +'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 14 MD5Sum:e10bb487c375b2b938d27bd31c2d1f5f" testsuccessequal "$HEADER -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo +$DOWNLOAD2" aptget source -q --print-uris foo # select by release: suite testsuccessequal "$HEADER Selected version '1.0' (stable) for foo -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/stable +$DOWNLOAD1" aptget source -q --print-uris foo/stable testsuccessequal "$HEADER Selected version '2.0' (unstable) for foo -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/unstable +$DOWNLOAD2" aptget source -q --print-uris foo/unstable # select by release: codename testsuccessequal "$HEADER Selected version '2.0' (sid) for foo -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/sid +$DOWNLOAD2" aptget source -q --print-uris foo/sid # select by version testsuccessequal "$HEADER -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo=1.0 +$DOWNLOAD1" aptget source -q --print-uris foo=1.0 # select by release with no binary package (Bug#731102) but ensure to get # highest version +DOWNLOAD01="Need to get 0 B/25 B of source archives. +'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 11 MD5Sum:0811a4d85238056c613ea897f49f01af +'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 14 MD5Sum:fa1ecb7a1a53e8e6f6551ca7db888a61" testsuccessequal "$HEADER Selected version '0.1' (wheezy) for foo -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/wheezy +$DOWNLOAD01" aptget source -q --print-uris foo/wheezy # unavailable one testfailureequal "$HEADER @@ -78,11 +75,12 @@ E: Can not find version '9.9-not-there' of package 'foo' E: Unable to find a source package for foo" aptget source -q --print-uris foo=9.9-not-there # version and release +DOWNLOAD001="Need to get 0 B/29 B of source archives. +'file://${APTARCHIVE}/foo_0.0.1.dsc' foo_0.0.1.dsc 13 MD5Sum:6c819ebf0a21b1a480e1dbf6b8edfebd +'file://${APTARCHIVE}/foo_0.0.1.tar.gz' foo_0.0.1.tar.gz 16 MD5Sum:a3c7e1ac2159fc0faf522e110d6906fd" testsuccessequal "$HEADER -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_0.0.1.dsc' foo_0.0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_0.0.1.tar.gz' foo_0.0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris -t unstable foo=0.0.1 +$DOWNLOAD001" aptget source -q --print-uris -t unstable foo=0.0.1 testsuccessequal "$HEADER -Need to get 0 B of source archives. +Need to get 0 B/25 B of source archives. Fetch source foo" aptget source -q -s foo diff --git a/test/integration/test-apt-get-source-arch b/test/integration/test-apt-get-source-arch index c75798209..f54bb6012 100755 --- a/test/integration/test-apt-get-source-arch +++ b/test/integration/test-apt-get-source-arch @@ -28,31 +28,30 @@ APTARCHIVE=$(readlink -f ./aptarchive) HEADER="Reading package lists... Building dependency tree..." +DOWNLOAD10="Need to get 0 B/25 B of source archives. +'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 MD5Sum:b998e085e36cf162e6a33c2801318fef +'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 MD5Sum:d46b9a02af8487cbeb49165540c88184" # pick :amd64 testsuccessequal "$HEADER -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:amd64 +$DOWNLOAD10" aptget source -q --print-uris foo:amd64 # pick :i386 testsuccessequal "$HEADER -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386 +Need to get 0 B/25 B of source archives. +'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 11 MD5Sum:c0de572c6f8aa576c8ff78c81132ed55 +'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 14 MD5Sum:e10bb487c375b2b938d27bd31c2d1f5f" aptget source -q --print-uris foo:i386 # pick :i386 by release testsuccessequal "$HEADER Selected version '0.1' (oldstable) for foo -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386/oldstable +Need to get 0 B/25 B of source archives. +'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 11 MD5Sum:0811a4d85238056c613ea897f49f01af +'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 14 MD5Sum:fa1ecb7a1a53e8e6f6551ca7db888a61" aptget source -q --print-uris foo:i386/oldstable # pick :i386 by version testsuccessequal "$HEADER -Need to get 0 B of source archives. -'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386=1.0 +$DOWNLOAD10" aptget source -q --print-uris foo:i386=1.0 # error on unknown arch testfailureequal "$HEADER diff --git a/test/integration/test-apt-get-source-multisources b/test/integration/test-apt-get-source-multisources index 03d0400a0..887a30685 100755 --- a/test/integration/test-apt-get-source-multisources +++ b/test/integration/test-apt-get-source-multisources @@ -20,11 +20,11 @@ APTARCHIVE=$(readlink -f ./aptarchive) HEADER="Reading package lists... Building dependency tree..." testsuccessequal "$HEADER -Need to get 0 B of source archives. -'file://${APTARCHIVE}/adduser_3.113+nmu3.dsc' adduser_3.113+nmu3.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/python-fll_0.9.11.dsc' python-fll_0.9.11.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qdy --print-uris --dsc-only adduser=3.113 python-fll=0.9.11 +Need to get 0 B/43 B of source archives. +'file://${APTARCHIVE}/adduser_3.113+nmu3.dsc' adduser_3.113+nmu3.dsc 22 MD5Sum:255405ab5af211238ef53b7a1dd8ca4b +'file://${APTARCHIVE}/python-fll_0.9.11.dsc' python-fll_0.9.11.dsc 21 MD5Sum:740a9dbf02a295932f15b1415d0dc0df" aptget source -qdy --print-uris --dsc-only adduser=3.113 python-fll=0.9.11 testsuccessequal "$HEADER -Need to get 0 B of source archives. -'file://${APTARCHIVE}/python-fll_0.9.11.dsc' python-fll_0.9.11.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/adduser_3.113+nmu3.dsc' adduser_3.113+nmu3.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qdy --print-uris --dsc-only python-fll=0.9.11 adduser=3.113 +Need to get 0 B/43 B of source archives. +'file://${APTARCHIVE}/python-fll_0.9.11.dsc' python-fll_0.9.11.dsc 21 MD5Sum:740a9dbf02a295932f15b1415d0dc0df +'file://${APTARCHIVE}/adduser_3.113+nmu3.dsc' adduser_3.113+nmu3.dsc 22 MD5Sum:255405ab5af211238ef53b7a1dd8ca4b" aptget source -qdy --print-uris --dsc-only python-fll=0.9.11 adduser=3.113 diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 5b81d56d2..fcabf244a 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -20,8 +20,10 @@ APTARCHIVE=$(readlink -f ./aptarchive) rm -f $APTARCHIVE/dists/unstable/*Release* # update without authenticated files leads to warning -testfailureequal "Ign:1 file:$APTARCHIVE unstable InRelease +testfailureequal "Get:1 file:$APTARCHIVE unstable InRelease +Ign:1 file:$APTARCHIVE unstable InRelease File not found +Get:2 file:$APTARCHIVE unstable Release Err:2 file:$APTARCHIVE unstable Release File not found W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. @@ -36,10 +38,41 @@ filesize() { stat -c%s "$(aptget files --no-release-info --format '$(URI)' "Created-By: $1" | cut -d'/' -f 3- ).gz" } # allow override -testwarningequal "Ign:1 file:$APTARCHIVE unstable InRelease +#aptget update --allow-insecure-repositories -o Debug::pkgAcquire::worker=1 +#exit +testwarningequal "Get:1 file:$APTARCHIVE unstable InRelease +Ign:1 file:$APTARCHIVE unstable InRelease File not found +Get:2 file:$APTARCHIVE unstable Release Ign:2 file:$APTARCHIVE unstable Release File not found +Get:3 file:$APTARCHIVE unstable/main Sources +Ign:3 file:$APTARCHIVE unstable/main Sources + File not found +Get:4 file:$APTARCHIVE unstable/main i386 Packages +Ign:4 file:$APTARCHIVE unstable/main i386 Packages + File not found +Get:5 file:$APTARCHIVE unstable/main Translation-en +Ign:5 file:$APTARCHIVE unstable/main Translation-en + File not found +Get:3 file:$APTARCHIVE unstable/main Sources +Ign:3 file:$APTARCHIVE unstable/main Sources + File not found +Get:4 file:$APTARCHIVE unstable/main i386 Packages +Ign:4 file:$APTARCHIVE unstable/main i386 Packages + File not found +Get:5 file:$APTARCHIVE unstable/main Translation-en +Ign:5 file:$APTARCHIVE unstable/main Translation-en + File not found +Get:3 file:$APTARCHIVE unstable/main Sources +Ign:3 file:$APTARCHIVE unstable/main Sources + File not found +Get:4 file:$APTARCHIVE unstable/main i386 Packages +Ign:4 file:$APTARCHIVE unstable/main i386 Packages + File not found +Get:5 file:$APTARCHIVE unstable/main Translation-en +Ign:5 file:$APTARCHIVE unstable/main Translation-en + File not found Get:3 file:$APTARCHIVE unstable/main Sources [$(filesize 'Sources') B] Get:4 file:$APTARCHIVE unstable/main i386 Packages [$(filesize 'Packages') B] Get:5 file:$APTARCHIVE unstable/main Translation-en [$(filesize 'Translations') B] diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd index 99b4ea050..e30d503cb 100755 --- a/test/integration/test-apt-progress-fd +++ b/test/integration/test-apt-progress-fd @@ -16,7 +16,6 @@ setupaptarchive exec 3> apt-progress.log testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 -dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing:0:Installing testing (amd64) @@ -33,7 +32,6 @@ pmstatus:dpkg-exec:83.3333:Running dpkg' exec 3> apt-progress.log testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 -dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing:0:Installing testing (amd64) @@ -50,7 +48,6 @@ pmstatus:dpkg-exec:83.3333:Running dpkg' exec 3> apt-progress.log testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 -dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing:0:Installing testing (amd64) @@ -77,7 +74,6 @@ pmstatus:dpkg-exec:75:Running dpkg' exec 3> apt-progress.log testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3 testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 -dlstatus:1:0:Retrieving file 1 of 1 dlstatus:1:20:Retrieving file 1 of 1 pmstatus:dpkg-exec:0:Running dpkg pmstatus:testing2:0:Installing testing2 (i386) diff --git a/test/integration/test-apt-update-ims b/test/integration/test-apt-update-ims index 2b662171c..33b4ed1b9 100755 --- a/test/integration/test-apt-update-ims +++ b/test/integration/test-apt-update-ims @@ -134,6 +134,24 @@ EXPECT="Ign:1 http://localhost:8080 unstable InRelease 404 Not Found Ign:2 http://localhost:8080 unstable Release 404 Not Found +Ign:3 http://localhost:8080 unstable/main Sources + 404 Not Found +Ign:4 http://localhost:8080 unstable/main amd64 Packages + 404 Not Found +Ign:5 http://localhost:8080 unstable/main Translation-en + 404 Not Found +Ign:3 http://localhost:8080 unstable/main Sources + 404 Not Found +Ign:4 http://localhost:8080 unstable/main amd64 Packages + 404 Not Found +Ign:5 http://localhost:8080 unstable/main Translation-en + 404 Not Found +Ign:3 http://localhost:8080 unstable/main Sources + 404 Not Found +Ign:4 http://localhost:8080 unstable/main amd64 Packages + 404 Not Found +Ign:5 http://localhost:8080 unstable/main Translation-en + 404 Not Found Hit:3 http://localhost:8080 unstable/main Sources Hit:4 http://localhost:8080 unstable/main amd64 Packages Hit:5 http://localhost:8080 unstable/main Translation-en diff --git a/test/integration/test-bug-722207-print-uris-even-if-very-quiet b/test/integration/test-bug-722207-print-uris-even-if-very-quiet index e51d72ccd..1fa94de7d 100755 --- a/test/integration/test-bug-722207-print-uris-even-if-very-quiet +++ b/test/integration/test-bug-722207-print-uris-even-if-very-quiet @@ -21,11 +21,11 @@ testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.d testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget dist-upgrade -qq --print-uris testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget install apt -qq --print-uris testsuccessequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 " aptget download apt -qq --print-uris -testsuccessequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt -qq --print-uris +testsuccessequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 9 MD5Sum:16ff470aaedad0f06fb951ed89ffdd3a +'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 12 MD5Sum:ab2b546f59ff9e8f5cc7a2d987ff3373" aptget source apt -qq --print-uris testsuccessequal "'http://metadata.ftp-master.debian.org/changelogs/main/a/apt/apt_2_changelog' apt.changelog" aptget changelog apt -qq --print-uris -testsuccessequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/apt2_1.dsc' apt2_1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/apt2_1.tar.gz' apt2_1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt apt2 -qq --print-uris +testsuccessequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 9 MD5Sum:16ff470aaedad0f06fb951ed89ffdd3a +'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 12 MD5Sum:ab2b546f59ff9e8f5cc7a2d987ff3373 +'file://${APTARCHIVE}/apt2_1.dsc' apt2_1.dsc 10 MD5Sum:4c572ce45f1e2bedbb30da7f5e1c241c +'file://${APTARCHIVE}/apt2_1.tar.gz' apt2_1.tar.gz 13 MD5Sum:2a96fec139f8722d93312a1ff8281232" aptget source apt apt2 -qq --print-uris diff --git a/test/integration/test-bug-738785-switch-protocol b/test/integration/test-bug-738785-switch-protocol index 539080200..e86f28824 100755 --- a/test/integration/test-bug-738785-switch-protocol +++ b/test/integration/test-bug-738785-switch-protocol @@ -39,18 +39,15 @@ cd - >/dev/null testsuccess aptget install apt -y testdpkginstalled 'apt' -# create a copy of all methods, expect https -eval `aptconfig shell METHODS Dir::Bin::Methods/d` -COPYMETHODS='usr/lib/apt/methods' -mv rootdir/${COPYMETHODS} rootdir/${COPYMETHODS}.bak -mkdir -p rootdir/$COPYMETHODS -cd rootdir/$COPYMETHODS -find $METHODS \! -type d | while read meth; do - ln -s $meth +# install a slowed down file: otherwise its to fast to reproduce combining +NEWMETHODS="$(readlink -f rootdir)/usr/lib/apt/methods" +OLDMETHODS="$(readlink -f rootdir/usr/lib/apt/methods)" +rm $NEWMETHODS +mkdir $NEWMETHODS +for METH in $(find $OLDMETHODS ! -type d); do + ln -s $OLDMETHODS/$(basename $METH) $NEWMETHODS done -rm https -cd - >/dev/null -echo "Dir::Bin::Methods \"${COPYMETHODS}\";" >> aptconfig.conf +rm $NEWMETHODS/https cd downloaded testfailureequal "E: The method driver $(readlink -f './../')/rootdir/usr/lib/apt/methods/https could not be found. @@ -59,8 +56,7 @@ testfailure test -e apt_1.0_all.deb cd - >/dev/null # revert to all methods -rm -rf rootdir/$COPYMETHODS -mv rootdir/${COPYMETHODS}.bak rootdir/${COPYMETHODS} +ln -s $OLDMETHODS/https $NEWMETHODS # check that downgrades from https to http are not allowed webserverconfig 'aptwebserver::support::http' 'true' -- cgit v1.2.3 From 533fe3d13927798c17bdef84eba60ed9441d9608 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 15 Jun 2015 23:59:14 +0200 Subject: allow ratelimiting progress reporting for testcases Progress reports once in a while which is a bit to unpredictable for testcases, so we enforce a steady progress for them in the hope that this makes the tests (mostly test-apt-progress-fd) a bit more stable. Git-Dch: Ignore --- apt-pkg/acquire.cc | 14 ++++++++----- test/integration/framework | 23 ++++++++++++---------- .../test-acquire-same-repository-multiple-times | 2 +- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 34afab181..5e5bec95c 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -955,7 +955,7 @@ std::string pkgAcquire::Queue::QItem::Custom600Headers() const /*{{{*/ // AcquireStatus::pkgAcquireStatus - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgAcquireStatus::pkgAcquireStatus() : d(NULL), Percent(0), Update(true), MorePulses(false) +pkgAcquireStatus::pkgAcquireStatus() : d(NULL), Percent(-1), Update(true), MorePulses(false) { Start(); } @@ -1054,13 +1054,17 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner) Time = NewTime; } + double const OldPercent = Percent; // calculate the percentage, if we have too little data assume 1% if (TotalBytes > 0 && UnfetchedReleaseFiles) Percent = 0; - else + else // use both files and bytes because bytes can be unreliable - Percent = (0.8 * (CurrentBytes/float(TotalBytes)*100.0) + + Percent = (0.8 * (CurrentBytes/float(TotalBytes)*100.0) + 0.2 * (CurrentItems/float(TotalItems)*100.0)); + double const DiffPercent = Percent - OldPercent; + if (DiffPercent < 0.001 && _config->FindB("Acquire::Progress::Diffpercent", false) == true) + return true; int fd = _config->FindI("APT::Status-Fd",-1); if(fd > 0) @@ -1078,11 +1082,11 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner) snprintf(msg,sizeof(msg), _("Retrieving file %li of %li (%s remaining)"), i, TotalItems, TimeToStr(ETA).c_str()); else snprintf(msg,sizeof(msg), _("Retrieving file %li of %li"), i, TotalItems); - + // build the status str status << "dlstatus:" << i << ":" << std::setprecision(3) << Percent - << ":" << msg + << ":" << msg << endl; std::string const dlstatus = status.str(); diff --git a/test/integration/framework b/test/integration/framework index d8f7567d9..5d949009f 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -273,16 +273,19 @@ EOF chmod +x "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" echo "Dir::Bin::dpkg \"${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg\";" > rootdir/etc/apt/apt.conf.d/99dpkg - if ! command dpkg --assert-multi-arch >/dev/null 2>&1; then - echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf # Added to test multiarch before dpkg is ready for it… - fi - echo 'quiet::NoUpdate "true";' >> aptconfig.conf - echo 'quiet::NoStatistic "true";' >> aptconfig.conf - # too distracting for users, but helpful to detect changes - echo 'Acquire::Progress::Ignore::ShowErrorText "true";' >> aptconfig.conf - # in testcases, it can appear as if localhost has a rotation setup, - # hide this as we can't really deal with it properly - echo 'Acquire::Failure::ShowIP "false";' >> aptconfig.conf + { + if ! command dpkg --assert-multi-arch >/dev/null 2>&1; then + echo "DPKG::options:: \"--force-architecture\";" # Added to test multiarch before dpkg is ready for it… + fi + echo 'quiet::NoUpdate "true";' + echo 'quiet::NoStatistic "true";' + # too distracting for users, but helpful to detect changes + echo 'Acquire::Progress::Ignore::ShowErrorText "true";' + echo 'Acquire::Progress::Diffpercent "true";' + # in testcases, it can appear as if localhost has a rotation setup, + # hide this as we can't really deal with it properly + echo 'Acquire::Failure::ShowIP "false";' + } >> aptconfig.conf cp "${TESTDIRECTORY}/apt.pem" "${TMPWORKINGDIRECTORY}/rootdir/etc/webserver.pem" if [ "$(id -u)" = '0' ]; then diff --git a/test/integration/test-acquire-same-repository-multiple-times b/test/integration/test-acquire-same-repository-multiple-times index bfeaf88db..a46e0d73c 100755 --- a/test/integration/test-acquire-same-repository-multiple-times +++ b/test/integration/test-acquire-same-repository-multiple-times @@ -32,7 +32,7 @@ cat >$NEWMETHODS/file < Date: Tue, 16 Jun 2015 16:22:46 +0200 Subject: add d-pointer, virtual destructors and de-inline de/constructors To have a chance to keep the ABI for a while we need all three to team up. One of them missing and we might loose, so ensuring that they are available is a very tedious but needed task once in a while. Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 11 +++- apt-pkg/acquire-item.h | 16 ++++-- apt-pkg/acquire-method.cc | 6 +- apt-pkg/acquire-method.h | 9 ++- apt-pkg/acquire-worker.h | 1 - apt-pkg/acquire.cc | 9 +++ apt-pkg/acquire.h | 10 +--- apt-pkg/algorithms.h | 6 +- apt-pkg/aptconfiguration.h | 21 ++++--- apt-pkg/cachefile.h | 1 - apt-pkg/cacheset.cc | 15 ++++- apt-pkg/cacheset.h | 24 +++++--- apt-pkg/cdrom.cc | 6 ++ apt-pkg/cdrom.h | 11 +++- apt-pkg/clean.cc | 1 + apt-pkg/clean.h | 2 + apt-pkg/deb/debindexfile.cc | 1 + apt-pkg/deb/debindexfile.h | 8 ++- apt-pkg/deb/debmetaindex.cc | 2 + apt-pkg/deb/debmetaindex.h | 3 +- apt-pkg/deb/debrecords.cc | 7 +++ apt-pkg/deb/debrecords.h | 15 +++-- apt-pkg/deb/debsrcrecords.cc | 4 ++ apt-pkg/deb/debsrcrecords.h | 4 +- apt-pkg/deb/debversion.h | 1 - apt-pkg/depcache.h | 6 +- apt-pkg/edsp.cc | 123 ++++++++++++++++++++-------------------- apt-pkg/edsp.h | 42 +++++--------- apt-pkg/edsp/edspindexfile.cc | 2 + apt-pkg/edsp/edspindexfile.h | 1 + apt-pkg/edsp/edsplistparser.cc | 2 + apt-pkg/edsp/edsplistparser.h | 2 + apt-pkg/edsp/edspsystem.h | 2 +- apt-pkg/indexcopy.cc | 10 ++++ apt-pkg/indexcopy.h | 23 ++++++-- apt-pkg/indexfile.cc | 3 + apt-pkg/indexfile.h | 6 +- apt-pkg/indexrecords.h | 3 - apt-pkg/install-progress.cc | 6 ++ apt-pkg/install-progress.h | 11 +++- apt-pkg/metaindex.h | 1 + apt-pkg/orderlist.h | 4 +- apt-pkg/packagemanager.h | 2 +- apt-pkg/pkgcache.cc | 2 + apt-pkg/pkgcache.h | 5 +- apt-pkg/pkgcachegen.cc | 3 + apt-pkg/pkgcachegen.h | 17 +++--- apt-pkg/pkgrecords.cc | 3 + apt-pkg/pkgrecords.h | 8 ++- apt-pkg/pkgsystem.cc | 2 + apt-pkg/pkgsystem.h | 5 +- apt-pkg/policy.cc | 2 + apt-pkg/policy.h | 5 +- apt-pkg/sourcelist.h | 4 +- apt-pkg/srcrecords.h | 1 - apt-pkg/tagfile.h | 2 - apt-pkg/version.cc | 3 + apt-pkg/version.h | 2 +- test/libapt/acqprogress_test.cc | 46 ++++++++------- 59 files changed, 348 insertions(+), 205 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 5460280ec..3313aaabc 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -438,7 +438,7 @@ APT_PURE pkgAcquire * pkgAcquire::Item::GetOwner() const /*{{{*/ return Owner; } /*}}}*/ -pkgAcquire::ItemDesc &pkgAcquire::Item::GetItemDesc() /*{{{*/ +APT_CONST pkgAcquire::ItemDesc &pkgAcquire::Item::GetItemDesc() /*{{{*/ { return Desc; } @@ -1098,6 +1098,7 @@ bool pkgAcqMetaBase::VerifyVendor(string const &Message) /*{{{*/ return true; } /*}}}*/ +pkgAcqMetaBase::~pkgAcqMetaBase() {} pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/ IndexTarget const &ClearsignedTarget, @@ -1319,6 +1320,7 @@ std::string pkgAcqMetaIndex::DescURI() const /*{{{*/ return Target.URI; } /*}}}*/ +pkgAcqMetaIndex::~pkgAcqMetaIndex() {} // AcqMetaSig::AcqMetaSig - Constructor /*{{{*/ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner, @@ -1491,6 +1493,7 @@ pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner, { } /*}}}*/ +pkgAcqBaseIndex::~pkgAcqBaseIndex() {} // AcqDiffIndex::AcqDiffIndex - Constructor /*{{{*/ // --------------------------------------------------------------------- @@ -1893,6 +1896,7 @@ void pkgAcqDiffIndex::Done(string const &Message,HashStringList const &Hashes, / return; } /*}}}*/ +pkgAcqDiffIndex::~pkgAcqDiffIndex() {} // AcqIndexDiffs::AcqIndexDiffs - Constructor /*{{{*/ // --------------------------------------------------------------------- @@ -2119,6 +2123,7 @@ std::string pkgAcqIndexDiffs::Custom600Headers() const /*{{{*/ return patchhashes.str(); } /*}}}*/ +pkgAcqIndexDiffs::~pkgAcqIndexDiffs() {} // AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor /*{{{*/ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, @@ -2263,6 +2268,7 @@ std::string pkgAcqIndexMergeDiffs::Custom600Headers() const /*{{{*/ return patchhashes.str(); } /*}}}*/ +pkgAcqIndexMergeDiffs::~pkgAcqIndexMergeDiffs() {} // AcqIndex::AcqIndex - Constructor /*{{{*/ pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner, @@ -2539,6 +2545,7 @@ void pkgAcqIndex::StageDecompressDone(string const &, return; } /*}}}*/ +pkgAcqIndex::~pkgAcqIndex() {} // AcqArchive::AcqArchive - Constructor /*{{{*/ @@ -2836,6 +2843,7 @@ std::string pkgAcqArchive::ShortDesc() const /*{{{*/ return Desc.ShortDesc; } /*}}}*/ +pkgAcqArchive::~pkgAcqArchive() {} // AcqChangelog::pkgAcqChangelog - Constructors /*{{{*/ pkgAcqChangelog::pkgAcqChangelog(pkgAcquire * const Owner, pkgCache::VerIterator const &Ver, @@ -3156,3 +3164,4 @@ string pkgAcqFile::Custom600Headers() const /*{{{*/ return ""; } /*}}}*/ +pkgAcqFile::~pkgAcqFile() {} diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 9dbacc1ea..df1380b5e 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-item.h,v 1.26.2.3 2004/01/02 18:51:00 mdz Exp $ /* ###################################################################### Acquire Item - Item to acquire @@ -345,6 +344,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ /** \brief baseclass for the indexes files to manage them all together */ { + void *d; protected: IndexTarget const Target; HashStringList GetExpectedHashesFor(std::string const MetaKey) const; @@ -380,7 +380,6 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ /** \brief the manager of a transaction */ { void *d; - protected: std::vector Transaction; @@ -478,6 +477,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ std::vector const IndexTargets, IndexTarget const &DataTarget, indexRecords* const MetaIndexParser); + virtual ~pkgAcqMetaBase(); }; /*}}}*/ /** \brief An item that is responsible for downloading the meta-index {{{ @@ -493,7 +493,6 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase { void *d; - protected: IndexTarget const DetachedSigTarget; @@ -513,6 +512,7 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget, std::vector const IndexTargets, indexRecords * const MetaIndexParser); + virtual ~pkgAcqMetaIndex(); friend class pkgAcqMetaSig; }; @@ -589,6 +589,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target); + virtual ~pkgAcqBaseIndex(); }; /*}}}*/ /** \brief An item that is responsible for fetching an index file of {{{ @@ -652,6 +653,7 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex */ pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target); + virtual ~pkgAcqDiffIndex(); private: APT_HIDDEN void QueueOnIMSHit() const; }; @@ -751,6 +753,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target, DiffInfo const &patch, std::vector const * const allPatches); + virtual ~pkgAcqIndexMergeDiffs(); }; /*}}}*/ /** \brief An item that is responsible for fetching server-merge patches {{{ @@ -864,6 +867,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target, std::vector const &diffs=std::vector()); + virtual ~pkgAcqIndexDiffs(); }; /*}}}*/ /** \brief An acquire item that is responsible for fetching an index {{{ @@ -940,8 +944,10 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target); + virtual ~pkgAcqIndex(); - void Init(std::string const &URI, std::string const &URIDesc, + private: + APT_HIDDEN void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc); }; /*}}}*/ @@ -1030,6 +1036,7 @@ class pkgAcqArchive : public pkgAcquire::Item pkgAcqArchive(pkgAcquire * const Owner,pkgSourceList * const Sources, pkgRecords * const Recs,pkgCache::VerIterator const &Version, std::string &StoreFilename); + virtual ~pkgAcqArchive(); }; /*}}}*/ /** \brief Retrieve the changelog for the given version {{{ @@ -1211,6 +1218,7 @@ class pkgAcqFile : public pkgAcquire::Item std::string const &Desc, std::string const &ShortDesc, std::string const &DestDir="", std::string const &DestFilename="", bool const IsIndexFile=false); + virtual ~pkgAcqFile(); }; /*}}}*/ /** @} */ diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index a8fc75f8e..d3aff4d5e 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -478,5 +478,9 @@ void pkgAcqMethod::Dequeue() { /*{{{*/ delete Tmp; } /*}}}*/ - pkgAcqMethod::~pkgAcqMethod() {} + +pkgAcqMethod::FetchItem::FetchItem() {} +pkgAcqMethod::FetchItem::~FetchItem() {} + +pkgAcqMethod::FetchResult::~FetchResult() {} diff --git a/apt-pkg/acquire-method.h b/apt-pkg/acquire-method.h index 6480eb4b5..f6659ef1f 100644 --- a/apt-pkg/acquire-method.h +++ b/apt-pkg/acquire-method.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-method.h,v 1.15.2.1 2003/12/24 23:09:17 mdz Exp $ /* ###################################################################### Acquire Method - Method helper class + functions @@ -53,6 +52,11 @@ class pkgAcqMethod // for when we know it or a arbitrary limit when we don't know the // filesize (like a InRelease file) unsigned long long MaximumSize; + + FetchItem(); + virtual ~FetchItem(); + private: + void *d; }; struct FetchResult @@ -67,6 +71,9 @@ class pkgAcqMethod void TakeHashes(class Hashes &Hash); FetchResult(); + virtual ~FetchResult(); + private: + void *d; }; // State diff --git a/apt-pkg/acquire-worker.h b/apt-pkg/acquire-worker.h index 3a3ef706d..b8e8fefed 100644 --- a/apt-pkg/acquire-worker.h +++ b/apt-pkg/acquire-worker.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire-worker.h,v 1.12 2001/02/20 07:03:17 jgg Exp $ /* ###################################################################### Acquire Worker - Worker process manager diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 5e5bec95c..75df858a8 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -1143,6 +1143,15 @@ void pkgAcquireStatus::Fetched(unsigned long long Size,unsigned long long Resume } /*}}}*/ +pkgAcquire::UriIterator::UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), CurItem(0) +{ + while (CurItem == 0 && CurQ != 0) + { + CurItem = CurQ->Items; + CurQ = CurQ->Next; + } +} + APT_CONST pkgAcquire::UriIterator::~UriIterator() {} APT_CONST pkgAcquire::MethodConfig::~MethodConfig() {} APT_CONST pkgAcquireStatus::~pkgAcquireStatus() {} diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index 02031dafd..b7e6c68f1 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acquire.h,v 1.29.2.1 2003/12/24 23:09:17 mdz Exp $ /* ###################################################################### Acquire - File Acquiration @@ -626,14 +625,7 @@ class pkgAcquire::UriIterator * * \param Q The queue over which this UriIterator should iterate. */ - UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), CurItem(0) - { - while (CurItem == 0 && CurQ != 0) - { - CurItem = CurQ->Items; - CurQ = CurQ->Next; - } - } + UriIterator(pkgAcquire::Queue *Q); virtual ~UriIterator(); }; /*}}}*/ diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index 2ac28c0d7..dab844220 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: algorithms.h,v 1.10 2001/05/22 04:17:41 jgg Exp $ /* ###################################################################### Algorithms - A set of misc algorithms @@ -55,6 +54,7 @@ using std::ostream; class pkgSimulate : public pkgPackageManager /*{{{*/ { + void *d; protected: class Policy : public pkgDepCache::Policy @@ -88,7 +88,7 @@ private: public: pkgSimulate(pkgDepCache *Cache); - ~pkgSimulate(); + virtual ~pkgSimulate(); }; /*}}}*/ class pkgProblemResolver /*{{{*/ @@ -156,7 +156,7 @@ class pkgProblemResolver /*{{{*/ APT_DEPRECATED void InstallProtect(); pkgProblemResolver(pkgDepCache *Cache); - ~pkgProblemResolver(); + virtual ~pkgProblemResolver(); }; /*}}}*/ bool pkgApplyStatus(pkgDepCache &Cache); diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h index c7b8d2d73..353843c3e 100644 --- a/apt-pkg/aptconfiguration.h +++ b/apt-pkg/aptconfiguration.h @@ -16,8 +16,7 @@ #include /*}}}*/ namespace APT { -class Configuration { /*{{{*/ -public: /*{{{*/ +namespace Configuration { /*{{{*/ /** \brief Returns a vector of usable Compression Types * * Files can be compressed in various ways to decrease the size of the @@ -39,7 +38,7 @@ public: /*{{{*/ * * \return a vector of the compression types in the preferred usage order */ - std::vector static const getCompressionTypes(bool const &Cached = true); + std::vector const getCompressionTypes(bool const &Cached = true); /** \brief Returns a vector of Language Codes * @@ -64,7 +63,7 @@ public: /*{{{*/ * * \return a vector of (all) Language Codes in the preferred usage order */ - std::vector static const getLanguages(bool const &All = false, + std::vector const getLanguages(bool const &All = false, bool const &Cached = true, char const ** const Locale = 0); /** \brief Are we interested in the given Language? @@ -73,7 +72,7 @@ public: /*{{{*/ * \param All defines if we check against all codes or only against used codes * \return true if we are interested, false otherwise */ - bool static checkLanguage(std::string Lang, bool const All = false); + bool checkLanguage(std::string Lang, bool const All = false); /** \brief Returns a vector of Architectures we support * @@ -82,14 +81,14 @@ public: /*{{{*/ * * \return a vector of Architectures in preferred order */ - std::vector static const getArchitectures(bool const &Cached = true); + std::vector const getArchitectures(bool const &Cached = true); /** \brief Are we interested in the given Architecture? * * \param Arch we want to check * \return true if we are interested, false otherwise */ - bool static checkArchitecture(std::string const &Arch); + bool checkArchitecture(std::string const &Arch); /** \brief Representation of supported compressors */ struct Compressor { @@ -113,15 +112,15 @@ public: /*{{{*/ * * \return a vector of Compressors */ - std::vector static const getCompressors(bool const Cached = true); + std::vector const getCompressors(bool const Cached = true); /** \brief Return a vector of extensions supported for data.tar's */ - std::vector static const getCompressorExtensions(); + std::vector const getCompressorExtensions(); /** \return Return a vector of enabled build profile specifications */ - std::vector static const getBuildProfiles(); + std::vector const getBuildProfiles(); /** \return Return a comma-separated list of enabled build profile specifications */ - std::string static const getBuildProfilesString(); + std::string const getBuildProfilesString(); /*}}}*/ }; /*}}}*/ diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h index 36b20893a..74a092593 100644 --- a/apt-pkg/cachefile.h +++ b/apt-pkg/cachefile.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: cachefile.h,v 1.5 2002/04/27 04:28:04 jgg Exp $ /* ###################################################################### CacheFile - Simple wrapper class for opening, generating and whatnot diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index 0ad99713a..c42f76112 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -37,7 +37,6 @@ #include /*}}}*/ namespace APT { - // PackageFrom - selecting the appropriate method for package selection /*{{{*/ bool CacheSetHelper::PackageFrom(enum PkgSelector const select, PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern) { @@ -812,4 +811,18 @@ APT_CONST void CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const & bool const /*verIsRel*/) { } /*}}}*/ + +CacheSetHelper::CacheSetHelper(bool const ShowError, GlobalError::MsgType ErrorType) : + ShowError(ShowError), ErrorType(ErrorType) {} +CacheSetHelper::~CacheSetHelper() {} + +PackageContainerInterface::PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN) {} +PackageContainerInterface::PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by) {} +PackageContainerInterface::~PackageContainerInterface() {} + +PackageUniverse::PackageUniverse(pkgCache * const Owner) : _cont(Owner) { } +PackageUniverse::~PackageUniverse() {} + +VersionContainerInterface::VersionContainerInterface() {} +VersionContainerInterface::~VersionContainerInterface() {} } diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 97aee8c2d..1a6feb5f7 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -50,9 +50,8 @@ class CacheSetHelper { /*{{{*/ */ public: /*{{{*/ CacheSetHelper(bool const ShowError = true, - GlobalError::MsgType ErrorType = GlobalError::ERROR) : - ShowError(ShowError), ErrorType(ErrorType) {} - virtual ~CacheSetHelper() {} + GlobalError::MsgType ErrorType = GlobalError::ERROR); + virtual ~CacheSetHelper(); enum PkgSelector { UNKNOWN, REGEX, TASK, FNMATCH, PACKAGENAME, STRING }; @@ -203,6 +202,8 @@ protected: bool PackageFromFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern); bool PackageFromPackageName(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern); bool PackageFromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern); +private: + void *d; }; /*}}}*/ class PackageContainerInterface { /*{{{*/ @@ -263,8 +264,9 @@ APT_IGNORE_DEPRECATED_POP void setConstructor(CacheSetHelper::PkgSelector const by) { ConstructedBy = by; } CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; } - PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN) {} - PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by) {} + PackageContainerInterface(); + PackageContainerInterface(CacheSetHelper::PkgSelector const by); + virtual ~PackageContainerInterface(); APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) { return helper.PackageFrom(CacheSetHelper::TASK, pci, Cache, pattern); } @@ -292,6 +294,7 @@ APT_IGNORE_DEPRECATED_POP private: CacheSetHelper::PkgSelector ConstructedBy; + void *d; }; /*}}}*/ template class PackageContainer : public PackageContainerInterface {/*{{{*/ @@ -355,7 +358,7 @@ public: /*{{{*/ iterator end() { return iterator(_cont.end()); } const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); } - PackageContainer() : PackageContainerInterface() {} + PackageContainer() : PackageContainerInterface(CacheSetHelper::UNKNOWN) {} PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {} APT_IGNORE_DEPRECATED_PUSH APT_DEPRECATED PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {} @@ -552,6 +555,7 @@ template<> template inline bool PackageContainerPkgBegin(); } APT_PUBLIC iterator end() { return _cont->PkgEnd(); } - APT_PUBLIC PackageUniverse(pkgCache * const Owner) : _cont(Owner) { } + APT_PUBLIC PackageUniverse(pkgCache * const Owner); + APT_PUBLIC virtual ~PackageUniverse(); private: bool insert(pkgCache::PkgIterator const &) { return true; } @@ -701,6 +706,11 @@ APT_IGNORE_DEPRECATED_PUSH } APT_IGNORE_DEPRECATED_POP + VersionContainerInterface(); + virtual ~VersionContainerInterface(); +private: + void *d; + protected: /*{{{*/ /** \brief returns the candidate version of the package diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 8cec4b78e..de5cd0657 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -1022,3 +1022,9 @@ pkgUdevCdromDevices::~pkgUdevCdromDevices() /*{{{*/ dlclose(libudev_handle); } /*}}}*/ + +pkgCdromStatus::pkgCdromStatus() : totalSteps(0) {} +pkgCdromStatus::~pkgCdromStatus() {} + +pkgCdrom::pkgCdrom() {} +pkgCdrom::~pkgCdrom() {} diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h index bd0902176..5626b5059 100644 --- a/apt-pkg/cdrom.h +++ b/apt-pkg/cdrom.h @@ -18,12 +18,13 @@ class OpProgress; class pkgCdromStatus /*{{{*/ { + void *d; protected: int totalSteps; public: - pkgCdromStatus() : totalSteps(0) {}; - virtual ~pkgCdromStatus() {}; + pkgCdromStatus(); + virtual ~pkgCdromStatus(); // total steps virtual void SetTotal(int total) { totalSteps = total; }; @@ -74,7 +75,12 @@ class pkgCdrom /*{{{*/ bool Ident(std::string &ident, pkgCdromStatus *log); bool Add(pkgCdromStatus *log); + pkgCdrom(); + virtual ~pkgCdrom(); + private: + void *d; + APT_HIDDEN bool MountAndIdentCDROM(Configuration &Database, std::string &CDROM, std::string &ident, pkgCdromStatus * const log, bool const interactive); APT_HIDDEN bool UnmountCDROM(std::string const &CDROM, pkgCdromStatus * const log); @@ -92,6 +98,7 @@ struct CdromDevice /*{{{*/ /*}}}*/ class pkgUdevCdromDevices /*{{{*/ { + void *d; protected: // libudev dlopen structure void *libudev_handle; diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc index 0fca60ba9..d05ae83b9 100644 --- a/apt-pkg/clean.cc +++ b/apt-pkg/clean.cc @@ -132,4 +132,5 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache) } /*}}}*/ +pkgArchiveCleaner::pkgArchiveCleaner() {} APT_CONST pkgArchiveCleaner::~pkgArchiveCleaner() {} diff --git a/apt-pkg/clean.h b/apt-pkg/clean.h index 466cb67a9..a1495702b 100644 --- a/apt-pkg/clean.h +++ b/apt-pkg/clean.h @@ -30,6 +30,8 @@ class pkgArchiveCleaner public: bool Go(std::string Dir,pkgCache &Cache); + + pkgArchiveCleaner(); virtual ~pkgArchiveCleaner(); }; diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 944cbe0bf..0fffa52b0 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -576,3 +576,4 @@ debTranslationsIndex::~debTranslationsIndex() {} debSourcesIndex::~debSourcesIndex() {} debDebPkgFileIndex::~debDebPkgFileIndex() {} +debDscFileIndex::~debDscFileIndex() {} diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 6b8c78e5a..6285a9e5c 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: debindexfile.h,v 1.3.2.1 2003/12/24 23:09:17 mdz Exp $ /* ###################################################################### Debian Index Files @@ -30,6 +29,7 @@ class pkgCacheGenerator; class APT_HIDDEN debStatusIndex : public pkgIndexFile { + void *d; protected: std::string File; @@ -53,6 +53,7 @@ class APT_HIDDEN debStatusIndex : public pkgIndexFile class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile { + void *d; public: virtual const Type *GetType() const APT_CONST; @@ -71,6 +72,7 @@ class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile { + void *d; public: virtual const Type *GetType() const APT_CONST; @@ -86,6 +88,7 @@ class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile { + void *d; public: virtual const Type *GetType() const APT_CONST; @@ -145,6 +148,7 @@ class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile class APT_HIDDEN debDscFileIndex : public pkgIndexFile { private: + void *d; std::string DscFile; public: virtual const Type *GetType() const APT_CONST; @@ -157,7 +161,7 @@ class APT_HIDDEN debDscFileIndex : public pkgIndexFile }; debDscFileIndex(std::string &DscFile); - virtual ~debDscFileIndex() {}; + virtual ~debDscFileIndex(); }; class APT_HIDDEN debDebianSourceDirIndex : public debDscFileIndex diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index b328fcea8..34fc98838 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -459,6 +459,8 @@ pkgCache::RlsFileIterator debReleaseIndex::FindInCache(pkgCache &Cache, bool con } /*}}}*/ +debDebFileMetaIndex::~debDebFileMetaIndex() {} + class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type { protected: diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index b448ecc53..f2706e08a 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -75,6 +75,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { class APT_HIDDEN debDebFileMetaIndex : public metaIndex { private: + void *d; std::string DebFile; debDebPkgFileIndex *DebIndex; public: @@ -94,7 +95,7 @@ class APT_HIDDEN debDebFileMetaIndex : public metaIndex return true; } debDebFileMetaIndex(std::string const &DebFile); - virtual ~debDebFileMetaIndex() {}; + virtual ~debDebFileMetaIndex(); }; diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index 335bcfda0..f527042e4 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -51,6 +51,7 @@ bool debRecordParser::Jump(pkgCache::DescFileIterator const &Desc) /*}}}*/ debRecordParser::~debRecordParser() {} +debRecordParserBase::debRecordParserBase() : Parser() {} // RecordParserBase::FileName - Return the archive filename on the site /*{{{*/ string debRecordParserBase::FileName() { @@ -207,3 +208,9 @@ bool debDebFileRecordParser::LoadContent() return _error->Error(_("Unable to parse package file %s (%d)"), debFileName.c_str(), 3); return true; } +bool debDebFileRecordParser::Jump(pkgCache::VerFileIterator const &) { return LoadContent(); } +bool debDebFileRecordParser::Jump(pkgCache::DescFileIterator const &) { return LoadContent(); } +std::string debDebFileRecordParser::FileName() { return debFileName; } + +debDebFileRecordParser::debDebFileRecordParser(std::string FileName) : debRecordParserBase(), debFileName(FileName) {} +debDebFileRecordParser::~debDebFileRecordParser() {} diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h index 38e071940..8efcec8cd 100644 --- a/apt-pkg/deb/debrecords.h +++ b/apt-pkg/deb/debrecords.h @@ -27,6 +27,7 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser { + void *d; protected: pkgTagSection Section; @@ -50,12 +51,13 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser virtual void GetRec(const char *&Start,const char *&Stop); - debRecordParserBase() : Parser() {} + debRecordParserBase(); virtual ~debRecordParserBase(); }; class APT_HIDDEN debRecordParser : public debRecordParserBase { + void *d; protected: FileFd File; pkgTagFile Tags; @@ -71,20 +73,21 @@ class APT_HIDDEN debRecordParser : public debRecordParserBase // custom record parser that reads deb files directly class APT_HIDDEN debDebFileRecordParser : public debRecordParserBase { + void *d; std::string debFileName; std::string controlContent; APT_HIDDEN bool LoadContent(); protected: // single file files, so no jumping whatsoever - bool Jump(pkgCache::VerFileIterator const &) { return LoadContent(); } - bool Jump(pkgCache::DescFileIterator const &) { return LoadContent(); } + bool Jump(pkgCache::VerFileIterator const &); + bool Jump(pkgCache::DescFileIterator const &); public: - virtual std::string FileName() { return debFileName; } + virtual std::string FileName(); - debDebFileRecordParser(std::string FileName) - : debRecordParserBase(), debFileName(FileName) {}; + debDebFileRecordParser(std::string FileName); + virtual ~debDebFileRecordParser(); }; #endif diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index ca6d09896..21a4ff8ea 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -32,6 +32,10 @@ using std::max; using std::string; +debSrcRecordParser::debSrcRecordParser(std::string const &File,pkgIndexFile const *Index) + : Parser(Index), Fd(File,FileFd::ReadOnly, FileFd::Extension), Tags(&Fd,102400), + iOffset(0), Buffer(NULL) {} + // SrcRecordParser::Binaries - Return the binaries field /*{{{*/ // --------------------------------------------------------------------- /* This member parses the binaries field into a pair of class arrays and diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h index cd246d624..7aeb2db88 100644 --- a/apt-pkg/deb/debsrcrecords.h +++ b/apt-pkg/deb/debsrcrecords.h @@ -56,9 +56,7 @@ class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser virtual bool Files(std::vector &F); bool Files2(std::vector &F); - debSrcRecordParser(std::string const &File,pkgIndexFile const *Index) - : Parser(Index), Fd(File,FileFd::ReadOnly, FileFd::Extension), Tags(&Fd,102400), - iOffset(0), Buffer(NULL) {} + debSrcRecordParser(std::string const &File,pkgIndexFile const *Index); virtual ~debSrcRecordParser(); }; diff --git a/apt-pkg/deb/debversion.h b/apt-pkg/deb/debversion.h index 434ff4a2e..7befe6372 100644 --- a/apt-pkg/deb/debversion.h +++ b/apt-pkg/deb/debversion.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: debversion.h,v 1.3 2001/05/03 05:25:04 jgg Exp $ /* ###################################################################### Debian Version - Versioning system for Debian diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 20d263c67..94c1088f2 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -1,6 +1,5 @@ // -*- mode: c++; mode: fold -*- // Description /*{{{*/ -// $Id: depcache.h,v 1.14 2001/02/20 07:03:17 jgg Exp $ /* ###################################################################### DepCache - Dependency Extension data for the cache @@ -164,6 +163,7 @@ class pkgDepCache : protected pkgCache::Namespace */ class ActionGroup { + void *d; pkgDepCache &cache; bool released; @@ -192,7 +192,7 @@ class pkgDepCache : protected pkgCache::Namespace * If this is the last action group, the automatic cache * cleanup operations will be undertaken. */ - ~ActionGroup(); + virtual ~ActionGroup(); }; /** \brief Returns \b true for packages matching a regular @@ -503,6 +503,8 @@ class pkgDepCache : protected pkgCache::Namespace bool const rPurge, unsigned long const Depth, bool const FromUser); private: + void *d; + APT_HIDDEN bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, unsigned long const Depth, bool const FromUser); }; diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 41cc2cdfe..25d53747c 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -39,60 +39,15 @@ using std::string; // we could use pkgCache::DepType and ::Priority, but these would be localized strings… -const char * const EDSP::PrioMap[] = {0, "important", "required", "standard", +const char * const PrioMap[] = {0, "important", "required", "standard", "optional", "extra"}; -const char * const EDSP::DepMap[] = {"", "Depends", "Pre-Depends", "Suggests", +const char * const DepMap[] = {"", "Depends", "Pre-Depends", "Suggests", "Recommends" , "Conflicts", "Replaces", "Obsoletes", "Breaks", "Enhances"}; -// EDSP::WriteScenario - to the given file descriptor /*{{{*/ -bool EDSP::WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress) -{ - if (Progress != NULL) - Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver")); - unsigned long p = 0; - std::vector archs = APT::Configuration::getArchitectures(); - for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg) - { - std::string const arch = Pkg.Arch(); - if (std::find(archs.begin(), archs.end(), arch) == archs.end()) - continue; - for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver, ++p) - { - WriteScenarioVersion(Cache, output, Pkg, Ver); - WriteScenarioDependency(output, Ver); - fprintf(output, "\n"); - if (Progress != NULL && p % 100 == 0) - Progress->Progress(p); - } - } - return true; -} - /*}}}*/ -// EDSP::WriteLimitedScenario - to the given file descriptor /*{{{*/ -bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FILE* output, - APT::PackageSet const &pkgset, - OpProgress *Progress) -{ - if (Progress != NULL) - Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver")); - unsigned long p = 0; - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg, ++p) - for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver) - { - WriteScenarioVersion(Cache, output, Pkg, Ver); - WriteScenarioLimitedDependency(output, Ver, pkgset); - fprintf(output, "\n"); - if (Progress != NULL && p % 100 == 0) - Progress->Progress(p); - } - if (Progress != NULL) - Progress->Done(); - return true; -} - /*}}}*/ -// EDSP::WriteScenarioVersion /*{{{*/ -void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgIterator const &Pkg, + +// WriteScenarioVersion /*{{{*/ +static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const &Ver) { fprintf(output, "Package: %s\n", Pkg.Name()); @@ -147,8 +102,8 @@ void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgI fprintf(output, "APT-Automatic: yes\n"); } /*}}}*/ -// EDSP::WriteScenarioDependency /*{{{*/ -void EDSP::WriteScenarioDependency( FILE* output, pkgCache::VerIterator const &Ver) +// WriteScenarioDependency /*{{{*/ +static void WriteScenarioDependency( FILE* output, pkgCache::VerIterator const &Ver) { std::string dependencies[pkgCache::Dep::Enhances + 1]; bool orGroup = false; @@ -183,8 +138,8 @@ void EDSP::WriteScenarioDependency( FILE* output, pkgCache::VerIterator const &V fprintf(output, "Provides: %s\n", provides.c_str()+2); } /*}}}*/ -// EDSP::WriteScenarioLimitedDependency /*{{{*/ -void EDSP::WriteScenarioLimitedDependency(FILE* output, +// WriteScenarioLimitedDependency /*{{{*/ +static void WriteScenarioLimitedDependency(FILE* output, pkgCache::VerIterator const &Ver, APT::PackageSet const &pkgset) { @@ -235,6 +190,52 @@ void EDSP::WriteScenarioLimitedDependency(FILE* output, fprintf(output, "Provides: %s\n", provides.c_str()+2); } /*}}}*/ +// EDSP::WriteScenario - to the given file descriptor /*{{{*/ +bool EDSP::WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress) +{ + if (Progress != NULL) + Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver")); + unsigned long p = 0; + std::vector archs = APT::Configuration::getArchitectures(); + for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg) + { + std::string const arch = Pkg.Arch(); + if (std::find(archs.begin(), archs.end(), arch) == archs.end()) + continue; + for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver, ++p) + { + WriteScenarioVersion(Cache, output, Pkg, Ver); + WriteScenarioDependency(output, Ver); + fprintf(output, "\n"); + if (Progress != NULL && p % 100 == 0) + Progress->Progress(p); + } + } + return true; +} + /*}}}*/ +// EDSP::WriteLimitedScenario - to the given file descriptor /*{{{*/ +bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FILE* output, + APT::PackageSet const &pkgset, + OpProgress *Progress) +{ + if (Progress != NULL) + Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver")); + unsigned long p = 0; + for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg, ++p) + for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver) + { + WriteScenarioVersion(Cache, output, Pkg, Ver); + WriteScenarioLimitedDependency(output, Ver, pkgset); + fprintf(output, "\n"); + if (Progress != NULL && p % 100 == 0) + Progress->Progress(p); + } + if (Progress != NULL) + Progress->Done(); + return true; +} + /*}}}*/ // EDSP::WriteRequest - to the given file descriptor /*{{{*/ bool EDSP::WriteRequest(pkgDepCache &Cache, FILE* output, bool const Upgrade, bool const DistUpgrade, bool const AutoRemove, @@ -365,13 +366,13 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progres return true; } /*}}}*/ -// EDSP::ReadLine - first line from the given file descriptor /*{{{*/ +// ReadLine - first line from the given file descriptor /*{{{*/ // --------------------------------------------------------------------- /* Little helper method to read a complete line into a string. Similar to fgets but we need to use the low-level read() here as otherwise the listparser will be confused later on as mixing of fgets and read isn't a supported action according to the manpages and results are undefined */ -bool EDSP::ReadLine(int const input, std::string &line) { +static bool ReadLine(int const input, std::string &line) { char one; ssize_t data = 0; line.erase(); @@ -390,11 +391,11 @@ bool EDSP::ReadLine(int const input, std::string &line) { return false; } /*}}}*/ -// EDSP::StringToBool - convert yes/no to bool /*{{{*/ +// StringToBool - convert yes/no to bool /*{{{*/ // --------------------------------------------------------------------- /* we are not as lazy as we are in the global StringToBool as we really only accept yes/no here - but we will ignore leading spaces */ -bool EDSP::StringToBool(char const *answer, bool const defValue) { +static bool StringToBool(char const *answer, bool const defValue) { for (; isspace(*answer) != 0; ++answer); if (strncasecmp(answer, "yes", 3) == 0) return true; @@ -443,11 +444,11 @@ bool EDSP::ReadRequest(int const input, std::list &install, request = &remove; } else if (line.compare(0, 8, "Upgrade:") == 0) - upgrade = EDSP::StringToBool(line.c_str() + 9, false); + upgrade = StringToBool(line.c_str() + 9, false); else if (line.compare(0, 13, "Dist-Upgrade:") == 0) - distUpgrade = EDSP::StringToBool(line.c_str() + 14, false); + distUpgrade = StringToBool(line.c_str() + 14, false); else if (line.compare(0, 11, "Autoremove:") == 0) - autoRemove = EDSP::StringToBool(line.c_str() + 12, false); + autoRemove = StringToBool(line.c_str() + 12, false); else if (line.compare(0, 13, "Architecture:") == 0) _config->Set("APT::Architecture", line.c_str() + 14); else if (line.compare(0, 14, "Architectures:") == 0) diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index 9e833556a..72b886a31 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -27,24 +27,8 @@ class pkgDepCache; class OpProgress; -class EDSP /*{{{*/ +namespace EDSP /*{{{*/ { - // we could use pkgCache::DepType and ::Priority, but these would be localized strings… - static const char * const PrioMap[]; - static const char * const DepMap[]; - - APT_HIDDEN bool static ReadLine(int const input, std::string &line); - APT_HIDDEN bool static StringToBool(char const *answer, bool const defValue); - - APT_HIDDEN void static WriteScenarioVersion(pkgDepCache &Cache, FILE* output, - pkgCache::PkgIterator const &Pkg, - pkgCache::VerIterator const &Ver); - APT_HIDDEN void static WriteScenarioDependency(FILE* output, - pkgCache::VerIterator const &Ver); - APT_HIDDEN void static WriteScenarioLimitedDependency(FILE* output, - pkgCache::VerIterator const &Ver, - APT::PackageSet const &pkgset); -public: /** \brief creates the EDSP request stanza * * In the EDSP protocol the first thing send to the resolver is a stanza @@ -61,7 +45,7 @@ public: * * \return true if request was composed successfully, otherwise false */ - bool static WriteRequest(pkgDepCache &Cache, FILE* output, + bool WriteRequest(pkgDepCache &Cache, FILE* output, bool const upgrade = false, bool const distUpgrade = false, bool const autoRemove = false, @@ -84,7 +68,7 @@ public: * * \return true if universe was composed successfully, otherwise false */ - bool static WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL); + bool WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL); /** \brief creates a limited scenario representing the package universe * @@ -101,7 +85,7 @@ public: * * \return true if universe was composed successfully, otherwise false */ - bool static WriteLimitedScenario(pkgDepCache &Cache, FILE* output, + bool WriteLimitedScenario(pkgDepCache &Cache, FILE* output, APT::PackageSet const &pkgset, OpProgress *Progress = NULL); @@ -118,7 +102,7 @@ public: * * \return true if a solution is found and applied correctly, otherwise false */ - bool static ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL); + bool ReadResponse(int const input, pkgDepCache &Cache, OpProgress *Progress = NULL); /** \brief search and read the request stanza for action later * @@ -136,7 +120,7 @@ public: * * \return true if the request could be found and worked on, otherwise false */ - bool static ReadRequest(int const input, std::list &install, + bool ReadRequest(int const input, std::list &install, std::list &remove, bool &upgrade, bool &distUpgrade, bool &autoRemove); @@ -152,7 +136,7 @@ public: * * \return false if the request couldn't be applied, true otherwise */ - bool static ApplyRequest(std::list const &install, + bool ApplyRequest(std::list const &install, std::list const &remove, pkgDepCache &Cache); @@ -168,7 +152,7 @@ public: * * \return true if solution could be written, otherwise false */ - bool static WriteSolution(pkgDepCache &Cache, FILE* output); + bool WriteSolution(pkgDepCache &Cache, FILE* output); /** \brief sends a progress report * @@ -176,7 +160,7 @@ public: * \param message the solver wants the user to see * \param output the front-end listens for progress report */ - bool static WriteProgress(unsigned short const percent, const char* const message, FILE* output); + bool WriteProgress(unsigned short const percent, const char* const message, FILE* output); /** \brief sends an error report * @@ -193,7 +177,7 @@ public: * \param message is free form text to describe the error * \param output the front-end listens for error messages */ - bool static WriteError(char const * const uuid, std::string const &message, FILE* output); + bool WriteError(char const * const uuid, std::string const &message, FILE* output); /** \brief executes the given solver and returns the pipe ends @@ -207,8 +191,8 @@ public: * * \return PID of the started solver or 0 if failure occurred */ - pid_t static ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool /*overload*/); - APT_DEPRECATED bool static ExecuteSolver(const char* const solver, int *solver_in, int *solver_out); + pid_t ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool /*overload*/); + APT_DEPRECATED bool ExecuteSolver(const char* const solver, int *solver_in, int *solver_out); /** \brief call an external resolver to handle the request * @@ -224,7 +208,7 @@ public: * \return true if the solver has successfully solved the problem, * otherwise false */ - bool static ResolveExternal(const char* const solver, pkgDepCache &Cache, + bool ResolveExternal(const char* const solver, pkgDepCache &Cache, bool const upgrade, bool const distUpgrade, bool const autoRemove, OpProgress *Progress = NULL); }; diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index a2ec0a19b..5d9383e94 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -81,3 +81,5 @@ const pkgIndexFile::Type *edspIndex::GetType() const return &_apt_Universe; } /*}}}*/ + +edspIndex::~edspIndex() {} diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h index 8c18d8cbd..0f63b7b2a 100644 --- a/apt-pkg/edsp/edspindexfile.h +++ b/apt-pkg/edsp/edspindexfile.h @@ -30,6 +30,7 @@ class APT_HIDDEN edspIndex : public debStatusIndex virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; edspIndex(std::string File); + virtual ~edspIndex(); }; #endif diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index d62abe709..d1c0cf7e8 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -92,3 +92,5 @@ APT_CONST bool edspListParser::LoadReleaseInfo(pkgCache::RlsFileIterator & /*Fil return true; } /*}}}*/ + +edspListParser::~edspListParser() {} diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index abe2ef139..ef5179e68 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -27,6 +27,7 @@ class FileFd; class APT_HIDDEN edspListParser : public debListParser { + void *d; public: virtual bool NewVersion(pkgCache::VerIterator &Ver); virtual std::string Description(); @@ -38,6 +39,7 @@ class APT_HIDDEN edspListParser : public debListParser std::string const §ion); edspListParser(FileFd *File, std::string const &Arch = ""); + virtual ~edspListParser(); protected: virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver); diff --git a/apt-pkg/edsp/edspsystem.h b/apt-pkg/edsp/edspsystem.h index 06a63f40c..1e27d2cb0 100644 --- a/apt-pkg/edsp/edspsystem.h +++ b/apt-pkg/edsp/edspsystem.h @@ -42,7 +42,7 @@ class APT_HIDDEN edspSystem : public pkgSystem pkgIndexFile *&Found) const; edspSystem(); - ~edspSystem(); + virtual ~edspSystem(); }; #endif diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 461aa4217..120d061ad 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -770,4 +770,14 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ } /*}}}*/ +IndexCopy::IndexCopy() {} APT_CONST IndexCopy::~IndexCopy() {} + +PackageCopy::PackageCopy() : IndexCopy() {} +APT_CONST PackageCopy::~PackageCopy() {} +SourceCopy::SourceCopy() : IndexCopy() {} +APT_CONST SourceCopy::~SourceCopy() {} +TranslationsCopy::TranslationsCopy() {} +APT_CONST TranslationsCopy::~TranslationsCopy() {} +SigVerify::SigVerify() {} +APT_CONST SigVerify::~SigVerify() {} diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index 729b0c8cb..7ee162542 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: indexcopy.h,v 1.3 2001/05/27 04:46:54 jgg Exp $ /* ###################################################################### Index Copying - Aid for copying and verifying the index files @@ -54,39 +53,52 @@ class IndexCopy /*{{{*/ bool CopyPackages(std::string CDROM,std::string Name,std::vector &List, pkgCdromStatus *log); + IndexCopy(); virtual ~IndexCopy(); }; /*}}}*/ class PackageCopy : public IndexCopy /*{{{*/ { + void *d; protected: - + virtual bool GetFile(std::string &Filename,unsigned long long &Size); virtual bool RewriteEntry(FileFd &Target, std::string const &File); virtual const char *GetFileName() {return "Packages";}; virtual const char *Type() {return "Package";}; - + + public: + PackageCopy(); + virtual ~PackageCopy(); }; /*}}}*/ class SourceCopy : public IndexCopy /*{{{*/ { + void *d; protected: virtual bool GetFile(std::string &Filename,unsigned long long &Size); virtual bool RewriteEntry(FileFd &Target, std::string const &File); virtual const char *GetFileName() {return "Sources";}; virtual const char *Type() {return "Source";}; - + + public: + SourceCopy(); + virtual ~SourceCopy(); }; /*}}}*/ class TranslationsCopy /*{{{*/ { + void *d; protected: pkgTagSection *Section; public: bool CopyTranslations(std::string CDROM,std::string Name,std::vector &List, pkgCdromStatus *log); + + TranslationsCopy(); + virtual ~TranslationsCopy(); }; /*}}}*/ class SigVerify /*{{{*/ @@ -106,6 +118,9 @@ class SigVerify /*{{{*/ int const &statusfd, int fd[2]); APT_DEPRECATED static bool RunGPGV(std::string const &File, std::string const &FileOut, int const &statusfd = -1); + + SigVerify(); + virtual ~SigVerify(); }; /*}}}*/ diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index 605bbeb47..b3c5cf229 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -227,3 +227,6 @@ bool pkgIndexTargetFile::Exists() const /*{{{*/ return FileExists(IndexFileName()); } /*}}}*/ + +APT_CONST pkgIndexFile::~pkgIndexFile() {} +APT_CONST pkgIndexTargetFile::~pkgIndexTargetFile() {} diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 042e5c2f7..c51879bb8 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: indexfile.h,v 1.6.2.1 2003/12/24 23:09:17 mdz Exp $ /* ###################################################################### Index File - Abstraction for an index of archive/source file. @@ -90,6 +89,7 @@ class IndexTarget /*{{{*/ class pkgIndexFile { + void *d; protected: bool Trusted; @@ -145,11 +145,12 @@ class pkgIndexFile bool IsTrusted() const { return Trusted; }; pkgIndexFile(bool Trusted); - virtual ~pkgIndexFile() {}; + virtual ~pkgIndexFile(); }; class pkgIndexTargetFile : public pkgIndexFile { + void *d; protected: IndexTarget const Target; @@ -162,6 +163,7 @@ public: virtual unsigned long Size() const; pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted); + virtual ~pkgIndexTargetFile(); }; #endif diff --git a/apt-pkg/indexrecords.h b/apt-pkg/indexrecords.h index 6ed5f0c2b..f7dfa3235 100644 --- a/apt-pkg/indexrecords.h +++ b/apt-pkg/indexrecords.h @@ -1,7 +1,4 @@ // -*- mode: cpp; mode: fold -*- -// Description /*{{{*/ -// $Id: indexrecords.h,v 1.1.2.1 2003/12/24 23:09:17 mdz Exp $ - /*}}}*/ #ifndef PKGLIB_INDEXRECORDS_H #define PKGLIB_INDEXRECORDS_H diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index 5ea8bf4d0..ee2ef683f 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -69,6 +69,7 @@ PackageManagerProgressFd::PackageManagerProgressFd(int progress_fd) { OutStatusFd = progress_fd; } +PackageManagerProgressFd::~PackageManagerProgressFd() {} void PackageManagerProgressFd::WriteToStatusFd(std::string s) { @@ -157,6 +158,7 @@ PackageManagerProgressDeb822Fd::PackageManagerProgressDeb822Fd(int progress_fd) { OutStatusFd = progress_fd; } +PackageManagerProgressDeb822Fd::~PackageManagerProgressDeb822Fd() {} void PackageManagerProgressDeb822Fd::WriteToStatusFd(std::string s) { @@ -433,6 +435,10 @@ bool PackageManagerText::StatusChanged(std::string PackageName, return true; } +PackageManagerText::PackageManagerText() : PackageManager() {} +PackageManagerText::~PackageManagerText() {} + + } // namespace progress diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h index d8b4a5c82..a4c5daf7f 100644 --- a/apt-pkg/install-progress.h +++ b/apt-pkg/install-progress.h @@ -61,6 +61,7 @@ namespace Progress { class PackageManagerProgressFd : public PackageManager { + void *d; protected: int OutStatusFd; int StepsDone; @@ -69,6 +70,7 @@ namespace Progress { public: PackageManagerProgressFd(int progress_fd); + virtual ~PackageManagerProgressFd(); virtual void StartDpkg(); virtual void Stop(); @@ -90,6 +92,7 @@ namespace Progress { class PackageManagerProgressDeb822Fd : public PackageManager { + void *d; protected: int OutStatusFd; int StepsDone; @@ -98,6 +101,7 @@ namespace Progress { public: PackageManagerProgressDeb822Fd(int progress_fd); + virtual ~PackageManagerProgressDeb822Fd(); virtual void StartDpkg(); virtual void Stop(); @@ -118,6 +122,7 @@ namespace Progress { class PackageManagerFancy : public PackageManager { + void *d; private: APT_HIDDEN static void staticSIGWINCH(int); static std::vector instances; @@ -138,7 +143,7 @@ namespace Progress { public: PackageManagerFancy(); - ~PackageManagerFancy(); + virtual ~PackageManagerFancy(); virtual void Start(int child_pty=-1); virtual void Stop(); virtual bool StatusChanged(std::string PackageName, @@ -153,11 +158,15 @@ namespace Progress { class PackageManagerText : public PackageManager { + void *d; public: virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, std::string HumanReadableAction); + + PackageManagerText(); + virtual ~PackageManagerText(); }; diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index e1810fb27..760c7dd15 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -28,6 +28,7 @@ class OpProgress; class metaIndex { + void *d; protected: std::vector *Indexes; const char *Type; diff --git a/apt-pkg/orderlist.h b/apt-pkg/orderlist.h index b8bad81b3..29ef79b84 100644 --- a/apt-pkg/orderlist.h +++ b/apt-pkg/orderlist.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: orderlist.h,v 1.9 2001/02/20 07:03:17 jgg Exp $ /* ###################################################################### Order List - Represents and Manipulates an ordered list of packages. @@ -25,6 +24,7 @@ class pkgDepCache; class pkgOrderList : protected pkgCache::Namespace { + void *d; protected: pkgDepCache &Cache; @@ -123,7 +123,7 @@ class pkgOrderList : protected pkgCache::Namespace int Score(PkgIterator Pkg); pkgOrderList(pkgDepCache *Cache); - ~pkgOrderList(); + virtual ~pkgOrderList(); }; #endif diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index fce0ad301..60414ae1c 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: packagemanager.h,v 1.14 2001/05/07 04:24:08 jgg Exp $ /* ###################################################################### Package Manager - Abstacts the package manager @@ -146,6 +145,7 @@ class pkgPackageManager : protected pkgCache::Namespace virtual ~pkgPackageManager(); private: + void *d; enum APT_HIDDEN SmartAction { UNPACK_IMMEDIATE, UNPACK, CONFIGURE }; APT_HIDDEN bool NonLoopingSmart(SmartAction const action, pkgCache::PkgIterator &Pkg, pkgCache::PkgIterator DepPkg, int const Depth, bool const PkgLoop, diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 9fe382108..dc7698edd 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -1059,3 +1059,5 @@ bool pkgCache::PrvIterator::IsMultiArchImplicit() const return false; } /*}}}*/ + +pkgCache::~pkgCache() {} diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 3cc85f1e8..b7bf26c2a 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -266,11 +266,12 @@ class pkgCache /*{{{*/ static const char *CompTypeDeb(unsigned char Comp) APT_CONST; static const char *CompType(unsigned char Comp) APT_CONST; static const char *DepType(unsigned char Dep); - + pkgCache(MMap *Map,bool DoMap = true); - virtual ~pkgCache() {} + virtual ~pkgCache(); private: + void *d; bool MultiArchEnabled; APT_HIDDEN PkgIterator SingleArchFindPkg(const std::string &Name); }; diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index ea0205944..54e2ef19c 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1720,3 +1720,6 @@ bool pkgCacheGenerator::FinishCache(OpProgress * /*Progress*/) return true; } /*}}}*/ + +pkgCacheGenerator::ListParser::ListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false) {} +pkgCacheGenerator::ListParser::~ListParser() {} diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index ade93795b..3c1a40972 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgcachegen.h,v 1.19 2002/07/08 03:13:30 jgg Exp $ /* ###################################################################### Package Cache Generator - Generator for the cache structure. @@ -123,9 +122,10 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ void ReMap(void const * const oldMap, void const * const newMap); pkgCacheGenerator(DynamicMMap *Map,OpProgress *Progress); - ~pkgCacheGenerator(); + virtual ~pkgCacheGenerator(); private: + void *d; APT_HIDDEN bool MergeListGroup(ListParser &List, std::string const &GrpName); APT_HIDDEN bool MergeListPackage(ListParser &List, pkgCache::PkgIterator &Pkg); APT_HIDDEN bool MergeListVersion(ListParser &List, pkgCache::PkgIterator &Pkg, @@ -151,7 +151,9 @@ class APT_HIDDEN pkgCacheGenerator::ListParser // Flag file dependencies bool FoundFileDeps; - + + void *d; + protected: inline map_stringitem_t StoreString(pkgCacheGenerator::StringType const type, std::string const &S) {return Owner->StoreString(type, S);}; @@ -182,10 +184,7 @@ class APT_HIDDEN pkgCacheGenerator::ListParser * \param Hash of the currently parsed version * \param Ver to compare with */ -#if APT_PKG_ABI >= 413 - virtual -#endif - APT_PURE bool SameVersion(unsigned short const Hash, pkgCache::VerIterator const &Ver); + virtual bool SameVersion(unsigned short const Hash, pkgCache::VerIterator const &Ver); virtual bool UsePackage(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver) = 0; virtual map_filesize_t Offset() = 0; @@ -197,8 +196,8 @@ class APT_HIDDEN pkgCacheGenerator::ListParser virtual bool CollectFileProvides(pkgCache &/*Cache*/, pkgCache::VerIterator &/*Ver*/) {return true;}; - ListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false) {}; - virtual ~ListParser() {}; + ListParser(); + virtual ~ListParser(); }; /*}}}*/ diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc index 859af3a09..87c965f87 100644 --- a/apt-pkg/pkgrecords.cc +++ b/apt-pkg/pkgrecords.cc @@ -76,3 +76,6 @@ pkgRecords::Parser &pkgRecords::Lookup(pkgCache::DescFileIterator const &Desc) return *Files[Desc.File()->ID]; } /*}}}*/ + +pkgRecords::Parser::Parser() {} +pkgRecords::Parser::~Parser() {} diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h index bcc05baba..66eb17857 100644 --- a/apt-pkg/pkgrecords.h +++ b/apt-pkg/pkgrecords.h @@ -43,7 +43,7 @@ class pkgRecords /*{{{*/ // Construct destruct pkgRecords(pkgCache &Cache); - ~pkgRecords(); + virtual ~pkgRecords(); }; /*}}}*/ class pkgRecords::Parser /*{{{*/ @@ -106,10 +106,12 @@ class pkgRecords::Parser /*{{{*/ // The record in binary form virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;}; - - virtual ~Parser() {}; + + Parser(); + virtual ~Parser(); private: + void *d; APT_HIDDEN std::string GetHashFromHashes(char const * const type) const { HashStringList const hashes = Hashes(); diff --git a/apt-pkg/pkgsystem.cc b/apt-pkg/pkgsystem.cc index 14d090c7a..98daeb2b9 100644 --- a/apt-pkg/pkgsystem.cc +++ b/apt-pkg/pkgsystem.cc @@ -45,3 +45,5 @@ APT_PURE pkgSystem *pkgSystem::GetSystem(const char *Label) return 0; } /*}}}*/ + +pkgSystem::~pkgSystem() {} diff --git a/apt-pkg/pkgsystem.h b/apt-pkg/pkgsystem.h index f88ffa7c8..3a447da8b 100644 --- a/apt-pkg/pkgsystem.h +++ b/apt-pkg/pkgsystem.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgsystem.h,v 1.6 2002/11/11 06:55:50 doogie Exp $ /* ###################################################################### System - Abstraction for running on different systems. @@ -93,7 +92,9 @@ class pkgSystem }; pkgSystem(); - virtual ~pkgSystem() {}; + virtual ~pkgSystem(); + private: + void *d; }; // The environment we are operating in. diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index bd40ad2d9..6da6ed606 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -439,3 +439,5 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) return true; } /*}}}*/ + +pkgPolicy::~pkgPolicy() {delete [] PFPriority; delete [] Pins;} diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index f15d8c0a0..c4b1cbadd 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: policy.h,v 1.4 2001/05/07 04:24:08 jgg Exp $ /* ###################################################################### Package Version Policy implementation @@ -85,7 +84,9 @@ class pkgPolicy : public pkgDepCache::Policy bool InitDefaults(); pkgPolicy(pkgCache *Owner); - virtual ~pkgPolicy() {delete [] PFPriority; delete [] Pins;}; + virtual ~pkgPolicy(); + private: + void *d; }; bool ReadPinFile(pkgPolicy &Plcy, std::string File = ""); diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index 998357509..c92643829 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: sourcelist.h,v 1.12.2.1 2003/12/24 23:09:17 mdz Exp $ /* ###################################################################### SourceList - Manage a list of sources @@ -54,6 +53,7 @@ class metaIndex; class pkgSourceList { + void *d; public: // List of supported source list types @@ -118,7 +118,7 @@ class pkgSourceList pkgSourceList(); pkgSourceList(std::string File); - ~pkgSourceList(); + virtual ~pkgSourceList(); }; #endif diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h index c931e17b7..dda66ce48 100644 --- a/apt-pkg/srcrecords.h +++ b/apt-pkg/srcrecords.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: srcrecords.h,v 1.8.2.1 2003/12/26 16:27:34 mdz Exp $ /* ###################################################################### Source Package Records - Allows access to source package records diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 118954541..24eda02f7 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: tagfile.h,v 1.20 2003/05/19 17:13:57 doogie Exp $ /* ###################################################################### Fast scanner for RFC-822 type header information @@ -47,7 +46,6 @@ class pkgTagSection APT_DEPRECATED unsigned int TagCount; #endif - // dpointer placeholder (for later in case we need it) pkgTagSectionPrivate *d; protected: diff --git a/apt-pkg/version.cc b/apt-pkg/version.cc index 29bee46da..f32d39a69 100644 --- a/apt-pkg/version.cc +++ b/apt-pkg/version.cc @@ -40,3 +40,6 @@ pkgVersioningSystem *pkgVersioningSystem::GetVS(const char *Label) return 0; } /*}}}*/ + + +pkgVersioningSystem::~pkgVersioningSystem() {} diff --git a/apt-pkg/version.h b/apt-pkg/version.h index d98809f7e..5110ecaa7 100644 --- a/apt-pkg/version.h +++ b/apt-pkg/version.h @@ -55,7 +55,7 @@ class pkgVersioningSystem APT_MKSTRCMP(CmpReleaseVer,DoCmpReleaseVer); pkgVersioningSystem(); - virtual ~pkgVersioningSystem() {}; + virtual ~pkgVersioningSystem(); }; #endif diff --git a/test/libapt/acqprogress_test.cc b/test/libapt/acqprogress_test.cc index c634733d4..dc31423fc 100644 --- a/test/libapt/acqprogress_test.cc +++ b/test/libapt/acqprogress_test.cc @@ -25,21 +25,23 @@ TEST(AcqProgress, IMSHit) AcqTextStatus Stat(out, width, 0); Stat.Start(); + pkgAcquire Acq(&Stat); pkgAcquire::ItemDesc hit; hit.URI = "http://example.org/file"; hit.Description = "Example File from example.org"; hit.ShortDesc = "Example File"; - hit.Owner = NULL; + TestItem hitO(&Acq); + hit.Owner = &hitO; EXPECT_EQ("", out.str()); Stat.IMSHit(hit); - EXPECT_EQ("Hit Example File from example.org\n", out.str()); + EXPECT_EQ("Hit:1 Example File from example.org\n", out.str()); Stat.IMSHit(hit); - EXPECT_EQ("Hit Example File from example.org\n" - "Hit Example File from example.org\n", out.str()); + EXPECT_EQ("Hit:1 Example File from example.org\n" + "Hit:1 Example File from example.org\n", out.str()); Stat.Stop(); - EXPECT_EQ("Hit Example File from example.org\n" - "Hit Example File from example.org\n", out.str()); + EXPECT_EQ("Hit:1 Example File from example.org\n" + "Hit:1 Example File from example.org\n", out.str()); } TEST(AcqProgress, FetchNoFileSize) { @@ -61,10 +63,10 @@ TEST(AcqProgress, FetchNoFileSize) EXPECT_EQ("Get:1 Example File from example.org\n", out.str()); Stat.Fetch(fetch); EXPECT_EQ("Get:1 Example File from example.org\n" - "Get:2 Example File from example.org\n", out.str()); + "Get:1 Example File from example.org\n", out.str()); Stat.Stop(); EXPECT_EQ("Get:1 Example File from example.org\n" - "Get:2 Example File from example.org\n", out.str()); + "Get:1 Example File from example.org\n", out.str()); } TEST(AcqProgress, FetchFileSize) { @@ -88,10 +90,10 @@ TEST(AcqProgress, FetchFileSize) fetchO.FileSize = 42; Stat.Fetch(fetch); EXPECT_EQ("Get:1 Example File from example.org [100 B]\n" - "Get:2 Example File from example.org [42 B]\n", out.str()); + "Get:1 Example File from example.org [42 B]\n", out.str()); Stat.Stop(); EXPECT_EQ("Get:1 Example File from example.org [100 B]\n" - "Get:2 Example File from example.org [42 B]\n", out.str()); + "Get:1 Example File from example.org [42 B]\n", out.str()); } TEST(AcqProgress, Fail) { @@ -112,30 +114,34 @@ TEST(AcqProgress, Fail) EXPECT_EQ("", out.str()); Stat.Fail(fetch); - EXPECT_EQ("", out.str()); + EXPECT_EQ("Ign:1 Example File from example.org\n", out.str()); fetchO.Status = pkgAcquire::Item::StatDone; Stat.Fail(fetch); - EXPECT_EQ("Ign Example File from example.org\n", out.str()); + EXPECT_EQ("Ign:1 Example File from example.org\n" + "Ign:1 Example File from example.org\n", out.str()); fetchO.Status = pkgAcquire::Item::StatError; fetchO.ErrorText = "An error test!"; Stat.Fail(fetch); - EXPECT_EQ("Ign Example File from example.org\n" - "Err Example File from example.org\n" + EXPECT_EQ("Ign:1 Example File from example.org\n" + "Ign:1 Example File from example.org\n" + "Err:1 Example File from example.org\n" " An error test!\n", out.str()); _config->Set("Acquire::Progress::Ignore::ShowErrorText", true); fetchO.Status = pkgAcquire::Item::StatDone; Stat.Fail(fetch); - EXPECT_EQ("Ign Example File from example.org\n" - "Err Example File from example.org\n" + EXPECT_EQ("Ign:1 Example File from example.org\n" + "Ign:1 Example File from example.org\n" + "Err:1 Example File from example.org\n" " An error test!\n" - "Ign Example File from example.org\n" + "Ign:1 Example File from example.org\n" " An error test!\n", out.str()); _config->Set("Acquire::Progress::Ignore::ShowErrorText", true); Stat.Stop(); - EXPECT_EQ("Ign Example File from example.org\n" - "Err Example File from example.org\n" + EXPECT_EQ("Ign:1 Example File from example.org\n" + "Ign:1 Example File from example.org\n" + "Err:1 Example File from example.org\n" " An error test!\n" - "Ign Example File from example.org\n" + "Ign:1 Example File from example.org\n" " An error test!\n", out.str()); } TEST(AcqProgress, Pulse) -- cgit v1.2.3 From ebda4f51f6707e5a6550f92d9407eab855039060 Mon Sep 17 00:00:00 2001 From: Mert Dirik Date: Tue, 23 Jun 2015 12:58:47 +0100 Subject: Turkish translation update for apt Closes: #789491 --- po/tr.po | 1941 ++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 945 insertions(+), 996 deletions(-) diff --git a/po/tr.po b/po/tr.po index 1e6f38903..d6d632436 100644 --- a/po/tr.po +++ b/po/tr.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: apt\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2015-03-09 02:17+0100\n" -"PO-Revision-Date: 2014-09-29 22:08+0200\n" +"POT-Creation-Date: 2015-04-13 07:23+0200\n" +"PO-Revision-Date: 2015-06-21 16:54+0200\n" "Last-Translator: Mert Dirik \n" "Language-Team: Debian l10n Turkish \n" "Language: tr\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n!=1;\n" -"X-Generator: Poedit 1.5.4\n" +"X-Generator: Poedit 1.6.10\n" "X-Launchpad-Export-Date: 2013-02-04 12:16+0000\n" #: cmdline/apt-cache.cc:149 @@ -25,146 +25,150 @@ msgstr "" msgid "Package %s version %s has an unmet dep:\n" msgstr "%s paketinin (sürüm %s) karşılanamayan bir bağımlılığı var:\n" -#: cmdline/apt-cache.cc:320 +#: cmdline/apt-cache.cc:277 msgid "Total package names: " msgstr "Toplam paketlerin adları: " -#: cmdline/apt-cache.cc:322 +#: cmdline/apt-cache.cc:279 msgid "Total package structures: " msgstr "Toplam paket yapıları: " -#: cmdline/apt-cache.cc:362 +#: cmdline/apt-cache.cc:319 msgid " Normal packages: " msgstr " Normal paketler: " -#: cmdline/apt-cache.cc:363 +#: cmdline/apt-cache.cc:320 msgid " Pure virtual packages: " msgstr " Saf sanal paketler: " -#: cmdline/apt-cache.cc:364 +#: cmdline/apt-cache.cc:321 msgid " Single virtual packages: " msgstr " Tekil sanal paketler: " -#: cmdline/apt-cache.cc:365 +#: cmdline/apt-cache.cc:322 msgid " Mixed virtual packages: " msgstr " Karışık sanal paketler: " -#: cmdline/apt-cache.cc:366 +#: cmdline/apt-cache.cc:323 msgid " Missing: " msgstr " Eksik: " -#: cmdline/apt-cache.cc:368 +#: cmdline/apt-cache.cc:325 msgid "Total distinct versions: " msgstr "Toplam farklı sürümler: " -#: cmdline/apt-cache.cc:370 +#: cmdline/apt-cache.cc:327 msgid "Total distinct descriptions: " msgstr "Toplam farklı açıklamalar: " -#: cmdline/apt-cache.cc:372 +#: cmdline/apt-cache.cc:329 msgid "Total dependencies: " msgstr "Toplam bağımlılıklar: " -#: cmdline/apt-cache.cc:375 +#: cmdline/apt-cache.cc:332 msgid "Total ver/file relations: " msgstr "Toplam sürüm/dosya ilişkileri: " -#: cmdline/apt-cache.cc:377 +#: cmdline/apt-cache.cc:334 msgid "Total Desc/File relations: " msgstr "Toplam Tanım/Dosya ilişkileri: " -#: cmdline/apt-cache.cc:379 +#: cmdline/apt-cache.cc:336 msgid "Total Provides mappings: " msgstr "Toplam destekleme eşleştirmeleri: " -#: cmdline/apt-cache.cc:433 +#: cmdline/apt-cache.cc:348 msgid "Total globbed strings: " msgstr "Toplam birikmiş dizgiler: " -#: cmdline/apt-cache.cc:439 +#: cmdline/apt-cache.cc:362 +msgid "Total dependency version space: " +msgstr "Toplam bağımlılık sürümü alanı: " + +#: cmdline/apt-cache.cc:367 msgid "Total slack space: " msgstr "Toplam serbest alan: " -#: cmdline/apt-cache.cc:454 +#: cmdline/apt-cache.cc:375 msgid "Total space accounted for: " msgstr "Hesaplanan toplam alan: " -#: cmdline/apt-cache.cc:590 cmdline/apt-cache.cc:1239 +#: cmdline/apt-cache.cc:506 cmdline/apt-cache.cc:1155 #: apt-private/private-show.cc:58 #, c-format msgid "Package file %s is out of sync." msgstr "%s paket dosyası eşzamansız." -#: cmdline/apt-cache.cc:668 cmdline/apt-cache.cc:1526 -#: cmdline/apt-cache.cc:1528 cmdline/apt-cache.cc:1605 cmdline/apt-mark.cc:56 -#: cmdline/apt-mark.cc:103 cmdline/apt-mark.cc:229 +#: cmdline/apt-cache.cc:584 cmdline/apt-cache.cc:1442 +#: cmdline/apt-cache.cc:1444 cmdline/apt-cache.cc:1521 cmdline/apt-mark.cc:59 +#: cmdline/apt-mark.cc:106 cmdline/apt-mark.cc:232 #: apt-private/private-show.cc:171 apt-private/private-show.cc:173 msgid "No packages found" msgstr "Hiç paket bulunamadı" -#: cmdline/apt-cache.cc:1338 apt-private/private-search.cc:41 +#: cmdline/apt-cache.cc:1254 apt-private/private-search.cc:41 msgid "You must give at least one search pattern" msgstr "En az bir arama örüntüsü vermelisiniz" -#: cmdline/apt-cache.cc:1505 +#: cmdline/apt-cache.cc:1421 msgid "This command is deprecated. Please use 'apt-mark showauto' instead." msgstr "" "Bu komutun kullanımı bırakılmıştır. Lütfen bunun yerine 'apt-mark showauto' " "komutunu kullanın." -#: cmdline/apt-cache.cc:1600 apt-pkg/cacheset.cc:653 +#: cmdline/apt-cache.cc:1516 apt-pkg/cacheset.cc:596 #, c-format msgid "Unable to locate package %s" msgstr "%s paketi bulunamadı" -#: cmdline/apt-cache.cc:1630 +#: cmdline/apt-cache.cc:1546 msgid "Package files:" msgstr "Paket dosyaları:" -#: cmdline/apt-cache.cc:1637 cmdline/apt-cache.cc:1728 +#: cmdline/apt-cache.cc:1553 cmdline/apt-cache.cc:1644 msgid "Cache is out of sync, can't x-ref a package file" msgstr "Önbellek eşzamanlı değil, paket dosyası 'x-ref' yapılamıyor" #. Show any packages have explicit pins -#: cmdline/apt-cache.cc:1651 +#: cmdline/apt-cache.cc:1567 msgid "Pinned packages:" msgstr "Sabitlenmiş paketler:" -#: cmdline/apt-cache.cc:1663 cmdline/apt-cache.cc:1708 +#: cmdline/apt-cache.cc:1579 cmdline/apt-cache.cc:1624 msgid "(not found)" msgstr "(bulunamadı)" -#: cmdline/apt-cache.cc:1671 +#: cmdline/apt-cache.cc:1587 msgid " Installed: " msgstr " Kurulu: " -#: cmdline/apt-cache.cc:1672 +#: cmdline/apt-cache.cc:1588 msgid " Candidate: " msgstr " Aday: " -#: cmdline/apt-cache.cc:1690 cmdline/apt-cache.cc:1698 +#: cmdline/apt-cache.cc:1606 cmdline/apt-cache.cc:1614 msgid "(none)" msgstr "(hiçbiri)" -#: cmdline/apt-cache.cc:1705 +#: cmdline/apt-cache.cc:1621 msgid " Package pin: " msgstr " Paket sabitleme: " #. Show the priority tables -#: cmdline/apt-cache.cc:1714 +#: cmdline/apt-cache.cc:1630 msgid " Version table:" msgstr " Sürüm çizelgesi:" -#: cmdline/apt-cache.cc:1827 cmdline/apt-cdrom.cc:208 cmdline/apt-config.cc:83 -#: cmdline/apt-get.cc:1610 cmdline/apt-helper.cc:86 cmdline/apt-mark.cc:446 -#: cmdline/apt.cc:42 cmdline/apt-extracttemplates.cc:222 -#: ftparchive/apt-ftparchive.cc:619 cmdline/apt-internal-solver.cc:47 -#: cmdline/apt-sortpkgs.cc:149 +#: cmdline/apt-cache.cc:1743 cmdline/apt-cdrom.cc:207 cmdline/apt-config.cc:83 +#: cmdline/apt-get.cc:1591 cmdline/apt-helper.cc:84 cmdline/apt-mark.cc:388 +#: cmdline/apt.cc:42 cmdline/apt-extracttemplates.cc:217 +#: ftparchive/apt-ftparchive.cc:620 cmdline/apt-internal-solver.cc:45 +#: cmdline/apt-sortpkgs.cc:147 #, c-format msgid "%s %s for %s compiled on %s %s\n" msgstr "%s %s (%s için) %s %s tarihinde derlendi\n" -#: cmdline/apt-cache.cc:1834 +#: cmdline/apt-cache.cc:1750 msgid "" "Usage: apt-cache [options] command\n" " apt-cache [options] showpkg pkg1 [pkg2 ...]\n" @@ -236,20 +240,20 @@ msgstr "" "Ayrıntılı bilgi için apt-cache(8) ve apt.conf(5) rehber sayfalarına göz " "atın.\n" -#: cmdline/apt-cdrom.cc:77 +#: cmdline/apt-cdrom.cc:76 msgid "Please provide a name for this Disc, such as 'Debian 5.0.3 Disk 1'" msgstr "Lütfen bu CD/DVD'ye bir ad verin, örneğin 'Debian 5.0.3 Disk 1'" -#: cmdline/apt-cdrom.cc:92 +#: cmdline/apt-cdrom.cc:91 msgid "Please insert a Disc in the drive and press enter" msgstr "Lütfen sürücüye bir Disk yerleştirin ve giriş tuşuna (Enter) basın" -#: cmdline/apt-cdrom.cc:140 +#: cmdline/apt-cdrom.cc:139 #, c-format msgid "Failed to mount '%s' to '%s'" msgstr "'%s', '%s' konumuna bağlanamadı" -#: cmdline/apt-cdrom.cc:179 +#: cmdline/apt-cdrom.cc:178 msgid "" "No CD-ROM could be auto-detected or found using the default mount point.\n" "You may try the --cdrom option to set the CD-ROM mount point.\n" @@ -262,7 +266,7 @@ msgstr "" "Otomatik CD-ROM ve bağlantı noktası algılama hakkında daha fazla bilgi almak " "için 'man apt-cdrom' komutunu kullanabilirsiniz." -#: cmdline/apt-cdrom.cc:183 +#: cmdline/apt-cdrom.cc:182 msgid "Repeat this process for the rest of the CDs in your set." msgstr "Kalan CD'leriniz için bu işlemi yineleyin." @@ -299,48 +303,48 @@ msgstr "" " -o=? İsteğe bağlı ayar seçeneği belirtmenizi sağlar, örneğin -o dir::" "cache=/tmp\n" -#: cmdline/apt-get.cc:224 +#: cmdline/apt-get.cc:245 #, c-format msgid "Can not find a package for architecture '%s'" msgstr "'%s' mimarisi için bir paket bulunamadı" -#: cmdline/apt-get.cc:311 +#: cmdline/apt-get.cc:327 #, c-format msgid "Can not find a package '%s' with version '%s'" msgstr "'%s' paketinin '%s' sürümü bulunamadı" -#: cmdline/apt-get.cc:314 +#: cmdline/apt-get.cc:330 #, c-format msgid "Can not find a package '%s' with release '%s'" msgstr "'%s' paketi '%s' dağıtım sürümünde bulunamadı" -#: cmdline/apt-get.cc:358 +#: cmdline/apt-get.cc:367 #, c-format msgid "Picking '%s' as source package instead of '%s'\n" msgstr "Kaynak paket olarak '%s' yerine '%s' kullanılacak\n" -#: cmdline/apt-get.cc:414 +#: cmdline/apt-get.cc:423 #, c-format msgid "Can not find version '%s' of package '%s'" msgstr "'%2$s' paketinin '%1$s' sürümünü bulunamadı" -#: cmdline/apt-get.cc:445 +#: cmdline/apt-get.cc:454 #, c-format msgid "Couldn't find package %s" msgstr "%s paketi bulunamadı" -#: cmdline/apt-get.cc:450 cmdline/apt-mark.cc:78 -#: apt-private/private-install.cc:863 +#: cmdline/apt-get.cc:459 cmdline/apt-mark.cc:81 +#: apt-private/private-install.cc:865 #, c-format msgid "%s set to manually installed.\n" msgstr "%s elle kurulmuş olarak ayarlandı.\n" -#: cmdline/apt-get.cc:452 cmdline/apt-mark.cc:80 +#: cmdline/apt-get.cc:461 cmdline/apt-mark.cc:83 #, c-format msgid "%s set to automatically installed.\n" msgstr "%s otomatik olarak kurulmuş şekilde ayarlandı.\n" -#: cmdline/apt-get.cc:460 cmdline/apt-mark.cc:124 +#: cmdline/apt-get.cc:469 cmdline/apt-mark.cc:127 msgid "" "This command is deprecated. Please use 'apt-mark auto' and 'apt-mark manual' " "instead." @@ -348,24 +352,24 @@ msgstr "" "Bu komut artık kullanılmamaktadır. Bunun yerine 'apt-mark auto' ve 'apt-mark " "manual' kullanın." -#: cmdline/apt-get.cc:529 cmdline/apt-get.cc:537 +#: cmdline/apt-get.cc:538 cmdline/apt-get.cc:546 msgid "Internal error, problem resolver broke stuff" msgstr "İç hata, sorun çözücü nesneyi bozdu" -#: cmdline/apt-get.cc:598 +#: cmdline/apt-get.cc:574 cmdline/apt-get.cc:611 msgid "Unable to lock the download directory" msgstr "İndirme dizini kilitlenemiyor" -#: cmdline/apt-get.cc:716 +#: cmdline/apt-get.cc:726 msgid "Must specify at least one package to fetch source for" msgstr "Kaynağının indirileceği en az bir paket seçilmeli" -#: cmdline/apt-get.cc:760 cmdline/apt-get.cc:1074 +#: cmdline/apt-get.cc:766 cmdline/apt-get.cc:1071 #, c-format msgid "Unable to find a source package for %s" msgstr "%s paketinin kaynak paketi bulunamadı" -#: cmdline/apt-get.cc:780 +#: cmdline/apt-get.cc:786 #, c-format msgid "" "NOTICE: '%s' packaging is maintained in the '%s' version control system at:\n" @@ -375,7 +379,7 @@ msgstr "" "yapılmaktadır:\n" "%s\n" -#: cmdline/apt-get.cc:785 +#: cmdline/apt-get.cc:791 #, c-format msgid "" "Please use:\n" @@ -387,67 +391,78 @@ msgstr "" "bzr branch %s\n" "komutunu kullanın.\n" -#: cmdline/apt-get.cc:833 +#: cmdline/apt-get.cc:839 #, c-format msgid "Skipping already downloaded file '%s'\n" msgstr "Zaten indirilmiş olan '%s' dosyası atlanıyor\n" +#: cmdline/apt-get.cc:873 cmdline/apt-get.cc:876 +#: apt-private/private-install.cc:187 apt-private/private-install.cc:190 +#, c-format +msgid "Couldn't determine free space in %s" +msgstr "%s içindeki boş alan miktarı belirlenemedi" + +#: cmdline/apt-get.cc:886 +#, c-format +msgid "You don't have enough free space in %s" +msgstr "%s üzerinde yeterli boş alan yok" + #. TRANSLATOR: The required space between number and unit is already included #. in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB -#: cmdline/apt-get.cc:863 +#: cmdline/apt-get.cc:895 #, c-format msgid "Need to get %sB/%sB of source archives.\n" msgstr "%sB/%sB kaynak arşivi indirilecek.\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB -#: cmdline/apt-get.cc:868 +#: cmdline/apt-get.cc:900 #, c-format msgid "Need to get %sB of source archives.\n" msgstr "%sB kaynak arşivi indirilecek.\n" -#: cmdline/apt-get.cc:874 +#: cmdline/apt-get.cc:906 #, c-format msgid "Fetch source %s\n" msgstr "%s kaynağını al\n" -#: cmdline/apt-get.cc:899 +#: cmdline/apt-get.cc:924 msgid "Failed to fetch some archives." msgstr "Bazı arşivler alınamadı." -#: cmdline/apt-get.cc:904 apt-private/private-install.cc:289 +#: cmdline/apt-get.cc:929 apt-private/private-install.cc:314 msgid "Download complete and in download only mode" msgstr "İndirme işlemi tamamlandı ve sadece indirme kipinde" -#: cmdline/apt-get.cc:929 +#: cmdline/apt-get.cc:954 #, c-format msgid "Skipping unpack of already unpacked source in %s\n" msgstr "%s için zaten açılmış bazı paketlerin açılması atlanıyor\n" -#: cmdline/apt-get.cc:942 +#: cmdline/apt-get.cc:967 #, c-format msgid "Unpack command '%s' failed.\n" msgstr "Paket açma komutu '%s' başarısız.\n" -#: cmdline/apt-get.cc:943 +#: cmdline/apt-get.cc:968 #, c-format msgid "Check if the 'dpkg-dev' package is installed.\n" msgstr "'dpkg-dev' paketinin kurulu olduğundan emin olun.\n" -#: cmdline/apt-get.cc:971 +#: cmdline/apt-get.cc:996 #, c-format msgid "Build command '%s' failed.\n" msgstr "İnşa komutu '%s' başarısız oldu.\n" -#: cmdline/apt-get.cc:990 +#: cmdline/apt-get.cc:1015 msgid "Child process failed" msgstr "Alt süreç başarısız" -#: cmdline/apt-get.cc:1009 +#: cmdline/apt-get.cc:1034 msgid "Must specify at least one package to check builddeps for" msgstr "İnşa bağımlılıklarının denetleneceği en az bir paket belirtilmelidir" -#: cmdline/apt-get.cc:1030 +#: cmdline/apt-get.cc:1059 #, c-format msgid "" "No architecture information available for %s. See apt.conf(5) APT::" @@ -456,27 +471,17 @@ msgstr "" "%s mimarisine uygun mimari bilgileri mevcut değil. Kurulumu için apt.conf(5) " "rehber sayfasındaki APT::Architectures kısmına göz atın" -#: cmdline/apt-get.cc:1047 -#, c-format -msgid "Note, using directory '%s' to get the build dependencies\n" -msgstr "" - -#: cmdline/apt-get.cc:1057 -#, fuzzy, c-format -msgid "Note, using file '%s' to get the build dependencies\n" -msgstr "İnşa bağımlılıklarını işleme başarısız oldu" - -#: cmdline/apt-get.cc:1086 cmdline/apt-get.cc:1089 +#: cmdline/apt-get.cc:1083 cmdline/apt-get.cc:1086 #, c-format msgid "Unable to get build-dependency information for %s" msgstr "%s paketinin inşa-bağımlılığı bilgisi alınamıyor" -#: cmdline/apt-get.cc:1109 +#: cmdline/apt-get.cc:1106 #, c-format msgid "%s has no build depends.\n" msgstr "%s paketinin hiç inşa bağımlılığı yok.\n" -#: cmdline/apt-get.cc:1279 +#: cmdline/apt-get.cc:1276 #, c-format msgid "" "%s dependency for %s can't be satisfied because %s is not allowed on '%s' " @@ -485,7 +490,7 @@ msgstr "" "'%4$s' paketlerinde %3$s paketine izin verilmediği için %2$s kaynağının %1$s " "bağımlılığı karşılanamıyor" -#: cmdline/apt-get.cc:1297 +#: cmdline/apt-get.cc:1294 #, c-format msgid "" "%s dependency for %s cannot be satisfied because the package %s cannot be " @@ -493,12 +498,12 @@ msgid "" msgstr "" "%2$s için %1$s bağımlılığı, %3$s paketi bulunamadığı için karşılanamadı" -#: cmdline/apt-get.cc:1320 +#: cmdline/apt-get.cc:1317 #, c-format msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new" msgstr "%2$s için %1$s bağımlılığı karşılanamadı: Kurulu %3$s paketi çok yeni" -#: cmdline/apt-get.cc:1359 +#: cmdline/apt-get.cc:1356 #, c-format msgid "" "%s dependency for %s cannot be satisfied because candidate version of " @@ -507,7 +512,7 @@ msgstr "" "%2$s için %1$s bağımlılığı sağlanamıyor, çünkü %3$s paketinin aday sürümü " "gerekli sürüm şartlarını karşılamıyor" -#: cmdline/apt-get.cc:1365 +#: cmdline/apt-get.cc:1362 #, c-format msgid "" "%s dependency for %s cannot be satisfied because package %s has no candidate " @@ -515,30 +520,30 @@ msgid "" msgstr "" "%2$s için %1$s bağımlılığı sağlanamıyor, çünkü %3$s paketinin aday sürümü yok" -#: cmdline/apt-get.cc:1388 +#: cmdline/apt-get.cc:1385 #, c-format msgid "Failed to satisfy %s dependency for %s: %s" msgstr "%2$s için %1$s bağımlılığı karşılanamadı: %3$s" -#: cmdline/apt-get.cc:1403 +#: cmdline/apt-get.cc:1400 #, c-format msgid "Build-dependencies for %s could not be satisfied." msgstr "%s için inşa bağımlılıkları karşılanamadı." -#: cmdline/apt-get.cc:1408 +#: cmdline/apt-get.cc:1405 msgid "Failed to process build dependencies" msgstr "İnşa bağımlılıklarını işleme başarısız oldu" -#: cmdline/apt-get.cc:1501 cmdline/apt-get.cc:1516 +#: cmdline/apt-get.cc:1498 cmdline/apt-get.cc:1510 #, c-format msgid "Changelog for %s (%s)" msgstr "%s (%s) paketinin değişim günlüğü" -#: cmdline/apt-get.cc:1615 +#: cmdline/apt-get.cc:1596 msgid "Supported modules:" msgstr "Desteklenen birimler:" -#: cmdline/apt-get.cc:1656 +#: cmdline/apt-get.cc:1637 msgid "" "Usage: apt-get [options] command\n" " apt-get [options] install|remove pkg1 [pkg2 ...]\n" @@ -636,11 +641,11 @@ msgstr "Argüman olarak bir adet URL'ye ihtiyaç vardır" msgid "Must specify at least one pair url/filename" msgstr "En az bir adet url/dosya-adı çifti belirtilmelidir" -#: cmdline/apt-helper.cc:75 cmdline/apt-helper.cc:79 +#: cmdline/apt-helper.cc:73 cmdline/apt-helper.cc:77 msgid "Download Failed" msgstr "İndirme Başarısız" -#: cmdline/apt-helper.cc:93 +#: cmdline/apt-helper.cc:91 msgid "" "Usage: apt-helper [options] command\n" " apt-helper [options] download-file uri target-path\n" @@ -664,53 +669,53 @@ msgstr "" "\n" " Bu APT yardımcısının Süper Meep Güçleri var.\n" -#: cmdline/apt-mark.cc:65 +#: cmdline/apt-mark.cc:68 #, c-format msgid "%s can not be marked as it is not installed.\n" msgstr "%s kurulu olmadığı için işaretlenemedi.\n" -#: cmdline/apt-mark.cc:71 +#: cmdline/apt-mark.cc:74 #, c-format msgid "%s was already set to manually installed.\n" msgstr "%s zaten elle kurulmuş olarak ayarlı.\n" -#: cmdline/apt-mark.cc:73 +#: cmdline/apt-mark.cc:76 #, c-format msgid "%s was already set to automatically installed.\n" msgstr "%s zaten otomatik kurulmuş olarak ayarlı.\n" -#: cmdline/apt-mark.cc:238 +#: cmdline/apt-mark.cc:241 #, c-format msgid "%s was already set on hold.\n" msgstr "%s zaten tutulacak şekilde ayarlanmış.\n" -#: cmdline/apt-mark.cc:240 +#: cmdline/apt-mark.cc:243 #, c-format msgid "%s was already not hold.\n" msgstr "%s zaten tutulmayacak şekilde ayarlanmış.\n" -#: cmdline/apt-mark.cc:255 cmdline/apt-mark.cc:333 cmdline/apt-mark.cc:397 -#: apt-pkg/contrib/fileutl.cc:834 apt-pkg/contrib/gpgv.cc:192 -#: apt-pkg/deb/dpkgpm.cc:1303 +#: cmdline/apt-mark.cc:258 cmdline/apt-mark.cc:339 +#: apt-pkg/contrib/fileutl.cc:812 apt-pkg/contrib/gpgv.cc:219 +#: apt-pkg/deb/dpkgpm.cc:1317 #, c-format msgid "Waited for %s but it wasn't there" msgstr "%s için beklenildi ama o gelmedi" -#: cmdline/apt-mark.cc:270 cmdline/apt-mark.cc:380 +#: cmdline/apt-mark.cc:273 cmdline/apt-mark.cc:322 #, c-format msgid "%s set on hold.\n" msgstr "%s paketi tutuluyor.\n" -#: cmdline/apt-mark.cc:272 cmdline/apt-mark.cc:385 +#: cmdline/apt-mark.cc:275 cmdline/apt-mark.cc:327 #, c-format msgid "Canceled hold on %s.\n" msgstr "%s paketini tutma işlemi iptal edildi.\n" -#: cmdline/apt-mark.cc:337 cmdline/apt-mark.cc:403 +#: cmdline/apt-mark.cc:345 msgid "Executing dpkg failed. Are you root?" msgstr "'dpkg' çalıştırılamadı. root olduğunuzdan emin misiniz?" -#: cmdline/apt-mark.cc:450 +#: cmdline/apt-mark.cc:392 msgid "" "Usage: apt-mark [options] {auto|manual} pkg1 [pkg2 ...]\n" "\n" @@ -831,12 +836,12 @@ msgstr "Disk bulunamadı." msgid "File not found" msgstr "Dosya bulunamadı" -#: methods/copy.cc:61 methods/gzip.cc:127 methods/rred.cc:598 +#: methods/copy.cc:61 methods/gzip.cc:117 methods/rred.cc:598 #: methods/rred.cc:608 msgid "Failed to stat" msgstr "Durum bilgisi okunamadı" -#: methods/copy.cc:113 methods/gzip.cc:134 methods/rred.cc:605 +#: methods/copy.cc:105 methods/gzip.cc:124 methods/rred.cc:605 msgid "Failed to set modification time" msgstr "Değişiklik zamanı ayarlanamadı" @@ -845,34 +850,34 @@ msgid "Invalid URI, local URIS must not start with //" msgstr "Geçersiz URI, yerel URI'ler // ile başlamamalıdır" #. Login must be before getpeername otherwise dante won't work. -#: methods/ftp.cc:178 +#: methods/ftp.cc:177 msgid "Logging in" msgstr "Giriş yapılıyor" -#: methods/ftp.cc:184 +#: methods/ftp.cc:183 msgid "Unable to determine the peer name" msgstr "Eş adı belirlenemiyor" -#: methods/ftp.cc:189 +#: methods/ftp.cc:188 msgid "Unable to determine the local name" msgstr "Yerel ad belirlenemiyor" -#: methods/ftp.cc:220 methods/ftp.cc:248 +#: methods/ftp.cc:219 methods/ftp.cc:247 #, c-format msgid "The server refused the connection and said: %s" msgstr "Sunucu bağlantıyı reddetti, sunucunun iletisi: %s" -#: methods/ftp.cc:226 +#: methods/ftp.cc:225 #, c-format msgid "USER failed, server said: %s" msgstr "USER başarısız, sunucunun iletisi: %s" -#: methods/ftp.cc:233 +#: methods/ftp.cc:232 #, c-format msgid "PASS failed, server said: %s" msgstr "PASS başarısız, sunucunun iletisi: %s" -#: methods/ftp.cc:253 +#: methods/ftp.cc:252 msgid "" "A proxy server was specified but no login script, Acquire::ftp::ProxyLogin " "is empty." @@ -880,123 +885,123 @@ msgstr "" "Bir Vekil sunucu belirtildi ancak oturum açma betiği belirtilmedi, Acquire::" "ftp::ProxyLogin boş." -#: methods/ftp.cc:281 +#: methods/ftp.cc:280 #, c-format msgid "Login script command '%s' failed, server said: %s" msgstr "Oturum açma betiği komutu '%s' başarısız oldu, sunucunun iletisi: %s" -#: methods/ftp.cc:307 +#: methods/ftp.cc:306 #, c-format msgid "TYPE failed, server said: %s" msgstr "TYPE başarısız, sunucunun iletisi: %s" -#: methods/ftp.cc:345 methods/ftp.cc:457 methods/rsh.cc:195 methods/rsh.cc:243 +#: methods/ftp.cc:344 methods/ftp.cc:456 methods/rsh.cc:195 methods/rsh.cc:243 msgid "Connection timeout" msgstr "Bağlantı zaman aşımına uğradı" -#: methods/ftp.cc:351 +#: methods/ftp.cc:350 msgid "Server closed the connection" msgstr "Sunucu bağlantıyı kesti" -#: methods/ftp.cc:354 methods/rsh.cc:202 apt-pkg/contrib/fileutl.cc:1515 -#: apt-pkg/contrib/fileutl.cc:1524 apt-pkg/contrib/fileutl.cc:1529 -#: apt-pkg/contrib/fileutl.cc:1531 +#: methods/ftp.cc:353 methods/rsh.cc:202 apt-pkg/contrib/fileutl.cc:1476 +#: apt-pkg/contrib/fileutl.cc:1485 apt-pkg/contrib/fileutl.cc:1490 +#: apt-pkg/contrib/fileutl.cc:1492 msgid "Read error" msgstr "Okuma hatası" -#: methods/ftp.cc:361 methods/rsh.cc:209 +#: methods/ftp.cc:360 methods/rsh.cc:209 msgid "A response overflowed the buffer." msgstr "Bir yanıt arabelleği taşırdı." -#: methods/ftp.cc:378 methods/ftp.cc:390 +#: methods/ftp.cc:377 methods/ftp.cc:389 msgid "Protocol corruption" msgstr "İletişim kuralları bozulması" -#: methods/ftp.cc:463 methods/rsh.cc:249 apt-pkg/contrib/fileutl.cc:911 -#: apt-pkg/contrib/fileutl.cc:1637 apt-pkg/contrib/fileutl.cc:1646 -#: apt-pkg/contrib/fileutl.cc:1651 apt-pkg/contrib/fileutl.cc:1653 -#: apt-pkg/contrib/fileutl.cc:1678 +#: methods/ftp.cc:462 methods/rsh.cc:249 apt-pkg/contrib/fileutl.cc:872 +#: apt-pkg/contrib/fileutl.cc:1598 apt-pkg/contrib/fileutl.cc:1607 +#: apt-pkg/contrib/fileutl.cc:1612 apt-pkg/contrib/fileutl.cc:1614 +#: apt-pkg/contrib/fileutl.cc:1639 msgid "Write error" msgstr "Yazma hatası" -#: methods/ftp.cc:702 methods/ftp.cc:708 methods/ftp.cc:743 +#: methods/ftp.cc:701 methods/ftp.cc:707 methods/ftp.cc:742 msgid "Could not create a socket" msgstr "Bir soket oluşturulamadı" -#: methods/ftp.cc:713 +#: methods/ftp.cc:712 msgid "Could not connect data socket, connection timed out" msgstr "Veri soketine bağlanılamadı, bağlantı zaman aşımına uğradı" -#: methods/ftp.cc:717 methods/connect.cc:116 +#: methods/ftp.cc:716 methods/connect.cc:116 msgid "Failed" msgstr "Başarısız" -#: methods/ftp.cc:719 +#: methods/ftp.cc:718 msgid "Could not connect passive socket." msgstr "Edilgen sokete bağlanılamadı." -#: methods/ftp.cc:736 +#: methods/ftp.cc:735 msgid "getaddrinfo was unable to get a listening socket" msgstr "getaddrinfo bir dinleme soketi alamıyor" -#: methods/ftp.cc:750 +#: methods/ftp.cc:749 msgid "Could not bind a socket" msgstr "Bir sokete bağlanılamadı" -#: methods/ftp.cc:754 +#: methods/ftp.cc:753 msgid "Could not listen on the socket" msgstr "Soket dinlenemedi" -#: methods/ftp.cc:761 +#: methods/ftp.cc:760 msgid "Could not determine the socket's name" msgstr "Soketin adı belirlenemedi" -#: methods/ftp.cc:793 +#: methods/ftp.cc:792 msgid "Unable to send PORT command" msgstr "PORT komutu gönderilemedi" -#: methods/ftp.cc:803 +#: methods/ftp.cc:802 #, c-format msgid "Unknown address family %u (AF_*)" msgstr "Bilinmeyen adres ailesi %u (AF_*)" -#: methods/ftp.cc:812 +#: methods/ftp.cc:811 #, c-format msgid "EPRT failed, server said: %s" msgstr "EPRT başarısız, sunucunun iletisi: %s" -#: methods/ftp.cc:832 +#: methods/ftp.cc:831 msgid "Data socket connect timed out" msgstr "Veri soketi bağlantısı zaman aşımına uğradı" -#: methods/ftp.cc:839 +#: methods/ftp.cc:838 msgid "Unable to accept connection" msgstr "Bağlantı kabul edilemiyor" -#: methods/ftp.cc:879 methods/server.cc:362 methods/rsh.cc:319 +#: methods/ftp.cc:877 methods/server.cc:357 methods/rsh.cc:319 msgid "Problem hashing file" msgstr "Dosya sağlaması yapılamadı" -#: methods/ftp.cc:892 +#: methods/ftp.cc:890 #, c-format msgid "Unable to fetch file, server said '%s'" msgstr "Dosya alınamıyor, sunucunun iletisi: '%s'" -#: methods/ftp.cc:907 methods/rsh.cc:338 +#: methods/ftp.cc:905 methods/rsh.cc:338 msgid "Data socket timed out" msgstr "Veri soketi zaman aşımına uğradı" -#: methods/ftp.cc:944 +#: methods/ftp.cc:935 #, c-format msgid "Data transfer failed, server said '%s'" msgstr "Veri aktarımı başarısız, sunucunun iletisi: '%s'" #. Get the files information -#: methods/ftp.cc:1027 +#: methods/ftp.cc:1014 msgid "Query" msgstr "Sorgu" -#: methods/ftp.cc:1141 +#: methods/ftp.cc:1128 msgid "Unable to invoke " msgstr "Çağrılamıyor " @@ -1062,21 +1067,21 @@ msgstr "'%s:%s' (%i - %s) adresi çözümlenirken bir şeyler kötü gitti" msgid "Unable to connect to %s:%s:" msgstr "Bağlanılamadı %s:%s:" -#: methods/gpgv.cc:158 +#: methods/gpgv.cc:168 msgid "" "Internal error: Good signature, but could not determine key fingerprint?!" msgstr "İç hata: İmza iyi, ancak anahtar parmak izi belirlenemedi?!" -#: methods/gpgv.cc:162 +#: methods/gpgv.cc:172 msgid "At least one invalid signature was encountered." msgstr "En az bir geçersiz imza ile karşılaşıldı." -#: methods/gpgv.cc:164 -msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)" -msgstr "İmza doğrulama için 'apt-key' çalıştırılamadı (gnupg kurulu mu?)" +#: methods/gpgv.cc:174 +msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)" +msgstr "İmza doğrulama için 'gpgv' çalıştırılamadı (gpgv kurulu mu?)" #. TRANSLATORS: %s is a single techy word like 'NODATA' -#: methods/gpgv.cc:170 +#: methods/gpgv.cc:180 #, c-format msgid "" "Clearsigned file isn't valid, got '%s' (does the network require " @@ -1085,49 +1090,49 @@ msgstr "" "Temiz-imzalı dosya geçerli değil, '%s' hatası alındı (ağ kimlik doğrulama " "gerektiriyor mu?)" -#: methods/gpgv.cc:174 -msgid "Unknown error executing apt-key" -msgstr "apt-key çalıştırılırken bilinmeyen hata" +#: methods/gpgv.cc:184 +msgid "Unknown error executing gpgv" +msgstr "gpgv çalıştırılırken bilinmeyen hata" -#: methods/gpgv.cc:207 methods/gpgv.cc:214 +#: methods/gpgv.cc:217 methods/gpgv.cc:224 msgid "The following signatures were invalid:\n" msgstr "Aşağıdaki imzalar geçersiz:\n" -#: methods/gpgv.cc:221 +#: methods/gpgv.cc:231 msgid "" "The following signatures couldn't be verified because the public key is not " "available:\n" msgstr "Aşağıdaki imzalar doğrulanamadı, çünkü genel anahtar mevcut değil:\n" -#: methods/gzip.cc:79 +#: methods/gzip.cc:69 msgid "Empty files can't be valid archives" msgstr "Boş dosyalar geçerli birer arşiv dosyası olamazlar" -#: methods/http.cc:517 +#: methods/http.cc:513 msgid "Error writing to the file" msgstr "Dosyaya yazılamadı" -#: methods/http.cc:531 +#: methods/http.cc:527 msgid "Error reading from server. Remote end closed connection" msgstr "Sunucundan okunurken hata. Uzak sonlu kapalı bağlantı" -#: methods/http.cc:533 +#: methods/http.cc:529 msgid "Error reading from server" msgstr "Sunucundan okunurken hata" -#: methods/http.cc:569 +#: methods/http.cc:565 msgid "Error writing to file" msgstr "Dosyaya yazılamadı" -#: methods/http.cc:629 +#: methods/http.cc:625 msgid "Select failed" msgstr "Seçme başarısız" -#: methods/http.cc:634 +#: methods/http.cc:630 msgid "Connection timed out" msgstr "Bağlantı zaman aşımına uğradı" -#: methods/http.cc:657 +#: methods/http.cc:653 msgid "Error writing to output file" msgstr "Çıktı dosyasına yazılırken hata" @@ -1159,30 +1164,23 @@ msgstr "HTTP sunucusunun aralık desteği bozuk" msgid "Unknown date format" msgstr "Bilinmeyen tarih biçimi" -#: methods/server.cc:506 +#: methods/server.cc:494 msgid "Bad header data" msgstr "Kötü başlık verisi" -#: methods/server.cc:523 methods/server.cc:617 +#: methods/server.cc:511 methods/server.cc:567 msgid "Connection failed" msgstr "Bağlantı başarısız" -#: methods/server.cc:589 -#, c-format -msgid "" -"Automatically disabled %s due to incorrect response from server/proxy. (man " -"5 apt.conf)" -msgstr "" - -#: methods/server.cc:712 +#: methods/server.cc:659 msgid "Internal error" msgstr "İç hata" -#: apt-private/private-list.cc:121 +#: apt-private/private-list.cc:129 msgid "Listing" msgstr "Listeleme" -#: apt-private/private-list.cc:151 +#: apt-private/private-list.cc:159 #, c-format msgid "There is %i additional version. Please use the '-a' switch to see it" msgid_plural "" @@ -1192,33 +1190,33 @@ msgstr[1] "" "Fazladan %i sürüm daha var. Bu sürümleri görmek için '-a' anahtarını " "kullanın." -#: apt-private/private-cachefile.cc:95 +#: apt-private/private-cachefile.cc:93 msgid "Correcting dependencies..." msgstr "Bağımlılıklar düzeltiliyor..." -#: apt-private/private-cachefile.cc:98 +#: apt-private/private-cachefile.cc:96 msgid " failed." msgstr " başarısız oldu." -#: apt-private/private-cachefile.cc:101 +#: apt-private/private-cachefile.cc:99 msgid "Unable to correct dependencies" msgstr "Bağımlılıklar düzeltilemedi" -#: apt-private/private-cachefile.cc:104 +#: apt-private/private-cachefile.cc:102 msgid "Unable to minimize the upgrade set" msgstr "Yükseltme kümesi küçültülemiyor" -#: apt-private/private-cachefile.cc:106 +#: apt-private/private-cachefile.cc:104 msgid " Done" msgstr " Tamamlandı" -#: apt-private/private-cachefile.cc:110 +#: apt-private/private-cachefile.cc:108 msgid "You might want to run 'apt-get -f install' to correct these." msgstr "" "Bu sorunları düzeltmek için 'apt-get -f install' komutunu çalıştırmanız " "gerekebilir." -#: apt-private/private-cachefile.cc:113 +#: apt-private/private-cachefile.cc:111 msgid "Unmet dependencies. Try using -f." msgstr "Karşılanmayan bağımlılıklar. -f kullanmayı deneyin." @@ -1379,7 +1377,7 @@ msgstr "E" msgid "N" msgstr "H" -#: apt-private/private-output.cc:806 apt-pkg/cachefilter.cc:40 +#: apt-private/private-output.cc:806 apt-pkg/cachefilter.cc:35 #, c-format msgid "Regex compilation error - %s" msgstr "Regex derleme hatası - %s" @@ -1388,7 +1386,7 @@ msgstr "Regex derleme hatası - %s" msgid "The update command takes no arguments" msgstr "'update' komutu argüman almaz" -#: apt-private/private-update.cc:95 +#: apt-private/private-update.cc:97 #, c-format msgid "%i package can be upgraded. Run 'apt list --upgradable' to see it.\n" msgid_plural "" @@ -1400,7 +1398,7 @@ msgstr[1] "" "%i paket yükseltilebilir. Bu paketleri görmek için 'apt list --upgradable' " "komutunu çalıştırın.\n" -#: apt-private/private-update.cc:99 +#: apt-private/private-update.cc:101 msgid "All packages are up to date." msgstr "Tüm paketler güncel." @@ -1413,10 +1411,11 @@ msgstr "Sıralama" msgid "There is %i additional record. Please use the '-a' switch to see it" msgid_plural "" "There are %i additional records. Please use the '-a' switch to see them." -msgstr[0] "Fazladan %i kayıt daha var. Görmek için '-a' anahtarını kullanın." +msgstr[0] "" +"Fazladan %i kayıt daha var. Görmek için '-a' anahtarını kullanabilirsiniz." msgstr[1] "" "Fazladan %i kayıt daha var. Bu kayıtları görmek için '-a' anahtarını " -"kullanın. kullanabilirsiniz." +"kullanabilirsiniz." #: apt-private/private-show.cc:163 msgid "not a real package (virtual)" @@ -1434,21 +1433,21 @@ msgstr "" " Unutmayın ki benzetim kipinde kilitleme yapılmaz, bu nedenle\n" " bu benzetimin gerçekteki durumla birebir aynı olacağına güvenmeyin!" -#: apt-private/private-install.cc:81 +#: apt-private/private-install.cc:82 msgid "Internal error, InstallPackages was called with broken packages!" msgstr "İç hata, InstallPackages bozuk paketler ile çağrıldı!" -#: apt-private/private-install.cc:90 +#: apt-private/private-install.cc:91 msgid "Packages need to be removed but remove is disabled." msgstr "" "Paketlerin kaldırılması gerekiyor ancak kaldırma işlemi devre dışı " "bırakılmış." -#: apt-private/private-install.cc:109 +#: apt-private/private-install.cc:110 msgid "Internal error, Ordering didn't finish" msgstr "İç hata, Sıralama tamamlanamadı" -#: apt-private/private-install.cc:147 +#: apt-private/private-install.cc:148 msgid "How odd... The sizes didn't match, email apt@packages.debian.org" msgstr "" "Ne kadar ilginç... Boyutlar eşleşmedi, apt@packages.debian.org adresine " @@ -1456,47 +1455,52 @@ msgstr "" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB -#: apt-private/private-install.cc:154 +#: apt-private/private-install.cc:155 #, c-format msgid "Need to get %sB/%sB of archives.\n" msgstr "%sB/%sB arşiv dosyası indirilecek.\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB -#: apt-private/private-install.cc:159 +#: apt-private/private-install.cc:160 #, c-format msgid "Need to get %sB of archives.\n" msgstr "%sB arşiv dosyası indirilecek.\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB -#: apt-private/private-install.cc:166 +#: apt-private/private-install.cc:167 #, c-format msgid "After this operation, %sB of additional disk space will be used.\n" msgstr "Bu işlem tamamlandıktan sonra %sB ek disk alanı kullanılacak.\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB -#: apt-private/private-install.cc:171 +#: apt-private/private-install.cc:172 #, c-format msgid "After this operation, %sB disk space will be freed.\n" msgstr "Bu işlem tamamlandıktan sonra %sB disk alanı boşalacak.\n" -#: apt-private/private-install.cc:185 apt-private/private-download.cc:117 +#: apt-private/private-install.cc:200 +#, c-format +msgid "You don't have enough free space in %s." +msgstr "%s içinde yeterli boş alanınız yok." + +#: apt-private/private-install.cc:210 apt-private/private-download.cc:59 msgid "There are problems and -y was used without --force-yes" msgstr "Bazı sorunlar çıktı ve -y seçeneği, --force-yes olmadan kullanıldı" -#: apt-private/private-install.cc:191 apt-private/private-install.cc:213 +#: apt-private/private-install.cc:216 apt-private/private-install.cc:238 msgid "Trivial Only specified but this is not a trivial operation." msgstr "Sadece Önemsiz seçeneği ayarlandı, ama bu önemsiz bir işlem değil." #. TRANSLATOR: This string needs to be typed by the user as a confirmation, so be #. careful with hard to type or special characters (like non-breaking spaces) -#: apt-private/private-install.cc:195 +#: apt-private/private-install.cc:220 msgid "Yes, do as I say!" msgstr "Evet, söylediğim şekilde yap!" -#: apt-private/private-install.cc:197 +#: apt-private/private-install.cc:222 #, c-format msgid "" "You are about to do something potentially harmful.\n" @@ -1507,19 +1511,19 @@ msgstr "" "Devam etmek için '%s' ifadesini yazınız\n" " ?] " -#: apt-private/private-install.cc:203 apt-private/private-install.cc:221 +#: apt-private/private-install.cc:228 apt-private/private-install.cc:246 msgid "Abort." msgstr "Vazgeç." -#: apt-private/private-install.cc:218 +#: apt-private/private-install.cc:243 msgid "Do you want to continue?" msgstr "Devam etmek istiyor musunuz?" -#: apt-private/private-install.cc:288 +#: apt-private/private-install.cc:313 msgid "Some files failed to download" msgstr "Bazı dosyalar indirilemedi" -#: apt-private/private-install.cc:295 +#: apt-private/private-install.cc:320 msgid "" "Unable to fetch some archives, maybe run apt-get update or try with --fix-" "missing?" @@ -1527,19 +1531,19 @@ msgstr "" "Bazı arşivler alınamıyor, apt-get update'i çalıştırmayı ya da --fix-missing " "seçeneğini ekleyerek düzeltmeyi deneyin." -#: apt-private/private-install.cc:299 +#: apt-private/private-install.cc:324 msgid "--fix-missing and media swapping is not currently supported" msgstr "--fix-missing seçeneği ve ortam takası şu an için desteklenmiyor" -#: apt-private/private-install.cc:304 +#: apt-private/private-install.cc:329 msgid "Unable to correct missing packages." msgstr "Eksik paketler düzeltilemedi." -#: apt-private/private-install.cc:305 +#: apt-private/private-install.cc:330 msgid "Aborting install." msgstr "Kurulum iptal ediliyor." -#: apt-private/private-install.cc:341 +#: apt-private/private-install.cc:366 msgid "" "The following package disappeared from your system as\n" "all files have been overwritten by other packages:" @@ -1553,15 +1557,15 @@ msgstr[1] "" "Tüm dosyalarının üzerine yazıldığı için aşağıdaki paketler\n" "sisteminizden kayboldu:" -#: apt-private/private-install.cc:345 +#: apt-private/private-install.cc:370 msgid "Note: This is done automatically and on purpose by dpkg." msgstr "Not: Bu eylem dpkg tarafından otomatik ve kasıtlı olarak yapılmıştır." -#: apt-private/private-install.cc:366 +#: apt-private/private-install.cc:391 msgid "We are not supposed to delete stuff, can't start AutoRemover" msgstr "Nesneleri silmemiz beklenemez, AutoRemover çalıştırılamıyor" -#: apt-private/private-install.cc:474 +#: apt-private/private-install.cc:499 msgid "" "Hmm, seems like the AutoRemover destroyed something which really\n" "shouldn't happen. Please file a bug report against apt." @@ -1579,15 +1583,15 @@ msgstr "" #. "that package should be filed.") << std::endl; #. } #. -#: apt-private/private-install.cc:477 apt-private/private-install.cc:627 +#: apt-private/private-install.cc:502 apt-private/private-install.cc:653 msgid "The following information may help to resolve the situation:" msgstr "Aşağıdaki bilgiler durumu çözmenize yardımcı olabilir:" -#: apt-private/private-install.cc:481 +#: apt-private/private-install.cc:506 msgid "Internal Error, AutoRemover broke stuff" msgstr "İç hata, AutoRemover bazı şeyleri bozdu" -#: apt-private/private-install.cc:488 +#: apt-private/private-install.cc:513 msgid "" "The following package was automatically installed and is no longer required:" msgid_plural "" @@ -1599,7 +1603,7 @@ msgstr[1] "" "Aşağıdaki paketler otomatik olarak kurulmuş ve artık bu paketlere gerek " "duyulmuyor:" -#: apt-private/private-install.cc:492 +#: apt-private/private-install.cc:517 #, c-format msgid "%lu package was automatically installed and is no longer required.\n" msgid_plural "" @@ -1607,19 +1611,19 @@ msgid_plural "" msgstr[0] "%lu paket otomatik olarak kurulmuş ve artık gerekli değil.\n" msgstr[1] "%lu paket otomatik olarak kurulmuş ve artık gerekli değil.\n" -#: apt-private/private-install.cc:494 +#: apt-private/private-install.cc:519 msgid "Use 'apt-get autoremove' to remove it." msgid_plural "Use 'apt-get autoremove' to remove them." msgstr[0] "Bu paketi kaldırmak için 'apt-get autoremove' komutunu kullanın." msgstr[1] "Bu paketleri kaldırmak için 'apt-get autoremove' komutunu kullanın." -#: apt-private/private-install.cc:587 +#: apt-private/private-install.cc:612 msgid "You might want to run 'apt-get -f install' to correct these:" msgstr "" "Bunları düzeltmek için 'apt-get -f install' komutunu çalıştırmanız " "gerekebilir:" -#: apt-private/private-install.cc:589 +#: apt-private/private-install.cc:614 msgid "" "Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a " "solution)." @@ -1627,7 +1631,7 @@ msgstr "" "Karşılanmamış bağımlılıklar. 'apt-get -f install' komutunu paket seçeneği " "vermeden deneyin (ya da bir çözüm belirtin)." -#: apt-private/private-install.cc:612 +#: apt-private/private-install.cc:638 msgid "" "Some packages could not be installed. This may mean that you have\n" "requested an impossible situation or if you are using the unstable\n" @@ -1639,105 +1643,88 @@ msgstr "" "bazı paketlerin henüz oluşturulamamış ya da oluşturulmakta\n" "olduğunu gösterir." -#: apt-private/private-install.cc:633 +#: apt-private/private-install.cc:659 msgid "Broken packages" msgstr "Bozuk paketler" -#: apt-private/private-install.cc:710 +#: apt-private/private-install.cc:712 msgid "The following extra packages will be installed:" msgstr "Aşağıdaki ek paketler de kurulacak:" -#: apt-private/private-install.cc:800 +#: apt-private/private-install.cc:802 msgid "Suggested packages:" msgstr "Önerilen paketler:" -#: apt-private/private-install.cc:801 +#: apt-private/private-install.cc:803 msgid "Recommended packages:" msgstr "Tavsiye edilen paketler:" -#: apt-private/private-install.cc:823 +#: apt-private/private-install.cc:825 #, c-format msgid "Skipping %s, it is already installed and upgrade is not set.\n" msgstr "%s atlanıyor, bu paket zaten kurulu ve yükseltme seçilmemiş.\n" -#: apt-private/private-install.cc:827 +#: apt-private/private-install.cc:829 #, c-format msgid "Skipping %s, it is not installed and only upgrades are requested.\n" msgstr "" "%s atlanıyor, bu paket kurulu değil ve sadece yükseltmeler isteniyor.\n" -#: apt-private/private-install.cc:839 +#: apt-private/private-install.cc:841 #, c-format msgid "Reinstallation of %s is not possible, it cannot be downloaded.\n" msgstr "" "%s paketinin yeniden kurulumu mümkün değil, çünkü paket indirilemedi.\n" -#: apt-private/private-install.cc:844 +#: apt-private/private-install.cc:846 #, c-format msgid "%s is already the newest version.\n" msgstr "%s zaten en yeni sürümde.\n" -#: apt-private/private-install.cc:892 +#: apt-private/private-install.cc:894 #, c-format msgid "Selected version '%s' (%s) for '%s'\n" msgstr "'%3$s' paketinin '%1$s' (%2$s) sürümü seçildi\n" -#: apt-private/private-install.cc:897 +#: apt-private/private-install.cc:899 #, c-format msgid "Selected version '%s' (%s) for '%s' because of '%s'\n" msgstr "'%4$s' nedeniyle '%3$s' paketinin '%1$s' (%2$s) sürümü seçildi\n" #. TRANSLATORS: Note, this is not an interactive question -#: apt-private/private-install.cc:939 +#: apt-private/private-install.cc:941 #, c-format msgid "Package '%s' is not installed, so not removed. Did you mean '%s'?\n" msgstr "" "'%s' kurulu değildi, dolayısıyla kaldırılmadı. Bunu mu demek istediniz: " "'%s'?\n" -#: apt-private/private-install.cc:945 +#: apt-private/private-install.cc:947 #, c-format msgid "Package '%s' is not installed, so not removed\n" msgstr "'%s' kurulu değildi, dolayısıyla kaldırılmadı\n" -#: apt-private/private-download.cc:62 -#, c-format -msgid "" -"Can't drop privileges for downloading as file '%s' couldn't be accessed by " -"user '%s'." -msgstr "" - -#: apt-private/private-download.cc:94 +#: apt-private/private-download.cc:36 msgid "WARNING: The following packages cannot be authenticated!" msgstr "UYARI: Aşağıdaki paketler doğrulanamıyor!" -#: apt-private/private-download.cc:98 +#: apt-private/private-download.cc:40 msgid "Authentication warning overridden.\n" msgstr "Kimlik denetimi uyarısı görmezden geliniyor.\n" -#: apt-private/private-download.cc:103 apt-private/private-download.cc:110 +#: apt-private/private-download.cc:45 apt-private/private-download.cc:52 msgid "Some packages could not be authenticated" msgstr "Bazı paketlerin kimlik denetimi yapılamadı" -#: apt-private/private-download.cc:108 +#: apt-private/private-download.cc:50 msgid "Install these packages without verification?" msgstr "Paketler doğrulanmadan kurulsun mu?" -#: apt-private/private-download.cc:149 apt-pkg/update.cc:77 +#: apt-private/private-download.cc:91 apt-pkg/update.cc:77 #, c-format msgid "Failed to fetch %s %s\n" msgstr "%s ağdan alınamadı. %s\n" -#: apt-private/private-download.cc:171 apt-private/private-download.cc:174 -#, c-format -msgid "Couldn't determine free space in %s" -msgstr "%s içindeki boş alan miktarı belirlenemedi" - -#: apt-private/private-download.cc:188 -#, c-format -msgid "You don't have enough free space in %s." -msgstr "%s içinde yeterli boş alanınız yok." - #: apt-private/private-sources.cc:58 #, c-format msgid "Failed to parse %s. Edit again? " @@ -1752,37 +1739,41 @@ msgstr "'%s' dosyası değişti, lütfen 'apt-get update' komutunu çalıştır msgid "Full Text Search" msgstr "Tam Metin Arama" +#: apt-private/private-upgrade.cc:25 +msgid "Calculating upgrade... " +msgstr "Yükseltme hesaplanıyor... " + +#: apt-private/private-upgrade.cc:28 +msgid "Done" +msgstr "Bitti" + #: apt-private/acqprogress.cc:66 -#, c-format -msgid "Hit:%lu %s" -msgstr "Bağlandı:%lu %s" +msgid "Hit " +msgstr "Bağlandı " -#: apt-private/acqprogress.cc:88 -#, c-format -msgid "Get:%lu %s" -msgstr "Alınıyor:%lu %s" +#: apt-private/acqprogress.cc:90 +msgid "Get:" +msgstr "Alınıyor: " -#: apt-private/acqprogress.cc:119 -#, c-format -msgid "Ign:%lu %s" -msgstr "Yoksay:%lu %s" +#: apt-private/acqprogress.cc:121 +msgid "Ign " +msgstr "Yoksay " -#: apt-private/acqprogress.cc:126 -#, c-format -msgid "Err:%lu %s" -msgstr "Hata:%lu %s" +#: apt-private/acqprogress.cc:125 +msgid "Err " +msgstr "Hata " -#: apt-private/acqprogress.cc:150 +#: apt-private/acqprogress.cc:146 #, c-format msgid "Fetched %sB in %s (%sB/s)\n" msgstr "%2$s'de %1$sB alındı (%3$sB/s)\n" -#: apt-private/acqprogress.cc:240 +#: apt-private/acqprogress.cc:236 #, c-format msgid " [Working]" msgstr " [Çalışıyor]" -#: apt-private/acqprogress.cc:301 +#: apt-private/acqprogress.cc:297 #, c-format msgid "" "Media change: please insert the disc labeled\n" @@ -1795,18 +1786,18 @@ msgstr "" #. Only warn if there are no sources.list.d. #. Only warn if there is no sources.list file. -#: methods/mirror.cc:95 apt-pkg/init.cc:113 apt-pkg/init.cc:121 -#: apt-pkg/sourcelist.cc:280 apt-pkg/sourcelist.cc:286 apt-pkg/clean.cc:43 -#: apt-pkg/acquire.cc:557 apt-pkg/policy.cc:381 apt-pkg/contrib/fileutl.cc:374 -#: apt-pkg/contrib/fileutl.cc:487 apt-pkg/contrib/cdromutl.cc:205 -#: apt-inst/extract.cc:471 +#: methods/mirror.cc:95 apt-inst/extract.cc:471 apt-pkg/init.cc:103 +#: apt-pkg/init.cc:111 apt-pkg/sourcelist.cc:280 apt-pkg/sourcelist.cc:286 +#: apt-pkg/clean.cc:43 apt-pkg/acquire.cc:494 apt-pkg/policy.cc:381 +#: apt-pkg/contrib/fileutl.cc:368 apt-pkg/contrib/fileutl.cc:481 +#: apt-pkg/contrib/cdromutl.cc:205 #, c-format msgid "Unable to read %s" -msgstr "%s okunamıyor" +msgstr "%s okunamadı" #: methods/mirror.cc:101 methods/mirror.cc:130 apt-pkg/clean.cc:49 -#: apt-pkg/clean.cc:67 apt-pkg/clean.cc:130 apt-pkg/acquire.cc:563 -#: apt-pkg/acquire.cc:588 apt-pkg/contrib/cdromutl.cc:201 +#: apt-pkg/clean.cc:67 apt-pkg/clean.cc:130 apt-pkg/acquire.cc:500 +#: apt-pkg/acquire.cc:525 apt-pkg/contrib/cdromutl.cc:201 #: apt-pkg/contrib/cdromutl.cc:235 #, c-format msgid "Unable to change to %s" @@ -1883,456 +1874,205 @@ msgstr "" msgid "Merging available information" msgstr "Kullanılabilir bilgiler birleştiriliyor" -#: cmdline/apt-extracttemplates.cc:229 -msgid "" -"Usage: apt-extracttemplates file1 [file2 ...]\n" -"\n" -"apt-extracttemplates is a tool to extract config and template info\n" -"from debian packages\n" -"\n" -"Options:\n" -" -h This help text\n" -" -t Set the temp dir\n" -" -c=? Read this configuration file\n" -" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" -msgstr "" -"Kullanım: apt-extracttemplates dosya1 [dosya2 ...]\n" -"\n" -"apt-extracttemplates, Debian paketlerinden ayar ve şablon bilgisini\n" -"almak için kullanılan bir araçtır\n" -"\n" -"Seçenekler:\n" -" -h Bu yardım dosyası\n" -" -t Geçici dizini ayarlar\n" -" -c=? Belirtilen ayar dosyasını kullanır\n" -" -o=? Ayar seçeneği belirtmeyi sağlar, ör -o dir::cache=/tmp\n" - -#: cmdline/apt-extracttemplates.cc:259 apt-pkg/contrib/fileutl.cc:2092 -#, c-format -msgid "Unable to mkstemp %s" -msgstr "mkstemp %s başarısız oldu" +#: apt-inst/filelist.cc:380 +msgid "DropNode called on still linked node" +msgstr "DropNode hâlâ bağlı olan düğüm üzerinde çağrıldı" -#: cmdline/apt-extracttemplates.cc:264 apt-pkg/pkgcachegen.cc:1385 -#: apt-pkg/contrib/fileutl.cc:2097 -#, c-format -msgid "Unable to write to %s" -msgstr "%s dosyasına yazılamıyor" +#: apt-inst/filelist.cc:412 +msgid "Failed to locate the hash element!" +msgstr "Sağlama elementi bulunamadı!" -#: cmdline/apt-extracttemplates.cc:305 -msgid "Cannot get debconf version. Is debconf installed?" -msgstr "debconf sürümü alınamıyor. debconf kurulu mu?" +#: apt-inst/filelist.cc:459 +msgid "Failed to allocate diversion" +msgstr "Yönlendirme tahsisi başarısız oldu" -#: ftparchive/apt-ftparchive.cc:186 ftparchive/apt-ftparchive.cc:370 -msgid "Package extension list is too long" -msgstr "Paket uzantı listesi çok uzun" +#: apt-inst/filelist.cc:464 +msgid "Internal error in AddDiversion" +msgstr "AddDiversion'da iç hata" -#: ftparchive/apt-ftparchive.cc:188 ftparchive/apt-ftparchive.cc:205 -#: ftparchive/apt-ftparchive.cc:228 ftparchive/apt-ftparchive.cc:282 -#: ftparchive/apt-ftparchive.cc:296 ftparchive/apt-ftparchive.cc:318 +#: apt-inst/filelist.cc:477 #, c-format -msgid "Error processing directory %s" -msgstr "%s dizinini işlemede hata" - -#: ftparchive/apt-ftparchive.cc:280 -msgid "Source extension list is too long" -msgstr "Kaynak uzantı listesi çok uzun" - -#: ftparchive/apt-ftparchive.cc:400 -msgid "Error writing header to contents file" -msgstr "İçindekiler dosyasına başlık yazmada hata" +msgid "Trying to overwrite a diversion, %s -> %s and %s/%s" +msgstr "Bir yönlendirmenin üzerine yazılmaya çalışılıyor, %s -> %s ve %s/%s" -#: ftparchive/apt-ftparchive.cc:430 +#: apt-inst/filelist.cc:506 #, c-format -msgid "Error processing contents %s" -msgstr "%s içeriğini işlemede hata" - -#: ftparchive/apt-ftparchive.cc:625 -msgid "" -"Usage: apt-ftparchive [options] command\n" -"Commands: packages binarypath [overridefile [pathprefix]]\n" -" sources srcpath [overridefile [pathprefix]]\n" -" contents path\n" -" release path\n" -" generate config [groups]\n" -" clean config\n" -"\n" -"apt-ftparchive generates index files for Debian archives. It supports\n" -"many styles of generation from fully automated to functional replacements\n" -"for dpkg-scanpackages and dpkg-scansources\n" -"\n" -"apt-ftparchive generates Package files from a tree of .debs. The\n" -"Package file contains the contents of all the control fields from\n" -"each package as well as the MD5 hash and filesize. An override file\n" -"is supported to force the value of Priority and Section.\n" -"\n" -"Similarly apt-ftparchive generates Sources files from a tree of .dscs.\n" -"The --source-override option can be used to specify a src override file\n" -"\n" -"The 'packages' and 'sources' command should be run in the root of the\n" -"tree. BinaryPath should point to the base of the recursive search and \n" -"override file should contain the override flags. Pathprefix is\n" -"appended to the filename fields if present. Example usage from the \n" -"Debian archive:\n" -" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n" -" dists/potato/main/binary-i386/Packages\n" -"\n" -"Options:\n" -" -h This help text\n" -" --md5 Control MD5 generation\n" -" -s=? Source override file\n" -" -q Quiet\n" -" -d=? Select the optional caching database\n" -" --no-delink Enable delinking debug mode\n" -" --contents Control contents file generation\n" -" -c=? Read this configuration file\n" -" -o=? Set an arbitrary configuration option" -msgstr "" -"Kullanım: apt-ftparchive [seçenekler] komut\n" -"Komutlar: packages ikilikonumu [geçersizkılmadosyası [konumöneki]]\n" -" sources kaynakkonumu [geçersizkılmadosyası [konumöneki]]\n" -" contents konum\n" -" release konum\n" -" generate yapılandırma [gruplar]\n" -" clean yapılandırma\n" -"\n" -"apt-ftparchive Debian arşivleri için indeks dosyaları üretir. \n" -"dpkg-scanpackages ve dpkg-scansources için tamamen otomatikten\n" -"işlevsel yedeklere kadar birçok üretim çeşidini destekler.\n" -"\n" -"apt-ftparchive, .deb dizinlerinden 'Package' dosyaları üretir. 'Package'\n" -"dosyası, her paketin MD5 doğrulama ve dosya büyüklüğü gibi denetim\n" -"alanlarının bilgilerini içerir. Öncelik (Priority) ve bölüm (Section)\n" -"değerlerini istenen başka değerlerle değiştirebilmek için bir geçersiz\n" -"kılma dosyası kullanılabilir.\n" -"\n" -"Benzer şekilde, apt-ftparchive, .dscs dosyalarından 'Sources' dosyaları\n" -"üretir. '--source-override' seçeneği bir src geçersiz kılma dosyası\n" -"belirtmek için kullanıabilir.\n" -"\n" -"'packages' ve 'sources' komutları dizin ağacının kökünde çalıştırıl-\n" -"malıdır. BinaryPath özyineli aramanın temeline işaret etmeli ve\n" -"geçersiz kılma dosyası geçersiz kılma bayraklarını içermelidir.\n" -"Pathprefix mevcutsa dosya adı alanlarının sonuna eklenir. Debian\n" -"arşivinden örnek kullanım şu şekildedir:\n" -"\n" -" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n" -" dists/potato/main/binary-i386/Packages\n" -"\n" -"Seçenekler:\n" -" -h Bu yardım metni\n" -" --md5 MD5 üretimini denetle\n" -" -s=? Kaynak geçersiz kılma dosyası\n" -" -q Sessiz\n" -" -d=? Seçimlik önbellek veritabanını seç\n" -" --no-delink Bağ kurulmamış hata ayıklama kipini etkinleştir\n" -" --contents İçerik dosyası üretimini denetle\n" -" -c=? Belirtilen yapılandırma dosyası kullan\n" -" -o=? Yapılandırma seçeneği ayarla" - -#: ftparchive/apt-ftparchive.cc:821 -msgid "No selections matched" -msgstr "Hiçbir seçim eşleşmedi" +msgid "Double add of diversion %s -> %s" +msgstr "Aynı dosya iki kez yönlendirilemez: %s -> %s" -#: ftparchive/apt-ftparchive.cc:906 +#: apt-inst/filelist.cc:549 #, c-format -msgid "Some files are missing in the package file group `%s'" -msgstr "'%s' paket dosyası grubunda bazı dosyalar eksik" +msgid "Duplicate conf file %s/%s" +msgstr "%s/%s yapılandırma dosyası zaten mevcut" -#: ftparchive/cachedb.cc:67 +#: apt-inst/extract.cc:101 apt-inst/extract.cc:172 #, c-format -msgid "DB was corrupted, file renamed to %s.old" -msgstr "Veritabanı bozuk, dosya adı %s.old olarak değiştirildi" +msgid "The path %s is too long" +msgstr "%s yolu çok uzun" -#: ftparchive/cachedb.cc:85 +#: apt-inst/extract.cc:132 #, c-format -msgid "DB is old, attempting to upgrade %s" -msgstr "Veritabanı eski, %s yükseltilmeye çalışılıyor" +msgid "Unpacking %s more than once" +msgstr "%s paketi bir çok kez açıldı" -#: ftparchive/cachedb.cc:96 -msgid "" -"DB format is invalid. If you upgraded from an older version of apt, please " -"remove and re-create the database." -msgstr "" -"Veritabanı biçimi geçersiz. Eğer apt'ın eski bir sürümünden yükseltme " -"yaptıysanız, lütfen veritabanını silin ve yeniden oluşturun." +#: apt-inst/extract.cc:142 +#, c-format +msgid "The directory %s is diverted" +msgstr "%s dizini yönlendirilmiş" -#: ftparchive/cachedb.cc:101 +#: apt-inst/extract.cc:152 #, c-format -msgid "Unable to open DB file %s: %s" -msgstr "Veritabanı dosyası %s açılamadı: %s" +msgid "The package is trying to write to the diversion target %s/%s" +msgstr "Bu paket yönlendirme hedefine (%s/%s) yazmayı deniyor" + +#: apt-inst/extract.cc:162 apt-inst/extract.cc:306 +msgid "The diversion path is too long" +msgstr "Yönlendirme yolu çok uzun" -#: ftparchive/cachedb.cc:184 apt-inst/extract.cc:186 apt-inst/extract.cc:199 -#: apt-inst/extract.cc:216 +#: apt-inst/extract.cc:186 apt-inst/extract.cc:199 apt-inst/extract.cc:216 +#: ftparchive/cachedb.cc:182 #, c-format msgid "Failed to stat %s" msgstr "%s durum bilgisi alınamadı" -#: ftparchive/cachedb.cc:326 -msgid "Failed to read .dsc" -msgstr ".dsc dosyası okunamadı" - -#: ftparchive/cachedb.cc:359 -msgid "Archive has no control record" -msgstr "Arşivin denetim kaydı yok" - -#: ftparchive/cachedb.cc:526 -msgid "Unable to get a cursor" -msgstr "İmleç alınamıyor" - -#: ftparchive/writer.cc:104 +#: apt-inst/extract.cc:194 ftparchive/multicompress.cc:374 #, c-format -msgid "W: Unable to read directory %s\n" -msgstr "U: %s dizini okunamıyor\n" +msgid "Failed to rename %s to %s" +msgstr "%s, %s olarak yeniden adlandırılamadı" -#: ftparchive/writer.cc:109 +#: apt-inst/extract.cc:249 #, c-format -msgid "W: Unable to stat %s\n" -msgstr "U: %s durum bilgisi alınamıyor\n" +msgid "The directory %s is being replaced by a non-directory" +msgstr "%s dizini dizin olmayan bir öğeyle değiştirildi" -#: ftparchive/writer.cc:165 -msgid "E: " -msgstr "H: " - -#: ftparchive/writer.cc:167 -msgid "W: " -msgstr "U: " - -#: ftparchive/writer.cc:174 -msgid "E: Errors apply to file " -msgstr "H: Hatalar şu dosya için geçerli: " - -#: ftparchive/writer.cc:192 ftparchive/writer.cc:224 -#, c-format -msgid "Failed to resolve %s" -msgstr "%s çözümlenemedi" - -#: ftparchive/writer.cc:205 -msgid "Tree walking failed" -msgstr "Ağaçta gezinme başarısız" - -#: ftparchive/writer.cc:232 -#, c-format -msgid "Failed to open %s" -msgstr "%s açılamadı" - -#: ftparchive/writer.cc:291 -#, c-format -msgid " DeLink %s [%s]\n" -msgstr " DeLink %s [%s]\n" - -#: ftparchive/writer.cc:299 -#, c-format -msgid "Failed to readlink %s" -msgstr "%s readlink çağrısı başarısız oldu" - -#: ftparchive/writer.cc:303 -#, c-format -msgid "Failed to unlink %s" -msgstr "%s bağı koparılamadı" - -#: ftparchive/writer.cc:311 -#, c-format -msgid "*** Failed to link %s to %s" -msgstr "*** %s, %s konumuna bağlanamadı" - -#: ftparchive/writer.cc:321 -#, c-format -msgid " DeLink limit of %sB hit.\n" -msgstr " %sB'lik bağ koparma (DeLink) sınırına ulaşıldı.\n" - -#: ftparchive/writer.cc:427 -msgid "Archive had no package field" -msgstr "Arşivde paket alanı yok" +#: apt-inst/extract.cc:289 +msgid "Failed to locate node in its hash bucket" +msgstr "Düğüm sağlama kovasında bulunamadı" -#: ftparchive/writer.cc:435 ftparchive/writer.cc:698 -#, c-format -msgid " %s has no override entry\n" -msgstr " %s için geçersiz kılma girdisi yok\n" +#: apt-inst/extract.cc:293 +msgid "The path is too long" +msgstr "Yol çok uzun" -#: ftparchive/writer.cc:502 ftparchive/writer.cc:862 +#: apt-inst/extract.cc:421 #, c-format -msgid " %s maintainer is %s not %s\n" -msgstr " %s geliştiricisi %s, %s değil\n" +msgid "Overwrite package match with no version for %s" +msgstr "%s paketinin sürümü yok" -#: ftparchive/writer.cc:712 +#: apt-inst/extract.cc:438 #, c-format -msgid " %s has no source override entry\n" -msgstr " '%s' paketinin yerine geçecek bir kaynak paket yok\n" +msgid "File %s/%s overwrites the one in the package %s" +msgstr "%s/%s dosyası %s paketindeki aynı adlı dosyanın üzerine yazmak istiyor" -#: ftparchive/writer.cc:716 +#: apt-inst/extract.cc:498 #, c-format -msgid " %s has no binary override entry either\n" -msgstr " '%s' paketinin yerine geçecek bir ikili paket de yok\n" - -#: ftparchive/contents.cc:351 ftparchive/contents.cc:382 -msgid "realloc - Failed to allocate memory" -msgstr "realloc - Bellek ayırma yapılamadı" +msgid "Unable to stat %s" +msgstr "%s durum bilgisi alınamadı" -#: ftparchive/override.cc:38 ftparchive/override.cc:142 +#: apt-inst/dirstream.cc:42 apt-inst/dirstream.cc:49 apt-inst/dirstream.cc:54 #, c-format -msgid "Unable to open %s" -msgstr "%s açılamıyor" +msgid "Failed to write file %s" +msgstr "%s dosyasına yazılamadı" -#. skip spaces -#. find end of word -#: ftparchive/override.cc:68 +#: apt-inst/dirstream.cc:105 #, c-format -msgid "Malformed override %s line %llu (%s)" -msgstr "Hatalı geçersiz kılma %s satır %llu (%s)" +msgid "Failed to close file %s" +msgstr "%s dosyası kapatılamadı" -#: ftparchive/override.cc:127 ftparchive/override.cc:201 +#: apt-inst/deb/debfile.cc:47 apt-inst/deb/debfile.cc:54 +#: apt-inst/deb/debfile.cc:63 #, c-format -msgid "Failed to read the override file %s" -msgstr "Geçersiz kılma dosyası %s okunamadı" +msgid "This is not a valid DEB archive, missing '%s' member" +msgstr "Bu dosya geçerli bir DEB arşivi değil, '%s' üyesi eksik" -#: ftparchive/override.cc:166 +#: apt-inst/deb/debfile.cc:132 #, c-format -msgid "Malformed override %s line %llu #1" -msgstr "Hatalı geçersiz kılma %s satır %llu #1" +msgid "Internal error, could not locate member %s" +msgstr "İç hata, %s üyesi bulunamadı" -#: ftparchive/override.cc:178 -#, c-format -msgid "Malformed override %s line %llu #2" -msgstr "Hatalı geçersiz kılma %s satır %llu #2" +#: apt-inst/deb/debfile.cc:227 +msgid "Unparsable control file" +msgstr "Ayrıştırılamayan 'control' dosyası" -#: ftparchive/override.cc:191 -#, c-format -msgid "Malformed override %s line %llu #3" -msgstr "Hatalı geçersiz kılma %s satır %llu #3" +#: apt-inst/contrib/arfile.cc:76 +msgid "Invalid archive signature" +msgstr "Geçersiz arşiv imzası" -#: ftparchive/multicompress.cc:73 -#, c-format -msgid "Unknown compression algorithm '%s'" -msgstr "Bilinmeyen sıkıştırma algoritması '%s'" +#: apt-inst/contrib/arfile.cc:84 +msgid "Error reading archive member header" +msgstr "Arşiv üyesi başlığı okuma hatası" -#: ftparchive/multicompress.cc:103 +#: apt-inst/contrib/arfile.cc:96 #, c-format -msgid "Compressed output %s needs a compression set" -msgstr "Sıkıştırılmış %s çıktısı bir sıkıştırma kümesine ihtiyaç duymaktadır" +msgid "Invalid archive member header %s" +msgstr "Geçersiz arşiv üyesi başlığı %s" -#: ftparchive/multicompress.cc:192 -msgid "Failed to create FILE*" -msgstr "DOSYA* oluşturulamadı" +#: apt-inst/contrib/arfile.cc:108 +msgid "Invalid archive member header" +msgstr "Geçersiz arşiv üyesi başlığı" -#: ftparchive/multicompress.cc:195 -msgid "Failed to fork" -msgstr "fork yapılamadı" +#: apt-inst/contrib/arfile.cc:137 +msgid "Archive is too short" +msgstr "Arşiv çok kısa" -#: ftparchive/multicompress.cc:209 -msgid "Compress child" -msgstr "Çocuğu sıkıştır" +#: apt-inst/contrib/arfile.cc:141 +msgid "Failed to read the archive headers" +msgstr "Arşiv başlıkları okunamadı" -#: ftparchive/multicompress.cc:232 -#, c-format -msgid "Internal error, failed to create %s" -msgstr "İç hata, %s oluşturulamadı" +#: apt-inst/contrib/extracttar.cc:124 +msgid "Failed to create pipes" +msgstr "Boru oluşturulamadı" -#: ftparchive/multicompress.cc:305 -msgid "IO to subprocess/file failed" -msgstr "Altsürece/dosyaya GÇ işlemi başarısız oldu" +#: apt-inst/contrib/extracttar.cc:151 +msgid "Failed to exec gzip " +msgstr "Gzip çalıştırılamadı " -#: ftparchive/multicompress.cc:343 -msgid "Failed to read while computing MD5" -msgstr "MD5 hesaplanırken okunamadı" +#: apt-inst/contrib/extracttar.cc:188 apt-inst/contrib/extracttar.cc:218 +msgid "Corrupted archive" +msgstr "Bozuk arşiv" -#: ftparchive/multicompress.cc:359 -#, c-format -msgid "Problem unlinking %s" -msgstr "%s bağı koparılırken sorun çıktı" +#: apt-inst/contrib/extracttar.cc:203 +msgid "Tar checksum failed, archive corrupted" +msgstr "Tar sağlama toplamı başarısız, arşiv bozulmuş" -#: ftparchive/multicompress.cc:374 apt-inst/extract.cc:194 +#: apt-inst/contrib/extracttar.cc:308 #, c-format -msgid "Failed to rename %s to %s" -msgstr "%s, %s olarak yeniden adlandırılamadı" - -#: cmdline/apt-internal-solver.cc:51 -msgid "" -"Usage: apt-internal-solver\n" -"\n" -"apt-internal-solver is an interface to use the current internal\n" -"like an external resolver for the APT family for debugging or alike\n" -"\n" -"Options:\n" -" -h This help text.\n" -" -q Loggable output - no progress indicator\n" -" -c=? Read this configuration file\n" -" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" -msgstr "" -"Kullanım: apt-internal-solver\n" -"\n" -"apt-internal-solver mevcut dâhilî çözücüyü (hata ayıklama\n" -"gibi sebeplerle) harici çözücü gibi kullanmaya yarayan bir\n" -"arayüzdür.\n" -"\n" -"Seçenekler:\n" -" -h Bu yardım metni.\n" -" -q Günlük tutmaya uygun çıktı - İlerleme göstergesi yok\n" -" -c=? Belirtilen yapılandırma dosyası kullan\n" -" -o=? Yapılandırma seçeneği ayarla, örneğin -o dir::cache=/tmp\n" - -#: cmdline/apt-sortpkgs.cc:91 -msgid "Unknown package record!" -msgstr "Bilinmeyen paket kaydı!" - -#: cmdline/apt-sortpkgs.cc:155 -msgid "" -"Usage: apt-sortpkgs [options] file1 [file2 ...]\n" -"\n" -"apt-sortpkgs is a simple tool to sort package files. The -s option is used\n" -"to indicate what kind of file it is.\n" -"\n" -"Options:\n" -" -h This help text\n" -" -s Use source file sorting\n" -" -c=? Read this configuration file\n" -" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" -msgstr "" -"Kullanım: apt-sortpkgs [seçenekler] dosya1 [dosya2 ...]\n" -"\n" -"apt-sortpkgs, paket dosyalarını sıralayan basit bir araçtır.\n" -"-s seçeneği ne tür bir dosya olduğunu göstermekte kullanılır.\n" -"\n" -"Seçenekler:\n" -" -h Bu yardım metni\n" -" -s Kaynak dosyası sıralamayı kullan\n" -" -c=? Belirtilen yapılandırma dosyasını oku\n" -" -o=? Herhangi bir yapılandırma seçeneği ayarla, örneğin -o dir::cache=/" -"tmp\n" +msgid "Unknown TAR header type %u, member %s" +msgstr "Bilinmeyen TAR başlığı türü %u, üye %s" -#: apt-pkg/install-progress.cc:59 +#: apt-pkg/install-progress.cc:57 #, c-format msgid "Progress: [%3i%%]" msgstr "Durum: [%3i%%]" -#: apt-pkg/install-progress.cc:93 apt-pkg/install-progress.cc:176 +#: apt-pkg/install-progress.cc:91 apt-pkg/install-progress.cc:174 msgid "Running dpkg" msgstr "dpkg çalıştırılıyor" -#: apt-pkg/init.cc:156 +#: apt-pkg/init.cc:146 #, c-format msgid "Packaging system '%s' is not supported" msgstr "Paketleme sistemi '%s' desteklenmiyor" -#: apt-pkg/init.cc:172 +#: apt-pkg/init.cc:162 msgid "Unable to determine a suitable packaging system type" msgstr "Uygun bir paketleme sistemi türü bulunamıyor" -#: apt-pkg/indexcopy.cc:236 apt-pkg/indexcopy.cc:775 +#: apt-pkg/indexcopy.cc:236 apt-pkg/indexcopy.cc:773 #, c-format msgid "Wrote %i records.\n" msgstr "%i kayıt yazıldı.\n" -#: apt-pkg/indexcopy.cc:238 apt-pkg/indexcopy.cc:777 +#: apt-pkg/indexcopy.cc:238 apt-pkg/indexcopy.cc:775 #, c-format msgid "Wrote %i records with %i missing files.\n" msgstr "%2$i eksik dosyayla %1$i kayıt yazıldı.\n" -#: apt-pkg/indexcopy.cc:241 apt-pkg/indexcopy.cc:780 +#: apt-pkg/indexcopy.cc:241 apt-pkg/indexcopy.cc:778 #, c-format msgid "Wrote %i records with %i mismatched files\n" msgstr "%2$i eşleşmeyen dosyayla %1$i kayıt yazıldı\n" -#: apt-pkg/indexcopy.cc:244 apt-pkg/indexcopy.cc:783 +#: apt-pkg/indexcopy.cc:244 apt-pkg/indexcopy.cc:781 #, c-format msgid "Wrote %i records with %i missing files and %i mismatched files\n" msgstr "%2$i eksik dosya ve %3$i eşleşmeyen dosyayla %1$i kayıt yazıldı\n" @@ -2347,22 +2087,22 @@ msgstr "%s için kimlik doğrulama kaydı bulunamadı" msgid "Hash mismatch for: %s" msgstr "Sağlama yapılamadı: %s" -#: apt-pkg/acquire-worker.cc:133 +#: apt-pkg/acquire-worker.cc:116 #, c-format msgid "The method driver %s could not be found." msgstr "Yöntem sürücüsü %s bulunamadı." -#: apt-pkg/acquire-worker.cc:135 +#: apt-pkg/acquire-worker.cc:118 #, c-format msgid "Is the package %s installed?" msgstr "%s paketi kurulu mu?" -#: apt-pkg/acquire-worker.cc:186 +#: apt-pkg/acquire-worker.cc:169 #, c-format msgid "Method %s did not start correctly" msgstr "%s yöntemi düzgün şekilde başlamadı" -#: apt-pkg/acquire-worker.cc:485 +#: apt-pkg/acquire-worker.cc:455 #, c-format msgid "Please insert the disc labeled: '%s' in the drive '%s' and press enter." msgstr "" @@ -2381,92 +2121,87 @@ msgstr "Bu sorunları gidermek için apt-get update komutunu çalıştırabilirs msgid "The list of sources could not be read." msgstr "Kaynak listesi okunamadı." -#: apt-pkg/pkgcache.cc:154 +#: apt-pkg/pkgcache.cc:155 msgid "Empty package cache" msgstr "Paket önbelleği boş" -#: apt-pkg/pkgcache.cc:160 apt-pkg/pkgcache.cc:171 +#: apt-pkg/pkgcache.cc:161 msgid "The package cache file is corrupted" msgstr "Paket önbelleği dosyası bozulmuş" -#: apt-pkg/pkgcache.cc:165 +#: apt-pkg/pkgcache.cc:166 msgid "The package cache file is an incompatible version" msgstr "Paket önbelleği dosyası uyumsuz bir sürümde" -#: apt-pkg/pkgcache.cc:168 +#: apt-pkg/pkgcache.cc:169 msgid "The package cache file is corrupted, it is too small" msgstr "Paket önbellek dosyası bozulmuş, çok küçük" -#: apt-pkg/pkgcache.cc:175 +#: apt-pkg/pkgcache.cc:174 #, c-format msgid "This APT does not support the versioning system '%s'" msgstr "Bu APT '%s' sürümleme sistemini desteklemiyor" -#: apt-pkg/pkgcache.cc:185 -#, fuzzy, c-format -msgid "The package cache was built for different architectures: %s vs %s" +#: apt-pkg/pkgcache.cc:179 +msgid "The package cache was built for a different architecture" msgstr "Paket önbelleği farklı bir mimarı için yapılmış" -#: apt-pkg/pkgcache.cc:322 +#: apt-pkg/pkgcache.cc:321 msgid "Depends" msgstr "Bağımlılıklar" -#: apt-pkg/pkgcache.cc:322 +#: apt-pkg/pkgcache.cc:321 msgid "PreDepends" msgstr "ÖnBağımlılıklar" -#: apt-pkg/pkgcache.cc:322 +#: apt-pkg/pkgcache.cc:321 msgid "Suggests" msgstr "Önerdikleri" -#: apt-pkg/pkgcache.cc:323 +#: apt-pkg/pkgcache.cc:322 msgid "Recommends" msgstr "Tavsiye ettikleri" -#: apt-pkg/pkgcache.cc:323 +#: apt-pkg/pkgcache.cc:322 msgid "Conflicts" msgstr "Çakışmalar" -#: apt-pkg/pkgcache.cc:323 +#: apt-pkg/pkgcache.cc:322 msgid "Replaces" msgstr "Değiştirilenler" -#: apt-pkg/pkgcache.cc:324 +#: apt-pkg/pkgcache.cc:323 msgid "Obsoletes" msgstr "Eskiyenler" -#: apt-pkg/pkgcache.cc:324 +#: apt-pkg/pkgcache.cc:323 msgid "Breaks" msgstr "Bozdukları" -#: apt-pkg/pkgcache.cc:324 +#: apt-pkg/pkgcache.cc:323 msgid "Enhances" msgstr "Geliştirdikleri" -#: apt-pkg/pkgcache.cc:335 +#: apt-pkg/pkgcache.cc:334 msgid "important" msgstr "önemli" -#: apt-pkg/pkgcache.cc:335 +#: apt-pkg/pkgcache.cc:334 msgid "required" msgstr "gerekli" -#: apt-pkg/pkgcache.cc:335 +#: apt-pkg/pkgcache.cc:334 msgid "standard" msgstr "standart" -#: apt-pkg/pkgcache.cc:336 +#: apt-pkg/pkgcache.cc:335 msgid "optional" msgstr "seçimlik" -#: apt-pkg/pkgcache.cc:336 +#: apt-pkg/pkgcache.cc:335 msgid "extra" msgstr "ilave" -#: apt-pkg/upgrade.cc:34 apt-pkg/upgrade.cc:136 apt-pkg/upgrade.cc:182 -msgid "Calculating upgrade" -msgstr "Yükseltme hesaplanıyor" - #: apt-pkg/pkgrecords.cc:38 #, c-format msgid "Index file type '%s' is not supported" @@ -2564,7 +2299,7 @@ msgstr "'%s' türü bilinmiyor. (Satır: %u, Kaynak Listesi: %s)" msgid "Type '%s' is not known on stanza %u in source list %s" msgstr "'%s' türü bilinmiyor (girdi: %u, kaynak listesi: %s)" -#: apt-pkg/clean.cc:39 apt-pkg/acquire.cc:553 +#: apt-pkg/clean.cc:39 apt-pkg/acquire.cc:490 #, c-format msgid "Clean of %s is not supported" msgstr "%s temizliği desteklenmiyor" @@ -2574,60 +2309,66 @@ msgstr "%s temizliği desteklenmiyor" msgid "Unable to stat %s." msgstr "%s için dosya bilgisi alınamadı." -#: apt-pkg/pkgcachegen.cc:113 +#: apt-pkg/pkgcachegen.cc:93 msgid "Cache has an incompatible versioning system" msgstr "Önbelleğin uyumsuz bir sürümleme sistemi var" #. TRANSLATOR: The first placeholder is a package name, #. the other two should be copied verbatim as they include debug info -#: apt-pkg/pkgcachegen.cc:240 apt-pkg/pkgcachegen.cc:250 -#: apt-pkg/pkgcachegen.cc:316 apt-pkg/pkgcachegen.cc:382 +#: apt-pkg/pkgcachegen.cc:224 apt-pkg/pkgcachegen.cc:234 +#: apt-pkg/pkgcachegen.cc:300 apt-pkg/pkgcachegen.cc:327 +#: apt-pkg/pkgcachegen.cc:340 apt-pkg/pkgcachegen.cc:382 #: apt-pkg/pkgcachegen.cc:386 apt-pkg/pkgcachegen.cc:403 #: apt-pkg/pkgcachegen.cc:411 apt-pkg/pkgcachegen.cc:415 #: apt-pkg/pkgcachegen.cc:419 apt-pkg/pkgcachegen.cc:440 -#: apt-pkg/pkgcachegen.cc:479 apt-pkg/pkgcachegen.cc:525 -#: apt-pkg/pkgcachegen.cc:539 apt-pkg/pkgcachegen.cc:570 -#: apt-pkg/pkgcachegen.cc:584 +#: apt-pkg/pkgcachegen.cc:479 apt-pkg/pkgcachegen.cc:517 +#: apt-pkg/pkgcachegen.cc:524 apt-pkg/pkgcachegen.cc:555 +#: apt-pkg/pkgcachegen.cc:569 #, c-format msgid "Error occurred while processing %s (%s%d)" msgstr "%s paketi işlenirken sorunlarla karşılaşıldı (%s%d)" -#: apt-pkg/pkgcachegen.cc:273 +#: apt-pkg/pkgcachegen.cc:257 msgid "Wow, you exceeded the number of package names this APT is capable of." msgstr "Vay canına, bu APT'nin alabileceği paket adları sayısını aştınız." -#: apt-pkg/pkgcachegen.cc:276 +#: apt-pkg/pkgcachegen.cc:260 msgid "Wow, you exceeded the number of versions this APT is capable of." msgstr "Vay canına, bu APT'nin alabileceği sürüm sayısını aştınız." -#: apt-pkg/pkgcachegen.cc:279 +#: apt-pkg/pkgcachegen.cc:263 msgid "Wow, you exceeded the number of descriptions this APT is capable of." msgstr "Vay canına, bu APT'nin alabileceği açıklama sayısını aştınız." -#: apt-pkg/pkgcachegen.cc:282 +#: apt-pkg/pkgcachegen.cc:266 msgid "Wow, you exceeded the number of dependencies this APT is capable of." msgstr "Vay canına, bu APT'nin alabileceği bağımlılık sayısını aştınız." -#: apt-pkg/pkgcachegen.cc:591 +#: apt-pkg/pkgcachegen.cc:576 #, c-format msgid "Package %s %s was not found while processing file dependencies" msgstr "Dosya bağımlılıkları işlenirken %s %s paketi bulunamadı" -#: apt-pkg/pkgcachegen.cc:1196 +#: apt-pkg/pkgcachegen.cc:1211 #, c-format msgid "Couldn't stat source package list %s" msgstr "Kaynak listesinin (%s) dosya bilgisi alınamadı" -#: apt-pkg/pkgcachegen.cc:1284 apt-pkg/pkgcachegen.cc:1388 -#: apt-pkg/pkgcachegen.cc:1394 apt-pkg/pkgcachegen.cc:1551 +#: apt-pkg/pkgcachegen.cc:1299 apt-pkg/pkgcachegen.cc:1403 +#: apt-pkg/pkgcachegen.cc:1409 apt-pkg/pkgcachegen.cc:1566 msgid "Reading package lists" msgstr "Paket listeleri okunuyor" -#: apt-pkg/pkgcachegen.cc:1301 +#: apt-pkg/pkgcachegen.cc:1316 msgid "Collecting File Provides" msgstr "Dosya Sağlananları Toplanıyor" -#: apt-pkg/pkgcachegen.cc:1493 apt-pkg/pkgcachegen.cc:1500 +#: apt-pkg/pkgcachegen.cc:1400 cmdline/apt-extracttemplates.cc:259 +#, c-format +msgid "Unable to write to %s" +msgstr "%s dosyasına yazılamıyor" + +#: apt-pkg/pkgcachegen.cc:1508 apt-pkg/pkgcachegen.cc:1515 msgid "IO Error saving source cache" msgstr "Kaynak önbelleği kaydedilirken GÇ Hatası" @@ -2635,106 +2376,59 @@ msgstr "Kaynak önbelleği kaydedilirken GÇ Hatası" msgid "Send scenario to solver" msgstr "Çözücüye senaryo gönder" -#: apt-pkg/edsp.cc:244 +#: apt-pkg/edsp.cc:241 msgid "Send request to solver" msgstr "Çözücüye istek gönder" -#: apt-pkg/edsp.cc:323 +#: apt-pkg/edsp.cc:320 msgid "Prepare for receiving solution" msgstr "Çözüm almak için hazırlan" -#: apt-pkg/edsp.cc:330 +#: apt-pkg/edsp.cc:327 msgid "External solver failed without a proper error message" msgstr "Harici çözücü düzgün bir hata iletisi göstermeden başarısız oldu" -#: apt-pkg/edsp.cc:622 apt-pkg/edsp.cc:625 apt-pkg/edsp.cc:630 +#: apt-pkg/edsp.cc:619 apt-pkg/edsp.cc:622 apt-pkg/edsp.cc:627 msgid "Execute external solver" msgstr "Harici çözücüyü çalıştır" -#: apt-pkg/acquire-item.cc:98 -msgid "Use --allow-insecure-repositories to force the update" -msgstr "" - -#: apt-pkg/acquire-item.cc:215 apt-pkg/contrib/fileutl.cc:2108 +#: apt-pkg/acquire-item.cc:148 apt-pkg/contrib/fileutl.cc:2047 #, c-format msgid "rename failed, %s (%s -> %s)." msgstr "yeniden adlandırma başarısız, %s (%s -> %s)." -#: apt-pkg/acquire-item.cc:240 +#: apt-pkg/acquire-item.cc:163 msgid "Hash Sum mismatch" msgstr "Sağlama toplamları eşleşmiyor" -#: apt-pkg/acquire-item.cc:245 +#: apt-pkg/acquire-item.cc:168 msgid "Size mismatch" msgstr "Boyutlar eşleşmiyor" -#: apt-pkg/acquire-item.cc:250 +#: apt-pkg/acquire-item.cc:173 msgid "Invalid file format" msgstr "Geçersiz dosya biçimi" -#: apt-pkg/acquire-item.cc:255 -#, fuzzy -msgid "Signature error" -msgstr "Yazma hatası" - -#: apt-pkg/acquire-item.cc:259 -#, fuzzy -msgid "Does not start with a cleartext signature" -msgstr "%s dosyası açıkimzalı bir iletiyle başlamıyor" - -#: apt-pkg/acquire-item.cc:1584 +#: apt-pkg/acquire-item.cc:1650 #, c-format msgid "" -"An error occurred during the signature verification. The repository is not " -"updated and the previous index files will be used. GPG error: %s: %s\n" +"Unable to find expected entry '%s' in Release file (Wrong sources.list entry " +"or malformed file)" msgstr "" -"İmza doğrulama sırasında bir hata meydana geldi. Depo güncel değil ve önceki " -"indeks dosyaları kullanılacak. GPG hatası: %s:%s\n" +"'Release' dosyasında olması beklenilen '%s' girdisi bulunamadı (sources.list " +"dosyasındaki girdi ya da satır hatalı)" -#. Invalid signature file, reject (LP: #346386) (Closes: #627642) -#: apt-pkg/acquire-item.cc:1594 apt-pkg/acquire-item.cc:1600 -#, c-format -msgid "GPG error: %s: %s" -msgstr "GPG hatası: %s: %s" - -#: apt-pkg/acquire-item.cc:1707 -#, fuzzy, c-format -msgid "The repository '%s' is no longer signed." -msgstr "%s dizini yönlendirilmiş" - -#: apt-pkg/acquire-item.cc:1714 -msgid "" -"This is normally not allowed, but the option Acquire::" -"AllowDowngradeToInsecureRepositories was given to override it." -msgstr "" - -#: apt-pkg/acquire-item.cc:1727 apt-pkg/acquire-item.cc:2202 -#, c-format -msgid "" -"The data from '%s' is not signed. Packages from that repository can not be " -"authenticated." -msgstr "" - -#: apt-pkg/acquire-item.cc:1956 -#, c-format -msgid "" -"Unable to find expected entry '%s' in Release file (Wrong sources.list entry " -"or malformed file)" -msgstr "" -"'Release' dosyasında olması beklenilen '%s' girdisi bulunamadı (sources.list " -"dosyasındaki girdi ya da satır hatalı)" - -#: apt-pkg/acquire-item.cc:1975 +#: apt-pkg/acquire-item.cc:1666 #, c-format msgid "Unable to find hash sum for '%s' in Release file" msgstr "'Release' dosyasında '%s' için uygun bir sağlama toplamı bulunamadı" -#: apt-pkg/acquire-item.cc:1999 +#: apt-pkg/acquire-item.cc:1708 msgid "There is no public key available for the following key IDs:\n" msgstr "" "Aşağıdaki anahtar kimlikleri için kullanılır hiçbir genel anahtar yok:\n" -#: apt-pkg/acquire-item.cc:2037 +#: apt-pkg/acquire-item.cc:1746 #, c-format msgid "" "Release file for %s is expired (invalid since %s). Updates for this " @@ -2743,19 +2437,27 @@ msgstr "" "%s konumundaki 'Release' dosyasının vâdesi dolmuş (%s önce). Bu deponun " "güncelleştirmeleri uygulanmayacak." -#: apt-pkg/acquire-item.cc:2059 +#: apt-pkg/acquire-item.cc:1768 #, c-format msgid "Conflicting distribution: %s (expected %s but got %s)" msgstr "Dağıtım çakışması: %s (beklenen %s ama eldeki %s)" -#: apt-pkg/acquire-item.cc:2078 +#: apt-pkg/acquire-item.cc:1798 #, c-format msgid "" -"The repository '%s' does not have a Release file. This is deprecated, please " -"contact the owner of the repository." +"An error occurred during the signature verification. The repository is not " +"updated and the previous index files will be used. GPG error: %s: %s\n" msgstr "" +"İmza doğrulama sırasında bir hata meydana geldi. Depo güncel değil ve önceki " +"indeks dosyaları kullanılacak. GPG hatası: %s:%s\n" -#: apt-pkg/acquire-item.cc:2249 +#. Invalid signature file, reject (LP: #346386) (Closes: #627642) +#: apt-pkg/acquire-item.cc:1808 apt-pkg/acquire-item.cc:1813 +#, c-format +msgid "GPG error: %s: %s" +msgstr "GPG hatası: %s: %s" + +#: apt-pkg/acquire-item.cc:1936 #, c-format msgid "" "I wasn't able to locate a file for the %s package. This might mean you need " @@ -2764,45 +2466,45 @@ msgstr "" "%s paketindeki dosyalardan biri konumlandırılamadı. Bu durum, bu paketi elle " "düzeltmeniz gerektiği anlamına gelebilir. (eksik mimariden dolayı)" -#: apt-pkg/acquire-item.cc:2315 +#: apt-pkg/acquire-item.cc:2002 #, c-format msgid "Can't find a source to download version '%s' of '%s'" msgstr "'%2$s' paketinin '%1$s' sürümü hiçbir kaynakta bulunamadı" -#: apt-pkg/acquire-item.cc:2351 +#: apt-pkg/acquire-item.cc:2060 #, c-format msgid "" "The package index files are corrupted. No Filename: field for package %s." msgstr "Paket indeks dosyaları bozuk. %s paketinin 'Filename:' alanı yok." -#: apt-pkg/vendorlist.cc:83 +#: apt-pkg/vendorlist.cc:85 #, c-format msgid "Vendor block %s contains no fingerprint" msgstr "Sağlayıcı bloğu %s parmak izi içermiyor" -#: apt-pkg/acquire.cc:126 apt-pkg/acquire.cc:146 apt-pkg/cdrom.cc:832 +#: apt-pkg/acquire.cc:87 apt-pkg/cdrom.cc:829 #, c-format msgid "List directory %spartial is missing." msgstr "Liste dizini %spartial bulunamadı." -#: apt-pkg/acquire.cc:129 apt-pkg/acquire.cc:151 +#: apt-pkg/acquire.cc:91 #, c-format msgid "Archives directory %spartial is missing." msgstr "Arşiv dizini %spartial bulunamadı." -#: apt-pkg/acquire.cc:162 +#: apt-pkg/acquire.cc:99 #, c-format msgid "Unable to lock directory %s" msgstr "%s dizini kilitlenemiyor" #. only show the ETA if it makes sense #. two days -#: apt-pkg/acquire.cc:981 +#: apt-pkg/acquire.cc:902 #, c-format msgid "Retrieving file %li of %li (%s remaining)" msgstr "Alınan dosya: %li / %li (%s kaldı)" -#: apt-pkg/acquire.cc:983 +#: apt-pkg/acquire.cc:904 #, c-format msgid "Retrieving file %li of %li" msgstr "Alınan dosya: %li / %li" @@ -2834,7 +2536,7 @@ msgstr "İğne türü %s anlaşılamadı" msgid "No priority (or zero) specified for pin" msgstr "İğne için öncelik belirlenmedi (ya da sıfır)" -#: apt-pkg/packagemanager.cc:304 apt-pkg/packagemanager.cc:984 +#: apt-pkg/packagemanager.cc:303 apt-pkg/packagemanager.cc:957 #, c-format msgid "" "Could not perform immediate configuration on '%s'. Please see man 5 apt.conf " @@ -2843,12 +2545,12 @@ msgstr "" "\"%s\" paketinin anında yapılandırması başarısız oldu. Ayrıntılar için apt." "conf(5) rehber sayfasının APT::Immediate-Configure kısmına bakın. (%d)" -#: apt-pkg/packagemanager.cc:563 apt-pkg/packagemanager.cc:593 +#: apt-pkg/packagemanager.cc:550 apt-pkg/packagemanager.cc:580 #, c-format msgid "Could not configure '%s'. " msgstr "'%s' paketi yapılandırılamadı. " -#: apt-pkg/packagemanager.cc:643 +#: apt-pkg/packagemanager.cc:630 #, c-format msgid "" "This installation run will require temporarily removing the essential " @@ -2937,11 +2639,11 @@ msgstr "" msgid "Copying package lists..." msgstr "Paket listeleri kopyalanıyor..." -#: apt-pkg/cdrom.cc:866 +#: apt-pkg/cdrom.cc:863 msgid "Writing new source list\n" msgstr "Yeni kaynak listesi yazılıyor\n" -#: apt-pkg/cdrom.cc:877 +#: apt-pkg/cdrom.cc:874 msgid "Source list entries for this disc are:\n" msgstr "Bu disk için olan kaynak listesi girdileri:\n" @@ -2953,7 +2655,7 @@ msgstr "" "%s paketinin tekrar kurulması gerekli, ancak gereken arşiv dosyası " "bulunamıyor." -#: apt-pkg/algorithms.cc:1090 +#: apt-pkg/algorithms.cc:1086 msgid "" "Error, pkgProblemResolver::Resolve generated breaks, this may be caused by " "held packages." @@ -2961,7 +2663,7 @@ msgstr "" "Hata, pkgProblemResolver::Resolve bozuk paketlere yol açtı, bu sorunun " "nedeni tutulan paketler olabilir." -#: apt-pkg/algorithms.cc:1092 +#: apt-pkg/algorithms.cc:1088 msgid "Unable to correct problems, you have held broken packages." msgstr "Sorunlar giderilemedi, tutulan bozuk paketleriniz var." @@ -2981,167 +2683,172 @@ msgstr "Bağımlılık oluşturma" msgid "Reading state information" msgstr "Durum bilgisi okunuyor" -#: apt-pkg/depcache.cc:252 +#: apt-pkg/depcache.cc:250 #, c-format msgid "Failed to open StateFile %s" msgstr "Durum dosyası (StateFile) %s açılamadı" -#: apt-pkg/depcache.cc:258 +#: apt-pkg/depcache.cc:256 #, c-format msgid "Failed to write temporary StateFile %s" msgstr "Geçici durum dosyasına (%s) yazma başarısız oldu" -#: apt-pkg/tagfile.cc:186 apt-pkg/tagfile.cc:286 apt-pkg/deb/debrecords.cc:207 +#: apt-pkg/tagfile.cc:140 +#, c-format +msgid "Unable to parse package file %s (1)" +msgstr "Paket dosyası %s ayrıştırılamadı (1)" + +#: apt-pkg/tagfile.cc:237 #, c-format -msgid "Unable to parse package file %s (%d)" -msgstr "Paket dosyası %s ayrıştırılamadı (%d)" +msgid "Unable to parse package file %s (2)" +msgstr "Paket dosyası %s ayrıştırılamadı (2)" -#: apt-pkg/cacheset.cc:501 +#: apt-pkg/cacheset.cc:489 #, c-format msgid "Release '%s' for '%s' was not found" msgstr "'%2$s' paketinin '%1$s' sürümü bulunamadı" -#: apt-pkg/cacheset.cc:504 +#: apt-pkg/cacheset.cc:492 #, c-format msgid "Version '%s' for '%s' was not found" msgstr "'%2$s' paketinin '%1$s' sürümü bulunamadı" -#: apt-pkg/cacheset.cc:629 +#: apt-pkg/cacheset.cc:603 #, c-format msgid "Couldn't find task '%s'" msgstr "'%s' görevi bulunamadı" -#: apt-pkg/cacheset.cc:635 +#: apt-pkg/cacheset.cc:609 #, c-format msgid "Couldn't find any package by regex '%s'" msgstr "'%s' düzenli ifadesini içeren herhangi bir paket bulunamadı" -#: apt-pkg/cacheset.cc:641 +#: apt-pkg/cacheset.cc:615 #, c-format msgid "Couldn't find any package by glob '%s'" msgstr "'%s' ifadesine eşleşen herhangi bir paket bulunamadı" -#: apt-pkg/cacheset.cc:680 +#: apt-pkg/cacheset.cc:626 #, c-format msgid "Can't select versions from package '%s' as it is purely virtual" msgstr "'%s' paketi tamamen sanal olduğu için sürümü seçilemiyor" -#: apt-pkg/cacheset.cc:719 +#: apt-pkg/cacheset.cc:633 apt-pkg/cacheset.cc:640 +#, c-format +msgid "" +"Can't select installed nor candidate version from package '%s' as it has " +"neither of them" +msgstr "" +"'%s' paketi kurulu olmadığı ve aday sürüme sahip olmadığı için her ikisi de " +"seçilemiyor" + +#: apt-pkg/cacheset.cc:647 #, c-format msgid "Can't select newest version from package '%s' as it is purely virtual" msgstr "'%s' paketi sanal olduğu için en yeni sürümü seçilemiyor" -#: apt-pkg/cacheset.cc:727 +#: apt-pkg/cacheset.cc:655 #, c-format msgid "Can't select candidate version from package %s as it has no candidate" msgstr "'%s' paketinin aday sürümü olmadığı için aday sürüm seçilemiyor" -#: apt-pkg/cacheset.cc:735 +#: apt-pkg/cacheset.cc:663 #, c-format msgid "Can't select installed version from package %s as it is not installed" msgstr "'%s' paketi kurulu olmadığı için kurulu sürüm seçilemiyor" -#: apt-pkg/cacheset.cc:743 apt-pkg/cacheset.cc:751 -#, c-format -msgid "" -"Can't select installed nor candidate version from package '%s' as it has " -"neither of them" -msgstr "" -"'%s' paketi kurulu olmadığı ve aday sürüme sahip olmadığı için her ikisi de " -"seçilemiyor" - -#: apt-pkg/indexrecords.cc:83 +#: apt-pkg/indexrecords.cc:78 #, c-format msgid "Unable to parse Release file %s" msgstr "'Release' dosyası (%s) ayrıştırılamadı" -#: apt-pkg/indexrecords.cc:91 +#: apt-pkg/indexrecords.cc:86 #, c-format msgid "No sections in Release file %s" msgstr "'Release' dosyası %s içinde hiç bölüm yok" -#: apt-pkg/indexrecords.cc:132 +#: apt-pkg/indexrecords.cc:117 #, c-format msgid "No Hash entry in Release file %s" msgstr "'Release' dosyasında (%s) sağlama girdisi yok" -#: apt-pkg/indexrecords.cc:145 +#: apt-pkg/indexrecords.cc:130 #, c-format msgid "Invalid 'Valid-Until' entry in Release file %s" msgstr "'Release' dosyasında (%s) geçersiz 'Valid-Until' girdisi" -#: apt-pkg/indexrecords.cc:164 +#: apt-pkg/indexrecords.cc:149 #, c-format msgid "Invalid 'Date' entry in Release file %s" msgstr "'Release' dosyasında (%s) geçersiz 'Date' girdisi" #. d means days, h means hours, min means minutes, s means seconds -#: apt-pkg/contrib/strutl.cc:425 +#: apt-pkg/contrib/strutl.cc:418 #, c-format msgid "%lid %lih %limin %lis" msgstr "%li gün %li saat %li dk. %li sn." #. h means hours, min means minutes, s means seconds -#: apt-pkg/contrib/strutl.cc:432 +#: apt-pkg/contrib/strutl.cc:425 #, c-format msgid "%lih %limin %lis" msgstr "%li saat %li dk. %li sn." #. min means minutes, s means seconds -#: apt-pkg/contrib/strutl.cc:439 +#: apt-pkg/contrib/strutl.cc:432 #, c-format msgid "%limin %lis" msgstr "%li dk. %li sn." #. s means seconds -#: apt-pkg/contrib/strutl.cc:444 +#: apt-pkg/contrib/strutl.cc:437 #, c-format msgid "%lis" msgstr "%li sn." -#: apt-pkg/contrib/strutl.cc:1290 +#: apt-pkg/contrib/strutl.cc:1258 #, c-format msgid "Selection %s not found" msgstr "%s seçimi bulunamadı" -#: apt-pkg/contrib/fileutl.cc:196 +#: apt-pkg/contrib/fileutl.cc:190 #, c-format msgid "Not using locking for read only lock file %s" msgstr "Kilitleme dosyası %s salt okunur olduğu için kilitleme kullanılmıyor" -#: apt-pkg/contrib/fileutl.cc:201 +#: apt-pkg/contrib/fileutl.cc:195 #, c-format msgid "Could not open lock file %s" msgstr "Kilit dosyası %s açılamadı" -#: apt-pkg/contrib/fileutl.cc:224 +#: apt-pkg/contrib/fileutl.cc:218 #, c-format msgid "Not using locking for nfs mounted lock file %s" msgstr "nfs ile bağlanmış kilit dosyası %s için kilitleme kullanılmıyor" -#: apt-pkg/contrib/fileutl.cc:229 +#: apt-pkg/contrib/fileutl.cc:223 #, c-format msgid "Could not get lock %s" msgstr "%s kilidi alınamadı" -#: apt-pkg/contrib/fileutl.cc:366 apt-pkg/contrib/fileutl.cc:480 +#: apt-pkg/contrib/fileutl.cc:360 apt-pkg/contrib/fileutl.cc:474 #, c-format msgid "List of files can't be created as '%s' is not a directory" msgstr "'%s' dizin olmadığı için dosya listeli oluşturulamıyor" -#: apt-pkg/contrib/fileutl.cc:400 +#: apt-pkg/contrib/fileutl.cc:394 #, c-format msgid "Ignoring '%s' in directory '%s' as it is not a regular file" msgstr "" "'%2$s' dizinindeki '%1$s' normal bir dosya olmadığı için görmezden geliniyor" -#: apt-pkg/contrib/fileutl.cc:418 +#: apt-pkg/contrib/fileutl.cc:412 #, c-format msgid "Ignoring file '%s' in directory '%s' as it has no filename extension" msgstr "" "'%2$s' dizinindeki '%1$s' dosyası uzantısı olmadığı için görmezden geliniyor" -#: apt-pkg/contrib/fileutl.cc:427 +#: apt-pkg/contrib/fileutl.cc:421 #, c-format msgid "" "Ignoring file '%s' in directory '%s' as it has an invalid filename extension" @@ -3149,75 +2856,75 @@ msgstr "" "'%2$s' dizinindeki '%1$s' dosyası geçersiz bir dosya uzantısı olduğu için " "yok sayılıyor" -#: apt-pkg/contrib/fileutl.cc:846 +#: apt-pkg/contrib/fileutl.cc:824 #, c-format msgid "Sub-process %s received a segmentation fault." msgstr "%s altsüreci bir bölümleme hatası aldı (segmentation fault)." -#: apt-pkg/contrib/fileutl.cc:848 +#: apt-pkg/contrib/fileutl.cc:826 #, c-format msgid "Sub-process %s received signal %u." msgstr "%s altsüreci %u sinyali aldı." -#: apt-pkg/contrib/fileutl.cc:852 apt-pkg/contrib/gpgv.cc:212 +#: apt-pkg/contrib/fileutl.cc:830 apt-pkg/contrib/gpgv.cc:239 #, c-format msgid "Sub-process %s returned an error code (%u)" msgstr "%s altsüreci bir hata kodu gönderdi (%u)" -#: apt-pkg/contrib/fileutl.cc:854 apt-pkg/contrib/gpgv.cc:205 +#: apt-pkg/contrib/fileutl.cc:832 apt-pkg/contrib/gpgv.cc:232 #, c-format msgid "Sub-process %s exited unexpectedly" msgstr "%s altsüreci beklenmeyen bir şekilde sona erdi" -#: apt-pkg/contrib/fileutl.cc:952 +#: apt-pkg/contrib/fileutl.cc:913 #, c-format msgid "Problem closing the gzip file %s" msgstr "Gzip dosyası %s kapatılamadı" -#: apt-pkg/contrib/fileutl.cc:1140 +#: apt-pkg/contrib/fileutl.cc:1101 #, c-format msgid "Could not open file %s" msgstr "%s dosyası açılamadı" -#: apt-pkg/contrib/fileutl.cc:1199 apt-pkg/contrib/fileutl.cc:1246 +#: apt-pkg/contrib/fileutl.cc:1160 apt-pkg/contrib/fileutl.cc:1207 #, c-format msgid "Could not open file descriptor %d" msgstr "Dosya tanımlayıcı %d açılamadı" -#: apt-pkg/contrib/fileutl.cc:1354 apt-pkg/contrib/fileutl.cc:2123 +#: apt-pkg/contrib/fileutl.cc:1315 msgid "Failed to create subprocess IPC" msgstr "Altsüreç IPC'si oluşturulamadı" -#: apt-pkg/contrib/fileutl.cc:1412 +#: apt-pkg/contrib/fileutl.cc:1373 msgid "Failed to exec compressor " msgstr "Sıkıştırma programı çalıştırılamadı " -#: apt-pkg/contrib/fileutl.cc:1553 +#: apt-pkg/contrib/fileutl.cc:1514 #, c-format msgid "read, still have %llu to read but none left" msgstr "read, %llu bayt okunması gerekli ama hiç kalmamış" -#: apt-pkg/contrib/fileutl.cc:1666 apt-pkg/contrib/fileutl.cc:1688 +#: apt-pkg/contrib/fileutl.cc:1627 apt-pkg/contrib/fileutl.cc:1649 #, c-format msgid "write, still have %llu to write but couldn't" msgstr "write, yazılması gereken %llu bayt yazılamıyor" -#: apt-pkg/contrib/fileutl.cc:1954 +#: apt-pkg/contrib/fileutl.cc:1915 #, c-format msgid "Problem closing the file %s" msgstr "%s dosyası kapatılamadı" -#: apt-pkg/contrib/fileutl.cc:1965 +#: apt-pkg/contrib/fileutl.cc:1927 #, c-format msgid "Problem renaming the file %s to %s" msgstr "%s dosyası %s olarak yeniden adlandırılamadı" -#: apt-pkg/contrib/fileutl.cc:1976 +#: apt-pkg/contrib/fileutl.cc:1938 #, c-format msgid "Problem unlinking the file %s" msgstr "%s dosyasından bağ kaldırma sorunu" -#: apt-pkg/contrib/fileutl.cc:1989 +#: apt-pkg/contrib/fileutl.cc:1951 msgid "Problem syncing the file" msgstr "Dosya eşitlenirken sorun çıktı" @@ -3305,108 +3012,114 @@ msgstr "Bağlama noktasının (%s) durum bilgisi alınamadı" msgid "Failed to stat the cdrom" msgstr "Cdrom durum bilgisi alınamadı" -#: apt-pkg/contrib/configuration.cc:522 +#: apt-pkg/contrib/configuration.cc:519 #, c-format msgid "Unrecognized type abbreviation: '%c'" msgstr "Tanınamayan tür kısaltması: '%c'" -#: apt-pkg/contrib/configuration.cc:636 +#: apt-pkg/contrib/configuration.cc:633 #, c-format msgid "Opening configuration file %s" msgstr "Yapılandırma dosyası (%s) açılıyor" -#: apt-pkg/contrib/configuration.cc:804 +#: apt-pkg/contrib/configuration.cc:801 #, c-format msgid "Syntax error %s:%u: Block starts with no name." msgstr "Sözdizimi hatası %s:%u: Blok ad olmadan başlıyor." -#: apt-pkg/contrib/configuration.cc:823 +#: apt-pkg/contrib/configuration.cc:820 #, c-format msgid "Syntax error %s:%u: Malformed tag" msgstr "Sözdizimi hatası %s:%u: Kötü biçimlendirilmiş etiket" -#: apt-pkg/contrib/configuration.cc:840 +#: apt-pkg/contrib/configuration.cc:837 #, c-format msgid "Syntax error %s:%u: Extra junk after value" msgstr "Sözdizimi hatası %s:%u: Değerden sonra ilave gereksiz" -#: apt-pkg/contrib/configuration.cc:880 +#: apt-pkg/contrib/configuration.cc:877 #, c-format msgid "Syntax error %s:%u: Directives can only be done at the top level" msgstr "Sözdizimi hatası %s:%u: Yönergeler sadece en üst düzeyde bitebilir" -#: apt-pkg/contrib/configuration.cc:887 +#: apt-pkg/contrib/configuration.cc:884 #, c-format msgid "Syntax error %s:%u: Too many nested includes" msgstr "Sözdizimi hatası %s:%u: Çok fazla yuvalanmış 'include'" -#: apt-pkg/contrib/configuration.cc:891 apt-pkg/contrib/configuration.cc:896 +#: apt-pkg/contrib/configuration.cc:888 apt-pkg/contrib/configuration.cc:893 #, c-format msgid "Syntax error %s:%u: Included from here" msgstr "Sözdizimi hatası %s:%u: Buradan 'include' edilmiş" -#: apt-pkg/contrib/configuration.cc:900 +#: apt-pkg/contrib/configuration.cc:897 #, c-format msgid "Syntax error %s:%u: Unsupported directive '%s'" msgstr "Sözdizimi hatası %s:%u: Desteklenmeyen yönerge '%s'" -#: apt-pkg/contrib/configuration.cc:903 +#: apt-pkg/contrib/configuration.cc:900 #, c-format msgid "Syntax error %s:%u: clear directive requires an option tree as argument" msgstr "" "Sözdizimi hatası %s:%u: clear yönergesi bir seçenek ağacı argümanını " "gerektirir" -#: apt-pkg/contrib/configuration.cc:953 +#: apt-pkg/contrib/configuration.cc:950 #, c-format msgid "Syntax error %s:%u: Extra junk at end of file" msgstr "Sözdizimi hatası %s:%u: Dosya sonunda ilave gereksiz" -#: apt-pkg/contrib/cmndline.cc:127 +#. TRANSLATOR: %s is the trusted keyring parts directory +#: apt-pkg/contrib/gpgv.cc:72 +#, c-format +msgid "No keyring installed in %s." +msgstr "%s dizininde kurulu bir anahtar yok." + +#: apt-pkg/contrib/cmndline.cc:124 #, c-format msgid "Command line option '%c' [from %s] is not known." msgstr "Komut satırı seçeneği '%c' [%s içinden] tanınmıyor." -#: apt-pkg/contrib/cmndline.cc:152 apt-pkg/contrib/cmndline.cc:161 -#: apt-pkg/contrib/cmndline.cc:169 +#: apt-pkg/contrib/cmndline.cc:149 apt-pkg/contrib/cmndline.cc:158 +#: apt-pkg/contrib/cmndline.cc:166 #, c-format msgid "Command line option %s is not understood" msgstr "Komut satırı seçeneği %s anlaşılamadı" -#: apt-pkg/contrib/cmndline.cc:174 +#: apt-pkg/contrib/cmndline.cc:171 #, c-format msgid "Command line option %s is not boolean" msgstr "Komut satırı seçeneği %s mantıksal değer değil" -#: apt-pkg/contrib/cmndline.cc:215 apt-pkg/contrib/cmndline.cc:236 +#: apt-pkg/contrib/cmndline.cc:212 apt-pkg/contrib/cmndline.cc:233 #, c-format msgid "Option %s requires an argument." msgstr "%s seçeneği bir argüman kullanımını gerektirir." -#: apt-pkg/contrib/cmndline.cc:249 apt-pkg/contrib/cmndline.cc:255 +#: apt-pkg/contrib/cmndline.cc:246 apt-pkg/contrib/cmndline.cc:252 #, c-format msgid "Option %s: Configuration item specification must have an =." msgstr "" "%s seçeneği: Yapılandırma öğesi tanımlaması = şeklinde değer " "içermelidir." -#: apt-pkg/contrib/cmndline.cc:284 +#: apt-pkg/contrib/cmndline.cc:281 #, c-format msgid "Option %s requires an integer argument, not '%s'" msgstr "" "%s seçeneği bir tam sayı argümanının kullanımını gerektirir, '%s' değil" -#: apt-pkg/contrib/cmndline.cc:315 +#: apt-pkg/contrib/cmndline.cc:312 #, c-format msgid "Option '%s' is too long" msgstr "'%s' seçeneği çok uzun" -#: apt-pkg/contrib/cmndline.cc:347 +#: apt-pkg/contrib/cmndline.cc:344 #, c-format msgid "Sense %s is not understood, try true or false." msgstr "%s algılaması anlaşılamadı, true (doğru) ya da false (yanlış) deneyin." -#: apt-pkg/contrib/cmndline.cc:397 +#: apt-pkg/contrib/cmndline.cc:394 #, c-format msgid "Invalid operation %s" msgstr "Geçersiz işlem: %s" @@ -3416,12 +3129,12 @@ msgstr "Geçersiz işlem: %s" msgid "Installing %s" msgstr "%s kuruluyor" -#: apt-pkg/deb/dpkgpm.cc:113 apt-pkg/deb/dpkgpm.cc:1008 +#: apt-pkg/deb/dpkgpm.cc:113 apt-pkg/deb/dpkgpm.cc:1016 #, c-format msgid "Configuring %s" msgstr "%s yapılandırılıyor" -#: apt-pkg/deb/dpkgpm.cc:114 apt-pkg/deb/dpkgpm.cc:1015 +#: apt-pkg/deb/dpkgpm.cc:114 apt-pkg/deb/dpkgpm.cc:1023 #, c-format msgid "Removing %s" msgstr "%s kaldırılıyor" @@ -3442,80 +3155,80 @@ msgid "Running post-installation trigger %s" msgstr "Kurulum sonrası tetikleyicisi %s çalıştırılıyor" #. FIXME: use a better string after freeze -#: apt-pkg/deb/dpkgpm.cc:839 +#: apt-pkg/deb/dpkgpm.cc:847 #, c-format msgid "Directory '%s' missing" msgstr "'%s' dizini bulunamadı" -#: apt-pkg/deb/dpkgpm.cc:854 apt-pkg/deb/dpkgpm.cc:876 +#: apt-pkg/deb/dpkgpm.cc:862 apt-pkg/deb/dpkgpm.cc:884 #, c-format msgid "Could not open file '%s'" msgstr "'%s' dosyası açılamadı" -#: apt-pkg/deb/dpkgpm.cc:1001 +#: apt-pkg/deb/dpkgpm.cc:1009 #, c-format msgid "Preparing %s" msgstr "%s hazırlanıyor" -#: apt-pkg/deb/dpkgpm.cc:1002 +#: apt-pkg/deb/dpkgpm.cc:1010 #, c-format msgid "Unpacking %s" msgstr "%s paketi açılıyor" -#: apt-pkg/deb/dpkgpm.cc:1007 +#: apt-pkg/deb/dpkgpm.cc:1015 #, c-format msgid "Preparing to configure %s" msgstr "%s paketini yapılandırmaya hazırlanılıyor" -#: apt-pkg/deb/dpkgpm.cc:1009 +#: apt-pkg/deb/dpkgpm.cc:1017 #, c-format msgid "Installed %s" msgstr "%s kuruldu" -#: apt-pkg/deb/dpkgpm.cc:1014 +#: apt-pkg/deb/dpkgpm.cc:1022 #, c-format msgid "Preparing for removal of %s" msgstr "%s paketinin kaldırılmasına hazırlanılıyor" -#: apt-pkg/deb/dpkgpm.cc:1016 +#: apt-pkg/deb/dpkgpm.cc:1024 #, c-format msgid "Removed %s" msgstr "%s kaldırıldı" -#: apt-pkg/deb/dpkgpm.cc:1021 +#: apt-pkg/deb/dpkgpm.cc:1029 #, c-format msgid "Preparing to completely remove %s" msgstr "%s paketinin tamamen kaldırılmasına hazırlanılıyor" -#: apt-pkg/deb/dpkgpm.cc:1022 +#: apt-pkg/deb/dpkgpm.cc:1030 #, c-format msgid "Completely removed %s" msgstr "%s tamamen kaldırıldı" -#: apt-pkg/deb/dpkgpm.cc:1081 apt-pkg/deb/dpkgpm.cc:1169 +#: apt-pkg/deb/dpkgpm.cc:1091 apt-pkg/deb/dpkgpm.cc:1179 #, c-format msgid "Can not write log (%s)" msgstr "Günlük dosyasına yazılamıyor (%s)" -#: apt-pkg/deb/dpkgpm.cc:1081 apt-pkg/deb/dpkgpm.cc:1169 +#: apt-pkg/deb/dpkgpm.cc:1091 apt-pkg/deb/dpkgpm.cc:1179 msgid "Is /dev/pts mounted?" msgstr "/dev/pts bağlı mı?" -#: apt-pkg/deb/dpkgpm.cc:1656 +#: apt-pkg/deb/dpkgpm.cc:1670 msgid "Operation was interrupted before it could finish" msgstr "İşlem yarıda kesildi" -#: apt-pkg/deb/dpkgpm.cc:1718 +#: apt-pkg/deb/dpkgpm.cc:1732 msgid "No apport report written because MaxReports is reached already" msgstr "" "En fazla rapor miktarına (MaxReports) ulaşıldığı için apport raporu yazılmadı" #. check if its not a follow up error -#: apt-pkg/deb/dpkgpm.cc:1723 +#: apt-pkg/deb/dpkgpm.cc:1737 msgid "dependency problems - leaving unconfigured" msgstr "bağımlılık sorunları - yapılandırılmamış durumda bırakılıyor" -#: apt-pkg/deb/dpkgpm.cc:1725 +#: apt-pkg/deb/dpkgpm.cc:1739 msgid "" "No apport report written because the error message indicates its a followup " "error from a previous failure." @@ -3523,14 +3236,14 @@ msgstr "" "Apport raporu yazılmadı çünkü hata iletisi bu durumun bir önceki hatadan " "kaynaklanan bir hata olduğunu belirtiyor." -#: apt-pkg/deb/dpkgpm.cc:1731 +#: apt-pkg/deb/dpkgpm.cc:1745 msgid "" "No apport report written because the error message indicates a disk full " "error" msgstr "" "Hata iletisi diskin dolu olduğunu belirttiği için apport raporu yazılamadı" -#: apt-pkg/deb/dpkgpm.cc:1738 +#: apt-pkg/deb/dpkgpm.cc:1752 msgid "" "No apport report written because the error message indicates a out of memory " "error" @@ -3538,7 +3251,7 @@ msgstr "" "Hata iletisi bir bellek yetersizliği hatasına işaret ettiği için apport " "raporu yazılamadı" -#: apt-pkg/deb/dpkgpm.cc:1745 apt-pkg/deb/dpkgpm.cc:1751 +#: apt-pkg/deb/dpkgpm.cc:1759 apt-pkg/deb/dpkgpm.cc:1765 msgid "" "No apport report written because the error message indicates an issue on the " "local system" @@ -3546,7 +3259,7 @@ msgstr "" "Hata iletisi yerel bir sistem hatasına işaret ettiği için apport raporu " "yazılamadı" -#: apt-pkg/deb/dpkgpm.cc:1773 +#: apt-pkg/deb/dpkgpm.cc:1787 msgid "" "No apport report written because the error message indicates a dpkg I/O error" msgstr "" @@ -3580,171 +3293,404 @@ msgstr "" msgid "Not locked" msgstr "Kilitlenmemiş" -#: apt-inst/filelist.cc:380 -msgid "DropNode called on still linked node" -msgstr "DropNode hâlâ bağlı olan düğüm üzerinde çağrıldı" +#: cmdline/apt-extracttemplates.cc:224 +msgid "" +"Usage: apt-extracttemplates file1 [file2 ...]\n" +"\n" +"apt-extracttemplates is a tool to extract config and template info\n" +"from debian packages\n" +"\n" +"Options:\n" +" -h This help text\n" +" -t Set the temp dir\n" +" -c=? Read this configuration file\n" +" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" +msgstr "" +"Kullanım: apt-extracttemplates dosya1 [dosya2 ...]\n" +"\n" +"apt-extracttemplates, Debian paketlerinden ayar ve şablon bilgisini\n" +"almak için kullanılan bir araçtır\n" +"\n" +"Seçenekler:\n" +" -h Bu yardım dosyası\n" +" -t Geçici dizini ayarlar\n" +" -c=? Belirtilen ayar dosyasını kullanır\n" +" -o=? Ayar seçeneği belirtmeyi sağlar, ör -o dir::cache=/tmp\n" -#: apt-inst/filelist.cc:412 -msgid "Failed to locate the hash element!" -msgstr "Sağlama elementi bulunamadı!" +#: cmdline/apt-extracttemplates.cc:254 +#, c-format +msgid "Unable to mkstemp %s" +msgstr "mkstemp %s başarısız oldu" -#: apt-inst/filelist.cc:459 -msgid "Failed to allocate diversion" -msgstr "Yönlendirme tahsisi başarısız oldu" +#: cmdline/apt-extracttemplates.cc:300 +msgid "Cannot get debconf version. Is debconf installed?" +msgstr "debconf sürümü alınamıyor. debconf kurulu mu?" -#: apt-inst/filelist.cc:464 -msgid "Internal error in AddDiversion" -msgstr "AddDiversion'da iç hata" +#: ftparchive/apt-ftparchive.cc:187 ftparchive/apt-ftparchive.cc:371 +msgid "Package extension list is too long" +msgstr "Paket uzantı listesi çok uzun" -#: apt-inst/filelist.cc:477 +#: ftparchive/apt-ftparchive.cc:189 ftparchive/apt-ftparchive.cc:206 +#: ftparchive/apt-ftparchive.cc:229 ftparchive/apt-ftparchive.cc:283 +#: ftparchive/apt-ftparchive.cc:297 ftparchive/apt-ftparchive.cc:319 #, c-format -msgid "Trying to overwrite a diversion, %s -> %s and %s/%s" -msgstr "Bir yönlendirmenin üzerine yazılmaya çalışılıyor, %s -> %s ve %s/%s" +msgid "Error processing directory %s" +msgstr "%s dizinini işlemede hata" -#: apt-inst/filelist.cc:506 +#: ftparchive/apt-ftparchive.cc:281 +msgid "Source extension list is too long" +msgstr "Kaynak uzantı listesi çok uzun" + +#: ftparchive/apt-ftparchive.cc:401 +msgid "Error writing header to contents file" +msgstr "İçindekiler dosyasına başlık yazmada hata" + +#: ftparchive/apt-ftparchive.cc:431 #, c-format -msgid "Double add of diversion %s -> %s" -msgstr "Aynı dosya iki kez yönlendirilemez: %s -> %s" +msgid "Error processing contents %s" +msgstr "%s içeriğini işlemede hata" -#: apt-inst/filelist.cc:549 +#: ftparchive/apt-ftparchive.cc:626 +msgid "" +"Usage: apt-ftparchive [options] command\n" +"Commands: packages binarypath [overridefile [pathprefix]]\n" +" sources srcpath [overridefile [pathprefix]]\n" +" contents path\n" +" release path\n" +" generate config [groups]\n" +" clean config\n" +"\n" +"apt-ftparchive generates index files for Debian archives. It supports\n" +"many styles of generation from fully automated to functional replacements\n" +"for dpkg-scanpackages and dpkg-scansources\n" +"\n" +"apt-ftparchive generates Package files from a tree of .debs. The\n" +"Package file contains the contents of all the control fields from\n" +"each package as well as the MD5 hash and filesize. An override file\n" +"is supported to force the value of Priority and Section.\n" +"\n" +"Similarly apt-ftparchive generates Sources files from a tree of .dscs.\n" +"The --source-override option can be used to specify a src override file\n" +"\n" +"The 'packages' and 'sources' command should be run in the root of the\n" +"tree. BinaryPath should point to the base of the recursive search and \n" +"override file should contain the override flags. Pathprefix is\n" +"appended to the filename fields if present. Example usage from the \n" +"Debian archive:\n" +" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n" +" dists/potato/main/binary-i386/Packages\n" +"\n" +"Options:\n" +" -h This help text\n" +" --md5 Control MD5 generation\n" +" -s=? Source override file\n" +" -q Quiet\n" +" -d=? Select the optional caching database\n" +" --no-delink Enable delinking debug mode\n" +" --contents Control contents file generation\n" +" -c=? Read this configuration file\n" +" -o=? Set an arbitrary configuration option" +msgstr "" +"Kullanım: apt-ftparchive [seçenekler] komut\n" +"Komutlar: packages ikilikonumu [geçersizkılmadosyası [konumöneki]]\n" +" sources kaynakkonumu [geçersizkılmadosyası [konumöneki]]\n" +" contents konum\n" +" release konum\n" +" generate yapılandırma [gruplar]\n" +" clean yapılandırma\n" +"\n" +"apt-ftparchive Debian arşivleri için indeks dosyaları üretir. \n" +"dpkg-scanpackages ve dpkg-scansources için tamamen otomatikten\n" +"işlevsel yedeklere kadar birçok üretim çeşidini destekler.\n" +"\n" +"apt-ftparchive, .deb dizinlerinden 'Package' dosyaları üretir. 'Package'\n" +"dosyası, her paketin MD5 doğrulama ve dosya büyüklüğü gibi denetim\n" +"alanlarının bilgilerini içerir. Öncelik (Priority) ve bölüm (Section)\n" +"değerlerini istenen başka değerlerle değiştirebilmek için bir geçersiz\n" +"kılma dosyası kullanılabilir.\n" +"\n" +"Benzer şekilde, apt-ftparchive, .dscs dosyalarından 'Sources' dosyaları\n" +"üretir. '--source-override' seçeneği bir src geçersiz kılma dosyası\n" +"belirtmek için kullanıabilir.\n" +"\n" +"'packages' ve 'sources' komutları dizin ağacının kökünde çalıştırıl-\n" +"malıdır. BinaryPath özyineli aramanın temeline işaret etmeli ve\n" +"geçersiz kılma dosyası geçersiz kılma bayraklarını içermelidir.\n" +"Pathprefix mevcutsa dosya adı alanlarının sonuna eklenir. Debian\n" +"arşivinden örnek kullanım şu şekildedir:\n" +"\n" +" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n" +" dists/potato/main/binary-i386/Packages\n" +"\n" +"Seçenekler:\n" +" -h Bu yardım metni\n" +" --md5 MD5 üretimini denetle\n" +" -s=? Kaynak geçersiz kılma dosyası\n" +" -q Sessiz\n" +" -d=? Seçimlik önbellek veritabanını seç\n" +" --no-delink Bağ kurulmamış hata ayıklama kipini etkinleştir\n" +" --contents İçerik dosyası üretimini denetle\n" +" -c=? Belirtilen yapılandırma dosyası kullan\n" +" -o=? Yapılandırma seçeneği ayarla" + +#: ftparchive/apt-ftparchive.cc:822 +msgid "No selections matched" +msgstr "Hiçbir seçim eşleşmedi" + +#: ftparchive/apt-ftparchive.cc:907 #, c-format -msgid "Duplicate conf file %s/%s" -msgstr "%s/%s yapılandırma dosyası zaten mevcut" +msgid "Some files are missing in the package file group `%s'" +msgstr "'%s' paket dosyası grubunda bazı dosyalar eksik" -#: apt-inst/extract.cc:101 apt-inst/extract.cc:172 +#: ftparchive/cachedb.cc:65 #, c-format -msgid "The path %s is too long" -msgstr "%s yolu çok uzun" +msgid "DB was corrupted, file renamed to %s.old" +msgstr "Veritabanı bozuk, dosya adı %s.old olarak değiştirildi" -#: apt-inst/extract.cc:132 +#: ftparchive/cachedb.cc:83 #, c-format -msgid "Unpacking %s more than once" -msgstr "%s paketi bir çok kez açıldı" +msgid "DB is old, attempting to upgrade %s" +msgstr "Veritabanı eski, %s yükseltilmeye çalışılıyor" -#: apt-inst/extract.cc:142 +#: ftparchive/cachedb.cc:94 +msgid "" +"DB format is invalid. If you upgraded from an older version of apt, please " +"remove and re-create the database." +msgstr "" +"Veritabanı biçimi geçersiz. Eğer apt'ın eski bir sürümünden yükseltme " +"yaptıysanız, lütfen veritabanını silin ve yeniden oluşturun." + +#: ftparchive/cachedb.cc:99 #, c-format -msgid "The directory %s is diverted" -msgstr "%s dizini yönlendirilmiş" +msgid "Unable to open DB file %s: %s" +msgstr "Veritabanı dosyası %s açılamadı: %s" -#: apt-inst/extract.cc:152 +#: ftparchive/cachedb.cc:332 +msgid "Failed to read .dsc" +msgstr ".dsc dosyası okunamadı" + +#: ftparchive/cachedb.cc:365 +msgid "Archive has no control record" +msgstr "Arşivin denetim kaydı yok" + +#: ftparchive/cachedb.cc:594 +msgid "Unable to get a cursor" +msgstr "İmleç alınamıyor" + +#: ftparchive/writer.cc:91 #, c-format -msgid "The package is trying to write to the diversion target %s/%s" -msgstr "Bu paket yönlendirme hedefine (%s/%s) yazmayı deniyor" +msgid "W: Unable to read directory %s\n" +msgstr "U: %s dizini okunamıyor\n" -#: apt-inst/extract.cc:162 apt-inst/extract.cc:306 -msgid "The diversion path is too long" -msgstr "Yönlendirme yolu çok uzun" +#: ftparchive/writer.cc:96 +#, c-format +msgid "W: Unable to stat %s\n" +msgstr "U: %s durum bilgisi alınamıyor\n" -#: apt-inst/extract.cc:249 +#: ftparchive/writer.cc:152 +msgid "E: " +msgstr "H: " + +#: ftparchive/writer.cc:154 +msgid "W: " +msgstr "U: " + +#: ftparchive/writer.cc:161 +msgid "E: Errors apply to file " +msgstr "H: Hatalar şu dosya için geçerli: " + +#: ftparchive/writer.cc:179 ftparchive/writer.cc:211 #, c-format -msgid "The directory %s is being replaced by a non-directory" -msgstr "%s dizini dizin olmayan bir öğeyle değiştirildi" +msgid "Failed to resolve %s" +msgstr "%s çözümlenemedi" -#: apt-inst/extract.cc:289 -msgid "Failed to locate node in its hash bucket" -msgstr "Düğüm sağlama kovasında bulunamadı" +#: ftparchive/writer.cc:192 +msgid "Tree walking failed" +msgstr "Ağaçta gezinme başarısız" -#: apt-inst/extract.cc:293 -msgid "The path is too long" -msgstr "Yol çok uzun" +#: ftparchive/writer.cc:219 +#, c-format +msgid "Failed to open %s" +msgstr "%s açılamadı" -#: apt-inst/extract.cc:421 +#: ftparchive/writer.cc:278 #, c-format -msgid "Overwrite package match with no version for %s" -msgstr "%s paketinin sürümü yok" +msgid " DeLink %s [%s]\n" +msgstr " DeLink %s [%s]\n" -#: apt-inst/extract.cc:438 +#: ftparchive/writer.cc:286 #, c-format -msgid "File %s/%s overwrites the one in the package %s" -msgstr "%s/%s dosyası %s paketindeki aynı adlı dosyanın üzerine yazmak istiyor" +msgid "Failed to readlink %s" +msgstr "%s readlink çağrısı başarısız oldu" -#: apt-inst/extract.cc:498 +#: ftparchive/writer.cc:290 #, c-format -msgid "Unable to stat %s" -msgstr "%s durum bilgisi alınamadı" +msgid "Failed to unlink %s" +msgstr "%s bağı koparılamadı" -#: apt-inst/dirstream.cc:42 apt-inst/dirstream.cc:49 apt-inst/dirstream.cc:54 +#: ftparchive/writer.cc:298 #, c-format -msgid "Failed to write file %s" -msgstr "%s dosyasına yazılamadı" +msgid "*** Failed to link %s to %s" +msgstr "*** %s, %s konumuna bağlanamadı" -#: apt-inst/dirstream.cc:104 +#: ftparchive/writer.cc:308 #, c-format -msgid "Failed to close file %s" -msgstr "%s dosyası kapatılamadı" +msgid " DeLink limit of %sB hit.\n" +msgstr " %sB'lik bağ koparma (DeLink) sınırına ulaşıldı.\n" -#: apt-inst/deb/debfile.cc:47 apt-inst/deb/debfile.cc:54 -#: apt-inst/deb/debfile.cc:63 +#: ftparchive/writer.cc:417 +msgid "Archive had no package field" +msgstr "Arşivde paket alanı yok" + +#: ftparchive/writer.cc:425 ftparchive/writer.cc:684 #, c-format -msgid "This is not a valid DEB archive, missing '%s' member" -msgstr "Bu dosya geçerli bir DEB arşivi değil, '%s' üyesi eksik" +msgid " %s has no override entry\n" +msgstr " %s için geçersiz kılma girdisi yok\n" -#: apt-inst/deb/debfile.cc:132 +#: ftparchive/writer.cc:493 ftparchive/writer.cc:840 #, c-format -msgid "Internal error, could not locate member %s" -msgstr "İç hata, %s üyesi bulunamadı" +msgid " %s maintainer is %s not %s\n" +msgstr " %s geliştiricisi %s, %s değil\n" -#: apt-inst/deb/debfile.cc:231 -msgid "Unparsable control file" -msgstr "Ayrıştırılamayan 'control' dosyası" +#: ftparchive/writer.cc:698 +#, c-format +msgid " %s has no source override entry\n" +msgstr " '%s' paketinin yerine geçecek bir kaynak paket yok\n" -#: apt-inst/contrib/arfile.cc:76 -msgid "Invalid archive signature" -msgstr "Geçersiz arşiv imzası" +#: ftparchive/writer.cc:702 +#, c-format +msgid " %s has no binary override entry either\n" +msgstr " '%s' paketinin yerine geçecek bir ikili paket de yok\n" -#: apt-inst/contrib/arfile.cc:84 -msgid "Error reading archive member header" -msgstr "Arşiv üyesi başlığı okuma hatası" +#: ftparchive/contents.cc:351 ftparchive/contents.cc:382 +msgid "realloc - Failed to allocate memory" +msgstr "realloc - Bellek ayırma yapılamadı" -#: apt-inst/contrib/arfile.cc:96 +#: ftparchive/override.cc:38 ftparchive/override.cc:142 #, c-format -msgid "Invalid archive member header %s" -msgstr "Geçersiz arşiv üyesi başlığı %s" +msgid "Unable to open %s" +msgstr "%s açılamıyor" -#: apt-inst/contrib/arfile.cc:108 -msgid "Invalid archive member header" -msgstr "Geçersiz arşiv üyesi başlığı" +#. skip spaces +#. find end of word +#: ftparchive/override.cc:68 +#, c-format +msgid "Malformed override %s line %llu (%s)" +msgstr "Hatalı geçersiz kılma %s satır %llu (%s)" -#: apt-inst/contrib/arfile.cc:137 -msgid "Archive is too short" -msgstr "Arşiv çok kısa" +#: ftparchive/override.cc:127 ftparchive/override.cc:201 +#, c-format +msgid "Failed to read the override file %s" +msgstr "Geçersiz kılma dosyası %s okunamadı" -#: apt-inst/contrib/arfile.cc:141 -msgid "Failed to read the archive headers" -msgstr "Arşiv başlıkları okunamadı" +#: ftparchive/override.cc:166 +#, c-format +msgid "Malformed override %s line %llu #1" +msgstr "Hatalı geçersiz kılma %s satır %llu #1" -#: apt-inst/contrib/extracttar.cc:128 -msgid "Failed to create pipes" -msgstr "Boru oluşturulamadı" +#: ftparchive/override.cc:178 +#, c-format +msgid "Malformed override %s line %llu #2" +msgstr "Hatalı geçersiz kılma %s satır %llu #2" -#: apt-inst/contrib/extracttar.cc:155 -msgid "Failed to exec gzip " -msgstr "Gzip çalıştırılamadı " +#: ftparchive/override.cc:191 +#, c-format +msgid "Malformed override %s line %llu #3" +msgstr "Hatalı geçersiz kılma %s satır %llu #3" -#: apt-inst/contrib/extracttar.cc:192 apt-inst/contrib/extracttar.cc:222 -msgid "Corrupted archive" -msgstr "Bozuk arşiv" +#: ftparchive/multicompress.cc:73 +#, c-format +msgid "Unknown compression algorithm '%s'" +msgstr "Bilinmeyen sıkıştırma algoritması '%s'" -#: apt-inst/contrib/extracttar.cc:207 -msgid "Tar checksum failed, archive corrupted" -msgstr "Tar sağlama toplamı başarısız, arşiv bozulmuş" +#: ftparchive/multicompress.cc:103 +#, c-format +msgid "Compressed output %s needs a compression set" +msgstr "Sıkıştırılmış %s çıktısı bir sıkıştırma kümesine ihtiyaç duymaktadır" + +#: ftparchive/multicompress.cc:192 +msgid "Failed to create FILE*" +msgstr "DOSYA* oluşturulamadı" + +#: ftparchive/multicompress.cc:195 +msgid "Failed to fork" +msgstr "fork yapılamadı" -#: apt-inst/contrib/extracttar.cc:312 +#: ftparchive/multicompress.cc:209 +msgid "Compress child" +msgstr "Çocuğu sıkıştır" + +#: ftparchive/multicompress.cc:232 #, c-format -msgid "Unknown TAR header type %u, member %s" -msgstr "Bilinmeyen TAR başlığı türü %u, üye %s" +msgid "Internal error, failed to create %s" +msgstr "İç hata, %s oluşturulamadı" + +#: ftparchive/multicompress.cc:305 +msgid "IO to subprocess/file failed" +msgstr "Altsürece/dosyaya GÇ işlemi başarısız oldu" -#~ msgid "Total dependency version space: " -#~ msgstr "Toplam bağımlılık sürümü alanı: " +#: ftparchive/multicompress.cc:343 +msgid "Failed to read while computing MD5" +msgstr "MD5 hesaplanırken okunamadı" -#~ msgid "You don't have enough free space in %s" -#~ msgstr "%s üzerinde yeterli boş alan yok" +#: ftparchive/multicompress.cc:359 +#, c-format +msgid "Problem unlinking %s" +msgstr "%s bağı koparılırken sorun çıktı" -#~ msgid "Done" -#~ msgstr "Bitti" +#: cmdline/apt-internal-solver.cc:49 +msgid "" +"Usage: apt-internal-solver\n" +"\n" +"apt-internal-solver is an interface to use the current internal\n" +"like an external resolver for the APT family for debugging or alike\n" +"\n" +"Options:\n" +" -h This help text.\n" +" -q Loggable output - no progress indicator\n" +" -c=? Read this configuration file\n" +" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" +msgstr "" +"Kullanım: apt-internal-solver\n" +"\n" +"apt-internal-solver mevcut dâhilî çözücüyü (hata ayıklama\n" +"gibi sebeplerle) harici çözücü gibi kullanmaya yarayan bir\n" +"arayüzdür.\n" +"\n" +"Seçenekler:\n" +" -h Bu yardım metni.\n" +" -q Günlük tutmaya uygun çıktı - İlerleme göstergesi yok\n" +" -c=? Belirtilen yapılandırma dosyası kullan\n" +" -o=? Yapılandırma seçeneği ayarla, örneğin -o dir::cache=/tmp\n" + +#: cmdline/apt-sortpkgs.cc:89 +msgid "Unknown package record!" +msgstr "Bilinmeyen paket kaydı!" -#~ msgid "No keyring installed in %s." -#~ msgstr "%s dizininde kurulu bir anahtar yok." +#: cmdline/apt-sortpkgs.cc:153 +msgid "" +"Usage: apt-sortpkgs [options] file1 [file2 ...]\n" +"\n" +"apt-sortpkgs is a simple tool to sort package files. The -s option is used\n" +"to indicate what kind of file it is.\n" +"\n" +"Options:\n" +" -h This help text\n" +" -s Use source file sorting\n" +" -c=? Read this configuration file\n" +" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" +msgstr "" +"Kullanım: apt-sortpkgs [seçenekler] dosya1 [dosya2 ...]\n" +"\n" +"apt-sortpkgs, paket dosyalarını sıralayan basit bir araçtır.\n" +"-s seçeneği ne tür bir dosya olduğunu göstermekte kullanılır.\n" +"\n" +"Seçenekler:\n" +" -h Bu yardım metni\n" +" -s Kaynak dosyası sıralamayı kullan\n" +" -c=? Belirtilen yapılandırma dosyasını oku\n" +" -o=? Herhangi bir yapılandırma seçeneği ayarla, örneğin -o dir::cache=/" +"tmp\n" #~ msgid "Is stdout a terminal?" #~ msgstr "stdout bir uçbirim mi?" @@ -3839,3 +3785,6 @@ msgstr "Bilinmeyen TAR başlığı türü %u, üye %s" #~ msgid "Can not write log, openpty() failed (/dev/pts not mounted?)\n" #~ msgstr "" #~ "Günlük yazılamadı, openpty() başarısız oldu (/dev/pts bağlanmadı mı?)\n" + +#~ msgid "File %s doesn't start with a clearsigned message" +#~ msgstr "%s dosyası açıkimzalı bir iletiyle başlamıyor" -- cgit v1.2.3 From 9fb02ab02528ea45747318af26fae8a732cd2840 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 11:00:37 +0200 Subject: pkgPolicy: Introduce storage and helpers for per-version pins Per-version pins should lead to more predictable results with /etc/apt/preferences uses like pinning one version with -1. --- apt-pkg/policy.cc | 11 ++++++++++- apt-pkg/policy.h | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 6da6ed606..5d7ab0e6b 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -50,9 +50,12 @@ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner) return; PFPriority = new signed short[Owner->Head().PackageFileCount]; Pins = new Pin[Owner->Head().PackageCount]; + VerPins = new Pin[Owner->Head().VersionCount]; for (unsigned long I = 0; I != Owner->Head().PackageCount; I++) Pins[I].Type = pkgVersionMatch::None; + for (unsigned long I = 0; I != Owner->Head().VersionCount; I++) + VerPins[I].Type = pkgVersionMatch::None; // The config file has a master override. string DefRel = _config->Find("APT::Default-Release"); @@ -318,6 +321,12 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgIterator const &Pkg) return Pins[Pkg->ID].Priority; return 0; } +APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver) +{ + if (VerPins[Ver->ID].Type != pkgVersionMatch::None) + return VerPins[Ver->ID].Priority; + return 0; +} APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &File) { return PFPriority[File->ID]; @@ -440,4 +449,4 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) } /*}}}*/ -pkgPolicy::~pkgPolicy() {delete [] PFPriority; delete [] Pins;} +pkgPolicy::~pkgPolicy() {delete [] PFPriority; delete [] Pins; delete [] VerPins; } diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index c4b1cbadd..9deeb9d0e 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -63,6 +63,7 @@ class pkgPolicy : public pkgDepCache::Policy }; Pin *Pins; + Pin *VerPins; signed short *PFPriority; std::vector Defaults; std::vector Unmatched; @@ -79,6 +80,7 @@ class pkgPolicy : public pkgDepCache::Policy // Things for the cache interface. virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg); virtual signed short GetPriority(pkgCache::PkgIterator const &Pkg); + virtual signed short GetPriority(pkgCache::VerIterator const &Pkg); virtual signed short GetPriority(pkgCache::PkgFileIterator const &File); bool InitDefaults(); -- cgit v1.2.3 From 5bfd306ee16fd1be012dd2cd01ae52ff4179176a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 11:19:11 +0200 Subject: versionmatch: Extract version match checking out of Find() Refactor version matching to allow us to check if a version matches a pin. This will aid the per-version pinning implementation. --- apt-pkg/versionmatch.cc | 38 +++++++++++++++++++++++++------------- apt-pkg/versionmatch.h | 1 + 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index 86c1b7d4a..c215f522c 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -164,25 +164,37 @@ pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg) pkgCache::VerIterator Ver = Pkg.VersionList(); for (; Ver.end() == false; ++Ver) { - if (Type == Version) - { - if (MatchVer(Ver.VerStr(),VerStr,VerPrefixMatch) == true) - return Ver; - if (ExpressionMatches(VerStr, Ver.VerStr()) == true) - return Ver; - continue; - } - - for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; ++VF) - if (FileMatch(VF.File()) == true) - return Ver; + if (VersionMatches(Ver)) + return Ver; } - + // This will be Ended by now. return Ver; } /*}}}*/ +// VersionMatch::Find - Locate the best match for the select type /*{{{*/ +// --------------------------------------------------------------------- +/* */ +bool pkgVersionMatch::VersionMatches(pkgCache::VerIterator Ver) +{ + if (Type == Version) + { + if (MatchVer(Ver.VerStr(),VerStr,VerPrefixMatch) == true) + return true; + if (ExpressionMatches(VerStr, Ver.VerStr()) == true) + return true; + return false; + } + + for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; ++VF) + if (FileMatch(VF.File()) == true) + return true; + + return false; +} + /*}}}*/ + #ifndef FNM_CASEFOLD #define FNM_CASEFOLD 0 #endif diff --git a/apt-pkg/versionmatch.h b/apt-pkg/versionmatch.h index bb950b9c7..156ad61cb 100644 --- a/apt-pkg/versionmatch.h +++ b/apt-pkg/versionmatch.h @@ -74,6 +74,7 @@ class pkgVersionMatch static bool ExpressionMatches(const std::string& pattern, const char *string); bool FileMatch(pkgCache::PkgFileIterator File); pkgCache::VerIterator Find(pkgCache::PkgIterator Pkg); + bool VersionMatches(pkgCache::VerIterator Ver); pkgVersionMatch(std::string Data,MatchType Type); }; -- cgit v1.2.3 From 7fd9c353e1149dc657086a718761e8e1ff05dcce Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 11:21:11 +0200 Subject: policy: Assign per-version pins --- apt-pkg/policy.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 5d7ab0e6b..370819e0b 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -284,6 +284,17 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, P->Priority = Priority; P->Data = Data; matched = true; + + // Find matching version(s) and copy the pin into it + pkgVersionMatch Match(P->Data,P->Type); + for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() != true; Ver++) + { + if (Match.VersionMatches(Ver)) { + Pin *VP = VerPins + Ver->ID; + if (VP->Type == pkgVersionMatch::None) + *VP = *P; + } + } } } -- cgit v1.2.3 From b44c21bd31eb1b150bef21431ca881b1ab497559 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 11:31:19 +0200 Subject: apt-cache: Change version pin output to use per-version pins --- cmdline/apt-cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index c2f6dbd5c..303605f70 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1728,7 +1728,7 @@ static bool Policy(CommandLine &CmdL) cout << " *** " << V.VerStr(); else cout << " " << V.VerStr(); - cout << " " << Plcy->GetPriority(Pkg) << endl; + cout << " " << Plcy->GetPriority(V) << endl; for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; ++VF) { // Locate the associated index files so we can derive a description -- cgit v1.2.3 From 20cf708a62df5e4aa45a506819db425c6cc975fe Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 11:42:34 +0200 Subject: fileutl_test.cc: Check for /etc/passwd instead of /bin/sh This fixes the tests on systems where usrmerge is installed. Gbp-dch: ignore --- test/libapt/fileutl_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/libapt/fileutl_test.cc b/test/libapt/fileutl_test.cc index a2c303768..b42261716 100644 --- a/test/libapt/fileutl_test.cc +++ b/test/libapt/fileutl_test.cc @@ -290,10 +290,10 @@ TEST(FileUtlTest, Popen) TEST(FileUtlTest, flAbsPath) { std::string cwd = SafeGetCWD(); - int res = chdir("/bin/"); + int res = chdir("/etc/"); EXPECT_EQ(res, 0); - std::string p = flAbsPath("ls"); - EXPECT_EQ(p, "/bin/ls"); + std::string p = flAbsPath("passwd"); + EXPECT_EQ(p, "/etc/passwd"); res = chdir(cwd.c_str()); EXPECT_EQ(res, 0); -- cgit v1.2.3 From 5f9386e54360c403772e2a876d48d31dde9d5097 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 12:18:28 +0200 Subject: policy: Return highest file pin if version pin == 0 in GetPriority() This makes sure that we display a useful value instead of 0 for versions that are pinned due to package files. --- apt-pkg/policy.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 370819e0b..2d1f2a5d4 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -336,7 +336,16 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver) { if (VerPins[Ver->ID].Type != pkgVersionMatch::None) return VerPins[Ver->ID].Priority; - return 0; + + + int priority = INT_MIN; + for (pkgCache::VerFileIterator file = Ver.FileList(); file.end() == false; file++) + { + if (GetPriority(file.File()) > priority) + priority = GetPriority(file.File()); + } + + return priority == INT_MIN ? 0 : priority; } APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &File) { -- cgit v1.2.3 From a91aae406112df1d8fe16d00212333a20210f674 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 12:20:51 +0200 Subject: Determine the candidate based on per-version pins, instead of old code The new implementation assigns each version a pin, instead of assigning the pin to a package. This enables us to give each version of a package a different priority. Closes: #770017 Closes: #622237 Closes: #620249 Closes: #685215 --- apt-pkg/policy.cc | 36 ++++++++++++++++++++++++++++++++++++ apt-pkg/policy.h | 1 + 2 files changed, 37 insertions(+) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 2d1f2a5d4..e1dc3aef5 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -131,6 +132,10 @@ bool pkgPolicy::InitDefaults() best package is. */ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const &Pkg) { + if (_config->FindI("APT::Policy", 1) >= 1) { + return GetCandidateVerNew(Pkg); + } + // Look for a package pin and evaluate it. signed Max = GetPriority(Pkg); pkgCache::VerIterator Pref = GetMatch(Pkg); @@ -217,6 +222,37 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const &Pk return Pref; } + +// Policy::GetCandidateVer - Get the candidate install version /*{{{*/ +// --------------------------------------------------------------------- +/* Evaluate the package pins and the default list to deteremine what the + best package is. */ +pkgCache::VerIterator pkgPolicy::GetCandidateVerNew(pkgCache::PkgIterator const &Pkg) +{ + // TODO: Replace GetCandidateVer() + pkgCache::VerIterator cand; + int candPriority = -1; + bool candInstalled = false; + pkgVersioningSystem *vs = Cache->VS; + + for (pkgCache::VerIterator ver = Pkg.VersionList(); ver.end() == false; ver++) { + int priority = GetPriority(ver); + bool installed = ver->ID == Pkg.CurrentVer()->ID; + + if (priority < candPriority) + continue; + if (priority < 1000 + && (priority == candPriority || installed < candInstalled) + && (cand.IsGood() && vs->CmpVersion(ver.VerStr(), cand.VerStr()) < 0)) + continue; + + candPriority = priority; + candInstalled = installed; + cand = ver; + } + + return cand; +} /*}}}*/ // Policy::CreatePin - Create an entry in the pin table.. /*{{{*/ // --------------------------------------------------------------------- diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index 9deeb9d0e..4efe2ec50 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -88,6 +88,7 @@ class pkgPolicy : public pkgDepCache::Policy pkgPolicy(pkgCache *Owner); virtual ~pkgPolicy(); private: + pkgCache::VerIterator GetCandidateVerNew(pkgCache::PkgIterator const &Pkg); void *d; }; -- cgit v1.2.3 From 3436218c5fbbd7ff543863dc4c2d590b9f12c377 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 15:00:16 +0200 Subject: policy: Fix the new policy implementation to handle downgrades correctly This was broken previously, as we'd choose a downgrade when it's pin was higher than the previously selected candidate. --- apt-pkg/policy.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index e1dc3aef5..78e34a344 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -231,23 +231,22 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVerNew(pkgCache::PkgIterator const { // TODO: Replace GetCandidateVer() pkgCache::VerIterator cand; + pkgCache::VerIterator cur = Pkg.CurrentVer(); int candPriority = -1; - bool candInstalled = false; pkgVersioningSystem *vs = Cache->VS; for (pkgCache::VerIterator ver = Pkg.VersionList(); ver.end() == false; ver++) { int priority = GetPriority(ver); - bool installed = ver->ID == Pkg.CurrentVer()->ID; - if (priority < candPriority) - continue; - if (priority < 1000 - && (priority == candPriority || installed < candInstalled) - && (cand.IsGood() && vs->CmpVersion(ver.VerStr(), cand.VerStr()) < 0)) - continue; + if (priority <= candPriority) + continue; + + // TODO: Maybe optimize to not compare versions + if (!cur.end() && priority < 1000 + && (vs->CmpVersion(ver.VerStr(), cur.VerStr()) < 0)) + continue; candPriority = priority; - candInstalled = installed; cand = ver; } -- cgit v1.2.3 From 76b004d1a2122206925abc1a412e055430cef283 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 15:36:51 +0200 Subject: Fix test case breakage from the new policy implementation Everything's working now. --- .../test-acquire-same-repository-multiple-times | 2 +- .../test-apt-translation-has-no-packages | 2 +- .../test-bug-543966-downgrade-below-1000-pin | 14 ++--- .../test-cve-2013-1051-InRelease-parsing | 4 +- test/integration/test-policy-pinning | 73 +++++++++++----------- 5 files changed, 48 insertions(+), 47 deletions(-) diff --git a/test/integration/test-acquire-same-repository-multiple-times b/test/integration/test-acquire-same-repository-multiple-times index a46e0d73c..ad9cd6d7e 100755 --- a/test/integration/test-acquire-same-repository-multiple-times +++ b/test/integration/test-acquire-same-repository-multiple-times @@ -50,7 +50,7 @@ tworepos() { Installed: (none) Candidate: 1.0 Version table: - 1.0 0 + 1.0 500 500 $1:$2 jessie/main amd64 Packages 500 $1:$2 stable/main amd64 Packages" aptcache policy foo testfailure aptcache show foo/unstable diff --git a/test/integration/test-apt-translation-has-no-packages b/test/integration/test-apt-translation-has-no-packages index cf5b56243..ec2e1e43b 100755 --- a/test/integration/test-apt-translation-has-no-packages +++ b/test/integration/test-apt-translation-has-no-packages @@ -37,5 +37,5 @@ testsuccessequal "foo: Installed: (none) Candidate: 1.0 Version table: - 1.0 0 + 1.0 500 500 file:$APTARCHIVE unstable/main amd64 Packages" aptcache policy foo diff --git a/test/integration/test-bug-543966-downgrade-below-1000-pin b/test/integration/test-bug-543966-downgrade-below-1000-pin index 180393867..ede9ad6aa 100755 --- a/test/integration/test-bug-543966-downgrade-below-1000-pin +++ b/test/integration/test-bug-543966-downgrade-below-1000-pin @@ -19,9 +19,9 @@ testsuccessequal "base-files: Installed: 5.0.0-1 Candidate: 5.0.0-1 Version table: - *** 5.0.0-1 0 + *** 5.0.0-1 100 100 $STATUS - 5.0.0 0 + 5.0.0 500 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=0 writepin() { @@ -34,7 +34,7 @@ Pin-Priority: $2" > rootdir/etc/apt/preferences testpinning() { local PKGPIN='' - local PKGPINPRIO='0' + local PKGPINPRIO='' local REPPINPRIO='' if [ "$1" != '*' ]; then PKGPINPRIO='' @@ -47,7 +47,7 @@ testpinning() { Installed: 5.0.0-1 Candidate: 5.0.0-1 ${PKGPIN}Version table: - *** 5.0.0-1 ${PKGPINPRIO:-99} + *** 5.0.0-1 100 100 $STATUS 5.0.0 ${PKGPINPRIO:-99} ${REPPINPRIO:- 99} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=99 @@ -57,7 +57,7 @@ testpinning() { Installed: 5.0.0-1 Candidate: 5.0.0-1 ${PKGPIN}Version table: - *** 5.0.0-1 ${PKGPINPRIO:-100} + *** 5.0.0-1 100 100 $STATUS 5.0.0 ${PKGPINPRIO:-100} ${REPPINPRIO:- 100} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=100 @@ -67,7 +67,7 @@ testpinning() { Installed: 5.0.0-1 Candidate: 5.0.0-1 ${PKGPIN}Version table: - *** 5.0.0-1 ${PKGPINPRIO:-999} + *** 5.0.0-1 100 100 $STATUS 5.0.0 ${PKGPINPRIO:-999} ${REPPINPRIO:- 999} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=999 @@ -77,7 +77,7 @@ testpinning() { Installed: 5.0.0-1 Candidate: 5.0.0 ${PKGPIN}Version table: - *** 5.0.0-1 ${PKGPINPRIO:-1000} + *** 5.0.0-1 100 100 $STATUS 5.0.0 ${PKGPINPRIO:-1000} ${REPPINPRIO:-1000} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=1000 diff --git a/test/integration/test-cve-2013-1051-InRelease-parsing b/test/integration/test-cve-2013-1051-InRelease-parsing index 933cbbd92..a503ad0fe 100755 --- a/test/integration/test-cve-2013-1051-InRelease-parsing +++ b/test/integration/test-cve-2013-1051-InRelease-parsing @@ -21,7 +21,7 @@ testsuccessequal "good-pkg: Installed: (none) Candidate: 1.0 Version table: - 1.0 0 + 1.0 500 500 ${ARCHIVE} stable/main i386 Packages" aptcache policy good-pkg # now exchange to the Packages file, note that this could be @@ -62,5 +62,5 @@ testsuccessequal "good-pkg: Installed: (none) Candidate: 1.0 Version table: - 1.0 0 + 1.0 500 500 ${ARCHIVE} stable/main i386 Packages" aptcache policy good-pkg diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index 9f7f457ae..c4f478efc 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -105,10 +105,11 @@ testequalpolicycoolstuff() { local BPO1ARCHIVE="" local BPO2ARCHIVE="" if [ ! "$7" = "2.0~bpo2" ]; then + BPO1PIN="$AB" BPO1ARCHIVE=" $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main i386 Packages" else BPO2ARCHIVE=" - 2.0~bpo2 $PB + 2.0~bpo2 $AB $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main i386 Packages" SB="$(echo "$SB" | tail -n 1)" shift @@ -120,25 +121,25 @@ testequalpolicycoolstuff() { ${PINVERSION}Version table:${BPO2ARCHIVE} $IB 2.0~bpo1 $PB ${BPO1ARCHIVE}$SB - $IS 1.0 $PB + $IS 1.0 $AS $(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} stable/main i386 Packages$SS" \ aptcache policy coolstuff -o Policy=${INSTALLED}-${CANDIDATE}-${AB}-${AS}-${PB} $* } -testequalpolicycoolstuff "" "2.0~bpo1" 500 500 0 "" -testequalpolicycoolstuff "" "1.0" 500 990 0 "" -t stable -testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -t backports +testequalpolicycoolstuff "" "2.0~bpo1" 500 500 500 "" +testequalpolicycoolstuff "" "1.0" 500 990 500 "" -t stable +testequalpolicycoolstuff "" "2.0~bpo1" 990 500 990 "" -t backports echo "Package: * Pin: release n=backports Pin-Priority: 200" > rootdir/etc/apt/preferences -testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=GlobalPin -testequalpolicycoolstuff "" "1.0" 200 990 0 "" -o Test=GlobalPin -t stable -testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=GlobalPin -t backports +testequalpolicycoolstuff "" "1.0" 200 500 200 "" -o Test=GlobalPin +testequalpolicycoolstuff "" "1.0" 200 990 200 "" -o Test=GlobalPin -t stable +testequalpolicycoolstuff "" "2.0~bpo1" 990 500 990 "" -o Test=GlobalPin -t backports echo "Package: * Pin: release n=backports Pin-Priority: 600" > rootdir/etc/apt/preferences -testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=GlobalPin -testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=GlobalPin -t stable +testequalpolicycoolstuff "" "2.0~bpo1" 600 500 600 "" -o Test=GlobalPin +testequalpolicycoolstuff "" "1.0" 600 990 600 "" -o Test=GlobalPin -t stable echo "Package: coolstuff Pin: release n=backports Pin-Priority: 200" > rootdir/etc/apt/preferences @@ -165,18 +166,18 @@ sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes" signreleasefiles aptgetupdate -testequalpolicycoolstuff "" "1.0" 1 500 0 "" -o Test=NotAutomatic -testequalpolicycoolstuff "" "1.0" 1 990 0 "" -o Test=NotAutomatic -t stable -testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=NotAutomatic -t backports +testequalpolicycoolstuff "" "1.0" 1 500 1 "" -o Test=NotAutomatic +testequalpolicycoolstuff "" "1.0" 1 990 1 "" -o Test=NotAutomatic -t stable +testequalpolicycoolstuff "" "2.0~bpo1" 990 500 990 "" -o Test=NotAutomatic -t backports echo "Package: * Pin: release n=backports Pin-Priority: 200" > rootdir/etc/apt/preferences -testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=NotAutomatic +testequalpolicycoolstuff "" "1.0" 200 500 200 "" -o Test=NotAutomatic echo "Package: * Pin: release n=backports Pin-Priority: 600" > rootdir/etc/apt/preferences -testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=NotAutomatic -testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=NotAutomatic -t stable +testequalpolicycoolstuff "" "2.0~bpo1" 600 500 600 "" -o Test=NotAutomatic +testequalpolicycoolstuff "" "1.0" 600 990 600 "" -o Test=NotAutomatic -t stable echo "Package: coolstuff Pin: release n=backports Pin-Priority: 200" > rootdir/etc/apt/preferences @@ -193,18 +194,18 @@ sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes" signreleasefiles aptgetupdate -testequalpolicycoolstuff "" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades -testequalpolicycoolstuff "" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable -testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports +testequalpolicycoolstuff "" "1.0" 100 500 100 "" -o Test=ButAutomaticUpgrades +testequalpolicycoolstuff "" "1.0" 100 990 100 "" -o Test=ButAutomaticUpgrades -t stable +testequalpolicycoolstuff "" "2.0~bpo1" 990 500 990 "" -o Test=ButAutomaticUpgrades -t backports echo "Package: * Pin: release n=backports Pin-Priority: 200" > rootdir/etc/apt/preferences -testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=ButAutomaticUpgrades +testequalpolicycoolstuff "" "1.0" 200 500 200 "" -o Test=ButAutomaticUpgrades echo "Package: * Pin: release n=backports Pin-Priority: 600" > rootdir/etc/apt/preferences -testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=ButAutomaticUpgrades -testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=ButAutomaticUpgrades -t stable +testequalpolicycoolstuff "" "2.0~bpo1" 600 500 600 "" -o Test=ButAutomaticUpgrades +testequalpolicycoolstuff "" "1.0" 600 990 600 "" -o Test=ButAutomaticUpgrades -t stable echo "Package: coolstuff Pin: release n=backports Pin-Priority: 200" > rootdir/etc/apt/preferences @@ -218,18 +219,18 @@ testequalpolicycoolstuff "" "1.0" 100 990 600 "2.0~bpo1" -o Test=ButAutomaticUpg rm rootdir/etc/apt/preferences testsuccess aptget install coolstuff -y -testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades +testequalpolicycoolstuff "1.0" "1.0" 100 500 100 "" -o Test=ButAutomaticUpgrades testsuccess aptget dist-upgrade -y -testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades -testequalpolicycoolstuff "1.0" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable -testequalpolicycoolstuff "1.0" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports +testequalpolicycoolstuff "1.0" "1.0" 100 500 100 "" -o Test=ButAutomaticUpgrades +testequalpolicycoolstuff "1.0" "1.0" 100 990 100 "" -o Test=ButAutomaticUpgrades -t stable +testequalpolicycoolstuff "1.0" "2.0~bpo1" 990 500 990 "" -o Test=ButAutomaticUpgrades -t backports testsuccess aptget install coolstuff -t backports -y -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 100 "" -o Test=ButAutomaticUpgrades testsuccess aptget dist-upgrade -y -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 100 "" -o Test=ButAutomaticUpgrades +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 990 100 "" -o Test=ButAutomaticUpgrades -t stable +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 990 500 990 "" -o Test=ButAutomaticUpgrades -t backports rm incoming/backports.main.pkglist incoming/backports.main.srclist buildsimplenativepackage "coolstuff" "all" "2.0~bpo2" "backports" @@ -239,14 +240,14 @@ sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes" signreleasefiles aptgetupdate -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 500 0 "" "2.0~bpo2" -o Test=NotAutomatic -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 990 0 "" "2.0~bpo2" -o Test=NotAutomatic -t stable -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=NotAutomatic -t backports +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 500 100 "" "2.0~bpo2" -o Test=NotAutomatic +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 990 100 "" "2.0~bpo2" -o Test=NotAutomatic -t stable +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 100 "" "2.0~bpo2" -o Test=NotAutomatic -t backports sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes" signreleasefiles aptgetupdate -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 990 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t stable -testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t backports +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 500 100 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 990 100 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t stable +testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 100 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t backports -- cgit v1.2.3 From 3d5e93f7cd6bea364ca811c7f64b5e1d4174a4ac Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 10 Aug 2015 15:52:06 +0200 Subject: policy: Fix the handling of config-files states Gbp-Dch: ignore --- apt-pkg/policy.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 78e34a344..7947103d5 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -238,7 +238,7 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVerNew(pkgCache::PkgIterator const for (pkgCache::VerIterator ver = Pkg.VersionList(); ver.end() == false; ver++) { int priority = GetPriority(ver); - if (priority <= candPriority) + if (priority == 0 || priority <= candPriority) continue; // TODO: Maybe optimize to not compare versions @@ -376,8 +376,17 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver) int priority = INT_MIN; for (pkgCache::VerFileIterator file = Ver.FileList(); file.end() == false; file++) { - if (GetPriority(file.File()) > priority) - priority = GetPriority(file.File()); + /* If this is the status file, and the current version is not the + version in the status file (ie it is not installed, or somesuch) + then it is not a candidate for installation, ever. This weeds + out bogus entries that may be due to config-file states, or + other. */ + if (file.File().Flagged(pkgCache::Flag::NotSource) && Ver.ParentPkg().CurrentVer() != Ver) { + if (priority < 0) + priority = 0; + } else if (GetPriority(file.File()) > priority) { + priority = GetPriority(file.File()); + } } return priority == INT_MIN ? 0 : priority; -- cgit v1.2.3 From e8afd16892e87a6e2f17c1019ee455f5583387c2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Jun 2015 00:14:10 +0200 Subject: apply various style suggestions by cppcheck Some of them modify the ABI, but given that we prepare a big one already, these few hardly count for much. Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 36 ++++++++++++++++++------------------ apt-pkg/acquire-item.h | 25 ++++++++++++------------- apt-pkg/acquire-worker.cc | 2 +- apt-pkg/acquire-worker.h | 2 +- apt-pkg/acquire.cc | 4 ++-- apt-pkg/acquire.h | 6 +++--- apt-pkg/algorithms.h | 6 +++--- apt-pkg/cachefilter.h | 12 ++++++------ apt-pkg/cacheiterators.h | 8 ++++---- apt-pkg/cacheset.h | 14 +++++++------- apt-pkg/contrib/hashes.cc | 2 +- apt-pkg/contrib/hashsum_template.h | 2 +- apt-pkg/contrib/strutl.cc | 4 ++-- apt-pkg/deb/debmetaindex.cc | 2 +- apt-pkg/depcache.cc | 6 ++++-- apt-pkg/depcache.h | 2 +- apt-pkg/indexcopy.cc | 1 - apt-pkg/indexfile.h | 2 +- apt-pkg/indexrecords.cc | 19 +++---------------- apt-pkg/indexrecords.h | 13 ++++--------- apt-pkg/install-progress.h | 4 ++-- apt-pkg/orderlist.h | 2 +- apt-pkg/packagemanager.h | 2 +- apt-pkg/pkgcachegen.h | 2 +- apt-pkg/pkgrecords.h | 2 +- apt-pkg/policy.h | 4 ++-- apt-pkg/sourcelist.h | 2 +- apt-pkg/srcrecords.cc | 4 ++++ apt-pkg/srcrecords.h | 11 ++++++----- apt-pkg/tagfile.cc | 2 +- cmdline/apt-extracttemplates.h | 2 +- 31 files changed, 96 insertions(+), 109 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 3313aaabc..034b7725a 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -120,7 +120,7 @@ static bool AllowInsecureRepositories(indexRecords const * const MetaIndexParser return false; } /*}}}*/ -static HashStringList GetExpectedHashesFromFor(indexRecords * const Parser, std::string const MetaKey)/*{{{*/ +static HashStringList GetExpectedHashesFromFor(indexRecords * const Parser, std::string const &MetaKey)/*{{{*/ { if (Parser == NULL) return HashStringList(); @@ -393,7 +393,7 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ virtual std::string DescURI() const {return Target.URI;}; virtual HashStringList GetExpectedHashes() const {return HashStringList();}; - NoActionItem(pkgAcquire * const Owner, IndexTarget const Target) : + NoActionItem(pkgAcquire * const Owner, IndexTarget const &Target) : pkgAcquire::Item(Owner), Target(Target) { Status = StatDone; @@ -404,9 +404,9 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ // Acquire::Item::Item - Constructor /*{{{*/ APT_IGNORE_DEPRECATED_PUSH -pkgAcquire::Item::Item(pkgAcquire * const Owner) : +pkgAcquire::Item::Item(pkgAcquire * const owner) : FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false), - QueueCounter(0), ExpectedAdditionalItems(0), Owner(Owner) + QueueCounter(0), ExpectedAdditionalItems(0), Owner(owner) { Owner->Add(this); Status = StatIdle; @@ -661,8 +661,8 @@ std::string pkgAcquire::Item::HashSum() const /*{{{*/ /*}}}*/ pkgAcqTransactionItem::pkgAcqTransactionItem(pkgAcquire * const Owner, /*{{{*/ - pkgAcqMetaBase * const TransactionManager, IndexTarget const Target) : - pkgAcquire::Item(Owner), Target(Target), TransactionManager(TransactionManager) + pkgAcqMetaBase * const transactionManager, IndexTarget const &target) : + pkgAcquire::Item(Owner), Target(target), TransactionManager(transactionManager) { if (TransactionManager != this) TransactionManager->Add(this); @@ -672,7 +672,7 @@ pkgAcqTransactionItem::~pkgAcqTransactionItem() /*{{{*/ { } /*}}}*/ -HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const MetaKey) const /*{{{*/ +HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const &MetaKey) const /*{{{*/ { return GetExpectedHashesFromFor(TransactionManager->MetaIndexParser, MetaKey); } @@ -681,7 +681,7 @@ HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const Met // AcqMetaBase - Constructor /*{{{*/ pkgAcqMetaBase::pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - std::vector const IndexTargets, + std::vector const &IndexTargets, IndexTarget const &DataTarget, indexRecords * const MetaIndexParser) : pkgAcqTransactionItem(Owner, TransactionManager, DataTarget), @@ -1103,11 +1103,11 @@ pkgAcqMetaBase::~pkgAcqMetaBase() {} pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/ IndexTarget const &ClearsignedTarget, IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget, - std::vector const IndexTargets, + std::vector const &IndexTargets, indexRecords * const MetaIndexParser) : pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets, MetaIndexParser), ClearsignedTarget(ClearsignedTarget), - DetachedDataTarget(DetachedDataTarget), DetachedSigTarget(DetachedSigTarget) + DetachedDataTarget(DetachedDataTarget) { // index targets + (worst case:) Release/Release.gpg ExpectedAdditionalItems = IndexTargets.size() + 2; @@ -1243,7 +1243,7 @@ pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire * const Owner, /*{{{*/ pkgAcqMetaBase * const TransactionManager, IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget, - vector const IndexTargets, + vector const &IndexTargets, indexRecords * const MetaIndexParser) : pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser), DetachedSigTarget(DetachedSigTarget) @@ -1325,7 +1325,7 @@ pkgAcqMetaIndex::~pkgAcqMetaIndex() {} // AcqMetaSig::AcqMetaSig - Constructor /*{{{*/ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target, + IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex) : pkgAcqTransactionItem(Owner, TransactionManager, Target), MetaIndex(MetaIndex) { @@ -1488,7 +1488,7 @@ void pkgAcqMetaSig::Failed(string const &Message,pkgAcquire::MethodConfig const // AcqBaseIndex - Constructor /*{{{*/ pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target) + IndexTarget const &Target) : pkgAcqTransactionItem(Owner, TransactionManager, Target) { } @@ -1504,7 +1504,7 @@ pkgAcqBaseIndex::~pkgAcqBaseIndex() {} */ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target) + IndexTarget const &Target) : pkgAcqBaseIndex(Owner, TransactionManager, Target) { Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); @@ -1905,7 +1905,7 @@ pkgAcqDiffIndex::~pkgAcqDiffIndex() {} */ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target, + IndexTarget const &Target, vector const &diffs) : pkgAcqBaseIndex(Owner, TransactionManager, Target), available_patches(diffs) @@ -2128,7 +2128,7 @@ pkgAcqIndexDiffs::~pkgAcqIndexDiffs() {} // AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor /*{{{*/ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target, + IndexTarget const &Target, DiffInfo const &patch, std::vector const * const allPatches) : pkgAcqBaseIndex(Owner, TransactionManager, Target), @@ -2273,8 +2273,8 @@ pkgAcqIndexMergeDiffs::~pkgAcqIndexMergeDiffs() {} // AcqIndex::AcqIndex - Constructor /*{{{*/ pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target) - : pkgAcqBaseIndex(Owner, TransactionManager, Target) + IndexTarget const &Target) + : pkgAcqBaseIndex(Owner, TransactionManager, Target), Stage(STAGE_DOWNLOAD) { // autoselect the compression method AutoSelectCompression(); diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index df1380b5e..36fedc7be 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -276,7 +276,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ * * \param Owner The new owner of this item. */ - Item(pkgAcquire * const Owner); + explicit Item(pkgAcquire * const Owner); /** \brief Remove this item from its owner's queue by invoking * pkgAcquire::Remove. @@ -347,7 +347,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ void *d; protected: IndexTarget const Target; - HashStringList GetExpectedHashesFor(std::string const MetaKey) const; + HashStringList GetExpectedHashesFor(std::string const &MetaKey) const; bool QueueURI(pkgAcquire::ItemDesc &Item); @@ -370,7 +370,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ virtual bool HashesRequired() const; - pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target); + pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target); virtual ~pkgAcqTransactionItem(); friend class pkgAcqMetaBase; @@ -474,7 +474,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ virtual std::string GetFinalFilename() const; pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - std::vector const IndexTargets, + std::vector const &IndexTargets, IndexTarget const &DataTarget, indexRecords* const MetaIndexParser); virtual ~pkgAcqMetaBase(); @@ -511,7 +511,7 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase /** \brief Create a new pkgAcqMetaIndex. */ pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget, - std::vector const IndexTargets, indexRecords * const MetaIndexParser); + std::vector const &IndexTargets, indexRecords * const MetaIndexParser); virtual ~pkgAcqMetaIndex(); friend class pkgAcqMetaSig; @@ -548,7 +548,7 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem pkgAcquire::MethodConfig const * const Cnf); /** \brief Create a new pkgAcqMetaSig. */ - pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target, + pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex); virtual ~pkgAcqMetaSig(); }; @@ -560,7 +560,6 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex IndexTarget const ClearsignedTarget; IndexTarget const DetachedDataTarget; - IndexTarget const DetachedSigTarget; public: virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); @@ -573,7 +572,7 @@ public: IndexTarget const &ClearsignedTarget, IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget, - std::vector const IndexTargets, + std::vector const &IndexTargets, indexRecords * const MetaIndexParser); virtual ~pkgAcqMetaClearSig(); }; @@ -588,7 +587,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem virtual std::string GetFinalFilename() const; pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target); + IndexTarget const &Target); virtual ~pkgAcqBaseIndex(); }; /*}}}*/ @@ -652,7 +651,7 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex * \param ShortDesc A short description of the list file to download. */ pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target); + IndexTarget const &Target); virtual ~pkgAcqDiffIndex(); private: APT_HIDDEN void QueueOnIMSHit() const; @@ -751,7 +750,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex * check if it was the last one to complete the download step */ pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target, DiffInfo const &patch, + IndexTarget const &Target, DiffInfo const &patch, std::vector const * const allPatches); virtual ~pkgAcqIndexMergeDiffs(); }; @@ -865,7 +864,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex * that depends on it. */ pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target, + IndexTarget const &Target, std::vector const &diffs=std::vector()); virtual ~pkgAcqIndexDiffs(); }; @@ -943,7 +942,7 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex virtual std::string GetMetaKey() const; pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, - IndexTarget const Target); + IndexTarget const &Target); virtual ~pkgAcqIndex(); private: diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index ef195d44b..55fa5734f 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -47,7 +47,7 @@ using namespace std; // --------------------------------------------------------------------- /* */ pkgAcquire::Worker::Worker(Queue *Q,MethodConfig *Cnf, - pkgAcquireStatus *Log) : Log(Log) + pkgAcquireStatus *log) : Log(log) { OwnerQ = Q; Config = Cnf; diff --git a/apt-pkg/acquire-worker.h b/apt-pkg/acquire-worker.h index b8e8fefed..31b9d3b88 100644 --- a/apt-pkg/acquire-worker.h +++ b/apt-pkg/acquire-worker.h @@ -317,7 +317,7 @@ class pkgAcquire::Worker : public WeakPointable * \param Config A location in which to store information about * the fetch method. */ - Worker(MethodConfig *Config); + explicit Worker(MethodConfig *Config); /** \brief Clean up this worker. * diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 75df858a8..f70feeeec 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -653,8 +653,8 @@ pkgAcquire::MethodConfig::MethodConfig() : d(NULL), Next(0), SingleInstance(fals // Queue::Queue - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgAcquire::Queue::Queue(string Name,pkgAcquire *Owner) : d(NULL), Next(0), - Name(Name), Items(0), Workers(0), Owner(Owner), PipeDepth(0), MaxPipeDepth(1) +pkgAcquire::Queue::Queue(string const &name,pkgAcquire * const owner) : d(NULL), Next(0), + Name(name), Items(0), Workers(0), Owner(owner), PipeDepth(0), MaxPipeDepth(1) { } /*}}}*/ diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index b7e6c68f1..661b35f34 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -369,7 +369,7 @@ class pkgAcquire bool GetLock(std::string const &Lock); /** \brief Construct a new pkgAcquire. */ - pkgAcquire(pkgAcquireStatus *Log); + explicit pkgAcquire(pkgAcquireStatus *Log); pkgAcquire(); /** \brief Destroy this pkgAcquire object. @@ -584,7 +584,7 @@ class pkgAcquire::Queue * \param Name The name of the new queue. * \param Owner The download process that owns the new queue. */ - Queue(std::string Name,pkgAcquire *Owner); + Queue(std::string const &Name,pkgAcquire * const Owner); /** Shut down all the worker processes associated with this queue * and empty the queue. @@ -625,7 +625,7 @@ class pkgAcquire::UriIterator * * \param Q The queue over which this UriIterator should iterate. */ - UriIterator(pkgAcquire::Queue *Q); + explicit UriIterator(pkgAcquire::Queue *Q); virtual ~UriIterator(); }; /*}}}*/ diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index dab844220..9c9ceead4 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -67,7 +67,7 @@ class pkgSimulate : public pkgPackageManager /*{{{*/ return (*Cache)[Pkg].CandidateVerIter(*Cache); } - Policy(pkgDepCache *Cache) : Cache(Cache) {}; + explicit Policy(pkgDepCache *Cache) : Cache(Cache) {}; }; unsigned char *Flags; @@ -87,7 +87,7 @@ private: public: - pkgSimulate(pkgDepCache *Cache); + explicit pkgSimulate(pkgDepCache *Cache); virtual ~pkgSimulate(); }; /*}}}*/ @@ -155,7 +155,7 @@ class pkgProblemResolver /*{{{*/ APT_DEPRECATED void InstallProtect(); - pkgProblemResolver(pkgDepCache *Cache); + explicit pkgProblemResolver(pkgDepCache *Cache); virtual ~pkgProblemResolver(); }; /*}}}*/ diff --git a/apt-pkg/cachefilter.h b/apt-pkg/cachefilter.h index b4697b773..df9e9460a 100644 --- a/apt-pkg/cachefilter.h +++ b/apt-pkg/cachefilter.h @@ -53,7 +53,7 @@ public: class NOTMatcher : public Matcher { Matcher * const matcher; public: - NOTMatcher(Matcher * const matcher); + explicit NOTMatcher(Matcher * const matcher); virtual bool operator() (pkgCache::PkgIterator const &Pkg); virtual bool operator() (pkgCache::GrpIterator const &Grp); virtual bool operator() (pkgCache::VerIterator const &Ver); @@ -65,7 +65,7 @@ class ANDMatcher : public Matcher { public: // 5 ought to be enough for everybody… c++11 variadic templates would be nice ANDMatcher(); - ANDMatcher(Matcher * const matcher1); + explicit ANDMatcher(Matcher * const matcher1); ANDMatcher(Matcher * const matcher1, Matcher * const matcher2); ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3); ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4); @@ -81,7 +81,7 @@ class ORMatcher : public Matcher { public: // 5 ought to be enough for everybody… c++11 variadic templates would be nice ORMatcher(); - ORMatcher(Matcher * const matcher1); + explicit ORMatcher(Matcher * const matcher1); ORMatcher(Matcher * const matcher1, Matcher * const matcher2); ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3); ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4); @@ -96,7 +96,7 @@ public: class PackageNameMatchesRegEx : public PackageMatcher { /*{{{*/ regex_t* pattern; public: - PackageNameMatchesRegEx(std::string const &Pattern); + explicit PackageNameMatchesRegEx(std::string const &Pattern); virtual bool operator() (pkgCache::PkgIterator const &Pkg); virtual bool operator() (pkgCache::GrpIterator const &Grp); virtual ~PackageNameMatchesRegEx(); @@ -105,7 +105,7 @@ public: class PackageNameMatchesFnmatch : public PackageMatcher { /*{{{*/ const std::string Pattern; public: - PackageNameMatchesFnmatch(std::string const &Pattern); + explicit PackageNameMatchesFnmatch(std::string const &Pattern); virtual bool operator() (pkgCache::PkgIterator const &Pkg); virtual bool operator() (pkgCache::GrpIterator const &Grp); virtual ~PackageNameMatchesFnmatch() {}; @@ -140,7 +140,7 @@ public: class PackageIsNewInstall : public PackageMatcher { /*{{{*/ pkgCacheFile * const Cache; public: - PackageIsNewInstall(pkgCacheFile * const Cache); + explicit PackageIsNewInstall(pkgCacheFile * const Cache); virtual bool operator() (pkgCache::PkgIterator const &Pkg); virtual ~PackageIsNewInstall(); }; diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 301da6fc4..f3b107699 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -107,7 +107,7 @@ class pkgCache::GrpIterator: public Iterator { public: // This constructor is the 'begin' constructor, never use it. - inline GrpIterator(pkgCache &Owner) : Iterator(Owner), HashIndex(-1) { + explicit inline GrpIterator(pkgCache &Owner) : Iterator(Owner), HashIndex(-1) { S = OwnerPointer(); operator ++(0); } @@ -148,7 +148,7 @@ class pkgCache::PkgIterator: public Iterator { public: // This constructor is the 'begin' constructor, never use it. - inline PkgIterator(pkgCache &Owner) : Iterator(Owner), HashIndex(-1) { + explicit inline PkgIterator(pkgCache &Owner) : Iterator(Owner), HashIndex(-1) { S = OwnerPointer(); operator ++(0); } @@ -394,7 +394,7 @@ class pkgCache::RlsFileIterator : public Iterator // Constructors inline RlsFileIterator() : Iterator() {} - inline RlsFileIterator(pkgCache &Owner) : Iterator(Owner, Owner.RlsFileP) {} + explicit inline RlsFileIterator(pkgCache &Owner) : Iterator(Owner, Owner.RlsFileP) {} inline RlsFileIterator(pkgCache &Owner,ReleaseFile *Trg) : Iterator(Owner, Trg) {} }; /*}}}*/ @@ -430,7 +430,7 @@ class pkgCache::PkgFileIterator : public Iterator // Constructors inline PkgFileIterator() : Iterator() {} - inline PkgFileIterator(pkgCache &Owner) : Iterator(Owner, Owner.PkgFileP) {} + explicit inline PkgFileIterator(pkgCache &Owner) : Iterator(Owner, Owner.PkgFileP) {} inline PkgFileIterator(pkgCache &Owner,PackageFile *Trg) : Iterator(Owner, Trg) {} }; /*}}}*/ diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 1a6feb5f7..7fd740335 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -265,7 +265,7 @@ APT_IGNORE_DEPRECATED_POP void setConstructor(CacheSetHelper::PkgSelector const by) { ConstructedBy = by; } CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; } PackageContainerInterface(); - PackageContainerInterface(CacheSetHelper::PkgSelector const by); + explicit PackageContainerInterface(CacheSetHelper::PkgSelector const by); virtual ~PackageContainerInterface(); APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) { @@ -310,7 +310,7 @@ public: /*{{{*/ public std::iterator { typename Container::const_iterator _iter; public: - const_iterator(typename Container::const_iterator i) : _iter(i) {} + explicit const_iterator(typename Container::const_iterator i) : _iter(i) {} pkgCache::PkgIterator getPkg(void) const { return *_iter; } inline pkgCache::PkgIterator operator*(void) const { return *_iter; } operator typename Container::const_iterator(void) const { return _iter; } @@ -324,7 +324,7 @@ public: /*{{{*/ public std::iterator { typename Container::iterator _iter; public: - iterator(typename Container::iterator i) : _iter(i) {} + explicit iterator(typename Container::iterator i) : _iter(i) {} pkgCache::PkgIterator getPkg(void) const { return *_iter; } inline pkgCache::PkgIterator operator*(void) const { return *_iter; } operator typename Container::iterator(void) const { return _iter; } @@ -359,7 +359,7 @@ public: /*{{{*/ const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); } PackageContainer() : PackageContainerInterface(CacheSetHelper::UNKNOWN) {} - PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {} + explicit PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {} APT_IGNORE_DEPRECATED_PUSH APT_DEPRECATED PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {} APT_IGNORE_DEPRECATED_POP @@ -568,7 +568,7 @@ public: APT_PUBLIC iterator begin() { return _cont->PkgBegin(); } APT_PUBLIC iterator end() { return _cont->PkgEnd(); } - APT_PUBLIC PackageUniverse(pkgCache * const Owner); + explicit APT_PUBLIC PackageUniverse(pkgCache * const Owner); APT_PUBLIC virtual ~PackageUniverse(); private: @@ -744,7 +744,7 @@ public: /*{{{*/ public std::iterator {/*{{{*/ typename Container::const_iterator _iter; public: - const_iterator(typename Container::const_iterator i) : _iter(i) {} + explicit const_iterator(typename Container::const_iterator i) : _iter(i) {} pkgCache::VerIterator getVer(void) const { return *_iter; } inline pkgCache::VerIterator operator*(void) const { return *_iter; } operator typename Container::const_iterator(void) const { return _iter; } @@ -758,7 +758,7 @@ public: /*{{{*/ public std::iterator { typename Container::iterator _iter; public: - iterator(typename Container::iterator i) : _iter(i) {} + explicit iterator(typename Container::iterator i) : _iter(i) {} pkgCache::VerIterator getVer(void) const { return *_iter; } inline pkgCache::VerIterator operator*(void) const { return *_iter; } operator typename Container::iterator(void) const { return _iter; } diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 46cf0ba08..05a137653 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -276,7 +276,7 @@ public: unsigned long long FileSize; unsigned int CalcHashes; - PrivateHashes(unsigned int const CalcHashes) : FileSize(0), CalcHashes(CalcHashes) {} + explicit PrivateHashes(unsigned int const CalcHashes) : FileSize(0), CalcHashes(CalcHashes) {} }; /*}}}*/ // Hashes::Add* - Add the contents of data or FD /*{{{*/ diff --git a/apt-pkg/contrib/hashsum_template.h b/apt-pkg/contrib/hashsum_template.h index 869dc5cb7..d0ea0971e 100644 --- a/apt-pkg/contrib/hashsum_template.h +++ b/apt-pkg/contrib/hashsum_template.h @@ -87,7 +87,7 @@ class HashSumValue Sum[I] = S[I]; } - HashSumValue(std::string Str) + explicit HashSumValue(std::string const &Str) { memset(Sum,0,sizeof(Sum)); Set(Str); diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 5731b5a2b..05624f7fb 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1308,7 +1308,7 @@ void ioprintf(ostream &out,const char *format,...) va_list args; ssize_t size = 400; while (true) { - bool ret = false; + bool ret; va_start(args,format); ret = iovprintf(out, format, args, size); va_end(args); @@ -1322,7 +1322,7 @@ void strprintf(string &out,const char *format,...) ssize_t size = 400; std::ostringstream outstr; while (true) { - bool ret = false; + bool ret; va_start(args,format); ret = iovprintf(outstr, format, args, size); va_end(args); diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 34fc98838..430a5021b 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -103,7 +103,7 @@ debReleaseIndex::~debReleaseIndex() { } template -void foreachTarget(std::string const URI, std::string const Dist, +void foreachTarget(std::string const &URI, std::string const &Dist, std::map > const &ArchEntries, CallC &Call) { diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 36e1ac9ec..921cbced5 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -95,7 +95,9 @@ pkgDepCache::ActionGroup::~ActionGroup() // --------------------------------------------------------------------- /* */ pkgDepCache::pkgDepCache(pkgCache *pCache,Policy *Plcy) : - group_level(0), Cache(pCache), PkgState(0), DepState(0) + group_level(0), Cache(pCache), PkgState(0), DepState(0), + iUsrSize(0), iDownloadSize(0), iInstCount(0), iDelCount(0), iKeepCount(0), + iBrokenCount(0), iPolicyBrokenCount(0), iBadCount(0) { DebugMarker = _config->FindB("Debug::pkgDepCache::Marker", false); DebugAutoInstall = _config->FindB("Debug::pkgDepCache::AutoInstall", false); @@ -947,7 +949,7 @@ bool pkgDepCache::IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, /* */ struct CompareProviders { pkgCache::PkgIterator const Pkg; - CompareProviders(pkgCache::DepIterator const &Dep) : Pkg(Dep.TargetPkg()) {}; + explicit CompareProviders(pkgCache::DepIterator const &Dep) : Pkg(Dep.TargetPkg()) {}; //bool operator() (APT::VersionList::iterator const &AV, APT::VersionList::iterator const &BV) bool operator() (pkgCache::VerIterator const &AV, pkgCache::VerIterator const &BV) { diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 94c1088f2..0594a253d 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -179,7 +179,7 @@ class pkgDepCache : protected pkgCache::Namespace * As long as this object exists, no automatic cleanup * operations will be undertaken. */ - ActionGroup(pkgDepCache &cache); + explicit ActionGroup(pkgDepCache &cache); /** \brief Clean up the action group before it is destroyed. * diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 120d061ad..b0f191ded 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -424,7 +424,6 @@ bool PackageCopy::GetFile(string &File,unsigned long long &Size) // PackageCopy::RewriteEntry - Rewrite the entry with a new filename /*{{{*/ bool PackageCopy::RewriteEntry(FileFd &Target,string const &File) { - string const Dir(File,0,File.rfind('/')); std::vector Changes; Changes.push_back(pkgTagSection::Tag::Rewrite("Filename", File)); diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index c51879bb8..b6472e201 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -144,7 +144,7 @@ class pkgIndexFile bool IsTrusted() const { return Trusted; }; - pkgIndexFile(bool Trusted); + explicit pkgIndexFile(bool Trusted); virtual ~pkgIndexFile(); }; diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index 7e6da9558..5a93d826f 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -42,7 +42,7 @@ APT_PURE bool indexRecords::GetSupportsAcquireByHash() const return this->SupportsAcquireByHash; } -APT_PURE bool indexRecords::CheckDist(const string MaybeDist) const +APT_PURE bool indexRecords::CheckDist(string const &MaybeDist) const { return (this->Dist == MaybeDist || this->Suite == MaybeDist); @@ -63,7 +63,7 @@ APT_PURE time_t indexRecords::GetDate() const return this->Date; } -APT_PURE indexRecords::checkSum *indexRecords::Lookup(const string MetaKey) +APT_PURE indexRecords::checkSum *indexRecords::Lookup(string const &MetaKey) { std::map::const_iterator sum = Entries.find(MetaKey); if (sum == Entries.end()) @@ -76,7 +76,7 @@ APT_PURE bool indexRecords::Exists(string const &MetaKey) const return Entries.find(MetaKey) != Entries.end(); } -bool indexRecords::Load(const string Filename) /*{{{*/ +bool indexRecords::Load(string const &Filename) /*{{{*/ { FileFd Fd; if (OpenMaybeClearSignedFile(Filename, Fd) == false) @@ -272,23 +272,10 @@ void indexRecords::SetTrusted(bool const Trusted) this->Trusted = NEVER_TRUSTED; } -#if APT_PKG_ABI >= 413 indexRecords::indexRecords(const string &ExpectedDist) : Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0), SupportsAcquireByHash(false) { } -#else -indexRecords::indexRecords() : - Trusted(CHECK_TRUST), d(NULL), ExpectedDist(""), ValidUntil(0), - SupportsAcquireByHash(false) -{ -} -indexRecords::indexRecords(const string ExpectedDist) : - Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0), - SupportsAcquireByHash(false) -{ -} -#endif indexRecords::~indexRecords() {} diff --git a/apt-pkg/indexrecords.h b/apt-pkg/indexrecords.h index f7dfa3235..3ff072590 100644 --- a/apt-pkg/indexrecords.h +++ b/apt-pkg/indexrecords.h @@ -40,21 +40,16 @@ class indexRecords std::map Entries; public: -#if APT_PKG_ABI >= 413 - indexRecords(const std::string &ExpectedDist = ""); -#else - indexRecords(); - indexRecords(const std::string ExpectedDist); -#endif + explicit indexRecords(const std::string &ExpectedDist = ""); // Lookup function - virtual checkSum *Lookup(const std::string MetaKey); + virtual checkSum *Lookup(std::string const &MetaKey); /** \brief tests if a checksum for this file is available */ bool Exists(std::string const &MetaKey) const; std::vector MetaKeys(); - virtual bool Load(std::string Filename); - virtual bool CheckDist(const std::string MaybeDist) const; + virtual bool Load(std::string const &Filename); + virtual bool CheckDist(std::string const &MaybeDist) const; std::string GetDist() const; std::string GetSuite() const; diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h index a4c5daf7f..5da3624c0 100644 --- a/apt-pkg/install-progress.h +++ b/apt-pkg/install-progress.h @@ -69,7 +69,7 @@ namespace Progress { void WriteToStatusFd(std::string msg); public: - PackageManagerProgressFd(int progress_fd); + explicit PackageManagerProgressFd(int progress_fd); virtual ~PackageManagerProgressFd(); virtual void StartDpkg(); @@ -100,7 +100,7 @@ namespace Progress { void WriteToStatusFd(std::string msg); public: - PackageManagerProgressDeb822Fd(int progress_fd); + explicit PackageManagerProgressDeb822Fd(int progress_fd); virtual ~PackageManagerProgressDeb822Fd(); virtual void StartDpkg(); diff --git a/apt-pkg/orderlist.h b/apt-pkg/orderlist.h index 29ef79b84..6d9f45eed 100644 --- a/apt-pkg/orderlist.h +++ b/apt-pkg/orderlist.h @@ -122,7 +122,7 @@ class pkgOrderList : protected pkgCache::Namespace int Score(PkgIterator Pkg); - pkgOrderList(pkgDepCache *Cache); + explicit pkgOrderList(pkgDepCache *Cache); virtual ~pkgOrderList(); }; diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index 60414ae1c..2cdf92cdd 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -141,7 +141,7 @@ class pkgPackageManager : protected pkgCache::Namespace /** \brief returns all packages dpkg let disappear */ inline std::set GetDisappearedPackages() { return disappearedPkgs; }; - pkgPackageManager(pkgDepCache *Cache); + explicit pkgPackageManager(pkgDepCache *Cache); virtual ~pkgPackageManager(); private: diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 3c1a40972..c7b6de1b6 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -54,7 +54,7 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ template class Dynamic { public: static std::vector toReMap; - Dynamic(Iter &I) { + explicit Dynamic(Iter &I) { toReMap.push_back(&I); } diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h index 66eb17857..766e845aa 100644 --- a/apt-pkg/pkgrecords.h +++ b/apt-pkg/pkgrecords.h @@ -42,7 +42,7 @@ class pkgRecords /*{{{*/ Parser &Lookup(pkgCache::DescFileIterator const &Desc); // Construct destruct - pkgRecords(pkgCache &Cache); + explicit pkgRecords(pkgCache &Cache); virtual ~pkgRecords(); }; /*}}}*/ diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index 4efe2ec50..0d2b468bc 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -59,7 +59,7 @@ class pkgPolicy : public pkgDepCache::Policy struct PkgPin : Pin { std::string Pkg; - PkgPin(std::string const &Pkg) : Pin(), Pkg(Pkg) {}; + explicit PkgPin(std::string const &Pkg) : Pin(), Pkg(Pkg) {}; }; Pin *Pins; @@ -85,7 +85,7 @@ class pkgPolicy : public pkgDepCache::Policy bool InitDefaults(); - pkgPolicy(pkgCache *Owner); + explicit pkgPolicy(pkgCache *Owner); virtual ~pkgPolicy(); private: pkgCache::VerIterator GetCandidateVerNew(pkgCache::PkgIterator const &Pkg); diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index c92643829..d9eacc08f 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -117,7 +117,7 @@ class pkgSourceList time_t GetLastModifiedTime(); pkgSourceList(); - pkgSourceList(std::string File); + explicit pkgSourceList(std::string File); virtual ~pkgSourceList(); }; diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index 3175ee75f..bbab9d796 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -178,3 +178,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector &F2)/*{{{*/ return true; } /*}}}*/ + + +pkgSrcRecords::Parser::Parser(const pkgIndexFile *Index) : iIndex(Index) {} +pkgSrcRecords::Parser::~Parser() {} diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h index dda66ce48..71173c953 100644 --- a/apt-pkg/srcrecords.h +++ b/apt-pkg/srcrecords.h @@ -48,6 +48,7 @@ APT_IGNORE_DEPRECATED_POP // Abstract parser for each source record class Parser { + void *d; protected: const pkgIndexFile *iIndex; @@ -85,9 +86,9 @@ APT_IGNORE_DEPRECATED_POP virtual bool Files(std::vector &F) = 0; bool Files2(std::vector &F); - - Parser(const pkgIndexFile *Index) : iIndex(Index) {}; - virtual ~Parser() {}; + + explicit Parser(const pkgIndexFile *Index); + virtual ~Parser(); }; private: @@ -110,8 +111,8 @@ APT_IGNORE_DEPRECATED_POP // Locate a package by name and return pointer to the Parser. // The pointer is owned by libapt. Parser* Find(const char *Package,bool const &SrcOnly = false); - - pkgSrcRecords(pkgSourceList &List); + + explicit pkgSrcRecords(pkgSourceList &List); virtual ~pkgSrcRecords(); }; diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 5ff495fbd..130aef19d 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -59,7 +59,7 @@ public: unsigned int StartValue; unsigned int NextInBucket; - TagData(unsigned int const StartTag) : StartTag(StartTag), EndTag(0), StartValue(0), NextInBucket(0) {} + explicit TagData(unsigned int const StartTag) : StartTag(StartTag), EndTag(0), StartValue(0), NextInBucket(0) {} }; std::vector Tags; }; diff --git a/cmdline/apt-extracttemplates.h b/cmdline/apt-extracttemplates.h index 829cdae75..b129a2d51 100644 --- a/cmdline/apt-extracttemplates.h +++ b/cmdline/apt-extracttemplates.h @@ -24,7 +24,7 @@ class DebFile : public pkgDirStream unsigned long ControlLen; public: - DebFile(const char *FileName); + explicit DebFile(const char *FileName); ~DebFile(); bool DoItem(Item &I, int &fd); bool Process(pkgDirStream::Item &I, const unsigned char *data, -- cgit v1.2.3 From 6c55f07a5fa3612a5d59c61a17da5fe640eadc8b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Jun 2015 09:29:00 +0200 Subject: make all d-pointer * const pointers Doing this disables the implicit copy assignment operator (among others) which would cause hovac if used on the classes as it would just copy the pointer, not the data the d-pointer points to. For most of the classes we don't need a copy assignment operator anyway and in many classes it was broken before as many contain a pointer of some sort. Only for our Cacheset Container interfaces we define an explicit copy assignment operator which could later be implemented to copy the data from one d-pointer to the other if we need it. Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 26 ++++++++++++------------ apt-pkg/acquire-item.h | 28 ++++++++++++------------- apt-pkg/acquire-method.cc | 4 ++-- apt-pkg/acquire-method.h | 4 ++-- apt-pkg/acquire-worker.cc | 13 ++++-------- apt-pkg/acquire-worker.h | 2 +- apt-pkg/acquire.cc | 4 ++-- apt-pkg/acquire.h | 10 ++++----- apt-pkg/algorithms.cc | 2 +- apt-pkg/algorithms.h | 4 ++-- apt-pkg/cachefile.h | 2 +- apt-pkg/cacheset.cc | 19 ++++++++++++----- apt-pkg/cacheset.h | 10 +++++---- apt-pkg/cdrom.cc | 6 +++--- apt-pkg/cdrom.h | 6 +++--- apt-pkg/clean.cc | 2 +- apt-pkg/clean.h | 2 +- apt-pkg/contrib/fileutl.cc | 19 +++++++++++++++++ apt-pkg/contrib/fileutl.h | 27 ++++++++----------------- apt-pkg/contrib/hashes.cc | 29 +++++++++++++------------- apt-pkg/contrib/hashes.h | 2 +- apt-pkg/deb/debindexfile.cc | 12 +++++------ apt-pkg/deb/debindexfile.h | 12 +++++------ apt-pkg/deb/deblistparser.cc | 2 +- apt-pkg/deb/deblistparser.h | 2 +- apt-pkg/deb/debmetaindex.cc | 6 +++--- apt-pkg/deb/debmetaindex.h | 4 ++-- apt-pkg/deb/debrecords.cc | 6 +++--- apt-pkg/deb/debrecords.h | 6 +++--- apt-pkg/deb/debsrcrecords.cc | 2 +- apt-pkg/deb/debsrcrecords.h | 2 +- apt-pkg/deb/debsystem.cc | 5 +---- apt-pkg/deb/debsystem.h | 2 +- apt-pkg/deb/dpkgpm.cc | 5 ++--- apt-pkg/deb/dpkgpm.h | 2 +- apt-pkg/depcache.cc | 4 ++-- apt-pkg/depcache.h | 4 ++-- apt-pkg/edsp/edspindexfile.cc | 2 +- apt-pkg/edsp/edspindexfile.h | 2 +- apt-pkg/edsp/edsplistparser.cc | 2 +- apt-pkg/edsp/edsplistparser.h | 2 +- apt-pkg/edsp/edspsystem.cc | 8 ++------ apt-pkg/edsp/edspsystem.h | 2 +- apt-pkg/indexcopy.cc | 10 ++++----- apt-pkg/indexcopy.h | 10 ++++----- apt-pkg/indexfile.cc | 4 ++-- apt-pkg/indexfile.h | 4 ++-- apt-pkg/indexrecords.h | 2 +- apt-pkg/install-progress.cc | 8 ++++---- apt-pkg/install-progress.h | 10 ++++----- apt-pkg/metaindex.cc | 2 +- apt-pkg/metaindex.h | 2 +- apt-pkg/orderlist.cc | 2 +- apt-pkg/orderlist.h | 2 +- apt-pkg/packagemanager.cc | 2 +- apt-pkg/packagemanager.h | 2 +- apt-pkg/pkgcache.cc | 2 +- apt-pkg/pkgcache.h | 2 +- apt-pkg/pkgcachegen.cc | 4 ++-- apt-pkg/pkgcachegen.h | 4 ++-- apt-pkg/pkgrecords.cc | 2 +- apt-pkg/pkgrecords.h | 4 ++-- apt-pkg/pkgsystem.cc | 3 ++- apt-pkg/pkgsystem.h | 10 ++++----- apt-pkg/policy.cc | 2 +- apt-pkg/policy.h | 4 ++-- apt-pkg/sourcelist.cc | 4 ++-- apt-pkg/sourcelist.h | 2 +- apt-pkg/srcrecords.cc | 2 +- apt-pkg/srcrecords.h | 4 ++-- apt-pkg/tagfile.cc | 46 ++++++++++++++++++++++-------------------- apt-pkg/tagfile.h | 8 ++++---- 72 files changed, 244 insertions(+), 234 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 034b7725a..222ca8931 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -406,7 +406,7 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ APT_IGNORE_DEPRECATED_PUSH pkgAcquire::Item::Item(pkgAcquire * const owner) : FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false), - QueueCounter(0), ExpectedAdditionalItems(0), Owner(owner) + QueueCounter(0), ExpectedAdditionalItems(0), Owner(owner), d(NULL) { Owner->Add(this); Status = StatIdle; @@ -662,7 +662,7 @@ std::string pkgAcquire::Item::HashSum() const /*{{{*/ pkgAcqTransactionItem::pkgAcqTransactionItem(pkgAcquire * const Owner, /*{{{*/ pkgAcqMetaBase * const transactionManager, IndexTarget const &target) : - pkgAcquire::Item(Owner), Target(target), TransactionManager(transactionManager) + pkgAcquire::Item(Owner), d(NULL), Target(target), TransactionManager(transactionManager) { if (TransactionManager != this) TransactionManager->Add(this); @@ -684,7 +684,7 @@ pkgAcqMetaBase::pkgAcqMetaBase(pkgAcquire * const Owner, std::vector const &IndexTargets, IndexTarget const &DataTarget, indexRecords * const MetaIndexParser) -: pkgAcqTransactionItem(Owner, TransactionManager, DataTarget), +: pkgAcqTransactionItem(Owner, TransactionManager, DataTarget), d(NULL), MetaIndexParser(MetaIndexParser), LastMetaIndexParser(NULL), IndexTargets(IndexTargets), AuthPass(false), IMSHit(false) { @@ -1106,7 +1106,7 @@ pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/ std::vector const &IndexTargets, indexRecords * const MetaIndexParser) : pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets, MetaIndexParser), - ClearsignedTarget(ClearsignedTarget), + d(NULL), ClearsignedTarget(ClearsignedTarget), DetachedDataTarget(DetachedDataTarget) { // index targets + (worst case:) Release/Release.gpg @@ -1245,7 +1245,7 @@ pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire * const Owner, /*{{{*/ IndexTarget const &DetachedSigTarget, vector const &IndexTargets, indexRecords * const MetaIndexParser) : - pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser), + pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser), d(NULL), DetachedSigTarget(DetachedSigTarget) { if(_config->FindB("Debug::Acquire::Transaction", false) == true) @@ -1327,7 +1327,7 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex) : - pkgAcqTransactionItem(Owner, TransactionManager, Target), MetaIndex(MetaIndex) + pkgAcqTransactionItem(Owner, TransactionManager, Target), d(NULL), MetaIndex(MetaIndex) { DestFile = GetPartialFileNameFromURI(Target.URI); @@ -1489,7 +1489,7 @@ void pkgAcqMetaSig::Failed(string const &Message,pkgAcquire::MethodConfig const pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target) -: pkgAcqTransactionItem(Owner, TransactionManager, Target) +: pkgAcqTransactionItem(Owner, TransactionManager, Target), d(NULL) { } /*}}}*/ @@ -1505,7 +1505,7 @@ pkgAcqBaseIndex::~pkgAcqBaseIndex() {} pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target) - : pkgAcqBaseIndex(Owner, TransactionManager, Target) + : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL) { Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); @@ -1907,7 +1907,7 @@ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target, vector const &diffs) - : pkgAcqBaseIndex(Owner, TransactionManager, Target), + : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL), available_patches(diffs) { DestFile = GetPartialFileNameFromURI(Target.URI); @@ -2131,7 +2131,7 @@ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, IndexTarget const &Target, DiffInfo const &patch, std::vector const * const allPatches) - : pkgAcqBaseIndex(Owner, TransactionManager, Target), + : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL), patch(patch), allPatches(allPatches), State(StateFetchDiff) { Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); @@ -2274,7 +2274,7 @@ pkgAcqIndexMergeDiffs::~pkgAcqIndexMergeDiffs() {} pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target) - : pkgAcqBaseIndex(Owner, TransactionManager, Target), Stage(STAGE_DOWNLOAD) + : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL), Stage(STAGE_DOWNLOAD) { // autoselect the compression method AutoSelectCompression(); @@ -2555,7 +2555,7 @@ pkgAcqIndex::~pkgAcqIndex() {} pkgAcqArchive::pkgAcqArchive(pkgAcquire * const Owner,pkgSourceList * const Sources, pkgRecords * const Recs,pkgCache::VerIterator const &Version, string &StoreFilename) : - Item(Owner), LocalSource(false), Version(Version), Sources(Sources), Recs(Recs), + Item(Owner), d(NULL), LocalSource(false), Version(Version), Sources(Sources), Recs(Recs), StoreFilename(StoreFilename), Vf(Version.FileList()), Trusted(false) { @@ -3048,7 +3048,7 @@ pkgAcqFile::pkgAcqFile(pkgAcquire * const Owner,string const &URI, HashStringLis unsigned long long const Size,string const &Dsc,string const &ShortDesc, const string &DestDir, const string &DestFilename, bool const IsIndexFile) : - Item(Owner), IsIndexFile(IsIndexFile), ExpectedHashes(Hashes) + Item(Owner), d(NULL), IsIndexFile(IsIndexFile), ExpectedHashes(Hashes) { Retries = _config->FindI("Acquire::Retries",0); diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 36fedc7be..c4bbfc7a1 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -336,7 +336,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ virtual std::string GetFinalFilename() const; private: - void *d; + void * const d; friend class pkgAcqMetaBase; }; @@ -344,7 +344,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ /** \brief baseclass for the indexes files to manage them all together */ { - void *d; + void * const d; protected: IndexTarget const Target; HashStringList GetExpectedHashesFor(std::string const &MetaKey) const; @@ -379,7 +379,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ /** \brief the manager of a transaction */ { - void *d; + void * const d; protected: std::vector Transaction; @@ -492,7 +492,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ */ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase { - void *d; + void * const d; protected: IndexTarget const DetachedSigTarget; @@ -527,7 +527,7 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase */ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem { - void *d; + void * const d; pkgAcqMetaIndex * const MetaIndex; @@ -556,7 +556,7 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem /** \brief An item repsonsible for downloading clearsigned metaindexes {{{*/ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex { - void *d; + void * const d; IndexTarget const ClearsignedTarget; IndexTarget const DetachedDataTarget; @@ -580,7 +580,7 @@ public: /** \brief Common base class for all classes that deal with fetching indexes {{{*/ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem { - void *d; + void * const d; public: /** \brief Get the full pathname of the final file for the current URI */ @@ -602,7 +602,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem */ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex { - void *d; + void * const d; protected: /** \brief If \b true, debugging information will be written to std::clog. */ @@ -684,7 +684,7 @@ struct APT_HIDDEN DiffInfo { /*{{{*/ */ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex { - void *d; + void * const d; protected: @@ -768,7 +768,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex */ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex { - void *d; + void * const d; private: @@ -878,7 +878,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex */ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex { - void *d; + void * const d; protected: @@ -957,7 +957,7 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex */ class pkgAcqArchive : public pkgAcquire::Item { - void *d; + void * const d; bool LocalSource; HashStringList ExpectedHashes; @@ -1045,7 +1045,7 @@ class pkgAcqArchive : public pkgAcquire::Item */ class pkgAcqChangelog : public pkgAcquire::Item { - void *d; + void * const d; std::string TemporaryDirectory; std::string const SrcName; std::string const SrcVersion; @@ -1160,7 +1160,7 @@ private: */ class pkgAcqFile : public pkgAcquire::Item { - void *d; + void * const d; /** \brief How many times to retry the download, set from * Acquire::Retries. diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index d3aff4d5e..991e6780a 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -457,7 +457,7 @@ void pkgAcqMethod::Redirect(const string &NewURI) // --------------------------------------------------------------------- /* */ pkgAcqMethod::FetchResult::FetchResult() : LastModified(0), - IMSHit(false), Size(0), ResumePoint(0) + IMSHit(false), Size(0), ResumePoint(0), d(NULL) { } /*}}}*/ @@ -480,7 +480,7 @@ void pkgAcqMethod::Dequeue() { /*{{{*/ /*}}}*/ pkgAcqMethod::~pkgAcqMethod() {} -pkgAcqMethod::FetchItem::FetchItem() {} +pkgAcqMethod::FetchItem::FetchItem() : d(NULL) {} pkgAcqMethod::FetchItem::~FetchItem() {} pkgAcqMethod::FetchResult::~FetchResult() {} diff --git a/apt-pkg/acquire-method.h b/apt-pkg/acquire-method.h index f6659ef1f..cab2bda40 100644 --- a/apt-pkg/acquire-method.h +++ b/apt-pkg/acquire-method.h @@ -56,7 +56,7 @@ class pkgAcqMethod FetchItem(); virtual ~FetchItem(); private: - void *d; + void * const d; }; struct FetchResult @@ -73,7 +73,7 @@ class pkgAcqMethod FetchResult(); virtual ~FetchResult(); private: - void *d; + void * const d; }; // State diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 55fa5734f..8d619e96d 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -47,7 +47,7 @@ using namespace std; // --------------------------------------------------------------------- /* */ pkgAcquire::Worker::Worker(Queue *Q,MethodConfig *Cnf, - pkgAcquireStatus *log) : Log(log) + pkgAcquireStatus *log) : d(NULL), Log(log) { OwnerQ = Q; Config = Cnf; @@ -62,15 +62,10 @@ pkgAcquire::Worker::Worker(Queue *Q,MethodConfig *Cnf, // Worker::Worker - Constructor for method config startup /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgAcquire::Worker::Worker(MethodConfig *Cnf) +pkgAcquire::Worker::Worker(MethodConfig *Cnf) : d(NULL), OwnerQ(NULL), Config(Cnf), + Access(Cnf->Access), CurrentItem(NULL), + CurrentSize(0), TotalSize(0) { - OwnerQ = 0; - Config = Cnf; - Access = Cnf->Access; - CurrentItem = 0; - TotalSize = 0; - CurrentSize = 0; - Construct(); } /*}}}*/ diff --git a/apt-pkg/acquire-worker.h b/apt-pkg/acquire-worker.h index 31b9d3b88..42762abe0 100644 --- a/apt-pkg/acquire-worker.h +++ b/apt-pkg/acquire-worker.h @@ -47,7 +47,7 @@ class pkgAcquire::Worker : public WeakPointable { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; friend class pkgAcquire; diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index f70feeeec..5fd378096 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -51,13 +51,13 @@ using namespace std; // Acquire::pkgAcquire - Constructor /*{{{*/ // --------------------------------------------------------------------- /* We grab some runtime state from the configuration space */ -pkgAcquire::pkgAcquire() : LockFD(-1), Queues(0), Workers(0), Configs(0), Log(NULL), ToFetch(0), +pkgAcquire::pkgAcquire() : LockFD(-1), d(NULL), Queues(0), Workers(0), Configs(0), Log(NULL), ToFetch(0), Debug(_config->FindB("Debug::pkgAcquire",false)), Running(false) { Initialize(); } -pkgAcquire::pkgAcquire(pkgAcquireStatus *Progress) : LockFD(-1), Queues(0), Workers(0), +pkgAcquire::pkgAcquire(pkgAcquireStatus *Progress) : LockFD(-1), d(NULL), Queues(0), Workers(0), Configs(0), Log(NULL), ToFetch(0), Debug(_config->FindB("Debug::pkgAcquire",false)), Running(false) diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index 661b35f34..aa581dfb8 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -101,7 +101,7 @@ class pkgAcquire /** \brief FD of the Lock file we acquire in Setup (if any) */ int LockFD; /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; public: @@ -411,7 +411,7 @@ class pkgAcquire::Queue friend class pkgAcquire::Worker; /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; /** \brief The next queue in the pkgAcquire object's list of queues. */ Queue *Next; @@ -596,7 +596,7 @@ class pkgAcquire::Queue class pkgAcquire::UriIterator { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; /** The next queue to iterate over. */ pkgAcquire::Queue *CurQ; @@ -633,7 +633,7 @@ class pkgAcquire::UriIterator struct pkgAcquire::MethodConfig { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; /** \brief The next link on the acquire method list. * @@ -694,7 +694,7 @@ struct pkgAcquire::MethodConfig class pkgAcquireStatus { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; protected: diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index adbec82f7..db765febe 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -43,7 +43,7 @@ pkgProblemResolver *pkgProblemResolver::This = 0; /* The legacy translations here of input Pkg iterators is obsolete, this is not necessary since the pkgCaches are fully shared now. */ pkgSimulate::pkgSimulate(pkgDepCache *Cache) : pkgPackageManager(Cache), - iPolicy(Cache), + d(NULL), iPolicy(Cache), Sim(&Cache->GetCache(),&iPolicy), group(Sim) { diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index 9c9ceead4..d9cce672a 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -54,7 +54,7 @@ using std::ostream; class pkgSimulate : public pkgPackageManager /*{{{*/ { - void *d; + void * const d; protected: class Policy : public pkgDepCache::Policy @@ -95,7 +95,7 @@ class pkgProblemResolver /*{{{*/ { private: /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; pkgDepCache &Cache; typedef pkgCache::PkgIterator PkgIterator; diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h index 74a092593..83dd90d36 100644 --- a/apt-pkg/cachefile.h +++ b/apt-pkg/cachefile.h @@ -37,7 +37,7 @@ class OpProgress; class pkgCacheFile { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; protected: diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index c42f76112..a4e330a0a 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -813,16 +813,25 @@ APT_CONST void CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const & /*}}}*/ CacheSetHelper::CacheSetHelper(bool const ShowError, GlobalError::MsgType ErrorType) : - ShowError(ShowError), ErrorType(ErrorType) {} + ShowError(ShowError), ErrorType(ErrorType), d(NULL) {} CacheSetHelper::~CacheSetHelper() {} -PackageContainerInterface::PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN) {} -PackageContainerInterface::PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by) {} +PackageContainerInterface::PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN), d(NULL) {} +PackageContainerInterface::PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by), d(NULL) {} +PackageContainerInterface& PackageContainerInterface::operator=(PackageContainerInterface const &other) { + if (this != &other) + this->ConstructedBy = other.ConstructedBy; + return *this; +} PackageContainerInterface::~PackageContainerInterface() {} -PackageUniverse::PackageUniverse(pkgCache * const Owner) : _cont(Owner) { } +PackageUniverse::PackageUniverse(pkgCache * const Owner) : _cont(Owner), d(NULL) { } PackageUniverse::~PackageUniverse() {} -VersionContainerInterface::VersionContainerInterface() {} +VersionContainerInterface::VersionContainerInterface() : d(NULL) {} +VersionContainerInterface& VersionContainerInterface::operator=(VersionContainerInterface const &) { + return *this; +} + VersionContainerInterface::~VersionContainerInterface() {} } diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 7fd740335..4fe1eba87 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -203,7 +203,7 @@ protected: bool PackageFromPackageName(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern); bool PackageFromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern); private: - void *d; + void * const d; }; /*}}}*/ class PackageContainerInterface { /*{{{*/ @@ -266,6 +266,7 @@ APT_IGNORE_DEPRECATED_POP CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; } PackageContainerInterface(); explicit PackageContainerInterface(CacheSetHelper::PkgSelector const by); + PackageContainerInterface& operator=(PackageContainerInterface const &other); virtual ~PackageContainerInterface(); APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) { @@ -294,7 +295,7 @@ APT_IGNORE_DEPRECATED_POP private: CacheSetHelper::PkgSelector ConstructedBy; - void *d; + void * const d; }; /*}}}*/ template class PackageContainer : public PackageContainerInterface {/*{{{*/ @@ -555,7 +556,7 @@ template<> template inline bool PackageContainerError diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 05a137653..4481321c4 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -277,6 +277,18 @@ public: unsigned int CalcHashes; explicit PrivateHashes(unsigned int const CalcHashes) : FileSize(0), CalcHashes(CalcHashes) {} + explicit PrivateHashes(HashStringList const &Hashes) : FileSize(0) { + unsigned int calcHashes = Hashes.usable() ? 0 : ~0; + if (Hashes.find("MD5Sum") != NULL) + calcHashes |= Hashes::MD5SUM; + if (Hashes.find("SHA1") != NULL) + calcHashes |= Hashes::SHA1SUM; + if (Hashes.find("SHA256") != NULL) + calcHashes |= Hashes::SHA256SUM; + if (Hashes.find("SHA512") != NULL) + calcHashes |= Hashes::SHA512SUM; + CalcHashes = calcHashes; + } }; /*}}}*/ // Hashes::Add* - Add the contents of data or FD /*{{{*/ @@ -372,19 +384,8 @@ APT_IGNORE_DEPRECATED_POP return hashes; } APT_IGNORE_DEPRECATED_PUSH -Hashes::Hashes() { d = new PrivateHashes(~0); } -Hashes::Hashes(unsigned int const Hashes) { d = new PrivateHashes(Hashes); } -Hashes::Hashes(HashStringList const &Hashes) { - unsigned int calcHashes = Hashes.usable() ? 0 : ~0; - if (Hashes.find("MD5Sum") != NULL) - calcHashes |= MD5SUM; - if (Hashes.find("SHA1") != NULL) - calcHashes |= SHA1SUM; - if (Hashes.find("SHA256") != NULL) - calcHashes |= SHA256SUM; - if (Hashes.find("SHA512") != NULL) - calcHashes |= SHA512SUM; - d = new PrivateHashes(calcHashes); -} +Hashes::Hashes() : d(new PrivateHashes(~0)) { } +Hashes::Hashes(unsigned int const Hashes) : d(new PrivateHashes(Hashes)) {} +Hashes::Hashes(HashStringList const &Hashes) : d(new PrivateHashes(Hashes)) {} Hashes::~Hashes() { delete d; } APT_IGNORE_DEPRECATED_POP diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index e8d84da9e..0e6ff9ef1 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -182,7 +182,7 @@ class HashStringList class PrivateHashes; class Hashes { - PrivateHashes *d; + PrivateHashes * const d; public: /* those will disappear in the future as it is hard to add new ones this way. diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 0fffa52b0..29a9a941c 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -45,7 +45,7 @@ using std::string; // --------------------------------------------------------------------- /* */ debSourcesIndex::debSourcesIndex(IndexTarget const &Target,bool const Trusted) : - pkgIndexTargetFile(Target, Trusted) + pkgIndexTargetFile(Target, Trusted), d(NULL) { } /*}}}*/ @@ -84,7 +84,7 @@ pkgSrcRecords::Parser *debSourcesIndex::CreateSrcParser() const // --------------------------------------------------------------------- /* */ debPackagesIndex::debPackagesIndex(IndexTarget const &Target, bool const Trusted) : - pkgIndexTargetFile(Target, Trusted) + pkgIndexTargetFile(Target, Trusted), d(NULL) { } /*}}}*/ @@ -179,7 +179,7 @@ pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const // TranslationsIndex::debTranslationsIndex - Contructor /*{{{*/ debTranslationsIndex::debTranslationsIndex(IndexTarget const &Target) : - pkgIndexTargetFile(Target, true) + pkgIndexTargetFile(Target, true), d(NULL) {} /*}}}*/ bool debTranslationsIndex::HasPackages() const /*{{{*/ @@ -255,7 +255,7 @@ pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) con // StatusIndex::debStatusIndex - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -debStatusIndex::debStatusIndex(string File) : pkgIndexFile(true), File(File) +debStatusIndex::debStatusIndex(string File) : pkgIndexFile(true), d(NULL), File(File) { } /*}}}*/ @@ -341,7 +341,7 @@ APT_CONST bool debStatusIndex::Exists() const // debDebPkgFile - Single .deb file /*{{{*/ debDebPkgFileIndex::debDebPkgFileIndex(std::string DebFile) - : pkgIndexFile(true), DebFile(DebFile) + : pkgIndexFile(true), d(NULL), DebFile(DebFile) { DebFileFullPath = flAbsPath(DebFile); } @@ -445,7 +445,7 @@ unsigned long debDebPkgFileIndex::Size() const // debDscFileIndex stuff debDscFileIndex::debDscFileIndex(std::string &DscFile) - : pkgIndexFile(true), DscFile(DscFile) + : pkgIndexFile(true), d(NULL), DscFile(DscFile) { } diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 6285a9e5c..1de609a7b 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -29,7 +29,7 @@ class pkgCacheGenerator; class APT_HIDDEN debStatusIndex : public pkgIndexFile { - void *d; + void * const d; protected: std::string File; @@ -53,7 +53,7 @@ class APT_HIDDEN debStatusIndex : public pkgIndexFile class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile { - void *d; + void * const d; public: virtual const Type *GetType() const APT_CONST; @@ -72,7 +72,7 @@ class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile { - void *d; + void * const d; public: virtual const Type *GetType() const APT_CONST; @@ -88,7 +88,7 @@ class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile { - void *d; + void * const d; public: virtual const Type *GetType() const APT_CONST; @@ -110,7 +110,7 @@ class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile { private: - void *d; + void * const d; std::string DebFile; std::string DebFileFullPath; @@ -148,7 +148,7 @@ class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile class APT_HIDDEN debDscFileIndex : public pkgIndexFile { private: - void *d; + void * const d; std::string DscFile; public: virtual const Type *GetType() const APT_CONST; diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index c5e77b0ff..4e49e1c78 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -50,7 +50,7 @@ static debListParser::WordList PrioList[] = { /* Provide an architecture and only this one and "all" will be accepted in Step(), if no Architecture is given we will accept every arch we would accept in general with checkArchitecture() */ -debListParser::debListParser(FileFd *File, string const &Arch) : Tags(File), +debListParser::debListParser(FileFd *File, string const &Arch) : d(NULL), Tags(File), Arch(Arch) { if (Arch == "native") this->Arch = _config->Find("APT::Architecture"); diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 420d5ff08..3fd040bdd 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -39,7 +39,7 @@ class APT_HIDDEN debListParser : public pkgCacheGenerator::ListParser private: /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; protected: pkgTagFile Tags; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 430a5021b..026af077f 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -86,11 +86,11 @@ std::string debReleaseIndex::LocalFileName() const } debReleaseIndex::debReleaseIndex(string const &URI, string const &Dist) : - metaIndex(URI, Dist, "deb"), Trusted(CHECK_TRUST) + metaIndex(URI, Dist, "deb"), d(NULL), Trusted(CHECK_TRUST) {} debReleaseIndex::debReleaseIndex(string const &URI, string const &Dist, bool const Trusted) : - metaIndex(URI, Dist, "deb") { + metaIndex(URI, Dist, "deb"), d(NULL) { SetTrusted(Trusted); } @@ -541,7 +541,7 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type }; debDebFileMetaIndex::debDebFileMetaIndex(std::string const &DebFile) - : metaIndex(DebFile, "local-uri", "deb-dist"), DebFile(DebFile) + : metaIndex(DebFile, "local-uri", "deb-dist"), d(NULL), DebFile(DebFile) { DebIndex = new debDebPkgFileIndex(DebFile); Indexes = new vector(); diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index f2706e08a..648c22436 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -36,7 +36,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { private: /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; std::map > ArchEntries; enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; @@ -75,7 +75,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { class APT_HIDDEN debDebFileMetaIndex : public metaIndex { private: - void *d; + void * const d; std::string DebFile; debDebPkgFileIndex *DebIndex; public: diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index f527042e4..326102d08 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -34,7 +34,7 @@ using std::string; // RecordParser::debRecordParser - Constructor /*{{{*/ debRecordParser::debRecordParser(string FileName,pkgCache &Cache) : - debRecordParserBase(), File(FileName, FileFd::ReadOnly, FileFd::Extension), + debRecordParserBase(), d(NULL), File(FileName, FileFd::ReadOnly, FileFd::Extension), Tags(&File, std::max(Cache.Head().MaxVerFileSize, Cache.Head().MaxDescFileSize) + 200) { } @@ -51,7 +51,7 @@ bool debRecordParser::Jump(pkgCache::DescFileIterator const &Desc) /*}}}*/ debRecordParser::~debRecordParser() {} -debRecordParserBase::debRecordParserBase() : Parser() {} +debRecordParserBase::debRecordParserBase() : Parser(), d(NULL) {} // RecordParserBase::FileName - Return the archive filename on the site /*{{{*/ string debRecordParserBase::FileName() { @@ -212,5 +212,5 @@ bool debDebFileRecordParser::Jump(pkgCache::VerFileIterator const &) { return Lo bool debDebFileRecordParser::Jump(pkgCache::DescFileIterator const &) { return LoadContent(); } std::string debDebFileRecordParser::FileName() { return debFileName; } -debDebFileRecordParser::debDebFileRecordParser(std::string FileName) : debRecordParserBase(), debFileName(FileName) {} +debDebFileRecordParser::debDebFileRecordParser(std::string FileName) : debRecordParserBase(), d(NULL), debFileName(FileName) {} debDebFileRecordParser::~debDebFileRecordParser() {} diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h index 8efcec8cd..4d0b713d4 100644 --- a/apt-pkg/deb/debrecords.h +++ b/apt-pkg/deb/debrecords.h @@ -27,7 +27,7 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser { - void *d; + void * const d; protected: pkgTagSection Section; @@ -57,7 +57,7 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser class APT_HIDDEN debRecordParser : public debRecordParserBase { - void *d; + void * const d; protected: FileFd File; pkgTagFile Tags; @@ -73,7 +73,7 @@ class APT_HIDDEN debRecordParser : public debRecordParserBase // custom record parser that reads deb files directly class APT_HIDDEN debDebFileRecordParser : public debRecordParserBase { - void *d; + void * const d; std::string debFileName; std::string controlContent; diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index 21a4ff8ea..9404b6421 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -33,7 +33,7 @@ using std::max; using std::string; debSrcRecordParser::debSrcRecordParser(std::string const &File,pkgIndexFile const *Index) - : Parser(Index), Fd(File,FileFd::ReadOnly, FileFd::Extension), Tags(&Fd,102400), + : Parser(Index), d(NULL), Fd(File,FileFd::ReadOnly, FileFd::Extension), Tags(&Fd,102400), iOffset(0), Buffer(NULL) {} // SrcRecordParser::Binaries - Return the binaries field /*{{{*/ diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h index 7aeb2db88..64b07a1ec 100644 --- a/apt-pkg/deb/debsrcrecords.h +++ b/apt-pkg/deb/debsrcrecords.h @@ -24,7 +24,7 @@ class pkgIndexFile; class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; protected: FileFd Fd; diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index 9a5da9da1..465e13b9e 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -53,11 +53,8 @@ public: // System::debSystem - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -debSystem::debSystem() +debSystem::debSystem() : pkgSystem("Debian dpkg interface", &debVS), d(new debSystemPrivate()) { - d = new debSystemPrivate(); - Label = "Debian dpkg interface"; - VS = &debVS; } /*}}}*/ // System::~debSystem - Destructor /*{{{*/ diff --git a/apt-pkg/deb/debsystem.h b/apt-pkg/deb/debsystem.h index 226cd60bf..e59bbebed 100644 --- a/apt-pkg/deb/debsystem.h +++ b/apt-pkg/deb/debsystem.h @@ -28,7 +28,7 @@ class debStatusIndex; class debSystem : public pkgSystem { // private d-pointer - debSystemPrivate *d; + debSystemPrivate * const d; APT_HIDDEN bool CheckUpdates(); public: diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 6ee939edd..1991a4a66 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -216,10 +216,9 @@ pkgCache::VerIterator FindNowVersion(const pkgCache::PkgIterator &Pkg) // DPkgPM::pkgDPkgPM - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgDPkgPM::pkgDPkgPM(pkgDepCache *Cache) - : pkgPackageManager(Cache), pkgFailures(0), PackagesDone(0), PackagesTotal(0) +pkgDPkgPM::pkgDPkgPM(pkgDepCache *Cache) + : pkgPackageManager(Cache),d(new pkgDPkgPMPrivate()), pkgFailures(0), PackagesDone(0), PackagesTotal(0) { - d = new pkgDPkgPMPrivate(); } /*}}}*/ // DPkgPM::pkgDPkgPM - Destructor /*{{{*/ diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h index 2a6e7e004..a1b36c6c0 100644 --- a/apt-pkg/deb/dpkgpm.h +++ b/apt-pkg/deb/dpkgpm.h @@ -37,7 +37,7 @@ class pkgDPkgPMPrivate; class pkgDPkgPM : public pkgPackageManager { private: - pkgDPkgPMPrivate *d; + pkgDPkgPMPrivate * const d; /** \brief record the disappear action and handle accordingly diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 921cbced5..d01c14223 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -63,7 +63,7 @@ ConfigValueInSubTree(const char* SubTree, const char *needle) } /*}}}*/ pkgDepCache::ActionGroup::ActionGroup(pkgDepCache &cache) : /*{{{*/ - cache(cache), released(false) + d(NULL), cache(cache), released(false) { ++cache.group_level; } @@ -97,7 +97,7 @@ pkgDepCache::ActionGroup::~ActionGroup() pkgDepCache::pkgDepCache(pkgCache *pCache,Policy *Plcy) : group_level(0), Cache(pCache), PkgState(0), DepState(0), iUsrSize(0), iDownloadSize(0), iInstCount(0), iDelCount(0), iKeepCount(0), - iBrokenCount(0), iPolicyBrokenCount(0), iBadCount(0) + iBrokenCount(0), iPolicyBrokenCount(0), iBadCount(0), d(NULL) { DebugMarker = _config->FindB("Debug::pkgDepCache::Marker", false); DebugAutoInstall = _config->FindB("Debug::pkgDepCache::AutoInstall", false); diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 0594a253d..40a2fcaab 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -163,7 +163,7 @@ class pkgDepCache : protected pkgCache::Namespace */ class ActionGroup { - void *d; + void * const d; pkgDepCache &cache; bool released; @@ -503,7 +503,7 @@ class pkgDepCache : protected pkgCache::Namespace bool const rPurge, unsigned long const Depth, bool const FromUser); private: - void *d; + void * const d; APT_HIDDEN bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg, unsigned long const Depth, bool const FromUser); diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index 5d9383e94..3bffc27e9 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -29,7 +29,7 @@ // edspIndex::edspIndex - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -edspIndex::edspIndex(std::string File) : debStatusIndex(File) +edspIndex::edspIndex(std::string File) : debStatusIndex(File), d(NULL) { } /*}}}*/ diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h index 0f63b7b2a..265a016c5 100644 --- a/apt-pkg/edsp/edspindexfile.h +++ b/apt-pkg/edsp/edspindexfile.h @@ -21,7 +21,7 @@ class pkgCacheGenerator; class APT_HIDDEN edspIndex : public debStatusIndex { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; public: diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index d1c0cf7e8..63f006628 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -22,7 +22,7 @@ /*}}}*/ // ListParser::edspListParser - Constructor /*{{{*/ -edspListParser::edspListParser(FileFd *File, std::string const &Arch) : debListParser(File, Arch) +edspListParser::edspListParser(FileFd *File, std::string const &Arch) : debListParser(File, Arch), d(NULL) {} /*}}}*/ // ListParser::NewVersion - Fill in the version structure /*{{{*/ diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index ef5179e68..98dde4bf5 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -27,7 +27,7 @@ class FileFd; class APT_HIDDEN edspListParser : public debListParser { - void *d; + void * const d; public: virtual bool NewVersion(pkgCache::VerIterator &Ver); virtual std::string Description(); diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc index 063517421..4fb34b896 100644 --- a/apt-pkg/edsp/edspsystem.cc +++ b/apt-pkg/edsp/edspsystem.cc @@ -26,13 +26,9 @@ #include /*}}}*/ -// System::debSystem - Constructor /*{{{*/ -edspSystem::edspSystem() +// System::edspSystem - Constructor /*{{{*/ +edspSystem::edspSystem() : pkgSystem("Debian APT solver interface", &debVS), d(NULL), StatusFile(NULL) { - StatusFile = 0; - - Label = "Debian APT solver interface"; - VS = &debVS; } /*}}}*/ // System::~debSystem - Destructor /*{{{*/ diff --git a/apt-pkg/edsp/edspsystem.h b/apt-pkg/edsp/edspsystem.h index 1e27d2cb0..156b02bb5 100644 --- a/apt-pkg/edsp/edspsystem.h +++ b/apt-pkg/edsp/edspsystem.h @@ -25,7 +25,7 @@ class edspIndex; class APT_HIDDEN edspSystem : public pkgSystem { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; edspIndex *StatusFile; diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index b0f191ded..6d210e65b 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -769,14 +769,14 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ } /*}}}*/ -IndexCopy::IndexCopy() {} +IndexCopy::IndexCopy() : d(NULL) {} APT_CONST IndexCopy::~IndexCopy() {} -PackageCopy::PackageCopy() : IndexCopy() {} +PackageCopy::PackageCopy() : IndexCopy(), d(NULL) {} APT_CONST PackageCopy::~PackageCopy() {} -SourceCopy::SourceCopy() : IndexCopy() {} +SourceCopy::SourceCopy() : IndexCopy(), d(NULL) {} APT_CONST SourceCopy::~SourceCopy() {} -TranslationsCopy::TranslationsCopy() {} +TranslationsCopy::TranslationsCopy() : d(NULL) {} APT_CONST TranslationsCopy::~TranslationsCopy() {} -SigVerify::SigVerify() {} +SigVerify::SigVerify() : d(NULL) {} APT_CONST SigVerify::~SigVerify() {} diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index 7ee162542..4f4c47169 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -32,7 +32,7 @@ class FileFd; class IndexCopy /*{{{*/ { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; protected: @@ -59,7 +59,7 @@ class IndexCopy /*{{{*/ /*}}}*/ class PackageCopy : public IndexCopy /*{{{*/ { - void *d; + void * const d; protected: virtual bool GetFile(std::string &Filename,unsigned long long &Size); @@ -74,7 +74,7 @@ class PackageCopy : public IndexCopy /*{{{*/ /*}}}*/ class SourceCopy : public IndexCopy /*{{{*/ { - void *d; + void * const d; protected: virtual bool GetFile(std::string &Filename,unsigned long long &Size); @@ -89,7 +89,7 @@ class SourceCopy : public IndexCopy /*{{{*/ /*}}}*/ class TranslationsCopy /*{{{*/ { - void *d; + void * const d; protected: pkgTagSection *Section; @@ -104,7 +104,7 @@ class TranslationsCopy /*{{{*/ class SigVerify /*{{{*/ { /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; APT_HIDDEN bool Verify(std::string prefix,std::string file, indexRecords *records); APT_HIDDEN bool CopyMetaIndex(std::string CDROM, std::string CDName, diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index b3c5cf229..e9e1b08c3 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -53,7 +53,7 @@ pkgIndexFile::Type *pkgIndexFile::Type::GetType(const char *Type) } /*}}}*/ pkgIndexFile::pkgIndexFile(bool Trusted) : /*{{{*/ - Trusted(Trusted) + d(NULL), Trusted(Trusted) { } /*}}}*/ @@ -172,7 +172,7 @@ std::string IndexTarget::Format(std::string format) const /*{{{*/ /*}}}*/ pkgIndexTargetFile::pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted) :/*{{{*/ - pkgIndexFile(Trusted), Target(Target) + pkgIndexFile(Trusted), d(NULL), Target(Target) { } /*}}}*/ diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index b6472e201..7eeccdbd3 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -89,7 +89,7 @@ class IndexTarget /*{{{*/ class pkgIndexFile { - void *d; + void * const d; protected: bool Trusted; @@ -150,7 +150,7 @@ class pkgIndexFile class pkgIndexTargetFile : public pkgIndexFile { - void *d; + void * const d; protected: IndexTarget const Target; diff --git a/apt-pkg/indexrecords.h b/apt-pkg/indexrecords.h index 3ff072590..683247e42 100644 --- a/apt-pkg/indexrecords.h +++ b/apt-pkg/indexrecords.h @@ -27,7 +27,7 @@ class indexRecords private: enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; // dpointer (for later) - void * d; + void * const d; protected: std::string Dist; diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index ee2ef683f..ff3f652e5 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -65,7 +65,7 @@ bool PackageManager::StatusChanged(std::string /*PackageName*/, } PackageManagerProgressFd::PackageManagerProgressFd(int progress_fd) - : StepsDone(0), StepsTotal(1) + : d(NULL), StepsDone(0), StepsTotal(1) { OutStatusFd = progress_fd; } @@ -154,7 +154,7 @@ bool PackageManagerProgressFd::StatusChanged(std::string PackageName, PackageManagerProgressDeb822Fd::PackageManagerProgressDeb822Fd(int progress_fd) - : StepsDone(0), StepsTotal(1) + : d(NULL), StepsDone(0), StepsTotal(1) { OutStatusFd = progress_fd; } @@ -235,7 +235,7 @@ bool PackageManagerProgressDeb822Fd::StatusChanged(std::string PackageName, PackageManagerFancy::PackageManagerFancy() - : child_pty(-1) + : d(NULL), child_pty(-1) { // setup terminal size old_SIGWINCH = signal(SIGWINCH, PackageManagerFancy::staticSIGWINCH); @@ -435,7 +435,7 @@ bool PackageManagerText::StatusChanged(std::string PackageName, return true; } -PackageManagerText::PackageManagerText() : PackageManager() {} +PackageManagerText::PackageManagerText() : PackageManager(), d(NULL) {} PackageManagerText::~PackageManagerText() {} diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h index 5da3624c0..07fc15fd8 100644 --- a/apt-pkg/install-progress.h +++ b/apt-pkg/install-progress.h @@ -18,7 +18,7 @@ namespace Progress { { private: /** \brief dpointer placeholder */ - void *d; + void * const d; protected: std::string progress_str; @@ -61,7 +61,7 @@ namespace Progress { class PackageManagerProgressFd : public PackageManager { - void *d; + void * const d; protected: int OutStatusFd; int StepsDone; @@ -92,7 +92,7 @@ namespace Progress { class PackageManagerProgressDeb822Fd : public PackageManager { - void *d; + void * const d; protected: int OutStatusFd; int StepsDone; @@ -122,7 +122,7 @@ namespace Progress { class PackageManagerFancy : public PackageManager { - void *d; + void * const d; private: APT_HIDDEN static void staticSIGWINCH(int); static std::vector instances; @@ -158,7 +158,7 @@ namespace Progress { class PackageManagerText : public PackageManager { - void *d; + void * const d; public: virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 3c1b696bd..d96349974 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -41,7 +41,7 @@ bool metaIndex::Merge(pkgCacheGenerator &Gen,OpProgress *) const metaIndex::metaIndex(std::string const &URI, std::string const &Dist, char const * const Type) -: Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false) +: d(NULL), Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false) { /* nothing */ } diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 760c7dd15..1bcec1c4a 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -28,7 +28,7 @@ class OpProgress; class metaIndex { - void *d; + void * const d; protected: std::vector *Indexes; const char *Type; diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index a1fcbcc98..edbdd09ab 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -86,7 +86,7 @@ pkgOrderList *pkgOrderList::Me = 0; // OrderList::pkgOrderList - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgOrderList::pkgOrderList(pkgDepCache *pCache) : Cache(*pCache), +pkgOrderList::pkgOrderList(pkgDepCache *pCache) : d(NULL), Cache(*pCache), Primary(NULL), Secondary(NULL), RevDepends(NULL), Remove(NULL), AfterEnd(NULL), FileList(NULL), diff --git a/apt-pkg/orderlist.h b/apt-pkg/orderlist.h index 6d9f45eed..7b35b2955 100644 --- a/apt-pkg/orderlist.h +++ b/apt-pkg/orderlist.h @@ -24,7 +24,7 @@ class pkgDepCache; class pkgOrderList : protected pkgCache::Namespace { - void *d; + void * const d; protected: pkgDepCache &Cache; diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index d137dc75a..016f4474c 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -45,7 +45,7 @@ bool pkgPackageManager::SigINTStop = false; // --------------------------------------------------------------------- /* */ pkgPackageManager::pkgPackageManager(pkgDepCache *pCache) : Cache(*pCache), - List(NULL), Res(Incomplete) + List(NULL), Res(Incomplete), d(NULL) { FileNames = new string[Cache.Head().PackageCount]; Debug = _config->FindB("Debug::pkgPackageManager",false); diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index 2cdf92cdd..febab26dd 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -145,7 +145,7 @@ class pkgPackageManager : protected pkgCache::Namespace virtual ~pkgPackageManager(); private: - void *d; + void * const d; enum APT_HIDDEN SmartAction { UNPACK_IMMEDIATE, UNPACK, CONFIGURE }; APT_HIDDEN bool NonLoopingSmart(SmartAction const action, pkgCache::PkgIterator &Pkg, pkgCache::PkgIterator DepPkg, int const Depth, bool const PkgLoop, diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index dc7698edd..ae04bc699 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -122,7 +122,7 @@ bool pkgCache::Header::CheckSizes(Header &Against) const // --------------------------------------------------------------------- /* */ APT_IGNORE_DEPRECATED_PUSH -pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map) +pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map), d(NULL) { // call getArchitectures() with cached=false to ensure that the // architectures cache is re-evaulated. this is needed in cases diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index b7bf26c2a..0042eac96 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -271,7 +271,7 @@ class pkgCache /*{{{*/ virtual ~pkgCache(); private: - void *d; + void * const d; bool MultiArchEnabled; APT_HIDDEN PkgIterator SingleArchFindPkg(const std::string &Name); }; diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 54e2ef19c..0eba5795f 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -54,7 +54,7 @@ using std::string; /* We set the dirty flag and make sure that is written to the disk */ pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) : Map(*pMap), Cache(pMap,false), Progress(Prog), - CurrentRlsFile(NULL), CurrentFile(NULL), FoundFileDeps(0) + CurrentRlsFile(NULL), CurrentFile(NULL), FoundFileDeps(0), d(NULL) { if (_error->PendingError() == true) return; @@ -1721,5 +1721,5 @@ bool pkgCacheGenerator::FinishCache(OpProgress * /*Progress*/) } /*}}}*/ -pkgCacheGenerator::ListParser::ListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false) {} +pkgCacheGenerator::ListParser::ListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false), d(NULL) {} pkgCacheGenerator::ListParser::~ListParser() {} diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index c7b6de1b6..c56b5abae 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -125,7 +125,7 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ virtual ~pkgCacheGenerator(); private: - void *d; + void * const d; APT_HIDDEN bool MergeListGroup(ListParser &List, std::string const &GrpName); APT_HIDDEN bool MergeListPackage(ListParser &List, pkgCache::PkgIterator &Pkg); APT_HIDDEN bool MergeListVersion(ListParser &List, pkgCache::PkgIterator &Pkg, @@ -152,7 +152,7 @@ class APT_HIDDEN pkgCacheGenerator::ListParser // Flag file dependencies bool FoundFileDeps; - void *d; + void * const d; protected: diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc index 87c965f87..ef4c17cd2 100644 --- a/apt-pkg/pkgrecords.cc +++ b/apt-pkg/pkgrecords.cc @@ -77,5 +77,5 @@ pkgRecords::Parser &pkgRecords::Lookup(pkgCache::DescFileIterator const &Desc) } /*}}}*/ -pkgRecords::Parser::Parser() {} +pkgRecords::Parser::Parser() : d(NULL) {} pkgRecords::Parser::~Parser() {} diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h index 766e845aa..9e10409e4 100644 --- a/apt-pkg/pkgrecords.h +++ b/apt-pkg/pkgrecords.h @@ -31,7 +31,7 @@ class pkgRecords /*{{{*/ private: /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; pkgCache &Cache; std::vectorFiles; @@ -111,7 +111,7 @@ class pkgRecords::Parser /*{{{*/ virtual ~Parser(); private: - void *d; + void * const d; APT_HIDDEN std::string GetHashFromHashes(char const * const type) const { HashStringList const hashes = Hashes(); diff --git a/apt-pkg/pkgsystem.cc b/apt-pkg/pkgsystem.cc index 98daeb2b9..a6b61e655 100644 --- a/apt-pkg/pkgsystem.cc +++ b/apt-pkg/pkgsystem.cc @@ -27,7 +27,8 @@ unsigned long pkgSystem::GlobalListLen = 0; // System::pkgSystem - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Add it to the global list.. */ -pkgSystem::pkgSystem() : Label(NULL), VS(NULL) +pkgSystem::pkgSystem(char const * const label, pkgVersioningSystem * const vs) : + Label(label), VS(vs), d(NULL) { assert(GlobalListLen < sizeof(SysList)/sizeof(*SysList)); SysList[GlobalListLen] = this; diff --git a/apt-pkg/pkgsystem.h b/apt-pkg/pkgsystem.h index 3a447da8b..5be93d059 100644 --- a/apt-pkg/pkgsystem.h +++ b/apt-pkg/pkgsystem.h @@ -60,8 +60,8 @@ class pkgSystem static unsigned long GlobalListLen; static pkgSystem *GetSystem(const char *Label); - const char *Label; - pkgVersioningSystem *VS; + const char * const Label; + pkgVersioningSystem * const VS; /* Prevent other programs from touching shared data not covered by other locks (cache or state locks) */ @@ -90,11 +90,11 @@ class pkgSystem virtual signed Score(Configuration const &/*Cnf*/) { return 0; }; - - pkgSystem(); + + pkgSystem(char const * const Label, pkgVersioningSystem * const VS); virtual ~pkgSystem(); private: - void *d; + void * const d; }; // The environment we are operating in. diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 7947103d5..cd48e040c 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -45,7 +45,7 @@ using namespace std; // --------------------------------------------------------------------- /* Set the defaults for operation. The default mode with no loaded policy file matches the V0 policy engine. */ -pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner) +pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner), d(NULL) { if (Owner == 0) return; diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index 0d2b468bc..58b062a7b 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -88,8 +88,8 @@ class pkgPolicy : public pkgDepCache::Policy explicit pkgPolicy(pkgCache *Owner); virtual ~pkgPolicy(); private: - pkgCache::VerIterator GetCandidateVerNew(pkgCache::PkgIterator const &Pkg); - void *d; + APT_HIDDEN pkgCache::VerIterator GetCandidateVerNew(pkgCache::PkgIterator const &Pkg); + void * const d; }; bool ReadPinFile(pkgPolicy &Plcy, std::string File = ""); diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 8b960572b..99b646513 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -236,11 +236,11 @@ bool pkgSourceList::Type::ParseLine(vector &List, // SourceList::pkgSourceList - Constructors /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgSourceList::pkgSourceList() +pkgSourceList::pkgSourceList() : d(NULL) { } -pkgSourceList::pkgSourceList(string File) +pkgSourceList::pkgSourceList(string File) : d(NULL) { Read(File); } diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index d9eacc08f..e17ad6a9a 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -53,7 +53,7 @@ class metaIndex; class pkgSourceList { - void *d; + void * const d; public: // List of supported source list types diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index bbab9d796..e3ffa9ab0 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -180,5 +180,5 @@ bool pkgSrcRecords::Parser::Files2(std::vector &F2)/*{{{*/ /*}}}*/ -pkgSrcRecords::Parser::Parser(const pkgIndexFile *Index) : iIndex(Index) {} +pkgSrcRecords::Parser::Parser(const pkgIndexFile *Index) : d(NULL), iIndex(Index) {} pkgSrcRecords::Parser::~Parser() {} diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h index 71173c953..f0a3c463a 100644 --- a/apt-pkg/srcrecords.h +++ b/apt-pkg/srcrecords.h @@ -48,7 +48,7 @@ APT_IGNORE_DEPRECATED_POP // Abstract parser for each source record class Parser { - void *d; + void * const d; protected: const pkgIndexFile *iIndex; @@ -93,7 +93,7 @@ APT_IGNORE_DEPRECATED_POP private: /** \brief dpointer placeholder (for later in case we need it) */ - void *d; + void * const d; // The list of files and the current parser pointer std::vector Files; diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 130aef19d..4c5505bf3 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -32,13 +32,22 @@ using std::string; class pkgTagFilePrivate { public: - pkgTagFilePrivate(FileFd *pFd, unsigned long long Size) : Fd(*pFd), Buffer(NULL), - Start(NULL), End(NULL), - Done(false), iOffset(0), - Size(Size) + void Reset(FileFd * const pFd, unsigned long long const pSize) { + Fd = pFd; + Buffer = NULL; + Start = NULL; + End = NULL; + Done = false; + iOffset = 0; + Size = pSize; } - FileFd &Fd; + + pkgTagFilePrivate(FileFd * const pFd, unsigned long long const Size) + { + Reset(pFd, Size); + } + FileFd * Fd; char *Buffer; char *Start; char *End; @@ -83,27 +92,21 @@ static unsigned long AlphaHash(const char *Text, size_t Length) /*{{{*/ // TagFile::pkgTagFile - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long long Size) - : d(NULL) +pkgTagFile::pkgTagFile(FileFd * const pFd,unsigned long long const Size) + : d(new pkgTagFilePrivate(pFd, Size + 4)) { Init(pFd, Size); } - -void pkgTagFile::Init(FileFd *pFd,unsigned long long Size) +void pkgTagFile::Init(FileFd * const pFd,unsigned long long Size) { /* The size is increased by 4 because if we start with the Size of the filename we need to try to read 1 char more to see an EOF faster, 1 char the end-pointer can be on and maybe 2 newlines need to be added to the end of the file -> 4 extra chars */ Size += 4; - if(d != NULL) - { - free(d->Buffer); - delete d; - } - d = new pkgTagFilePrivate(pFd, Size); + d->Reset(pFd, Size); - if (d->Fd.IsOpen() == false) + if (d->Fd->IsOpen() == false) d->Start = d->End = d->Buffer = 0; else d->Buffer = (char*)malloc(sizeof(char) * Size); @@ -184,7 +187,7 @@ bool pkgTagFile::Step(pkgTagSection &Tag) if (Resize() == false) return _error->Error(_("Unable to parse package file %s (%d)"), - d->Fd.Name().c_str(), 1); + d->Fd->Name().c_str(), 1); } while (Tag.Scan(d->Start,d->End - d->Start, false) == false); } @@ -213,7 +216,7 @@ bool pkgTagFile::Fill() { // See if only a bit of the file is left unsigned long long const dataSize = d->Size - ((d->End - d->Buffer) + 1); - if (d->Fd.Read(d->End, dataSize, &Actual) == false) + if (d->Fd->Read(d->End, dataSize, &Actual) == false) return false; if (Actual != dataSize) d->Done = true; @@ -268,7 +271,7 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset) // Reposition and reload.. d->iOffset = Offset; d->Done = false; - if (d->Fd.Seek(Offset) == false) + if (d->Fd->Seek(Offset) == false) return false; d->End = d->Start = d->Buffer; @@ -283,7 +286,7 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset) return false; if (Tag.Scan(d->Start, d->End - d->Start, false) == false) - return _error->Error(_("Unable to parse package file %s (%d)"),d->Fd.Name().c_str(), 2); + return _error->Error(_("Unable to parse package file %s (%d)"),d->Fd->Name().c_str(), 2); return true; } @@ -293,9 +296,8 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset) /* */ APT_IGNORE_DEPRECATED_PUSH pkgTagSection::pkgTagSection() - : Section(0), d(NULL), Stop(0) + : Section(0), d(new pkgTagSectionPrivate()), Stop(0) { - d = new pkgTagSectionPrivate(); #if APT_PKG_ABI < 413 TagCount = 0; memset(&Indexes, 0, sizeof(Indexes)); diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 24eda02f7..23238d979 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -46,7 +46,7 @@ class pkgTagSection APT_DEPRECATED unsigned int TagCount; #endif - pkgTagSectionPrivate *d; + pkgTagSectionPrivate * const d; protected: const char *Stop; @@ -145,7 +145,7 @@ class pkgTagSection class pkgTagFilePrivate; class pkgTagFile { - pkgTagFilePrivate *d; + pkgTagFilePrivate * const d; APT_HIDDEN bool Fill(); APT_HIDDEN bool Resize(); @@ -157,9 +157,9 @@ class pkgTagFile unsigned long Offset(); bool Jump(pkgTagSection &Tag,unsigned long long Offset); - void Init(FileFd *F,unsigned long long Size = 32*1024); + void Init(FileFd * const F,unsigned long long const Size = 32*1024); - pkgTagFile(FileFd *F,unsigned long long Size = 32*1024); + pkgTagFile(FileFd * const F,unsigned long long Size = 32*1024); virtual ~pkgTagFile(); }; -- cgit v1.2.3 From c687384b7a53887ea455fd824824429615d94f7b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Jun 2015 13:30:14 +0200 Subject: cleanup Container.erase API to look more like std::containers C++11 slightly changes the API again to const_iterator, but we are find with iterators in the C++03 style for now as long as they look and behave equally to the methods of the standard containers. Git-Dch: Ignore --- apt-pkg/cacheiterators.h | 1 - apt-pkg/cacheset.h | 30 ++++++++++++++++-------------- cmdline/apt-mark.cc | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index f3b107699..d7614374e 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -77,7 +77,6 @@ template class pkgCache::Iterator : inline pkgCache *Cache() const {return Owner;} // Mixed stuff - inline void operator =(const Itr &B) {S = B.S; Owner = B.Owner;} inline bool IsGood() const { return S && Owner && ! end();} inline unsigned long Index() const {return S - OwnerPointer();} diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 4fe1eba87..29f7540ca 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -346,13 +346,10 @@ public: /*{{{*/ bool empty() const { return _cont.empty(); } void clear() { return _cont.clear(); } - //FIXME: on ABI break, replace the first with the second without bool - void erase(iterator position) { _cont.erase((typename Container::iterator)position); } - iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); } - size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); } - void erase(iterator first, iterator last) { _cont.erase(first, last); } size_t size() const { return _cont.size(); } - + iterator erase( iterator pos ) { return iterator(_cont.erase(pos)); } + iterator erase( iterator first, iterator last ) { return iterator(_cont.erase(first, last)); } + size_t erase(pkgCache::PkgIterator const & P) { size_t oldsize = size(); _cont.erase(std::remove(_cont.begin(), _cont.end(), P), _cont.end()); return oldsize - size(); } const_iterator begin() const { return const_iterator(_cont.begin()); } const_iterator end() const { return const_iterator(_cont.end()); } iterator begin() { return iterator(_cont.begin()); } @@ -578,9 +575,9 @@ private: void insert(const_iterator, const_iterator) { } void clear() { } - iterator& erase(iterator &iter) { return iter; } - size_t erase(const pkgCache::PkgIterator) { return 0; } - void erase(iterator, iterator) { } + iterator erase( iterator pos ); + iterator erase( iterator first, iterator last ); + size_t erase(pkgCache::PkgIterator const & P); }; /*}}}*/ typedef PackageContainer > PackageSet; @@ -780,12 +777,10 @@ public: /*{{{*/ void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); } bool empty() const { return _cont.empty(); } void clear() { return _cont.clear(); } - //FIXME: on ABI break, replace the first with the second without bool - void erase(iterator position) { _cont.erase((typename Container::iterator)position); } - iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); } - size_t erase(const pkgCache::VerIterator x) { return _cont.erase(x); } - void erase(iterator first, iterator last) { _cont.erase(first, last); } size_t size() const { return _cont.size(); } + iterator erase( iterator pos ) { return iterator(_cont.erase(pos)); } + iterator erase( iterator first, iterator last ) { return iterator(_cont.erase(first, last)); } + size_t erase(pkgCache::VerIterator const & V) { size_t oldsize = size(); _cont.erase(std::remove(_cont.begin(), _cont.end(), V), _cont.end()); return oldsize - size(); } const_iterator begin() const { return const_iterator(_cont.begin()); } const_iterator end() const { return const_iterator(_cont.end()); } @@ -989,6 +984,13 @@ template<> inline void VersionContainer >::in } /*}}}*/ +template<> inline size_t PackageContainer >::erase(pkgCache::PkgIterator const &P) { + return _cont.erase(P); +} +template<> inline size_t VersionContainer >::erase(pkgCache::VerIterator const &V) { + return _cont.erase(V); +} + template<> template inline bool VersionContainer >::sort(Compare Comp) { std::sort(_cont.begin(), _cont.end(), Comp); return true; diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index de1c80309..02c73fc2e 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -238,7 +238,7 @@ static bool DoHold(CommandLine &CmdL) ioprintf(c1out,_("%s was already set on hold.\n"), Pkg.FullName(true).c_str()); else ioprintf(c1out,_("%s was already not hold.\n"), Pkg.FullName(true).c_str()); - Pkg = pkgset.erase(Pkg, true); + Pkg = pkgset.erase(Pkg); } else ++Pkg; -- cgit v1.2.3 From ddb286525d196b53683533648425c5c8f5288839 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Jun 2015 19:22:13 +0200 Subject: simplify Origin matchmaking for status files The old check is overly complicated nowadays as we have a pretty defining difference between packages from a Packages files coming from with a Release file (even if the file itself doesn't exist) and packages coming from the dpkg.status or directly out of *.deb's as these have no associated Release file. Git-Dch: Ignore --- apt-pkg/versionmatch.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index c215f522c..2376ca8fd 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -281,12 +281,9 @@ bool pkgVersionMatch::FileMatch(pkgCache::PkgFileIterator File) if (OrSite.empty() == false) { if (File.Site() == NULL) return false; - } else // so we are talking about file:// or status file - { - pkgCache::RlsFileIterator const RlsFile = File.ReleaseFile(); - if (strcmp(File.Site(),"") == 0 && RlsFile->Archive != 0 && strcmp(RlsFile.Archive(),"now") == 0) // skip the status file - return false; } + else if (File->Release == 0)// only 'bad' files like dpkg.status file has no release file + return false; return (ExpressionMatches(OrSite, File.Site())); /* both strings match */ } -- cgit v1.2.3 From 1b36b5fa1b8dbd76aec7ddd4ffe72f8515c29038 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Jun 2015 19:34:45 +0200 Subject: apt manpage is built from xml nowadays like the rest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It used be a handwritten manpage, but that is gone and this artifact is the cause for the message: ../../buildlib/manpage.mak:23: target '../../build/docs/apt.de.8' given more than once in the same rule [ … repeated for all translations … ] So lets get right of it. Git-Dch: Ignore --- buildlib/po4a_manpage.mak | 1 - 1 file changed, 1 deletion(-) diff --git a/buildlib/po4a_manpage.mak b/buildlib/po4a_manpage.mak index 0f53a8600..2e98652a5 100644 --- a/buildlib/po4a_manpage.mak +++ b/buildlib/po4a_manpage.mak @@ -57,7 +57,6 @@ HAVE_PO4A=yes endif # take care of the rest -SOURCE := $(SOURCE) $(wildcard apt.$(LC).8) INCLUDES := ifndef HAVE_PO4A -- cgit v1.2.3 From c3392a9fccc04129816057b1184c651171034376 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 17 Jun 2015 22:15:01 +0200 Subject: some CXXFLAGS housekeeping More warnings are always better. Git-Dch: Ignore --- apt-pkg/aptconfiguration.h | 2 +- apt-pkg/contrib/sptr.h | 8 ++++++++ apt-pkg/edsp.h | 2 +- buildlib/environment.mak.in | 6 +++++- test/libapt/makefile | 3 ++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h index 353843c3e..fbd9b02e6 100644 --- a/apt-pkg/aptconfiguration.h +++ b/apt-pkg/aptconfiguration.h @@ -122,7 +122,7 @@ namespace Configuration { /*{{{*/ /** \return Return a comma-separated list of enabled build profile specifications */ std::string const getBuildProfilesString(); /*}}}*/ -}; +} /*}}}*/ } #endif diff --git a/apt-pkg/contrib/sptr.h b/apt-pkg/contrib/sptr.h index 9df0e44a7..e2e811b1d 100644 --- a/apt-pkg/contrib/sptr.h +++ b/apt-pkg/contrib/sptr.h @@ -60,7 +60,15 @@ class SPtrArray inline SPtrArray(T *Ptr) : Ptr(Ptr) {}; inline SPtrArray() : Ptr(0) {}; +#if __GNUC__ >= 4 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations" + // gcc warns about this, but we can do nothing here… +#endif inline ~SPtrArray() {delete [] Ptr;}; +#if __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif }; #endif diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index 72b886a31..4f5f500a1 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -211,6 +211,6 @@ namespace EDSP /*{{{*/ bool ResolveExternal(const char* const solver, pkgDepCache &Cache, bool const upgrade, bool const distUpgrade, bool const autoRemove, OpProgress *Progress = NULL); -}; +} /*}}}*/ #endif diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in index b0a8d9d35..0dff02e69 100644 --- a/buildlib/environment.mak.in +++ b/buildlib/environment.mak.in @@ -11,7 +11,11 @@ CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT -D_FORTIFY_SOURCE=2 CXX = @CXX@ CXXFLAGS+= @CXXFLAGS@ -Wall -Wextra CXXFLAGS+= -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations -CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn +CXXFLAGS+= -Wctor-dtor-privacy -Wdisabled-optimization -Winit-self -Wmissing-include-dirs -Wnoexcept -Wsign-promo -Wundef +# suggests methods which already have such an attribute +#CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn +# gcc reports currently lots of them at the end of file - unknown reason +CXXFLAGS+= -Wno-deprecated-declarations # a bit too pedantic to be run by default #CXXFLAGS+= -Wpedantic -Wno-long-long -Wno-vla -Wno-variadic-macros NUM_PROCS = @NUM_PROCS@ diff --git a/test/libapt/makefile b/test/libapt/makefile index 61a8aaf31..c078cc568 100644 --- a/test/libapt/makefile +++ b/test/libapt/makefile @@ -33,7 +33,7 @@ GTEST_DIR = /usr/src/gtest # Flags passed to the preprocessor. # Set Google Test's header directory as a system directory, such that # the compiler doesn't generate warnings in Google Test headers. -CPPFLAGS += -isystem $(GTEST_DIR)/include +#CPPFLAGS += -isystem $(GTEST_DIR)/include # Flags passed to the C++ compiler. CXXFLAGS += -pthread @@ -41,6 +41,7 @@ CXXFLAGS += -pthread CXXFLAGS+= -Wno-missing-declarations CXXFLAGS+= -Wno-missing-field-initializers CXXFLAGS+= -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Wno-suggest-attribute=noreturn +CXXFLAGS+= -Wno-undef # All Google Test headers. Usually you shouldn't change this definition. GTEST_HEADERS = /usr/include/gtest/*.h \ -- cgit v1.2.3 From 3d8232bf97ce11818fb07813a71136484ea1a44a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 18 Jun 2015 17:33:15 +0200 Subject: fix memory leaks reported by -fsanitize Various small leaks here and there. Nothing particularily big, but still good to fix. Found by the sanitizers while running our testcases. Reported-By: gcc -fsanitize Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 57 +++++++++++++++++++--------------- apt-pkg/acquire-item.h | 45 +++++++++++++-------------- apt-pkg/acquire-worker.cc | 2 +- apt-pkg/cachefile.cc | 4 +-- apt-pkg/contrib/cdromutl.cc | 2 ++ apt-pkg/contrib/gpgv.cc | 2 ++ apt-pkg/deb/debmetaindex.cc | 2 +- apt-pkg/deb/debrecords.cc | 4 +++ apt-pkg/deb/dpkgpm.cc | 4 +++ apt-pkg/indexrecords.cc | 5 ++- apt-pkg/tagfile.cc | 13 ++++++-- apt-pkg/tagfile.h | 2 +- apt-private/private-cacheset.h | 13 +++++--- apt-private/private-output.cc | 23 ++++++++------ buildlib/environment.mak.in | 2 ++ cmdline/apt-cache.cc | 1 + cmdline/apt-get.cc | 8 ++--- ftparchive/apt-ftparchive.cc | 69 +++++++++++++++++++++--------------------- ftparchive/cachedb.cc | 1 + ftparchive/writer.cc | 31 ++++++++++++------- ftparchive/writer.h | 14 +++------ test/integration/framework | 3 ++ test/libapt/cdrom_test.cc | 7 ++--- test/libapt/file-helpers.cc | 7 ++--- test/libapt/file-helpers.h | 2 +- test/libapt/sourcelist_test.cc | 5 +-- 26 files changed, 190 insertions(+), 138 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 222ca8931..0ab52a0cd 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -109,7 +109,7 @@ static std::string GetDiffsPatchFileName(std::string const &Final) /*{{{*/ } /*}}}*/ -static bool AllowInsecureRepositories(indexRecords const * const MetaIndexParser, pkgAcqMetaBase * const TransactionManager, pkgAcquire::Item * const I) /*{{{*/ +static bool AllowInsecureRepositories(indexRecords const * const MetaIndexParser, pkgAcqMetaClearSig * const TransactionManager, pkgAcquire::Item * const I) /*{{{*/ { if(MetaIndexParser->IsAlwaysTrusted() || _config->FindB("Acquire::AllowInsecureRepositories") == true) return true; @@ -661,7 +661,7 @@ std::string pkgAcquire::Item::HashSum() const /*{{{*/ /*}}}*/ pkgAcqTransactionItem::pkgAcqTransactionItem(pkgAcquire * const Owner, /*{{{*/ - pkgAcqMetaBase * const transactionManager, IndexTarget const &target) : + pkgAcqMetaClearSig * const transactionManager, IndexTarget const &target) : pkgAcquire::Item(Owner), d(NULL), Target(target), TransactionManager(transactionManager) { if (TransactionManager != this) @@ -680,12 +680,11 @@ HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const &Me // AcqMetaBase - Constructor /*{{{*/ pkgAcqMetaBase::pkgAcqMetaBase(pkgAcquire * const Owner, - pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaClearSig * const TransactionManager, std::vector const &IndexTargets, - IndexTarget const &DataTarget, - indexRecords * const MetaIndexParser) + IndexTarget const &DataTarget) : pkgAcqTransactionItem(Owner, TransactionManager, DataTarget), d(NULL), - MetaIndexParser(MetaIndexParser), LastMetaIndexParser(NULL), IndexTargets(IndexTargets), + IndexTargets(IndexTargets), AuthPass(false), IMSHit(false) { } @@ -1047,7 +1046,7 @@ bool pkgAcqMetaBase::VerifyVendor(string const &Message) /*{{{*/ std::string errmsg; strprintf(errmsg, // TRANSLATOR: The first %s is the URL of the bad Release file, the second is - // the time since then the file is invalid - formated in the same way as in + // the time since then the file is invalid - formatted in the same way as in // the download progress display (e.g. 7d 3h 42min 1s) _("Release file for %s is expired (invalid since %s). " "Updates for this repository will not be applied."), @@ -1098,16 +1097,19 @@ bool pkgAcqMetaBase::VerifyVendor(string const &Message) /*{{{*/ return true; } /*}}}*/ -pkgAcqMetaBase::~pkgAcqMetaBase() {} +pkgAcqMetaBase::~pkgAcqMetaBase() +{ +} pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/ IndexTarget const &ClearsignedTarget, IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget, std::vector const &IndexTargets, indexRecords * const MetaIndexParser) : - pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets, MetaIndexParser), + pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets), d(NULL), ClearsignedTarget(ClearsignedTarget), - DetachedDataTarget(DetachedDataTarget) + DetachedDataTarget(DetachedDataTarget), + MetaIndexParser(MetaIndexParser), LastMetaIndexParser(NULL) { // index targets + (worst case:) Release/Release.gpg ExpectedAdditionalItems = IndexTargets.size() + 2; @@ -1116,6 +1118,10 @@ pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/ /*}}}*/ pkgAcqMetaClearSig::~pkgAcqMetaClearSig() /*{{{*/ { + if (MetaIndexParser != NULL) + delete MetaIndexParser; + if (LastMetaIndexParser != NULL) + delete LastMetaIndexParser; } /*}}}*/ // pkgAcqMetaClearSig::Custom600Headers - Insert custom request headers /*{{{*/ @@ -1180,7 +1186,7 @@ void pkgAcqMetaClearSig::Failed(string const &Message,pkgAcquire::MethodConfig c TransactionManager->TransactionStageRemoval(this, GetFinalFilename()); Status = StatDone; - new pkgAcqMetaIndex(Owner, TransactionManager, DetachedDataTarget, DetachedSigTarget, IndexTargets, TransactionManager->MetaIndexParser); + new pkgAcqMetaIndex(Owner, TransactionManager, DetachedDataTarget, DetachedSigTarget, IndexTargets); } else { @@ -1240,12 +1246,11 @@ void pkgAcqMetaClearSig::Failed(string const &Message,pkgAcquire::MethodConfig c /*}}}*/ pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire * const Owner, /*{{{*/ - pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget, - vector const &IndexTargets, - indexRecords * const MetaIndexParser) : - pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser), d(NULL), + vector const &IndexTargets) : + pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget), d(NULL), DetachedSigTarget(DetachedSigTarget) { if(_config->FindB("Debug::Acquire::Transaction", false) == true) @@ -1324,7 +1329,7 @@ pkgAcqMetaIndex::~pkgAcqMetaIndex() {} // AcqMetaSig::AcqMetaSig - Constructor /*{{{*/ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner, - pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex) : pkgAcqTransactionItem(Owner, TransactionManager, Target), d(NULL), MetaIndex(MetaIndex) @@ -1487,7 +1492,7 @@ void pkgAcqMetaSig::Failed(string const &Message,pkgAcquire::MethodConfig const // AcqBaseIndex - Constructor /*{{{*/ pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner, - pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target) : pkgAcqTransactionItem(Owner, TransactionManager, Target), d(NULL) { @@ -1503,9 +1508,9 @@ pkgAcqBaseIndex::~pkgAcqBaseIndex() {} * the original packages file */ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner, - pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target) - : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL) + : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL), diffs(NULL) { Debug = _config->FindB("Debug::pkgAcquire::Diffs",false); @@ -1840,7 +1845,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile) /*{{{*/ new pkgAcqIndexDiffs(Owner, TransactionManager, Target, available_patches); else { - std::vector *diffs = new std::vector(available_patches.size()); + diffs = new std::vector(available_patches.size()); for(size_t i = 0; i < available_patches.size(); ++i) (*diffs)[i] = new pkgAcqIndexMergeDiffs(Owner, TransactionManager, Target, @@ -1896,7 +1901,11 @@ void pkgAcqDiffIndex::Done(string const &Message,HashStringList const &Hashes, / return; } /*}}}*/ -pkgAcqDiffIndex::~pkgAcqDiffIndex() {} +pkgAcqDiffIndex::~pkgAcqDiffIndex() +{ + if (diffs != NULL) + delete diffs; +} // AcqIndexDiffs::AcqIndexDiffs - Constructor /*{{{*/ // --------------------------------------------------------------------- @@ -1904,7 +1913,7 @@ pkgAcqDiffIndex::~pkgAcqDiffIndex() {} * for each diff and the index */ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire * const Owner, - pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target, vector const &diffs) : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL), @@ -2127,7 +2136,7 @@ pkgAcqIndexDiffs::~pkgAcqIndexDiffs() {} // AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor /*{{{*/ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, - pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target, DiffInfo const &patch, std::vector const * const allPatches) @@ -2272,7 +2281,7 @@ pkgAcqIndexMergeDiffs::~pkgAcqIndexMergeDiffs() {} // AcqIndex::AcqIndex - Constructor /*{{{*/ pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner, - pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target) : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL), Stage(STAGE_DOWNLOAD) { diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index c4bbfc7a1..4d235dce2 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -46,7 +46,8 @@ class indexRecords; class pkgRecords; class pkgSourceList; -class pkgAcqMetaBase; +class pkgAcqMetaClearSig; +class pkgAcqIndexMergeDiffs; class pkgAcquire::Item : public WeakPointable /*{{{*/ /** \brief Represents the process by which a pkgAcquire object should @@ -339,6 +340,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ void * const d; friend class pkgAcqMetaBase; + friend class pkgAcqMetaClearSig; }; /*}}}*/ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ @@ -356,7 +358,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ std::string PartialFile; /** \brief TransactionManager */ - pkgAcqMetaBase * const TransactionManager; + pkgAcqMetaClearSig * const TransactionManager; enum TransactionStates { TransactionCommit, @@ -370,10 +372,11 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ virtual bool HashesRequired() const; - pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target); + pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); virtual ~pkgAcqTransactionItem(); friend class pkgAcqMetaBase; + friend class pkgAcqMetaClearSig; }; /*}}}*/ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ @@ -383,12 +386,6 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ protected: std::vector Transaction; - public: - /** \brief A package-system-specific parser for the meta-index file. */ - indexRecords *MetaIndexParser; - indexRecords *LastMetaIndexParser; - protected: - /** \brief The index files which should be looked up in the meta-index * and then downloaded. */ @@ -473,10 +470,9 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ /** \brief Get the full pathname of the final file for the current URI */ virtual std::string GetFinalFilename() const; - pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, std::vector const &IndexTargets, - IndexTarget const &DataTarget, - indexRecords* const MetaIndexParser); + IndexTarget const &DataTarget); virtual ~pkgAcqMetaBase(); }; /*}}}*/ @@ -509,9 +505,9 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase virtual void Finished(); /** \brief Create a new pkgAcqMetaIndex. */ - pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget, - std::vector const &IndexTargets, indexRecords * const MetaIndexParser); + std::vector const &IndexTargets); virtual ~pkgAcqMetaIndex(); friend class pkgAcqMetaSig; @@ -548,8 +544,8 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem pkgAcquire::MethodConfig const * const Cnf); /** \brief Create a new pkgAcqMetaSig. */ - pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target, - pkgAcqMetaIndex * const MetaIndex); + pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, + IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex); virtual ~pkgAcqMetaSig(); }; /*}}}*/ @@ -561,7 +557,11 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex IndexTarget const ClearsignedTarget; IndexTarget const DetachedDataTarget; -public: + public: + /** \brief A package-system-specific parser for the meta-index file. */ + indexRecords *MetaIndexParser; + indexRecords *LastMetaIndexParser; + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); virtual std::string Custom600Headers() const; virtual void Done(std::string const &Message, HashStringList const &Hashes, @@ -586,7 +586,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem /** \brief Get the full pathname of the final file for the current URI */ virtual std::string GetFinalFilename() const; - pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); virtual ~pkgAcqBaseIndex(); }; @@ -603,6 +603,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex { void * const d; + std::vector * diffs; protected: /** \brief If \b true, debugging information will be written to std::clog. */ @@ -650,7 +651,7 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex * * \param ShortDesc A short description of the list file to download. */ - pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); virtual ~pkgAcqDiffIndex(); private: @@ -749,7 +750,7 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex * \param allPatches contains all related items so that each item can * check if it was the last one to complete the download step */ - pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target, DiffInfo const &patch, std::vector const * const allPatches); virtual ~pkgAcqIndexMergeDiffs(); @@ -863,7 +864,7 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex * should be ordered so that each diff appears before any diff * that depends on it. */ - pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target, std::vector const &diffs=std::vector()); virtual ~pkgAcqIndexDiffs(); @@ -941,7 +942,7 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex virtual std::string DescURI() const {return Desc.URI;}; virtual std::string GetMetaKey() const; - pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, + pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); virtual ~pkgAcqIndex(); diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 8d619e96d..c0f93f9ce 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -722,7 +722,7 @@ void pkgAcquire::Worker::PrepareFiles(char const * const caller, pkgAcquire::Que unlink(Owner->DestFile.c_str()); if (link(filename.c_str(), Owner->DestFile.c_str()) != 0) { - // diferent mounts can't happen for us as we download to lists/ by default, + // different mounts can't happen for us as we download to lists/ by default, // but if the system is reused by others the locations can potentially be on // different disks, so use symlink as poor-men replacement. // FIXME: Real copying as last fallback, but that is costly, so offload to a method preferable diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index ea3d45480..690776266 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -65,8 +65,8 @@ bool pkgCacheFile::BuildCaches(OpProgress *Progress, bool WithLock) if (_config->FindB("pkgCacheFile::Generate", true) == false) { - Map = new MMap(*new FileFd(_config->FindFile("Dir::Cache::pkgcache"), - FileFd::ReadOnly),MMap::Public|MMap::ReadOnly); + FileFd file(_config->FindFile("Dir::Cache::pkgcache"), FileFd::ReadOnly); + Map = new MMap(file, MMap::Public|MMap::ReadOnly); Cache = new pkgCache(Map); if (_error->PendingError() == true) return false; diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 6eb917457..428ef0161 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -287,9 +287,11 @@ string FindMountPointForDevice(const char *devnode) fclose(f); // unescape the \0XXX chars in the path string mount_point = out[1]; + free(line); return DeEscapeString(mount_point); } fclose(f); + free(line); } return string(); diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index 9d798cca9..a01e319eb 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -296,6 +296,8 @@ bool SplitClearSignedFile(std::string const &InFile, FileFd * const ContentFile, // all the rest is whitespace, unsigned garbage or additional message blocks we ignore } fclose(in); + if (buf != NULL) + free(buf); if (found_signature == true) return _error->Error("Signature in file %s wasn't closed", InFile.c_str()); diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 026af077f..5a517b290 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -270,7 +270,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const // special case for --print-uris std::vector const targets = GetIndexTargets(); #define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X), false, std::map()) - pkgAcqMetaBase * const TransactionManager = new pkgAcqMetaClearSig(Owner, + pkgAcqMetaClearSig * const TransactionManager = new pkgAcqMetaClearSig(Owner, APT_TARGET("InRelease"), APT_TARGET("Release"), APT_TARGET("Release.gpg"), targets, iR); #undef APT_TARGET diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index 326102d08..d78a7e2e0 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -42,10 +42,14 @@ debRecordParser::debRecordParser(string FileName,pkgCache &Cache) : // RecordParser::Jump - Jump to a specific record /*{{{*/ bool debRecordParser::Jump(pkgCache::VerFileIterator const &Ver) { + if (Ver.end() == true) + return false; return Tags.Jump(Section,Ver->Offset); } bool debRecordParser::Jump(pkgCache::DescFileIterator const &Desc) { + if (Desc.end() == true) + return false; return Tags.Jump(Section,Desc->Offset); } /*}}}*/ diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 1991a4a66..3594a6efe 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1484,6 +1484,10 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) a != Args.end(); ++a) clog << *a << ' '; clog << endl; + for (std::vector::const_iterator p = Packages.begin(); + p != Packages.end(); ++p) + free(*p); + Packages.clear(); continue; } Args.push_back(NULL); diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index 5a93d826f..03ba59460 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -278,4 +278,7 @@ indexRecords::indexRecords(const string &ExpectedDist) : { } -indexRecords::~indexRecords() {} +indexRecords::~indexRecords() { + for (std::map::const_iterator S = Entries.begin(); S != Entries.end(); ++S) + delete S->second; +} diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 4c5505bf3..6d7d8185b 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -34,8 +34,10 @@ class pkgTagFilePrivate public: void Reset(FileFd * const pFd, unsigned long long const pSize) { - Fd = pFd; + if (Buffer != NULL) + free(Buffer); Buffer = NULL; + Fd = pFd; Start = NULL; End = NULL; Done = false; @@ -43,7 +45,7 @@ public: Size = pSize; } - pkgTagFilePrivate(FileFd * const pFd, unsigned long long const Size) + pkgTagFilePrivate(FileFd * const pFd, unsigned long long const Size) : Buffer(NULL) { Reset(pFd, Size); } @@ -54,6 +56,12 @@ public: bool Done; unsigned long long iOffset; unsigned long long Size; + + ~pkgTagFilePrivate() + { + if (Buffer != NULL) + free(Buffer); + } }; class pkgTagSectionPrivate @@ -127,7 +135,6 @@ void pkgTagFile::Init(FileFd * const pFd,unsigned long long Size) /* */ pkgTagFile::~pkgTagFile() { - free(d->Buffer); delete d; } /*}}}*/ diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 23238d979..d0d0c7a84 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -136,7 +136,7 @@ class pkgTagSection * * @param File to write the section to * @param Order in which tags should appear in the file - * @param Rewrite is a set of tags to be renamed, rewitten and/or removed + * @param Rewrite is a set of tags to be renamed, rewritten and/or removed * @return \b true if successful, otherwise \b false */ bool Write(FileFd &File, char const * const * const Order = NULL, std::vector const &Rewrite = std::vector()) const; diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h index 059c7637e..0eb22b788 100644 --- a/apt-private/private-cacheset.h +++ b/apt-private/private-cacheset.h @@ -32,10 +32,15 @@ struct VersionSortDescriptionLocality bool operator () (const pkgCache::VerIterator &v_lhs, const pkgCache::VerIterator &v_rhs) { - pkgCache::DescFile *A = v_lhs.TranslatedDescription().FileList(); - pkgCache::DescFile *B = v_rhs.TranslatedDescription().FileList(); - if (A == 0 && B == 0) - return false; + pkgCache::DescFile const *A = NULL; + pkgCache::DescFile const *B = NULL; + if (v_lhs->DescriptionList != 0) + A = v_lhs.TranslatedDescription().FileList(); + if (v_rhs->DescriptionList != 0) + B = v_rhs.TranslatedDescription().FileList(); + + if (A == 0 && B == 0) + return false; if (A == 0) return true; diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc index 4e18030ab..9944ab002 100644 --- a/apt-private/private-output.cc +++ b/apt-private/private-output.cc @@ -199,10 +199,12 @@ static std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &reco std::string ShortDescription = "(none)"; if(ver) { - pkgCache::DescIterator Desc = ver.TranslatedDescription(); - pkgRecords::Parser & parser = records.Lookup(Desc.FileList()); - - ShortDescription = parser.ShortDesc(); + pkgCache::DescIterator const Desc = ver.TranslatedDescription(); + if (Desc.end() == false) + { + pkgRecords::Parser & parser = records.Lookup(Desc.FileList()); + ShortDescription = parser.ShortDesc(); + } } return ShortDescription; } @@ -222,11 +224,14 @@ static std::string GetLongDescription(pkgCacheFile &CacheFile, pkgRecords &recor return EmptyDescription; pkgCache::DescIterator const Desc = ver.TranslatedDescription(); - pkgRecords::Parser & parser = records.Lookup(Desc.FileList()); - std::string const longdesc = parser.LongDesc(); - if (longdesc.empty() == true) - return EmptyDescription; - return SubstVar(longdesc, "\n ", "\n "); + if (Desc.end() == false) + { + pkgRecords::Parser & parser = records.Lookup(Desc.FileList()); + std::string const longdesc = parser.LongDesc(); + if (longdesc.empty() == false) + return SubstVar(longdesc, "\n ", "\n "); + } + return EmptyDescription; } /*}}}*/ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/ diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in index 0dff02e69..8ea7a05ba 100644 --- a/buildlib/environment.mak.in +++ b/buildlib/environment.mak.in @@ -16,6 +16,8 @@ CXXFLAGS+= -Wctor-dtor-privacy -Wdisabled-optimization -Winit-self -Wmissing-inc #CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn # gcc reports currently lots of them at the end of file - unknown reason CXXFLAGS+= -Wno-deprecated-declarations +# sanitize options to be enabled for testing +#CXXFLAGS+= -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr # a bit too pedantic to be run by default #CXXFLAGS+= -Wpedantic -Wno-long-long -Wno-vla -Wno-variadic-macros NUM_PROCS = @NUM_PROCS@ diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 303605f70..9c884433c 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1484,6 +1484,7 @@ static bool Search(CommandLine &CmdL) delete [] PatternMatch; for (unsigned I = 0; I != NumPatterns; I++) regfree(&Patterns[I]); + delete [] Patterns; if (ferror(stdout)) return _error->Error("Write to stdout failed"); return true; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 184b51d23..632c7cfea 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1015,9 +1015,6 @@ static bool DoBuildDep(CommandLine &CmdL) pkgSourceList *List = Cache.GetSourceList(); // Create the text record parsers -#if APT_PKG_ABI < 413 - pkgRecords Recs(Cache); -#endif pkgSrcRecords SrcRecs(*List); if (_error->PendingError() == true) return false; @@ -1039,6 +1036,7 @@ static bool DoBuildDep(CommandLine &CmdL) { string Src; pkgSrcRecords::Parser *Last = 0; + SPtr LastOwner; // an unpacked debian source tree using APT::String::Startswith; @@ -1050,7 +1048,7 @@ static bool DoBuildDep(CommandLine &CmdL) std::string TypeName = "debian/control File Source Index"; pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str()); if(Type != NULL) - Last = Type->CreateSrcPkgParser(*I); + LastOwner = Last = Type->CreateSrcPkgParser(*I); } // if its a local file (e.g. .dsc) use this else if (FileExists(*I)) @@ -1061,7 +1059,7 @@ static bool DoBuildDep(CommandLine &CmdL) string TypeName = flExtension(*I) + " File Source Index"; pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str()); if(Type != NULL) - Last = Type->CreateSrcPkgParser(*I); + LastOwner = Last = Type->CreateSrcPkgParser(*I); } else { // normal case, search the cache for the source file #if APT_PKG_ABI >= 413 diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index 62108f7ca..cf667483c 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -180,7 +180,7 @@ bool PackageMap::GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats) // Create a package writer object. MultiCompress Comp(flCombine(ArchiveDir,PkgFile), PkgCompress,Permissions); - PackagesWriter Packages(&Comp.Input, flCombine(CacheDir,BinCacheDB), + PackagesWriter Packages(&Comp.Input, TransWriter, flCombine(CacheDir,BinCacheDB), flCombine(OverrideDir,BinOverride), flCombine(OverrideDir,ExtraOverride), Arch); @@ -193,7 +193,6 @@ bool PackageMap::GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats) Packages.DirStrip = ArchiveDir; Packages.InternalPrefix = flCombine(ArchiveDir,InternalPrefix); - Packages.TransWriter = TransWriter; Packages.LongDescription = LongDesc; Packages.Stats.DeLinkBytes = Stats.DeLinkBytes; @@ -457,7 +456,7 @@ bool PackageMap::GenContents(Configuration &Setup, // --------------------------------------------------------------------- /* This populates the PkgList with all the possible permutations of the section/arch lists. */ -static void LoadTree(vector &PkgList,Configuration &Setup) +static void LoadTree(vector &PkgList, std::vector &TransList, Configuration &Setup) { // Load the defaults string DDir = Setup.Find("TreeDefault::Directory", @@ -508,16 +507,7 @@ static void LoadTree(vector &PkgList,Configuration &Setup) {NULL, NULL}}; mode_t const Perms = Block.FindI("FileMode", Permissions); bool const LongDesc = Block.FindB("LongDescription", LongDescription); - TranslationWriter *TransWriter; - if (DTrans.empty() == false && LongDesc == false) - { - string const TranslationFile = flCombine(Setup.FindDir("Dir::ArchiveDir"), - SubstVar(Block.Find("Translation", DTrans.c_str()), Vars)); - string const TransCompress = Block.Find("Translation::Compress", TranslationCompress); - TransWriter = new TranslationWriter(TranslationFile, TransCompress, Perms); - } - else - TransWriter = NULL; + TranslationWriter *TransWriter = NULL; string const Tmp2 = Block.Find("Architectures"); const char *Archs = Tmp2.c_str(); @@ -546,27 +536,34 @@ static void LoadTree(vector &PkgList,Configuration &Setup) Itm.Tag = SubstVar("$(DIST)/$(SECTION)/$(ARCH)",Vars); Itm.Arch = Arch; Itm.LongDesc = LongDesc; - if (TransWriter != NULL) + if (TransWriter == NULL && DTrans.empty() == false && LongDesc == false && DTrans != "/dev/null") { - TransWriter->IncreaseRefCounter(); - Itm.TransWriter = TransWriter; + string const TranslationFile = flCombine(Setup.FindDir("Dir::ArchiveDir"), + SubstVar(Block.Find("Translation", DTrans.c_str()), Vars)); + string const TransCompress = Block.Find("Translation::Compress", TranslationCompress); + TransWriter = new TranslationWriter(TranslationFile, TransCompress, Perms); + TransList.push_back(TransWriter); } + Itm.TransWriter = TransWriter; Itm.Contents = SubstVar(Block.Find("Contents",DContents.c_str()),Vars); Itm.ContentsHead = SubstVar(Block.Find("Contents::Header",DContentsH.c_str()),Vars); Itm.FLFile = SubstVar(Block.Find("FileList",DFLFile.c_str()),Vars); Itm.ExtraOverride = SubstVar(Block.Find("ExtraOverride"),Vars); } - Itm.GetGeneral(Setup,Block); + Itm.GetGeneral(Setup,Block); PkgList.push_back(Itm); } - // we didn't use this TransWriter, so we can release it - if (TransWriter != NULL && TransWriter->GetRefCounter() == 0) - delete TransWriter; } - + Top = Top->Next; - } + } +} + /*}}}*/ +static void UnloadTree(std::vector const &Trans) /*{{{*/ +{ + for (std::vector::const_reverse_iterator T = Trans.rbegin(); T != Trans.rend(); ++T) + delete *T; } /*}}}*/ // LoadBinDir - Load a 'bindirectory' section from the Generate Config /*{{{*/ @@ -671,7 +668,7 @@ static bool SimpleGenPackages(CommandLine &CmdL) Override = CmdL.FileList[2]; // Create a package writer object. - PackagesWriter Packages(NULL, _config->Find("APT::FTPArchive::DB"), + PackagesWriter Packages(NULL, NULL, _config->Find("APT::FTPArchive::DB"), Override, "", _config->Find("APT::FTPArchive::Architecture")); if (_error->PendingError() == true) return false; @@ -844,12 +841,6 @@ static bool DoGeneratePackagesAndSources(Configuration &Setup, delete [] List; } - - // close the Translation master files - for (vector::reverse_iterator I = PkgList.rbegin(); I != PkgList.rend(); ++I) - if (I->TransWriter != NULL && I->TransWriter->DecreaseRefCounter() == 0) - delete I->TransWriter; - return true; } @@ -940,7 +931,8 @@ static bool Generate(CommandLine &CmdL) return false; vector PkgList; - LoadTree(PkgList,Setup); + std::vector TransList; + LoadTree(PkgList, TransList, Setup); LoadBinDir(PkgList,Setup); // Sort by cache DB to improve IO locality. @@ -951,7 +943,10 @@ static bool Generate(CommandLine &CmdL) if (_config->FindB("APT::FTPArchive::ContentsOnly", false) == false) { if(DoGeneratePackagesAndSources(Setup, PkgList, SrcStats, Stats, CmdL) == false) + { + UnloadTree(TransList); return false; + } } else { c1out << "Skipping Packages/Sources generation" << endl; } @@ -959,7 +954,10 @@ static bool Generate(CommandLine &CmdL) // do Contents if needed if (_config->FindB("APT::FTPArchive::Contents", true) == true) if (DoGenerateContents(Setup, PkgList, CmdL) == false) - return false; + { + UnloadTree(TransList); + return false; + } struct timeval NewTime; gettimeofday(&NewTime,0); @@ -968,6 +966,7 @@ static bool Generate(CommandLine &CmdL) c1out << "Done. " << SizeToStr(Stats.Bytes) << "B in " << Stats.Packages << " archives. Took " << TimeToStr((long)Delta) << endl; + UnloadTree(TransList); return true; } @@ -984,9 +983,12 @@ static bool Clean(CommandLine &CmdL) Configuration Setup; if (ReadConfigFile(Setup,CmdL.FileList[1],true) == false) return false; + // we don't need translation creation here + Setup.Set("TreeDefault::Translation", "/dev/null"); vector PkgList; - LoadTree(PkgList,Setup); + std::vector TransList; + LoadTree(PkgList, TransList, Setup); LoadBinDir(PkgList,Setup); // Sort by cache DB to improve IO locality. @@ -1007,14 +1009,13 @@ static bool Clean(CommandLine &CmdL) _error->DumpErrors(); if (DB_SRC.Clean() == false) _error->DumpErrors(); - + string CacheDB = I->BinCacheDB; string SrcCacheDB = I->SrcCacheDB; while(I != PkgList.end() && I->BinCacheDB == CacheDB && I->SrcCacheDB == SrcCacheDB) ++I; - } diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index cc3527ea4..ce6c865f3 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -45,6 +45,7 @@ CacheDB::~CacheDB() { ReadyDB(); delete DebFile; + CloseFile(); } // CacheDB::ReadyDB - Ready the DB2 /*{{{*/ diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 7cf7e6efc..1bc926d21 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -69,22 +69,29 @@ static void ConfigToDoHashes(unsigned int &DoHashes, std::string const &Conf) /*}}}*/ // FTWScanner::FTWScanner - Constructor /*{{{*/ -// --------------------------------------------------------------------- -/* */ FTWScanner::FTWScanner(FileFd * const GivenOutput, string const &Arch): Arch(Arch), DoHashes(~0) { if (GivenOutput == NULL) { Output = new FileFd; + OwnsOutput = true; Output->OpenDescriptor(STDOUT_FILENO, FileFd::WriteOnly, false); } else + { Output = GivenOutput; + OwnsOutput = false; + } ErrorPrinted = false; NoLinkAct = !_config->FindB("APT::FTPArchive::DeLinkAct",true); ConfigToDoHashes(DoHashes, "APT::FTPArchive"); } /*}}}*/ +FTWScanner::~FTWScanner() +{ + if (Output != NULL && OwnsOutput) + delete Output; +} // FTWScanner::Scanner - FTW Scanner /*{{{*/ // --------------------------------------------------------------------- /* This is the FTW scanner, it processes each directory element in the @@ -324,9 +331,10 @@ bool FTWScanner::Delink(string &FileName,const char *OriginalPath, // PackagesWriter::PackagesWriter - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -PackagesWriter::PackagesWriter(FileFd * const GivenOutput, string const &DB,string const &Overrides,string const &ExtOverrides, - string const &Arch) : - FTWScanner(GivenOutput, Arch), Db(DB), Stats(Db.Stats), TransWriter(NULL) +PackagesWriter::PackagesWriter(FileFd * const GivenOutput, TranslationWriter * const transWriter, + string const &DB,string const &Overrides,string const &ExtOverrides, + string const &Arch) : + FTWScanner(GivenOutput, Arch), Db(DB), Stats(Db.Stats), TransWriter(transWriter) { SetExts(".deb .udeb"); DeLinkLimit = 0; @@ -377,7 +385,6 @@ bool FTWScanner::SetExts(string const &Vals) return true; } - /*}}}*/ // PackagesWriter::DoPackage - Process a single package /*{{{*/ // --------------------------------------------------------------------- @@ -524,12 +531,16 @@ bool PackagesWriter::DoPackage(string FileName) return Db.Finish(); } /*}}}*/ +PackagesWriter::~PackagesWriter() /*{{{*/ +{ +} + /*}}}*/ // TranslationWriter::TranslationWriter - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Create a Translation-Master file for this Packages file */ TranslationWriter::TranslationWriter(string const &File, string const &TransCompress, - mode_t const &Permissions) : RefCounter(0) + mode_t const &Permissions) : Comp(NULL), Output(NULL) { if (File.empty() == true) return; @@ -568,10 +579,8 @@ bool TranslationWriter::DoPackage(string const &Pkg, string const &Desc, /* */ TranslationWriter::~TranslationWriter() { - if (Comp == NULL) - return; - - delete Comp; + if (Comp != NULL) + delete Comp; } /*}}}*/ diff --git a/ftparchive/writer.h b/ftparchive/writer.h index 0ba60db5e..b9c1f672a 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -64,6 +64,7 @@ class FTWScanner public: FileFd *Output; + bool OwnsOutput; unsigned int DoHashes; unsigned long DeLinkLimit; @@ -79,7 +80,7 @@ class FTWScanner bool SetExts(string const &Vals); FTWScanner(FileFd * const Output, string const &Arch = string()); - virtual ~FTWScanner() {}; + virtual ~FTWScanner(); }; class MultiCompress; @@ -88,17 +89,12 @@ class TranslationWriter { MultiCompress *Comp; std::set Included; - unsigned short RefCounter; FileFd *Output; public: - void IncreaseRefCounter() { ++RefCounter; }; - unsigned short DecreaseRefCounter() { return (RefCounter == 0) ? 0 : --RefCounter; }; - unsigned short GetRefCounter() const { return RefCounter; }; bool DoPackage(string const &Pkg, string const &Desc, string const &MD5); TranslationWriter(string const &File, string const &TransCompress, mode_t const &Permissions); - TranslationWriter() : Comp(NULL), RefCounter(0) {}; ~TranslationWriter(); }; @@ -119,18 +115,18 @@ class PackagesWriter : public FTWScanner string PathPrefix; string DirStrip; struct CacheDB::Stats &Stats; - TranslationWriter *TransWriter; + TranslationWriter * const TransWriter; inline bool ReadOverride(string const &File) {return Over.ReadOverride(File);}; inline bool ReadExtraOverride(string const &File) {return Over.ReadExtraOverride(File);}; virtual bool DoPackage(string FileName); - PackagesWriter(FileFd * const Output, string const &DB, + PackagesWriter(FileFd * const Output, TranslationWriter * const TransWriter, string const &DB, string const &Overrides, string const &ExtOverrides = "", string const &Arch = ""); - virtual ~PackagesWriter() {}; + virtual ~PackagesWriter(); }; class ContentsWriter : public FTWScanner diff --git a/test/integration/framework b/test/integration/framework index 5d949009f..059cba9fb 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -143,6 +143,7 @@ gdb() { aptcache) CMD="apt-cache";; aptmark) CMD="apt-mark";; apthelper) CMD="apt-helper";; + aptftparchive) CMD="apt-ftparchive";; *) CMD="$1";; esac shift @@ -1415,6 +1416,8 @@ testfailure() { if expr match "$1" '^apt.*' >/dev/null; then if grep -q -E ' runtime error: ' "$OUTPUT"; then msgfailoutput 'compiler detected undefined behavior' "$OUTPUT" "$@" + elif grep -q -E '==ERROR' "$OUTPUT"; then + msgfailoutput 'compiler sanitizers reported errors' "$OUTPUT" "$@" elif ! grep -q -E '^E: ' "$OUTPUT"; then msgfailoutput "run failed with exitcode ${EXITCODE}, but with no errors" "$OUTPUT" "$@" else diff --git a/test/libapt/cdrom_test.cc b/test/libapt/cdrom_test.cc index 7257eaf1b..b4c51cdb0 100644 --- a/test/libapt/cdrom_test.cc +++ b/test/libapt/cdrom_test.cc @@ -91,7 +91,7 @@ TEST(CDROMTest,ReduceSourcelist) } TEST(CDROMTest, FindMountPointForDevice) { - char * tempfile = NULL; + std::string tempfile; FileFd fd; createTemporaryFile("mountpoints", fd, &tempfile, "rootfs / rootfs rw 0 0\n" @@ -109,7 +109,6 @@ TEST(CDROMTest, FindMountPointForDevice) EXPECT_EQ("/boot/efi", FindMountPointForDevice("/dev/sda1")); EXPECT_EQ("/tmp", FindMountPointForDevice("tmpfs")); - if (tempfile != NULL) - unlink(tempfile); - free(tempfile); + if (tempfile.empty() == false) + unlink(tempfile.c_str()); } diff --git a/test/libapt/file-helpers.cc b/test/libapt/file-helpers.cc index 5edb9a9fe..387192868 100644 --- a/test/libapt/file-helpers.cc +++ b/test/libapt/file-helpers.cc @@ -53,20 +53,19 @@ void helperCreateLink(std::string const &dir, std::string const &targetname, std link.append(linkname); ASSERT_EQ(0, symlink(target.c_str(), link.c_str())); } -void helperCreateTemporaryFile(std::string const &id, FileFd &fd, char * * const filename, char const * const content) +void helperCreateTemporaryFile(std::string const &id, FileFd &fd, std::string * const filename, char const * const content) { std::string name("apt-test-"); name.append(id).append(".XXXXXXXX"); char * tempfile = strdup(name.c_str()); + ASSERT_STRNE(NULL, tempfile); int tempfile_fd = mkstemp(tempfile); ASSERT_NE(-1, tempfile_fd); if (filename != NULL) *filename = tempfile; else - { unlink(tempfile); - free(tempfile); - } + free(tempfile); EXPECT_TRUE(fd.OpenDescriptor(tempfile_fd, FileFd::ReadWrite)); if (content != NULL) diff --git a/test/libapt/file-helpers.h b/test/libapt/file-helpers.h index e8472d503..f639c1cbc 100644 --- a/test/libapt/file-helpers.h +++ b/test/libapt/file-helpers.h @@ -24,6 +24,6 @@ void helperCreateDirectory(std::string const &dir, std::string const &name); void helperCreateLink(std::string const &dir, std::string const &targetname, std::string const &linkname); #define createTemporaryFile(id, fd, filename, content) \ ASSERT_NO_FATAL_FAILURE(helperCreateTemporaryFile(id, fd, filename, content)) -void helperCreateTemporaryFile(std::string const &id, FileFd &fd, char * * const filename, char const * const content); +void helperCreateTemporaryFile(std::string const &id, FileFd &fd, std::string * const filename, char const * const content); #endif diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index 747ab4957..9e6f82213 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -20,7 +20,7 @@ class SourceList : public pkgSourceList { TEST(SourceListTest,ParseFileDeb822) { FileFd fd; - char * tempfile = NULL; + std::string tempfile; createTemporaryFile("parsefiledeb822", fd, &tempfile, "Types: deb\n" "URIs: http://ftp.debian.org/debian\n" @@ -39,5 +39,6 @@ TEST(SourceListTest,ParseFileDeb822) EXPECT_EQ(2, sources.ParseFileDeb822(tempfile)); EXPECT_EQ(2, sources.size()); - unlink(tempfile); + if (tempfile.empty() == false) + unlink(tempfile.c_str()); } -- cgit v1.2.3 From 463c8d801595ce5ac94d7c032264820be7434232 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 21 Jun 2015 16:47:53 +0200 Subject: support lang= and target= sources.list options We support arch= for a while, now we finally add lang= as well and as a first simple way of controlling which targets to acquire also target=. This asked for a redesign of the internal API of parsing and storing information about 'deb' and 'deb-src' lines. As this API isn't visible to the outside no damage done through. Beside being a nice cleanup (= it actually does more in less lines) it also provides us with a predictable order of architectures as provides in the configuration rather than based on string sorting-order, so that now the native architecture is parsed/displayed first. Observeable e.g. in apt-get output. --- apt-pkg/deb/debindexfile.cc | 6 +- apt-pkg/deb/debmetaindex.cc | 430 +++++++++------------ apt-pkg/deb/debmetaindex.h | 38 +- apt-pkg/sourcelist.cc | 40 +- apt-pkg/sourcelist.h | 8 +- cmdline/apt-get.cc | 4 +- doc/sources.list.5.xml | 16 + .../test-bug-632221-cross-dependency-satisfaction | 22 +- .../test-ignore-provides-if-versioned-breaks | 10 +- .../test-ignore-provides-if-versioned-conflicts | 10 +- .../test-sourceslist-lang-plusminus-options | 87 +++++ 11 files changed, 354 insertions(+), 317 deletions(-) create mode 100755 test/integration/test-sourceslist-lang-plusminus-options diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 29a9a941c..c5086b04b 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -510,7 +510,7 @@ class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type { return new debDebFileRecordParser(File.FileName()); }; - debIFTypeDebPkgFile() {Label = "deb Package file";}; + debIFTypeDebPkgFile() {Label = "Debian deb file";}; }; class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type { @@ -519,7 +519,7 @@ class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type { return new debDscRecordParser(DscFile, NULL); }; - debIFTypeDscFile() {Label = "dsc File Source Index";}; + debIFTypeDscFile() {Label = "Debian dsc file";}; }; class APT_HIDDEN debIFTypeDebianSourceDir : public pkgIndexFile::Type { @@ -528,7 +528,7 @@ class APT_HIDDEN debIFTypeDebianSourceDir : public pkgIndexFile::Type { return new debDscRecordParser(SourceDir + string("/debian/control"), NULL); }; - debIFTypeDebianSourceDir() {Label = "debian/control File Source Index";}; + debIFTypeDebianSourceDir() {Label = "Debian control file";}; }; APT_HIDDEN debIFTypeSrc _apt_Src; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 5a517b290..f690a8d64 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -29,11 +29,25 @@ #include #include -using namespace std; - -string debReleaseIndex::MetaIndexInfo(const char *Type) const +class APT_HIDDEN debReleaseIndexPrivate /*{{{*/ +{ + public: + struct APT_HIDDEN debSectionEntry + { + std::string Name; + std::vector Targets; + std::vector Architectures; + std::vector Languages; + }; + + std::vector DebEntries; + std::vector DebSrcEntries; +}; + /*}}}*/ +// ReleaseIndex::MetaIndex* - display helpers /*{{{*/ +std::string debReleaseIndex::MetaIndexInfo(const char *Type) const { - string Info = ::URI::ArchiveOnly(URI) + ' '; + std::string Info = ::URI::ArchiveOnly(URI) + ' '; if (Dist[Dist.size() - 1] == '/') { if (Dist != "/") @@ -50,15 +64,15 @@ std::string debReleaseIndex::Describe() const return MetaIndexInfo("Release"); } -string debReleaseIndex::MetaIndexFile(const char *Type) const +std::string debReleaseIndex::MetaIndexFile(const char *Type) const { return _config->FindDir("Dir::State::lists") + URItoFileName(MetaIndexURI(Type)); } -string debReleaseIndex::MetaIndexURI(const char *Type) const +std::string debReleaseIndex::MetaIndexURI(const char *Type) const { - string Res; + std::string Res; if (Dist == "/") Res = URI; @@ -70,8 +84,8 @@ string debReleaseIndex::MetaIndexURI(const char *Type) const Res += Type; return Res; } - -std::string debReleaseIndex::LocalFileName() const + /*}}}*/ +std::string debReleaseIndex::LocalFileName() const /*{{{*/ { // see if we have a InRelease file std::string PathInRelease = MetaIndexFile("InRelease"); @@ -84,28 +98,24 @@ std::string debReleaseIndex::LocalFileName() const return ""; } - -debReleaseIndex::debReleaseIndex(string const &URI, string const &Dist) : - metaIndex(URI, Dist, "deb"), d(NULL), Trusted(CHECK_TRUST) + /*}}}*/ +// ReleaseIndex Con- and Destructors /*{{{*/ +debReleaseIndex::debReleaseIndex(std::string const &URI, std::string const &Dist) : + metaIndex(URI, Dist, "deb"), d(new debReleaseIndexPrivate()), Trusted(CHECK_TRUST) {} - -debReleaseIndex::debReleaseIndex(string const &URI, string const &Dist, bool const Trusted) : - metaIndex(URI, Dist, "deb"), d(NULL) { +debReleaseIndex::debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted) : + metaIndex(URI, Dist, "deb"), d(new debReleaseIndexPrivate()) { SetTrusted(Trusted); } - debReleaseIndex::~debReleaseIndex() { - for (map >::const_iterator A = ArchEntries.begin(); - A != ArchEntries.end(); ++A) - for (vector::const_iterator S = A->second.begin(); - S != A->second.end(); ++S) - delete *S; + if (d != NULL) + delete d; } - -template -void foreachTarget(std::string const &URI, std::string const &Dist, - std::map > const &ArchEntries, - CallC &Call) + /*}}}*/ +// ReleaseIndex::GetIndexTargets /*{{{*/ +static void GetIndexTargetsFor(char const * const Type, std::string const &URI, std::string const &Dist, + std::vector const &entries, + std::vector &IndexTargets) { bool const flatArchive = (Dist[Dist.length() - 1] == '/'); std::string baseURI = URI; @@ -118,148 +128,101 @@ void foreachTarget(std::string const &URI, std::string const &Dist, baseURI += "dists/" + Dist + "/"; std::string const Release = (Dist == "/") ? "" : Dist; std::string const Site = ::URI::ArchiveOnly(URI); - std::vector lang = APT::Configuration::getLanguages(true); - if (lang.empty()) - lang.push_back("none"); - map >::const_iterator const src = ArchEntries.find("source"); - if (src != ArchEntries.end()) + + for (std::vector::const_iterator E = entries.begin(); E != entries.end(); ++E) { - std::vector const targets = _config->FindVector("APT::Acquire::Targets::deb-src", "", true); - for (std::vector::const_iterator T = targets.begin(); T != targets.end(); ++T) + for (std::vector::const_iterator T = E->Targets.begin(); T != E->Targets.end(); ++T) { -#define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb-src::") + *T + "::" + (X)) - std::string const MetaKey = APT_T_CONFIG(flatArchive ? "flatMetaKey" : "MetaKey"); - std::string const ShortDesc = APT_T_CONFIG("ShortDescription"); - std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); +#define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::") + Type + "::" + *T + "::" + (X)) + std::string const tplMetaKey = APT_T_CONFIG(flatArchive ? "flatMetaKey" : "MetaKey"); + std::string const tplShortDesc = APT_T_CONFIG("ShortDescription"); + std::string const tplLongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb-src::") + *T + "::Optional", true); #undef APT_T_CONFIG - if (MetaKey.empty()) + if (tplMetaKey.empty()) continue; - vector const SectionEntries = src->second; - for (vector::const_iterator I = SectionEntries.begin(); - I != SectionEntries.end(); ++I) + for (std::vector::const_iterator L = E->Languages.begin(); L != E->Languages.end(); ++L) { - for (vector::const_iterator l = lang.begin(); l != lang.end(); ++l) + if (*L == "none" && tplMetaKey.find("$(LANGUAGE)") != std::string::npos) + continue; + + for (std::vector::const_iterator A = E->Architectures.begin(); A != E->Architectures.end(); ++A) { - if (*l == "none" && MetaKey.find("$(LANGUAGE)") != std::string::npos) - continue; std::map Options; Options.insert(std::make_pair("SITE", Site)); Options.insert(std::make_pair("RELEASE", Release)); - if (MetaKey.find("$(COMPONENT)") != std::string::npos) - Options.insert(std::make_pair("COMPONENT", (*I)->Section)); - if (MetaKey.find("$(LANGUAGE)") != std::string::npos) - Options.insert(std::make_pair("LANGUAGE", *l)); - Options.insert(std::make_pair("ARCHITECTURE", "source")); + if (tplMetaKey.find("$(COMPONENT)") != std::string::npos) + Options.insert(std::make_pair("COMPONENT", E->Name)); + if (tplMetaKey.find("$(LANGUAGE)") != std::string::npos) + Options.insert(std::make_pair("LANGUAGE", *L)); + if (tplMetaKey.find("$(ARCHITECTURE)") != std::string::npos) + Options.insert(std::make_pair("ARCHITECTURE", *A)); Options.insert(std::make_pair("BASE_URI", baseURI)); Options.insert(std::make_pair("REPO_URI", URI)); Options.insert(std::make_pair("TARGET_OF", "deb-src")); Options.insert(std::make_pair("CREATED_BY", *T)); - Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options); - if (MetaKey.find("$(LANGUAGE)") == std::string::npos) + std::string MetaKey = tplMetaKey; + std::string ShortDesc = tplShortDesc; + std::string LongDesc = tplLongDesc; + for (std::map::const_iterator O = Options.begin(); O != Options.end(); ++O) + { + MetaKey = SubstVar(MetaKey, std::string("$(") + O->first + ")", O->second); + ShortDesc = SubstVar(ShortDesc, std::string("$(") + O->first + ")", O->second); + LongDesc = SubstVar(LongDesc, std::string("$(") + O->first + ")", O->second); + } + IndexTarget Target( + MetaKey, + ShortDesc, + LongDesc, + Options.find("BASE_URI")->second + MetaKey, + IsOptional, + Options + ); + IndexTargets.push_back(Target); + + if (tplMetaKey.find("$(ARCHITECTURE)") == std::string::npos) break; - } - - if (MetaKey.find("$(COMPONENT)") == std::string::npos) - break; - } - } - } - - std::vector const targets = _config->FindVector("APT::Acquire::Targets::deb", "", true); - for (std::vector::const_iterator T = targets.begin(); T != targets.end(); ++T) - { -#define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::deb::") + *T + "::" + (X)) - std::string const MetaKey = APT_T_CONFIG(flatArchive ? "flatMetaKey" : "MetaKey"); - std::string const ShortDesc = APT_T_CONFIG("ShortDescription"); - std::string const LongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); - bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb::") + *T + "::Optional", true); -#undef APT_T_CONFIG - if (MetaKey.empty()) - continue; - - for (map >::const_iterator a = ArchEntries.begin(); - a != ArchEntries.end(); ++a) - { - if (a->first == "source") - continue; - - for (vector ::const_iterator I = a->second.begin(); - I != a->second.end(); ++I) { - - for (vector::const_iterator l = lang.begin(); l != lang.end(); ++l) - { - if (*l == "none" && MetaKey.find("$(LANGUAGE)") != std::string::npos) - continue; - - std::map Options; - Options.insert(std::make_pair("SITE", Site)); - Options.insert(std::make_pair("RELEASE", Release)); - if (MetaKey.find("$(COMPONENT)") != std::string::npos) - Options.insert(std::make_pair("COMPONENT", (*I)->Section)); - if (MetaKey.find("$(LANGUAGE)") != std::string::npos) - Options.insert(std::make_pair("LANGUAGE", *l)); - if (MetaKey.find("$(ARCHITECTURE)") != std::string::npos) - Options.insert(std::make_pair("ARCHITECTURE", a->first)); - Options.insert(std::make_pair("BASE_URI", baseURI)); - Options.insert(std::make_pair("REPO_URI", URI)); - Options.insert(std::make_pair("TARGET_OF", "deb")); - Options.insert(std::make_pair("CREATED_BY", *T)); - Call(MetaKey, ShortDesc, LongDesc, IsOptional, Options); - if (MetaKey.find("$(LANGUAGE)") == std::string::npos) - break; } - if (MetaKey.find("$(COMPONENT)") == std::string::npos) + if (tplMetaKey.find("$(LANGUAGE)") == std::string::npos) break; + } - if (MetaKey.find("$(ARCHITECTURE)") == std::string::npos) - break; } } } - - -struct ComputeIndexTargetsClass -{ - vector IndexTargets; - - void operator()(std::string MetaKey, std::string ShortDesc, std::string LongDesc, - bool const IsOptional, std::map Options) - { - for (std::map::const_iterator O = Options.begin(); O != Options.end(); ++O) - { - MetaKey = SubstVar(MetaKey, std::string("$(") + O->first + ")", O->second); - ShortDesc = SubstVar(ShortDesc, std::string("$(") + O->first + ")", O->second); - LongDesc = SubstVar(LongDesc, std::string("$(") + O->first + ")", O->second); - } - IndexTarget Target( - MetaKey, - ShortDesc, - LongDesc, - Options.find("BASE_URI")->second + MetaKey, - IsOptional, - Options - ); - IndexTargets.push_back(Target); - } -}; - std::vector debReleaseIndex::GetIndexTargets() const { - ComputeIndexTargetsClass comp; - foreachTarget(URI, Dist, ArchEntries, comp); - return comp.IndexTargets; + std::vector IndexTargets; + GetIndexTargetsFor("deb-src", URI, Dist, d->DebSrcEntries, IndexTargets); + GetIndexTargetsFor("deb", URI, Dist, d->DebEntries, IndexTargets); + return IndexTargets; } + /*}}}*/ +void debReleaseIndex::AddComponent(bool const isSrc, std::string const &Name,/*{{{*/ + std::vector const &Targets, + std::vector const &Architectures, + std::vector Languages) +{ + if (Languages.empty() == true) + Languages.push_back("none"); + debReleaseIndexPrivate::debSectionEntry const entry = { + Name, Targets, Architectures, Languages + }; + if (isSrc) + d->DebSrcEntries.push_back(entry); + else + d->DebEntries.push_back(entry); +} + /*}}}*/ - /*}}}*/ -bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const +bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const/*{{{*/ { indexRecords * const iR = new indexRecords(Dist); if (Trusted == ALWAYS_TRUSTED) @@ -282,7 +245,8 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const return true; } - + /*}}}*/ +// ReleaseIndex::*Trusted setters and checkers /*{{{*/ void debReleaseIndex::SetTrusted(bool const Trusted) { if (Trusted == true) @@ -290,7 +254,6 @@ void debReleaseIndex::SetTrusted(bool const Trusted) else this->Trusted = NEVER_TRUSTED; } - bool debReleaseIndex::IsTrusted() const { if (Trusted == ALWAYS_TRUSTED) @@ -303,19 +266,13 @@ bool debReleaseIndex::IsTrusted() const if(URI.substr(0,strlen("cdrom:")) == "cdrom:") return true; - string VerifiedSigFile = _config->FindDir("Dir::State::lists") + - URItoFileName(MetaIndexURI("Release")) + ".gpg"; - - if (FileExists(VerifiedSigFile)) + if (FileExists(MetaIndexFile("Release.gpg"))) return true; - VerifiedSigFile = _config->FindDir("Dir::State::lists") + - URItoFileName(MetaIndexURI("InRelease")); - - return FileExists(VerifiedSigFile); + return FileExists(MetaIndexFile("InRelease")); } - -std::vector *debReleaseIndex::GetIndexFiles() + /*}}}*/ +std::vector *debReleaseIndex::GetIndexFiles() /*{{{*/ { if (Indexes != NULL) return Indexes; @@ -335,23 +292,9 @@ std::vector *debReleaseIndex::GetIndexFiles() } return Indexes; } + /*}}}*/ -void debReleaseIndex::PushSectionEntry(vector const &Archs, const debSectionEntry *Entry) { - for (vector::const_iterator a = Archs.begin(); - a != Archs.end(); ++a) - ArchEntries[*a].push_back(new debSectionEntry(Entry->Section, Entry->IsSrc)); - delete Entry; -} - -void debReleaseIndex::PushSectionEntry(string const &Arch, const debSectionEntry *Entry) { - ArchEntries[Arch].push_back(Entry); -} - -debReleaseIndex::debSectionEntry::debSectionEntry (string const &Section, - bool const &IsSrc): Section(Section), IsSrc(IsSrc) -{} - -static bool ReleaseFileName(debReleaseIndex const * const That, std::string &ReleaseFile) +static bool ReleaseFileName(debReleaseIndex const * const That, std::string &ReleaseFile)/*{{{*/ { ReleaseFile = That->MetaIndexFile("InRelease"); bool releaseExists = false; @@ -365,7 +308,7 @@ static bool ReleaseFileName(debReleaseIndex const * const That, std::string &Rel } return releaseExists; } - + /*}}}*/ bool debReleaseIndex::Merge(pkgCacheGenerator &Gen,OpProgress * /*Prog*/) const/*{{{*/ { std::string ReleaseFile; @@ -459,46 +402,46 @@ pkgCache::RlsFileIterator debReleaseIndex::FindInCache(pkgCache &Cache, bool con } /*}}}*/ -debDebFileMetaIndex::~debDebFileMetaIndex() {} - -class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type +static std::vector parsePlusMinusOptions(std::string const &Name, /*{{{*/ + std::map const &Options, std::vector const &defaultValues) { - protected: + std::map::const_iterator val = Options.find(Name); + std::vector Values; + if (val != Options.end()) + Values = VectorizeString(val->second, ','); + else + Values = defaultValues; - bool CreateItemInternal(vector &List, string const &URI, - string const &Dist, string const &Section, - bool const &IsSrc, map const &Options) const + if ((val = Options.find(Name + "+")) != Options.end()) { - // parse arch=, arch+= and arch-= settings - map::const_iterator arch = Options.find("arch"); - vector Archs; - if (arch != Options.end()) - Archs = VectorizeString(arch->second, ','); - else - Archs = APT::Configuration::getArchitectures(); - - if ((arch = Options.find("arch+")) != Options.end()) - { - std::vector const plusArch = VectorizeString(arch->second, ','); - for (std::vector::const_iterator plus = plusArch.begin(); plus != plusArch.end(); ++plus) - if (std::find(Archs.begin(), Archs.end(), *plus) == Archs.end()) - Archs.push_back(*plus); - } - if ((arch = Options.find("arch-")) != Options.end()) + std::vector const plusArch = VectorizeString(val->second, ','); + for (std::vector::const_iterator plus = plusArch.begin(); plus != plusArch.end(); ++plus) + if (std::find(Values.begin(), Values.end(), *plus) == Values.end()) + Values.push_back(*plus); + } + if ((val = Options.find(Name + "-")) != Options.end()) + { + std::vector const minusArch = VectorizeString(val->second, ','); + for (std::vector::const_iterator minus = minusArch.begin(); minus != minusArch.end(); ++minus) { - std::vector const minusArch = VectorizeString(arch->second, ','); - for (std::vector::const_iterator minus = minusArch.begin(); minus != minusArch.end(); ++minus) - { - std::vector::iterator kill = std::find(Archs.begin(), Archs.end(), *minus); - if (kill != Archs.end()) - Archs.erase(kill); - } + std::vector::iterator kill = std::find(Values.begin(), Values.end(), *minus); + if (kill != Values.end()) + Values.erase(kill); } + } + return Values; +} + /*}}}*/ +class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ +{ + protected: - map::const_iterator const trusted = Options.find("trusted"); - + bool CreateItemInternal(std::vector &List, std::string const &URI, + std::string const &Dist, std::string const &Section, + bool const &IsSrc, std::map const &Options) const + { debReleaseIndex *Deb = NULL; - for (vector::const_iterator I = List.begin(); + for (std::vector::const_iterator I = List.begin(); I != List.end(); ++I) { // We only worry about debian entries here @@ -523,87 +466,86 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type List.push_back(Deb); } - if (IsSrc == true) - Deb->PushSectionEntry ("source", new debReleaseIndex::debSectionEntry(Section, IsSrc)); - else - { - if (Dist[Dist.size() - 1] == '/') - Deb->PushSectionEntry ("any", new debReleaseIndex::debSectionEntry(Section, IsSrc)); - else - Deb->PushSectionEntry (Archs, new debReleaseIndex::debSectionEntry(Section, IsSrc)); - } + Deb->AddComponent( + IsSrc, + Section, + parsePlusMinusOptions("target", Options, _config->FindVector(std::string("APT::Acquire::Targets::") + Name, "", true)), + parsePlusMinusOptions("arch", Options, APT::Configuration::getArchitectures()), + parsePlusMinusOptions("lang", Options, APT::Configuration::getLanguages(true)) + ); + std::map::const_iterator const trusted = Options.find("trusted"); if (trusted != Options.end()) Deb->SetTrusted(StringToBool(trusted->second, false)); return true; } -}; - -debDebFileMetaIndex::debDebFileMetaIndex(std::string const &DebFile) - : metaIndex(DebFile, "local-uri", "deb-dist"), d(NULL), DebFile(DebFile) -{ - DebIndex = new debDebPkgFileIndex(DebFile); - Indexes = new vector(); - Indexes->push_back(DebIndex); -} - -class APT_HIDDEN debSLTypeDeb : public debSLTypeDebian + debSLTypeDebian(char const * const Name, char const * const Label) : Type(Name, Label) + { + } +}; + /*}}}*/ +class APT_HIDDEN debSLTypeDeb : public debSLTypeDebian /*{{{*/ { public: - bool CreateItem(vector &List, string const &URI, - string const &Dist, string const &Section, - std::map const &Options) const + bool CreateItem(std::vector &List, std::string const &URI, + std::string const &Dist, std::string const &Section, + std::map const &Options) const { return CreateItemInternal(List, URI, Dist, Section, false, Options); } - debSLTypeDeb() + debSLTypeDeb() : debSLTypeDebian("deb", "Debian binary tree") { - Name = "deb"; - Label = "Standard Debian binary tree"; - } + } }; - -class APT_HIDDEN debSLTypeDebSrc : public debSLTypeDebian + /*}}}*/ +class APT_HIDDEN debSLTypeDebSrc : public debSLTypeDebian /*{{{*/ { public: - bool CreateItem(vector &List, string const &URI, - string const &Dist, string const &Section, - std::map const &Options) const + bool CreateItem(std::vector &List, std::string const &URI, + std::string const &Dist, std::string const &Section, + std::map const &Options) const { return CreateItemInternal(List, URI, Dist, Section, true, Options); } - - debSLTypeDebSrc() + + debSLTypeDebSrc() : debSLTypeDebian("deb-src", "Debian source tree") { - Name = "deb-src"; - Label = "Standard Debian source tree"; - } + } }; + /*}}}*/ -class APT_HIDDEN debSLTypeDebFile : public pkgSourceList::Type +debDebFileMetaIndex::debDebFileMetaIndex(std::string const &DebFile) /*{{{*/ + : metaIndex(DebFile, "local-uri", "deb-dist"), d(NULL), DebFile(DebFile) +{ + DebIndex = new debDebPkgFileIndex(DebFile); + Indexes = new std::vector(); + Indexes->push_back(DebIndex); +} +debDebFileMetaIndex::~debDebFileMetaIndex() {} + /*}}}*/ +class APT_HIDDEN debSLTypeDebFile : public pkgSourceList::Type /*{{{*/ { public: - bool CreateItem(vector &List, string const &URI, - string const &/*Dist*/, string const &/*Section*/, - std::map const &/*Options*/) const + bool CreateItem(std::vector &List, std::string const &URI, + std::string const &/*Dist*/, std::string const &/*Section*/, + std::map const &/*Options*/) const { metaIndex *mi = new debDebFileMetaIndex(URI); List.push_back(mi); return true; } - - debSLTypeDebFile() + + debSLTypeDebFile() : Type("deb-file", "Debian local deb file") { - Name = "deb-file"; - Label = "Debian Deb File"; - } + } }; + /*}}}*/ APT_HIDDEN debSLTypeDeb _apt_DebType; APT_HIDDEN debSLTypeDebSrc _apt_DebSrcType; diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 648c22436..9b60b6137 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -1,4 +1,3 @@ -// ijones, walters #ifndef PKGLIB_DEBMETAINDEX_H #define PKGLIB_DEBMETAINDEX_H @@ -22,26 +21,20 @@ class debDebPkgFileIndex; class IndexTarget; class pkgCacheGenerator; class OpProgress; +class debReleaseIndexPrivate; -class APT_HIDDEN debReleaseIndex : public metaIndex { - public: +class APT_HIDDEN debReleaseIndex : public metaIndex +{ + debReleaseIndexPrivate * const d; - class debSectionEntry - { - public: - debSectionEntry (std::string const &Section, bool const &IsSrc); - std::string const Section; - bool const IsSrc; - }; - - private: - /** \brief dpointer placeholder (for later in case we need it) */ - void * const d; - std::map > ArchEntries; enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; public: + APT_HIDDEN std::string MetaIndexInfo(const char *Type) const; + APT_HIDDEN std::string MetaIndexFile(const char *Types) const; + APT_HIDDEN std::string MetaIndexURI(const char *Type) const; + debReleaseIndex(std::string const &URI, std::string const &Dist); debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted); virtual ~debReleaseIndex(); @@ -54,22 +47,17 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const; virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - std::string MetaIndexInfo(const char *Type) const; - std::string MetaIndexFile(const char *Types) const; - std::string MetaIndexURI(const char *Type) const; - -#if APT_PKG_ABI >= 413 - virtual -#endif - std::string LocalFileName() const; + virtual std::string LocalFileName() const; virtual std::vector *GetIndexFiles(); void SetTrusted(bool const Trusted); virtual bool IsTrusted() const; - void PushSectionEntry(std::vector const &Archs, const debSectionEntry *Entry); - void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry); + void AddComponent(bool const isSrc, std::string const &Name, + std::vector const &Targets, + std::vector const &Architectures, + std::vector Languages); }; class APT_HIDDEN debDebFileMetaIndex : public metaIndex diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 99b646513..6ef99863d 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -37,25 +37,26 @@ using namespace std; // Global list of Items supported -static pkgSourceList::Type *ItmList[10]; +static pkgSourceList::Type *ItmList[10]; pkgSourceList::Type **pkgSourceList::Type::GlobalList = ItmList; unsigned long pkgSourceList::Type::GlobalListLen = 0; // Type::Type - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Link this to the global list of items*/ -pkgSourceList::Type::Type() : Name(NULL), Label(NULL) +pkgSourceList::Type::Type(char const * const pName, char const * const pLabel) : Name(pName), Label(pLabel) { ItmList[GlobalListLen] = this; - GlobalListLen++; + ++GlobalListLen; } +pkgSourceList::Type::~Type() {} /*}}}*/ // Type::GetType - Get a specific meta for a given type /*{{{*/ // --------------------------------------------------------------------- /* */ pkgSourceList::Type *pkgSourceList::Type::GetType(const char *Type) { - for (unsigned I = 0; I != GlobalListLen; I++) + for (unsigned I = 0; I != GlobalListLen; ++I) if (strcmp(GlobalList[I]->Name,Type) == 0) return GlobalList[I]; return 0; @@ -91,23 +92,26 @@ bool pkgSourceList::Type::ParseStanza(vector &List, string Enabled = Tags.FindS("Enabled"); if (Enabled.size() > 0 && StringToBool(Enabled) == false) return true; - - // Define external/internal options - const char* option_deb822[] = { - "Architectures", "Architectures-Add", "Architectures-Remove", "Trusted", - }; - const char* option_internal[] = { - "arch", "arch+", "arch-", "trusted", - }; - for (unsigned int j=0; j < sizeof(option_deb822)/sizeof(char*); j++) - if (Tags.Exists(option_deb822[j])) + + std::map mapping; +#define APT_PLUSMINUS(X, Y) \ + mapping.insert(std::make_pair(X, Y)); \ + mapping.insert(std::make_pair(X "Add", Y "+")); \ + mapping.insert(std::make_pair(X "Remove", Y "-")) + APT_PLUSMINUS("Architectures", "arch"); + APT_PLUSMINUS("Languages", "lang"); + APT_PLUSMINUS("Targets", "target"); +#undef APT_PLUSMINUS + mapping.insert(std::make_pair("Trusted", "trusted")); + for (std::map::const_iterator m = mapping.begin(); m != mapping.end(); ++m) + if (Tags.Exists(m->first)) { // for deb822 the " " is the delimiter, but the backend expects "," - std::string option = Tags.FindS(option_deb822[j]); + std::string option = Tags.FindS(m->first); std::replace(option.begin(), option.end(), ' ', ','); - Options[option_internal[j]] = option; + Options[m->second] = option; } - + // now create one item per suite/section string Suite = Tags.FindS("Suites"); Suite = SubstVar(Suite,"$(ARCH)",_config->Find("APT::Architecture")); @@ -209,7 +213,7 @@ bool pkgSourceList::Type::ParseLine(vector &List, if (FixupURI(URI) == false) return _error->Error(_("Malformed line %lu in source list %s (URI parse)"),CurLine,File.c_str()); - + // Check for an absolute dists specification. if (Dist.empty() == false && Dist[Dist.size() - 1] == '/') { diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index e17ad6a9a..4f42b3e91 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -66,8 +66,8 @@ class pkgSourceList static unsigned long GlobalListLen; static Type *GetType(const char *Type) APT_PURE; - const char *Name; - const char *Label; + char const * const Name; + char const * const Label; bool FixupURI(std::string &URI) const; virtual bool ParseStanza(std::vector &List, @@ -80,8 +80,8 @@ class pkgSourceList virtual bool CreateItem(std::vector &List,std::string const &URI, std::string const &Dist,std::string const &Section, std::map const &Options) const = 0; - Type(); - virtual ~Type() {}; + Type(char const * const Name, char const * const Label); + virtual ~Type(); }; typedef std::vector::const_iterator const_iterator; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 632c7cfea..500a0a3c5 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1045,7 +1045,7 @@ static bool DoBuildDep(CommandLine &CmdL) { ioprintf(c1out, _("Note, using directory '%s' to get the build dependencies\n"), *I); // FIXME: how can we make this more elegant? - std::string TypeName = "debian/control File Source Index"; + std::string TypeName = "Debian control file"; pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str()); if(Type != NULL) LastOwner = Last = Type->CreateSrcPkgParser(*I); @@ -1056,7 +1056,7 @@ static bool DoBuildDep(CommandLine &CmdL) ioprintf(c1out, _("Note, using file '%s' to get the build dependencies\n"), *I); // see if we can get a parser for this pkgIndexFile type - string TypeName = flExtension(*I) + " File Source Index"; + string TypeName = "Debian " + flExtension(*I) + " file"; pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str()); if(Type != NULL) LastOwner = Last = Type->CreateSrcPkgParser(*I); diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index da4f571b5..6ebba3528 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -137,9 +137,25 @@ can be used to specify for which architectures information should be downloaded. If this option is not set all architectures defined by the APT::Architectures option will be downloaded. + arch+=arch1,arch2,… and arch-=arch1,arch2,… which can be used to add/remove architectures from the set which will be downloaded. + + lang=lang1,lang2,…, + lang+=lang1,lang2,… and + lang-=lang1,lang2,… functioning in + the same way as the arch-options described before. They can be used to specify for + which languages apt will acquire metadata, like translated package descriptions, for. If not specified, the + default set is defined by the Acquire::Languages config option. + + target=target1,target2,…, + target+=target1,target2,… and + target-=target1,target2,… again functioning in + the same way as the arch-options described before. They can be used to specify which + targets apt will try to acquire from this source. If not specified, the default set is defined by + the APT::Acquire::Targets configuration scope. + trusted=yes can be set to indicate that packages from this source are always authenticated even if the Release file is not signed or the signature can't be checked. This disables parts of &apt-secure; diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index 563821173..12704e5de 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -167,17 +167,17 @@ Conf libfwibble-dev (1.0 unstable [armel])' aptget build-dep apt -s testsuccessequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - amdboot:amd64 cool doxygen foreigner libc6:amd64 libc6 libc6-dev:amd64 - libc6-dev libfwibble-dev:amd64 libfwibble1:amd64 linux-stuff:amd64 + amdboot:amd64 cool doxygen foreigner libc6 libc6:amd64 libc6-dev + libc6-dev:amd64 libfwibble-dev:amd64 libfwibble1:amd64 linux-stuff:amd64 0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) Inst cool (1.0 unstable [armel]) Inst doxygen (1.0 unstable [armel]) Inst foreigner (1.0 unstable [armel]) -Inst libc6:amd64 (1.0 unstable [amd64]) Inst libc6 (1.0 unstable [armel]) -Inst libc6-dev:amd64 (1.0 unstable [amd64]) +Inst libc6:amd64 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [armel]) +Inst libc6-dev:amd64 (1.0 unstable [amd64]) Inst libfwibble1:amd64 (1.0 unstable [amd64]) Inst libfwibble-dev:amd64 (1.0 unstable [amd64]) Inst linux-stuff:amd64 (1.0 unstable [amd64]) @@ -185,10 +185,10 @@ Conf amdboot:amd64 (1.0 unstable [amd64]) Conf cool (1.0 unstable [armel]) Conf doxygen (1.0 unstable [armel]) Conf foreigner (1.0 unstable [armel]) -Conf libc6:amd64 (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [armel]) -Conf libc6-dev:amd64 (1.0 unstable [amd64]) +Conf libc6:amd64 (1.0 unstable [amd64]) Conf libc6-dev (1.0 unstable [armel]) +Conf libc6-dev:amd64 (1.0 unstable [amd64]) Conf libfwibble1:amd64 (1.0 unstable [amd64]) Conf libfwibble-dev:amd64 (1.0 unstable [amd64]) Conf linux-stuff:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 @@ -275,24 +275,24 @@ Conf libfwibble-dev (1.0 unstable [armel])' aptget build-dep apt -s testsuccessequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - amdboot:amd64 doxygen libc6:amd64 libc6 libc6-dev:amd64 libc6-dev + amdboot:amd64 doxygen libc6 libc6:amd64 libc6-dev libc6-dev:amd64 libfwibble-dev:amd64 libfwibble1:amd64 linux-stuff:amd64 0 upgraded, 9 newly installed, 0 to remove and 2 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [armel]) -Inst libc6:amd64 (1.0 unstable [amd64]) Inst libc6 (1.0 unstable [armel]) -Inst libc6-dev:amd64 (1.0 unstable [amd64]) +Inst libc6:amd64 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [armel]) +Inst libc6-dev:amd64 (1.0 unstable [amd64]) Inst libfwibble1:amd64 (1.0 unstable [amd64]) Inst libfwibble-dev:amd64 (1.0 unstable [amd64]) Inst linux-stuff:amd64 (1.0 unstable [amd64]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [armel]) -Conf libc6:amd64 (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [armel]) -Conf libc6-dev:amd64 (1.0 unstable [amd64]) +Conf libc6:amd64 (1.0 unstable [amd64]) Conf libc6-dev (1.0 unstable [armel]) +Conf libc6-dev:amd64 (1.0 unstable [amd64]) Conf libfwibble1:amd64 (1.0 unstable [amd64]) Conf libfwibble-dev:amd64 (1.0 unstable [amd64]) Conf linux-stuff:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 diff --git a/test/integration/test-ignore-provides-if-versioned-breaks b/test/integration/test-ignore-provides-if-versioned-breaks index 20424b942..4d6114637 100755 --- a/test/integration/test-ignore-provides-if-versioned-breaks +++ b/test/integration/test-ignore-provides-if-versioned-breaks @@ -134,17 +134,17 @@ Conf foo-same-provider (1.0 unstable [i386])' aptget install foo-same-provider f testsuccessequal 'Reading package lists... Building dependency tree... The following extra packages will be installed: - foo-same:amd64 foo-same + foo-same foo-same:amd64 The following NEW packages will be installed: foo-same-breaker-3 foo-same-provider The following packages will be upgraded: - foo-same:amd64 foo-same + foo-same foo-same:amd64 2 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. -Inst foo-same:amd64 [2.0] (4.0 unstable [amd64]) [foo-same:amd64 on foo-same:i386] [foo-same:i386 on foo-same:amd64] [foo-same:i386 ] -Inst foo-same [2.0] (4.0 unstable [i386]) +Inst foo-same [2.0] (4.0 unstable [i386]) [foo-same:i386 on foo-same:amd64] [foo-same:amd64 on foo-same:i386] [foo-same:amd64 ] +Inst foo-same:amd64 [2.0] (4.0 unstable [amd64]) Inst foo-same-breaker-3 (1.0 unstable [i386]) Inst foo-same-provider (1.0 unstable [i386]) -Conf foo-same (4.0 unstable [i386]) Conf foo-same:amd64 (4.0 unstable [amd64]) +Conf foo-same (4.0 unstable [i386]) Conf foo-same-breaker-3 (1.0 unstable [i386]) Conf foo-same-provider (1.0 unstable [i386])' aptget install foo-same-provider foo-same-breaker-3 -s diff --git a/test/integration/test-ignore-provides-if-versioned-conflicts b/test/integration/test-ignore-provides-if-versioned-conflicts index a781d8e44..6a0c924e2 100755 --- a/test/integration/test-ignore-provides-if-versioned-conflicts +++ b/test/integration/test-ignore-provides-if-versioned-conflicts @@ -134,17 +134,17 @@ Conf foo-same-provider (1.0 unstable [i386])' aptget install foo-same-provider f testsuccessequal 'Reading package lists... Building dependency tree... The following extra packages will be installed: - foo-same:amd64 foo-same + foo-same foo-same:amd64 The following NEW packages will be installed: foo-same-breaker-3 foo-same-provider The following packages will be upgraded: - foo-same:amd64 foo-same + foo-same foo-same:amd64 2 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. -Inst foo-same:amd64 [2.0] (4.0 unstable [amd64]) [foo-same:amd64 on foo-same:i386] [foo-same:i386 on foo-same:amd64] [foo-same:i386 ] -Inst foo-same [2.0] (4.0 unstable [i386]) +Inst foo-same [2.0] (4.0 unstable [i386]) [foo-same:i386 on foo-same:amd64] [foo-same:amd64 on foo-same:i386] [foo-same:amd64 ] +Inst foo-same:amd64 [2.0] (4.0 unstable [amd64]) Inst foo-same-breaker-3 (1.0 unstable [i386]) Inst foo-same-provider (1.0 unstable [i386]) -Conf foo-same (4.0 unstable [i386]) Conf foo-same:amd64 (4.0 unstable [amd64]) +Conf foo-same (4.0 unstable [i386]) Conf foo-same-breaker-3 (1.0 unstable [i386]) Conf foo-same-provider (1.0 unstable [i386])' aptget install foo-same-provider foo-same-breaker-3 -s diff --git a/test/integration/test-sourceslist-lang-plusminus-options b/test/integration/test-sourceslist-lang-plusminus-options new file mode 100755 index 000000000..28d5f9e06 --- /dev/null +++ b/test/integration/test-sourceslist-lang-plusminus-options @@ -0,0 +1,87 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'native' + +testlangs() { + msgtest 'Test acquired languages for' "$1" + local LANGS="$2" + shift 2 + rm -f gotlangs.list + aptget files --no-release-info 'Created-By: Translations' "$@" --format '$(LANGUAGE)' | sort -u > gotlangs.list + if [ -z "$LANGS" ]; then + echo -n | tr ',' '\n' | sort | checkdiff - gotlangs.list && msgpass || msgfail + else + echo -n "$LANGS" | tr ',' '\n' | sort | checkdiff - gotlangs.list && msgpass || msgfail + fi +} +echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'default' 'en' + +echo 'Acquire::Languages "environment,en";' > rootdir/etc/apt/apt.conf.d/langs.conf +testlangs 'default config' 'en' + +echo 'Acquire::Languages "en,en,en";' > rootdir/etc/apt/apt.conf.d/langs.conf +testlangs 'duplicated config' 'en' + +echo 'Acquire::Languages "none";' > rootdir/etc/apt/apt.conf.d/langs.conf +testlangs 'none config' '' + +echo 'Acquire::Languages "en,none,de,de_DE";' > rootdir/etc/apt/apt.conf.d/langs.conf +testlangs 'english + german config' 'en,de,de_DE' + +echo 'deb [lang=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang=pt' 'pt' + +echo 'deb [lang=en] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang=en' 'en' + +echo 'deb [lang=de_DE] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang=de_DE' 'de_DE' + +echo 'deb [lang=none] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang=none' '' +testequal 'amd64' aptget files --no-release-info 'Created-By: Packages' --format '$(ARCHITECTURE)' + +echo 'deb [lang+=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang+=pt' 'en,de,de_DE,pt' + +echo 'deb [lang+=en] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang+=en' 'en,de,de_DE' + +echo 'deb [lang+=de_DE] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang+=de_DE' 'en,de,de_DE' + +echo 'deb [lang-=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang-=pt' 'en,de,de_DE' + +echo 'deb [lang-=en] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang-=en' 'de,de_DE' + +echo 'deb [lang-=de_DE] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testlangs 'lang-=de_DE' 'en,de' + +echo 'deb http://example.org/debian stable rocks +deb http://example.org/debian stable solid' > rootdir/etc/apt/sources.list +testlangs 'english + german config multicomponent' 'en,de,de_DE' + +echo 'deb http://example.org/debian stable rocks +deb [lang=pt] http://example.org/debian stable solid' > rootdir/etc/apt/sources.list +testlangs 'multicomponent one lang= combined' 'en,de,de_DE,pt' +testlangs 'multicomponent one lang= rocks' 'en,de,de_DE' 'Component: rocks' +testlangs 'multicomponent one lang= solid' 'pt' 'Component: solid' + +echo 'deb [lang=pt] http://example.org/debian stable rocks +deb [lang=de] http://example.org/debian stable solid' > rootdir/etc/apt/sources.list +testlangs 'multicomponent different lang= combined' 'de,pt' +testlangs 'multicomponent different lang= rocks' 'pt' 'Component: rocks' +testlangs 'multicomponent different lang= solid' 'de' 'Component: solid' + +echo 'deb [lang+=pt] http://example.org/debian stable rocks +deb [lang-=de] http://example.org/debian stable solid' > rootdir/etc/apt/sources.list +testlangs 'multicomponent different lang+-= combined' 'en,de,de_DE,pt' +testlangs 'multicomponent different lang+-= rocks' 'en,de,de_DE,pt' 'Component: rocks' +testlangs 'multicomponent different lang+-= solid' 'en,de_DE' 'Component: solid' -- cgit v1.2.3 From 81460e32961bb0b9922bf8a1a27d87705d8c3e51 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 21 Jun 2015 23:12:24 +0200 Subject: bring back deb822 sources.list entries as .sources Having two different formats in the same file is very dirty and causes external tools to fail hard trying to parse them. It is probably not a good idea for them to parse them in the first place, but they do and we shouldn't break them if there is a better way. So we solve this issue for now by giving our deb822 format a new filename extension ".sources" which unsupporting applications are likely to ignore an can begin gradually moving forward rather than waiting for the unknown applications to catch up. Currently and for the forseeable future apt is going to support both with the same feature set as documented in the manpage, with the longtime plan of adopting the 'new' format as default, but that is a long way to go and might get going more from having an easier time setting options than from us pushing it explicitely. --- apt-pkg/policy.cc | 19 +- apt-pkg/sourcelist.cc | 228 ++++++++++----------- apt-pkg/sourcelist.h | 16 +- apt-pkg/tagfile.cc | 8 + apt-pkg/tagfile.h | 8 + doc/sources.list.5.xml | 337 +++++++++++++++++++++---------- test/integration/test-apt-sources-deb822 | 75 +++++-- test/libapt/file-helpers.cc | 11 +- test/libapt/sourcelist_test.cc | 15 +- vendor/README | 8 +- vendor/blankon/apt-vendor.ent | 9 + vendor/debian/apt-vendor.ent | 12 ++ vendor/debian/sources.list.in | 3 +- vendor/raspbian/apt-vendor.ent | 6 + vendor/steamos/apt-vendor.ent | 7 + vendor/steamos/sources.list.in | 4 +- vendor/tanglu/apt-vendor.ent | 6 + vendor/ubuntu/apt-vendor.ent | 13 ++ 18 files changed, 500 insertions(+), 285 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index cd48e040c..170da7c63 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -396,21 +396,6 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &Fi return PFPriority[File->ID]; } /*}}}*/ -// PreferenceSection class - Overriding the default TrimRecord method /*{{{*/ -// --------------------------------------------------------------------- -/* The preference file is a user generated file so the parser should - therefore be a bit more friendly by allowing comments and new lines - all over the place rather than forcing a special format */ -class PreferenceSection : public pkgTagSection -{ - void TrimRecord(bool /*BeforeRecord*/, const char* &End) - { - for (; Stop < End && (Stop[0] == '\n' || Stop[0] == '\r' || Stop[0] == '#'); Stop++) - if (Stop[0] == '#') - Stop = (const char*) memchr(Stop,'\n',End-Stop); - } -}; - /*}}}*/ // ReadPinDir - Load the pin files from this dir into a Policy /*{{{*/ // --------------------------------------------------------------------- /* This will load each pin file in the given dir into a Policy. If the @@ -455,8 +440,8 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) pkgTagFile TF(&Fd); if (_error->PendingError() == true) return false; - - PreferenceSection Tags; + + pkgUserTagSection Tags; while (TF.Step(Tags) == true) { // can happen when there are only comments in a record diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 6ef99863d..69f7ac043 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -82,15 +82,15 @@ bool pkgSourceList::Type::FixupURI(string &URI) const return true; } /*}}}*/ -bool pkgSourceList::Type::ParseStanza(vector &List, +bool pkgSourceList::Type::ParseStanza(vector &List, /*{{{*/ pkgTagSection &Tags, - int i, + unsigned int const i, FileFd &Fd) { map Options; string Enabled = Tags.FindS("Enabled"); - if (Enabled.size() > 0 && StringToBool(Enabled) == false) + if (Enabled.empty() == false && StringToBool(Enabled) == false) return true; std::map mapping; @@ -115,46 +115,63 @@ bool pkgSourceList::Type::ParseStanza(vector &List, // now create one item per suite/section string Suite = Tags.FindS("Suites"); Suite = SubstVar(Suite,"$(ARCH)",_config->Find("APT::Architecture")); - string const Section = Tags.FindS("Sections"); - string URIS = Tags.FindS("URIs"); + string const Component = Tags.FindS("Components"); + string const URIS = Tags.FindS("URIs"); + + std::vector const list_uris = VectorizeString(URIS, ' '); + std::vector const list_suite = VectorizeString(Suite, ' '); + std::vector const list_comp = VectorizeString(Component, ' '); + + if (list_uris.empty()) + // TRANSLATOR: %u is a line number, the first %s is a filename of a file with the extension "second %s" and the third %s is a unique identifier for bugreports + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), i, "sources", Fd.Name().c_str(), "URI"); - std::vector list_uris = StringSplit(URIS, " "); - std::vector list_dist = StringSplit(Suite, " "); - std::vector list_section = StringSplit(Section, " "); - for (std::vector::const_iterator U = list_uris.begin(); U != list_uris.end(); ++U) { - std::string URI = (*U); - if (!FixupURI(URI)) - { - _error->Error(_("Malformed stanza %u in source list %s (URI parse)"),i,Fd.Name().c_str()); - return false; - } + std::string URI = *U; + if (U->empty() || FixupURI(URI) == false) + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), i, "sources", Fd.Name().c_str(), "URI parse"); + + if (list_suite.empty()) + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), i, "sources", Fd.Name().c_str(), "Suite"); - for (std::vector::const_iterator I = list_dist.begin(); - I != list_dist.end(); ++I) + for (std::vector::const_iterator S = list_suite.begin(); + S != list_suite.end(); ++S) { - for (std::vector::const_iterator J = list_section.begin(); - J != list_section.end(); ++J) - { - if (CreateItem(List, URI, (*I), (*J), Options) == false) - { - return false; - } - } + if (S->empty() == false && (*S)[S->size() - 1] == '/') + { + if (list_comp.empty() == false) + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), i, "sources", Fd.Name().c_str(), "absolute Suite Component"); + if (CreateItem(List, URI, *S, "", Options) == false) + return false; + } + else + { + if (list_comp.empty()) + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), i, "sources", Fd.Name().c_str(), "Component"); + + for (std::vector::const_iterator C = list_comp.begin(); + C != list_comp.end(); ++C) + { + if (CreateItem(List, URI, *S, *C, Options) == false) + { + return false; + } + } + } } } return true; } - + /*}}}*/ // Type::ParseLine - Parse a single line /*{{{*/ // --------------------------------------------------------------------- /* This is a generic one that is the 'usual' format for sources.list Weird types may override this. */ bool pkgSourceList::Type::ParseLine(vector &List, const char *Buffer, - unsigned long const &CurLine, + unsigned int const CurLine, string const &File) const { for (;Buffer != 0 && isspace(*Buffer); ++Buffer); // Skip whitespaces @@ -171,10 +188,10 @@ bool pkgSourceList::Type::ParseLine(vector &List, // get one option, e.g. option1=value1 string option; if (ParseQuoteWord(Buffer,option) == false) - return _error->Error(_("Malformed line %lu in source list %s ([option] unparseable)"),CurLine,File.c_str()); + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] unparseable"); if (option.length() < 3) - return _error->Error(_("Malformed line %lu in source list %s ([option] too short)"),CurLine,File.c_str()); + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] too short"); // accept options even if the last has no space before the ]-end marker if (option.at(option.length()-1) == ']') @@ -185,16 +202,16 @@ bool pkgSourceList::Type::ParseLine(vector &List, size_t const needle = option.find('='); if (needle == string::npos) - return _error->Error(_("Malformed line %lu in source list %s ([%s] is not an assignment)"),CurLine,File.c_str(), option.c_str()); + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] not assignment"); string const key = string(option, 0, needle); string const value = string(option, needle + 1, option.length()); if (key.empty() == true) - return _error->Error(_("Malformed line %lu in source list %s ([%s] has no key)"),CurLine,File.c_str(), option.c_str()); + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] no key"); if (value.empty() == true) - return _error->Error(_("Malformed line %lu in source list %s ([%s] key %s has no value)"),CurLine,File.c_str(),option.c_str(),key.c_str()); + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] no value"); Options[key] = value; } @@ -207,33 +224,33 @@ bool pkgSourceList::Type::ParseLine(vector &List, string Section; if (ParseQuoteWord(Buffer,URI) == false) - return _error->Error(_("Malformed line %lu in source list %s (URI)"),CurLine,File.c_str()); + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "URI"); if (ParseQuoteWord(Buffer,Dist) == false) - return _error->Error(_("Malformed line %lu in source list %s (dist)"),CurLine,File.c_str()); - + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "Suite"); + if (FixupURI(URI) == false) - return _error->Error(_("Malformed line %lu in source list %s (URI parse)"),CurLine,File.c_str()); + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "URI parse"); // Check for an absolute dists specification. if (Dist.empty() == false && Dist[Dist.size() - 1] == '/') { if (ParseQuoteWord(Buffer,Section) == true) - return _error->Error(_("Malformed line %lu in source list %s (absolute dist)"),CurLine,File.c_str()); + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "absolute Suite Component"); Dist = SubstVar(Dist,"$(ARCH)",_config->Find("APT::Architecture")); return CreateItem(List, URI, Dist, Section, Options); } - + // Grab the rest of the dists if (ParseQuoteWord(Buffer,Section) == false) - return _error->Error(_("Malformed line %lu in source list %s (dist parse)"),CurLine,File.c_str()); - + return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "Component"); + do { if (CreateItem(List, URI, Dist, Section, Options) == false) return false; } while (ParseQuoteWord(Buffer,Section) == true); - + return true; } /*}}}*/ @@ -242,11 +259,6 @@ bool pkgSourceList::Type::ParseLine(vector &List, /* */ pkgSourceList::pkgSourceList() : d(NULL) { -} - -pkgSourceList::pkgSourceList(string File) : d(NULL) -{ - Read(File); } /*}}}*/ // SourceList::~pkgSourceList - Destructor /*{{{*/ @@ -305,7 +317,7 @@ void pkgSourceList::Reset() // SourceList::Read - Parse the sourcelist file /*{{{*/ // --------------------------------------------------------------------- /* */ -bool pkgSourceList::Read(string File) +bool pkgSourceList::Read(string const &File) { Reset(); return ReadAppend(File); @@ -314,71 +326,63 @@ bool pkgSourceList::Read(string File) // SourceList::ReadAppend - Parse a sourcelist file /*{{{*/ // --------------------------------------------------------------------- /* */ -bool pkgSourceList::ReadAppend(string File) +bool pkgSourceList::ReadAppend(string const &File) { - if (_config->FindB("APT::Sources::Use-Deb822", false) == true) - { - int lines_parsed =ParseFileDeb822(File); - if (lines_parsed < 0) - return false; - else if (lines_parsed > 0) - return true; - // no lines parsed ... fall through and use old style parser - } - return ParseFileOldStyle(File); + if (flExtension(File) == "sources") + return ParseFileDeb822(File); + else + return ParseFileOldStyle(File); } // SourceList::ReadFileOldStyle - Read Traditional style sources.list /*{{{*/ // --------------------------------------------------------------------- /* */ -bool pkgSourceList::ParseFileOldStyle(string File) +bool pkgSourceList::ParseFileOldStyle(std::string const &File) { // Open the stream for reading ifstream F(File.c_str(),ios::in /*| ios::nocreate*/); if (F.fail() == true) return _error->Errno("ifstream::ifstream",_("Opening %s"),File.c_str()); - // CNC:2003-12-10 - 300 is too short. - char Buffer[1024]; - - int CurLine = 0; - while (F.eof() == false) + std::string Buffer; + for (unsigned int CurLine = 1; std::getline(F, Buffer); ++CurLine) { - F.getline(Buffer,sizeof(Buffer)); - CurLine++; - _strtabexpand(Buffer,sizeof(Buffer)); - if (F.fail() && !F.eof()) - return _error->Error(_("Line %u too long in source list %s."), - CurLine,File.c_str()); - - - char *I; - // CNC:2003-02-20 - Do not break if '#' is inside []. - for (I = Buffer; *I != 0 && *I != '#'; I++) - if (*I == '[') - { - char *b_end = strchr(I + 1, ']'); - if (b_end != NULL) - I = b_end; - } - *I = 0; - - const char *C = _strstrip(Buffer); - - // Comment or blank - if (C[0] == '#' || C[0] == 0) + // remove comments + size_t curpos = 0; + while ((curpos = Buffer.find('#', curpos)) != std::string::npos) + { + size_t const openbrackets = std::count(Buffer.begin(), Buffer.begin() + curpos, '['); + size_t const closedbrackets = std::count(Buffer.begin(), Buffer.begin() + curpos, ']'); + if (openbrackets > closedbrackets) + { + // a # in an option, unlikely, but oh well, it was supported so stick to it + ++curpos; + continue; + } + Buffer.erase(curpos); + break; + } + // remove spaces before/after + curpos = Buffer.find_first_not_of(" \t\r"); + if (curpos != 0) + Buffer.erase(0, curpos); + curpos = Buffer.find_last_not_of(" \t\r"); + if (curpos != std::string::npos) + Buffer.erase(curpos + 1); + + if (Buffer.empty()) continue; - + // Grok it - string LineType; - if (ParseQuoteWord(C,LineType) == false) + std::string const LineType = Buffer.substr(0, Buffer.find(' ')); + if (LineType.empty() || LineType == Buffer) return _error->Error(_("Malformed line %u in source list %s (type)"),CurLine,File.c_str()); Type *Parse = Type::GetType(LineType.c_str()); if (Parse == 0) return _error->Error(_("Type '%s' is not known on line %u in source list %s"),LineType.c_str(),CurLine,File.c_str()); - - if (Parse->ParseLine(SrcList, C, CurLine, File) == false) + + if (Parse->ParseLine(SrcList, Buffer.c_str() + LineType.length(), CurLine, File) == false) return false; } return true; @@ -387,30 +391,25 @@ bool pkgSourceList::ParseFileOldStyle(string File) // SourceList::ParseFileDeb822 - Parse deb822 style sources.list /*{{{*/ // --------------------------------------------------------------------- /* Returns: the number of stanzas parsed*/ -int pkgSourceList::ParseFileDeb822(string File) +bool pkgSourceList::ParseFileDeb822(string const &File) { - pkgTagSection Tags; - unsigned int i=0; + pkgUserTagSection Tags; + unsigned int i = 1; // see if we can read the file - _error->PushToStack(); FileFd Fd(File, FileFd::ReadOnly); pkgTagFile Sources(&Fd); if (_error->PendingError() == true) - { - _error->RevertToStack(); - return 0; - } - _error->MergeWithStack(); - + return _error->Error(_("Malformed stanza %u in source list %s (type)"),i,File.c_str()); + // read step by step while (Sources.Step(Tags) == true) { - if(!Tags.Exists("Types")) - continue; + if(Tags.Exists("Types") == false) + return _error->Error(_("Malformed stanza %u in source list %s (type)"),i,File.c_str()); string const types = Tags.FindS("Types"); - std::vector list_types = StringSplit(types, " "); + std::vector const list_types = VectorizeString(types, ' '); for (std::vector::const_iterator I = list_types.begin(); I != list_types.end(); ++I) { @@ -418,18 +417,16 @@ int pkgSourceList::ParseFileDeb822(string File) if (Parse == 0) { _error->Error(_("Type '%s' is not known on stanza %u in source list %s"), (*I).c_str(),i,Fd.Name().c_str()); - return -1; + return false; } - + if (!Parse->ParseStanza(SrcList, Tags, i, Fd)) - return -1; + return false; - i++; + ++i; } } - - // we are done, return the number of stanzas read - return i; + return true; } /*}}}*/ // SourceList::FindIndex - Get the index associated with a file /*{{{*/ @@ -471,9 +468,12 @@ bool pkgSourceList::GetIndexes(pkgAcquire *Owner, bool GetAll) const // Based on ReadConfigDir() /*{{{*/ // --------------------------------------------------------------------- /* */ -bool pkgSourceList::ReadSourceDir(string Dir) +bool pkgSourceList::ReadSourceDir(string const &Dir) { - vector const List = GetListOfFilesInDir(Dir, "list", true); + std::vector ext; + ext.push_back("list"); + ext.push_back("sources"); + std::vector const List = GetListOfFilesInDir(Dir, ext, true); // Read the files for (vector::const_iterator I = List.begin(); I != List.end(); ++I) diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index 4f42b3e91..079f3cb3d 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -72,11 +72,11 @@ class pkgSourceList bool FixupURI(std::string &URI) const; virtual bool ParseStanza(std::vector &List, pkgTagSection &Tags, - int stanza_n, + unsigned int const stanza_n, FileFd &Fd); virtual bool ParseLine(std::vector &List, const char *Buffer, - unsigned long const &CurLine,std::string const &File) const; + unsigned int const CurLine,std::string const &File) const; virtual bool CreateItem(std::vector &List,std::string const &URI, std::string const &Dist,std::string const &Section, std::map const &Options) const = 0; @@ -90,18 +90,19 @@ class pkgSourceList std::vector SrcList; - int ParseFileDeb822(std::string File); - bool ParseFileOldStyle(std::string File); + private: + APT_HIDDEN bool ParseFileDeb822(std::string const &File); + APT_HIDDEN bool ParseFileOldStyle(std::string const &File); public: bool ReadMainList(); - bool Read(std::string File); + bool Read(std::string const &File); // CNC:2003-03-03 void Reset(); - bool ReadAppend(std::string File); - bool ReadSourceDir(std::string Dir); + bool ReadAppend(std::string const &File); + bool ReadSourceDir(std::string const &Dir); // List accessors inline const_iterator begin() const {return SrcList.begin();}; @@ -117,7 +118,6 @@ class pkgSourceList time_t GetLastModifiedTime(); pkgSourceList(); - explicit pkgSourceList(std::string File); virtual ~pkgSourceList(); }; diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 6d7d8185b..cc63b213f 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -775,6 +775,14 @@ bool pkgTagSection::Write(FileFd &File, char const * const * const Order, std::v } /*}}}*/ +void pkgUserTagSection::TrimRecord(bool /*BeforeRecord*/, const char* &End)/*{{{*/ +{ + for (; Stop < End && (Stop[0] == '\n' || Stop[0] == '\r' || Stop[0] == '#'); Stop++) + if (Stop[0] == '#') + Stop = (const char*) memchr(Stop,'\n',End-Stop); +} + /*}}}*/ + #include "tagfile-order.c" // TFRewrite - Rewrite a control record /*{{{*/ diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index d0d0c7a84..81fff89f0 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -142,6 +142,14 @@ class pkgTagSection bool Write(FileFd &File, char const * const * const Order = NULL, std::vector const &Rewrite = std::vector()) const; }; + +/* For user generated file the parser should be a bit more relaxed in exchange + for being a bit slower to allow comments and new lines all over the place */ +class pkgUserTagSection : public pkgTagSection +{ + virtual void TrimRecord(bool BeforeRecord, const char* &End); +}; + class pkgTagFilePrivate; class pkgTagFile { diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index 6ebba3528..8506017ad 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -31,37 +31,99 @@ Description - The source list /etc/apt/sources.list is designed to support - any number of active sources and a variety of source media. The file lists one - source per line, with the most preferred source listed first. The information available - from the configured sources is acquired by apt-get update - (or by an equivalent command from another APT front-end). - - - Each line specifying a source starts with type (e.g. deb-src) - followed by options and arguments for this type. - Individual entries cannot be continued onto a following line. Empty lines - are ignored, and a # character anywhere on a line marks - the remainder of that line as a comment. + The source list /etc/apt/sources.list and the the + files contained in /etc/apt/sources.list.d/ are + designed to support any number of active sources and a variety of source + media. The files list one source per line (one line style) or contain multiline + stanzas defining one or more sources per stanza (deb822 style), with the + most preferred source listed first. The information available from the + configured sources is acquired by apt-get update (or + by an equivalent command from another APT front-end). sources.list.d - The /etc/apt/sources.list.d directory provides - a way to add sources.list entries in separate files. - The format is the same as for the regular sources.list file. - File names need to end with - .list and may only contain letters (a-z and A-Z), - digits (0-9), underscore (_), hyphen (-) and period (.) characters. - Otherwise APT will print a notice that it has ignored a file, unless that - file matches a pattern in the Dir::Ignore-Files-Silently - configuration list - in which case it will be silently ignored. + The /etc/apt/sources.list.d directory provides + a way to add sources.list entries in separate files. + Two different file formats are allowed as described in the next two sections. + Filenames need to have either the extension .list or + .sources depending on the contained format. + The filenames may only contain letters (a-z and A-Z), + digits (0-9), underscore (_), hyphen (-) and period (.) characters. + Otherwise APT will print a notice that it has ignored a file, unless that + file matches a pattern in the Dir::Ignore-Files-Silently + configuration list - in which case it will be silently ignored. - The deb and deb-src types + one line style format + + Files in this format have the extension .list. + Each line specifying a source starts with a type (e.g. deb-src) + followed by options and arguments for this type. + + Individual entries cannot be continued onto a following line. Empty lines + are ignored, and a # character anywhere on a line marks + the remainder of that line as a comment. Consequently an entry can be + disabled by commenting out the entire line. + + If options should be provided they are separated by spaces and all of + them together are enclosed by square brackets ([]) + included in the line after the type separated from it with a space. + If an option allows multiple values these are separated from each other + with a comma (,). An option name is separated from its + value(s) by a equal sign (=). Multivalue options have + also -= and += as separator which + instead of replacing the default with the given value(s) modify the default + value(s) to remove or include the given values. + + This is the traditional format and supported by all apt versions. + Note that not all options as described below are supported by all apt versions. + Note also that some older applications parsing this format on its own might not + expect to encounter options as they were uncommon before the introduction of + multi-architecture support. + + + + deb822 style format + + Files in this format have the extension .sources. + The format is similar in syntax to other files used by Debian and its + derivatives, like the metadata itself apt will download from the configured + sources or the debian/control file in a Debian source package. + + Individual entries are separated by an empty line, additional empty + lines are ignored, and a # character at the start of + the line marks the entire line as a comment. An entry can hence be + disabled by commenting out each line belonging to the stanza, but it is + usually easier to add the field "Enabled: no" to the stanza to disable + the entry. Removing the field or setting it to yes reenables it. + + Options have the same syntax as every other field: A fieldname separated by + a colon (:) and optionally spaces from its value(s). + Note especially that multiple values are separated by spaces, not by + commas as in the one line format. Multivalue fields like Architectures + also have Architectures-Add and Architectures-Remove + to modify the default value rather than replacing it. + + This is a new format supported by apt itself since version 1.1. Previous + versions ignore such files with a notice message as described earlier. + It is intended to make this format gradually the default format and + deprecating the previously described one line style format as it is + easier to create, extend and modify by humans and machines alike + especially if a lot of sources and/or options are involved. + + Developers who are working with and/or parsing apt sources are highly + encouraged to add support for this format and to contact the APT team + to coordinate and share this work. Users can freely adopt this format + already, but could encounter problems with software not supporting + the format yet. + + + + The deb and deb-src types: General Format The deb type references a typical two-level Debian archive, distribution/component. The - distribution is generally an archive name like + distribution is generally a suite name like stable or testing or a codename like &stable-codename; or &testing-codename; while component is one of main, contrib or @@ -70,42 +132,33 @@ code in the same form as the deb type. A deb-src line is required to fetch source indexes. - The format for a sources.list entry using the + The format for two one line style entries using the deb and deb-src types is: - deb [ options ] uri suite [component1] [component2] [...] + deb [ option1=value1 option2=value2 ] uri suite [component1] [component2] [...] +deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [...] - Alternatively a rfc822 style format is also supported: + Alternatively the equivalent entry in deb822 style looks like this: Types: deb deb-src - URIs: http://example.com - Suites: stable testing - Sections: component1 component2 - Description: short - long long long - [option1]: [option1-value] - - Types: deb - URIs: http://another.example.com - Suites: experimental - Sections: component1 component2 - Enabled: no - Description: short - long long long - [option1]: [option1-value] + URIs: uri + Suites: suite + Components: [component1] [component2] [...] + option1: value1 + option2: value2 The URI for the deb type must specify the base of the - Debian distribution, from which APT will find the information it needs. - suite can specify an exact path, in which case the + Debian distribution, from which APT will find the information it needs. + suite can specify an exact path, in which case the components must be omitted and suite must end with a slash (/). This is useful for the case when only a - particular sub-section of the archive denoted by the URI is of interest. + particular sub-directory of the archive denoted by the URI is of interest. If suite does not specify an exact path, at least one component must be present. - suite may also contain a variable, + suite may also contain a variable, $(ARCH) which expands to the Debian architecture (such as amd64 or armel) used on the system. This permits architecture-independent @@ -113,67 +166,80 @@ of interest when specifying an exact path, APT will automatically generate a URI with the current architecture otherwise. - In the traditional style sources.list format since only one - distribution can be specified per line it may be necessary to have - multiple lines for the same URI, if a subset of all available - distributions or components at that location is desired. APT will - sort the URI list after it has generated a complete set internally, - and will collapse multiple references to the same Internet host, - for instance, into a single connection, so that it does not - inefficiently establish an FTP connection, close it, do something - else, and then re-establish a connection to that same host. This - feature is useful for accessing busy FTP sites with limits on the - number of simultaneous anonymous users. APT also parallelizes - connections to different hosts to more effectively deal with sites - with low bandwidth. - - options is always optional and needs to be surrounded by - square brackets. It can consist of multiple settings in the form - setting=value. - Multiple settings are separated by spaces. The following settings are supported by APT - (note however that unsupported settings will be ignored silently): - - arch=arch1,arch2,… - can be used to specify for which architectures information should - be downloaded. If this option is not set all architectures defined by the - APT::Architectures option will be downloaded. - - arch+=arch1,arch2,… - and arch-=arch1,arch2,… - which can be used to add/remove architectures from the set which will be downloaded. - - lang=lang1,lang2,…, - lang+=lang1,lang2,… and - lang-=lang1,lang2,… functioning in - the same way as the arch-options described before. They can be used to specify for - which languages apt will acquire metadata, like translated package descriptions, for. If not specified, the - default set is defined by the Acquire::Languages config option. - - target=target1,target2,…, - target+=target1,target2,… and - target-=target1,target2,… again functioning in - the same way as the arch-options described before. They can be used to specify which - targets apt will try to acquire from this source. If not specified, the default set is defined by - the APT::Acquire::Targets configuration scope. - - trusted=yes can be set to indicate that packages - from this source are always authenticated even if the Release file - is not signed or the signature can't be checked. This disables parts of &apt-secure; - and should therefore only be used in a local and trusted context. trusted=no - is the opposite which handles even correctly authenticated sources as not authenticated. - + Especially in the one line style format since only one distribution + can be specified per line it may be necessary to have multiple lines for + the same URI, if a subset of all available distributions or components at + that location is desired. APT will sort the URI list after it has + generated a complete set internally, and will collapse multiple + references to the same Internet host, for instance, into a single + connection, so that it does not inefficiently establish a + connection, close it, do something else, and then re-establish a + connection to that same host. APT also parallelizes connections to + different hosts to more effectively deal with sites with low + bandwidth. It is important to list sources in order of preference, with the most preferred source listed first. Typically this will result in sorting by speed from fastest to slowest (CD-ROM followed by hosts on a local network, followed by distant Internet hosts, for example). - Some examples: - -deb http://ftp.debian.org/debian &stable-codename; main contrib non-free -deb http://security.debian.org/ &stable-codename;/updates main contrib non-free - + As an example, the sources for your distribution could look like this + in one line style format: + &sourceslist-list-format; or like this in + deb822 style format: + &sourceslist-sources-format; + + The deb and deb-src types: Options + Each source entry can have options specified modifying which and how + the source is accessed and data acquired from it. Format, syntax and names + of the options varies between the two formats one line and deb822 style + as described, but they have both the same options available. For simplicity + we list the deb822 fieldname and provide the one line name in brackets. + Remember that beside setting multivalue options explicitly, there is also + the option to modify them based on the default, but we aren't listing those + names explicitly here. Unsupported options are silently ignored by all + APT versions. + + + Architectures + (arch) is a multivalue option defining for + which architectures information should be downloaded. If this + option isn't set the default is all architectures as defined by + the APT::Architectures config option. + + + Languages + (lang) is a multivalue option defining for + which languages information like translated package + descriptions should be downloaded. If this option isn't set + the default is all languages as defined by the + Acquire::Languages config option. + + + Targets + (target) is a multivalue option defining + which download targets apt will try to acquire from this + source. If not specified, the default set is defined by the + APT::Acquire::Targets configuration scope. + + + Trusted (trusted) + is a tri-state value which defaults to APT deciding if a source + is considered trusted or if warnings should be raised before e.g. + packages are installed from this source. This option can be used + to override this decision either with the value yes, + which lets APT consider this source always as a trusted source + even if it has no or fails authentication checks by disabling parts + of &apt-secure; and should therefore only be used in a local and trusted + context (if at all) as otherwise security is breached. The opposite + can be achieved with the value no, which causes the source to be handled + as untrusted even if the authentication checks passed successfully. + The default value can't be set explicitly. + + + + URI specification @@ -247,34 +313,70 @@ deb http://security.debian.org/ &stable-codename;/updates main contrib non-free Examples - Uses the archive stored locally (or NFS mounted) at /home/jason/debian + Uses the archive stored locally (or NFS mounted) at /home/apt/debian for stable/main, stable/contrib, and stable/non-free. - deb file:/home/jason/debian stable main contrib non-free + deb file:/home/apt/debian stable main contrib non-free + Types: deb +URIs: file:/home/apt/debian +Suites: stable +Components: main contrib non-free As above, except this uses the unstable (development) distribution. - deb file:/home/jason/debian unstable main contrib non-free + deb file:/home/apt/debian unstable main contrib non-free + Types: deb +URIs: file:/home/apt/debian +Suites: unstable +Components: main contrib non-free Source line for the above - deb-src file:/home/jason/debian unstable main contrib non-free + deb-src file:/home/apt/debian unstable main contrib non-free + Types: deb-src +URIs: file:/home/apt/debian +Suites: unstable +Components: main contrib non-free + The first line gets package information for the architectures in APT::Architectures while the second always retrieves amd64 and armel. - deb http://ftp.debian.org/debian &stable-codename; main -deb [ arch=amd64,armel ] http://ftp.debian.org/debian &stable-codename; main + deb http://httpredir.debian.org/debian &stable-codename; main +deb [ arch=amd64,armel ] http://httpredir.debian.org/debian &stable-codename; main + Types: deb +URIs: http://httpredir.debian.org/debian +Suites: &stable-codename; +Components: main + +Types: deb +URIs: http://httpredir.debian.org/debian +Suites: &stable-codename; +Components: main +Architectures: amd64 armel + Uses HTTP to access the archive at archive.debian.org, and uses only the hamm/main area. deb http://archive.debian.org/debian-archive hamm main + Types: deb +URIs: http://archive.debian.org/debian-archive +Suites: hamm +Components: main Uses FTP to access the archive at ftp.debian.org, under the debian directory, and uses only the &stable-codename;/contrib area. deb ftp://ftp.debian.org/debian &stable-codename; contrib + Types: deb +URIs: ftp://ftp.debian.org/debian +Suites: &stable-codename; +Components: contrib Uses FTP to access the archive at ftp.debian.org, under the debian directory, and uses only the unstable/contrib area. If this line appears as well as the one in the previous example in sources.list a single FTP session will be used for both resource lines. deb ftp://ftp.debian.org/debian unstable contrib + Types: deb +URIs: ftp://ftp.debian.org/debian +Suites: unstable +Components: contrib Uses HTTP to access the archive at ftp.tlh.debian.org, under the universe directory, and uses only files found under @@ -284,15 +386,32 @@ deb [ arch=amd64,armel ] http://ftp.debian.org/debian &stable-codename; maindeb http://ftp.tlh.debian.org/universe unstable/binary-$(ARCH)/ + Types: deb +URIs: http://ftp.tlh.debian.org/universe +Suites: unstable/binary-$(ARCH)/ + + Uses HTTP to get binary packages as well as sources from the stable, testing and unstable + suites and the components main and contrib. + deb http://httpredir.debian.org/debian stable main contrib +deb-src http://httpredir.debian.org/debian stable main contrib +deb http://httpredir.debian.org/debian testing main contrib +deb-src http://httpredir.debian.org/debian testing main contrib +deb http://httpredir.debian.org/debian unstable main contrib +deb-src http://httpredir.debian.org/debian unstable main contrib + Types: deb deb-src +URIs: http://httpredir.debian.org/debian +Suites: stable testing unstable +Components: main contrib + + - + See Also - &apt-cache; &apt-conf; + &apt-get;, &apt-conf; &manbugs; - - + diff --git a/test/integration/test-apt-sources-deb822 b/test/integration/test-apt-sources-deb822 index 51fe7bcfe..adfe0e003 100755 --- a/test/integration/test-apt-sources-deb822 +++ b/test/integration/test-apt-sources-deb822 @@ -7,9 +7,8 @@ TESTDIR=$(readlink -f $(dirname $0)) setupenvironment configarchitecture 'i386' -echo 'APT::Sources::Use-Deb822 "true";' > rootdir/etc/apt/apt.conf.d/00enabledeb822 - -SOURCES='rootdir/etc/apt/sources.list' +LISTS='rootdir/etc/apt/sources.list.d/test.list' +SOURCES='rootdir/etc/apt/sources.list.d/test.sources' BASE='# some comment # that contains a : as well #Types: meep @@ -17,23 +16,48 @@ BASE='# some comment Types: deb URIs: http://ftp.debian.org/debian Suites: stable -Sections: main +Components: main Description: summay and the long part' -msgtest 'Test sources.list' 'old style' -echo "deb http://ftp.debian.org/debian stable main" > $SOURCES +msgcleantest() { + rm -f $LISTS $SOURCES + msgtest "$@" +} + +msgcleantest 'Test sources.list' 'old style' +echo "deb http://ftp.debian.org/debian stable main" > $LISTS +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris + +msgcleantest 'Test sources.list' 'old style with options' +echo "deb [trusted=yes arch+=armel,powerpc] http://ftp.debian.org/debian stable main" > $LISTS +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-powerpc/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-powerpc_Packages 0 +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris + +msgcleantest 'Test sources.list' 'old style with comments' +echo "deb http://ftp.debian.org/debian stable main # non-free" > $LISTS +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 +'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris + +msgcleantest 'Test sources.list' 'old style with option comments' +echo "deb [trusted=yes#yeahreally] http://ftp.debian.org/debian stable main # non-free" > $LISTS testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris -msgtest 'Test sources.list' 'simple deb822' +msgcleantest 'Test sources.list' 'simple deb822' echo "$BASE" > $SOURCES testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris -msgtest 'Test deb822 with' 'two entries' +msgcleantest 'Test deb822 with' 'two entries' # Two entries echo "$BASE" > $SOURCES echo "" >> $SOURCES @@ -46,7 +70,7 @@ testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.deb 'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris # two suite entries -msgtest 'Test deb822 with' 'two Suite entries' +msgcleantest 'Test deb822 with' 'two Suite entries' echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 @@ -55,7 +79,7 @@ testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.deb 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 " aptget update --print-uris -msgtest 'Test deb822' 'architecture option' +msgcleantest 'Test deb822' 'architecture option' echo "$BASE" > $SOURCES echo "Architectures: amd64 armel" >> $SOURCES testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 @@ -63,17 +87,30 @@ testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.deb 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris - -msgtest 'Test old-style sources.list file which has' 'malformed dist' -echo "deb http://ftp.debian.org" > $SOURCES -testequal --nomsg "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist) +msgcleantest 'Test old-style' 'suite arch variable' +echo 'deb http://ftp.tlh.debian.org/universe unstable/binary-$(ARCH)/' > $LISTS +testequal --nomsg "'http://ftp.tlh.debian.org/universe/unstable/binary-i386/InRelease' ftp.tlh.debian.org_universe_unstable_binary-i386_InRelease 0 +'http://ftp.tlh.debian.org/universe/unstable/binary-i386/Packages.bz2' ftp.tlh.debian.org_universe_unstable_binary-i386_Packages 0 +'http://ftp.tlh.debian.org/universe/unstable/binary-i386/en.bz2' ftp.tlh.debian.org_universe_unstable_binary-i386_en 0 " aptget update --print-uris + +msgcleantest 'Test deb822' 'suite arch variable' +echo 'Types: deb +URIs: http://ftp.tlh.debian.org/universe +Suites: stable/binary-$(ARCH)/' > $SOURCES +testequal --nomsg "'http://ftp.tlh.debian.org/universe/stable/binary-i386/InRelease' ftp.tlh.debian.org_universe_stable_binary-i386_InRelease 0 +'http://ftp.tlh.debian.org/universe/stable/binary-i386/Packages.bz2' ftp.tlh.debian.org_universe_stable_binary-i386_Packages 0 +'http://ftp.tlh.debian.org/universe/stable/binary-i386/en.bz2' ftp.tlh.debian.org_universe_stable_binary-i386_en 0 " aptget update --print-uris + +msgcleantest 'Test old-style sources.list file which has' 'malformed dist' +echo "deb http://ftp.debian.org" > $LISTS +testequal --nomsg "E: Malformed entry 1 in list file $TMPWORKINGDIRECTORY/$LISTS (Suite) E: The list of sources could not be read." aptget update --print-uris -msgtest 'Test deb822 sources.list file which has' 'malformed URI' +msgcleantest 'Test deb822 sources.list file which has' 'malformed URI' echo "Types: deb Suites: stable " > $SOURCES -testequal --nomsg "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse) +testequal --nomsg "E: Malformed entry 1 in sources file $TMPWORKINGDIRECTORY/$SOURCES (URI) E: The list of sources could not be read." aptget update --print-uris # with Enabled: false @@ -82,7 +119,7 @@ echo "Enabled: no" >> $SOURCES testempty aptget update --print-uris # multiple URIs -msgtest 'Test deb822 sources.list file which has' 'Multiple URIs work' +msgcleantest 'Test deb822 sources.list file which has' 'Multiple URIs work' echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0 'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0 @@ -92,7 +129,7 @@ testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris # multiple Type in one field -msgtest 'Test deb822 sources.list file which has' 'Multiple Types work' +msgcleantest 'Test deb822 sources.list file which has' 'Multiple Types work' echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 'http://ftp.debian.org/debian/dists/stable/main/source/Sources.bz2' ftp.debian.org_debian_dists_stable_main_source_Sources 0 @@ -100,7 +137,7 @@ testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.deb 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris # a Suite -msgtest 'Test deb822 sources.list file which has' 'a exact path and no sections' +msgcleantest 'Test deb822 sources.list file which has' 'an exact path and no sections' cat > $SOURCES < + + + + diff --git a/vendor/debian/apt-vendor.ent b/vendor/debian/apt-vendor.ent index 6cda5995c..8b26da385 100644 --- a/vendor/debian/apt-vendor.ent +++ b/vendor/debian/apt-vendor.ent @@ -5,3 +5,15 @@ /usr/share/keyrings/debian-archive-removed-keys.gpg"> + + + diff --git a/vendor/debian/sources.list.in b/vendor/debian/sources.list.in index 2e430296a..c36fb16a7 100644 --- a/vendor/debian/sources.list.in +++ b/vendor/debian/sources.list.in @@ -1,7 +1,6 @@ # See sources.list(5) manpage for more information # Remember that CD-ROMs, DVDs and such are managed through the apt-cdrom tool. -deb http://ftp.us.debian.org/debian &debian-stable-codename; main contrib non-free -deb http://security.debian.org &debian-stable-codename;/updates main contrib non-free +&sourceslist-list-format; # Uncomment if you want the apt-get source function to work #deb-src http://ftp.us.debian.org/debian &debian-stable-codename; main contrib non-free diff --git a/vendor/raspbian/apt-vendor.ent b/vendor/raspbian/apt-vendor.ent index e359d2001..dc69f3c03 100644 --- a/vendor/raspbian/apt-vendor.ent +++ b/vendor/raspbian/apt-vendor.ent @@ -5,3 +5,9 @@ /usr/share/keyrings/raspbian-archive-removed-keys.gpg"> + + + diff --git a/vendor/steamos/apt-vendor.ent b/vendor/steamos/apt-vendor.ent index dc1b798e6..7cf100fc4 100644 --- a/vendor/steamos/apt-vendor.ent +++ b/vendor/steamos/apt-vendor.ent @@ -6,3 +6,10 @@ + + + diff --git a/vendor/steamos/sources.list.in b/vendor/steamos/sources.list.in index 69174d090..246d2e336 100644 --- a/vendor/steamos/sources.list.in +++ b/vendor/steamos/sources.list.in @@ -1,5 +1,3 @@ # See sources.list(5) manpage for more information # Remember that CD-ROMs, DVDs and such are managed through the apt-cdrom tool. - -deb http://repo.steampowered.com/steamos ¤t-codename; main contrib non-free -deb-src http://repo.steampowered.com/steamos ¤t-codename; main contrib non-free +&sourceslist-list-format; diff --git a/vendor/tanglu/apt-vendor.ent b/vendor/tanglu/apt-vendor.ent index d2442209c..f5cd813bf 100644 --- a/vendor/tanglu/apt-vendor.ent +++ b/vendor/tanglu/apt-vendor.ent @@ -6,3 +6,9 @@ + + + diff --git a/vendor/ubuntu/apt-vendor.ent b/vendor/ubuntu/apt-vendor.ent index caa532699..dcebc9209 100644 --- a/vendor/ubuntu/apt-vendor.ent +++ b/vendor/ubuntu/apt-vendor.ent @@ -5,3 +5,16 @@ /usr/share/keyrings/ubuntu-archive-removed-keys.gpg"> + + + -- cgit v1.2.3 From 268ffcebb9ae4278b1e3c3f89f8167f229164dbd Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 22 Jun 2015 12:34:11 +0200 Subject: detect and error out on conflicting Trusted settings A specific trust state can be enforced via a sources.list option, but it effects all entries handled by the same Release file, not just the entry it was given on so we enforce acknowledgement of this by requiring the same value to be (not) set on all such entries. --- apt-pkg/deb/debmetaindex.cc | 43 ++++++++++++++-------- apt-pkg/deb/debmetaindex.h | 8 ++-- apt-pkg/metaindex.cc | 2 +- apt-pkg/metaindex.h | 1 - doc/sources.list.5.xml | 8 ++++ .../test-bug-596498-trusted-unsigned-repo | 8 ++-- test/integration/test-sourceslist-trusted-options | 17 +++++++++ 7 files changed, 63 insertions(+), 24 deletions(-) diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index f690a8d64..1f725ba05 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -29,6 +29,8 @@ #include #include +#include + class APT_HIDDEN debReleaseIndexPrivate /*{{{*/ { public: @@ -42,6 +44,11 @@ class APT_HIDDEN debReleaseIndexPrivate /*{{{*/ std::vector DebEntries; std::vector DebSrcEntries; + + debReleaseIndex::TriState Trusted; + + debReleaseIndexPrivate() : Trusted(debReleaseIndex::TRI_UNSET) {} + debReleaseIndexPrivate(bool const pTrusted) : Trusted(pTrusted ? debReleaseIndex::TRI_YES : debReleaseIndex::TRI_NO) {} }; /*}}}*/ // ReleaseIndex::MetaIndex* - display helpers /*{{{*/ @@ -101,12 +108,11 @@ std::string debReleaseIndex::LocalFileName() const /*{{{*/ /*}}}*/ // ReleaseIndex Con- and Destructors /*{{{*/ debReleaseIndex::debReleaseIndex(std::string const &URI, std::string const &Dist) : - metaIndex(URI, Dist, "deb"), d(new debReleaseIndexPrivate()), Trusted(CHECK_TRUST) + metaIndex(URI, Dist, "deb"), d(new debReleaseIndexPrivate()) {} debReleaseIndex::debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted) : - metaIndex(URI, Dist, "deb"), d(new debReleaseIndexPrivate()) { - SetTrusted(Trusted); -} + metaIndex(URI, Dist, "deb"), d(new debReleaseIndexPrivate(Trusted)) +{} debReleaseIndex::~debReleaseIndex() { if (d != NULL) delete d; @@ -225,9 +231,9 @@ void debReleaseIndex::AddComponent(bool const isSrc, std::string const &Name,/*{ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const/*{{{*/ { indexRecords * const iR = new indexRecords(Dist); - if (Trusted == ALWAYS_TRUSTED) + if (d->Trusted == TRI_YES) iR->SetTrusted(true); - else if (Trusted == NEVER_TRUSTED) + else if (d->Trusted == TRI_NO) iR->SetTrusted(false); // special case for --print-uris @@ -246,19 +252,21 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const/*{ return true; } /*}}}*/ -// ReleaseIndex::*Trusted setters and checkers /*{{{*/ -void debReleaseIndex::SetTrusted(bool const Trusted) +// ReleaseIndex::IsTrusted /*{{{*/ +bool debReleaseIndex::SetTrusted(TriState const Trusted) { - if (Trusted == true) - this->Trusted = ALWAYS_TRUSTED; - else - this->Trusted = NEVER_TRUSTED; + if (d->Trusted == TRI_UNSET) + d->Trusted = Trusted; + else if (d->Trusted != Trusted) + // TRANSLATOR: The first is an option name from sources.list manpage, the other two URI and Suite + return _error->Error(_("Conflicting values set for option %s concerning source %s %s"), "Trusted", URI.c_str(), Dist.c_str()); + return true; } bool debReleaseIndex::IsTrusted() const { - if (Trusted == ALWAYS_TRUSTED) + if (d->Trusted == TRI_YES) return true; - else if (Trusted == NEVER_TRUSTED) + else if (d->Trusted == TRI_NO) return false; @@ -476,7 +484,12 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ std::map::const_iterator const trusted = Options.find("trusted"); if (trusted != Options.end()) - Deb->SetTrusted(StringToBool(trusted->second, false)); + { + if (Deb->SetTrusted(StringToBool(trusted->second, false) ? debReleaseIndex::TRI_YES : debReleaseIndex::TRI_NO) == false) + return false; + } + else if (Deb->SetTrusted(debReleaseIndex::TRI_DONTCARE) == false) + return false; return true; } diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 9b60b6137..a6db4e287 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -27,8 +27,6 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { debReleaseIndexPrivate * const d; - enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; - public: APT_HIDDEN std::string MetaIndexInfo(const char *Type) const; @@ -51,7 +49,11 @@ class APT_HIDDEN debReleaseIndex : public metaIndex virtual std::vector *GetIndexFiles(); - void SetTrusted(bool const Trusted); + enum APT_HIDDEN TriState { + TRI_YES, TRI_DONTCARE, TRI_NO, TRI_UNSET + }; + bool SetTrusted(TriState const Trusted); + virtual bool IsTrusted() const; void AddComponent(bool const isSrc, std::string const &Name, diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index d96349974..0c88ee9cd 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -41,7 +41,7 @@ bool metaIndex::Merge(pkgCacheGenerator &Gen,OpProgress *) const metaIndex::metaIndex(std::string const &URI, std::string const &Dist, char const * const Type) -: d(NULL), Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false) +: d(NULL), Indexes(NULL), Type(Type), URI(URI), Dist(Dist) { /* nothing */ } diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 1bcec1c4a..9667e1c92 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -34,7 +34,6 @@ class metaIndex const char *Type; std::string URI; std::string Dist; - bool Trusted; public: diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index 8506017ad..f87dcda23 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -223,7 +223,15 @@ deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [. source. If not specified, the default set is defined by the APT::Acquire::Targets configuration scope. + + + Further more, there are options which if set effect + all sources with the same URI and Suite, so they + have to be set on all such entries and can not be varied between + different components. APT will try to detect and error out on such + anomalies. + Trusted (trusted) is a tri-state value which defaults to APT deciding if a source is considered trusted or if warnings should be raised before e.g. diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index 1ff0f1d8d..c515837a3 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -18,7 +18,7 @@ aptgetupdate() { PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)" DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)" PKGTEXT="$(echo "$PKGTEXT" | head -n 7)" -DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list' +DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-*.list' testsuccessequal "$PKGTEXT $DOWNLOG @@ -28,7 +28,7 @@ testsuccessequal "$PKGTEXT $DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated -sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE +sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=no] #' $DEBFILE aptgetupdate 'testsuccess' testfailureequal "$PKGTEXT @@ -38,7 +38,7 @@ Install these packages without verification? [y/N] N E: Some packages could not be authenticated" aptget install cool --assume-no -d find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete -sed -i -e 's#deb \[trusted=no\]#deb#' $DEBFILE +sed -i -e 's#\(deb\(-src\)\?\) \[trusted=no\] #\1 #' $DEBFILE aptgetupdate testfailureequal "$PKGTEXT @@ -54,7 +54,7 @@ Authentication warning overridden. $DOWNLOG Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated -sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE +sed -i -e 's#\(deb\(-src\)\?\) #\1 [trusted=yes] #' $DEBFILE aptgetupdate testsuccessequal "$PKGTEXT diff --git a/test/integration/test-sourceslist-trusted-options b/test/integration/test-sourceslist-trusted-options index 5fe4933ce..86036e242 100755 --- a/test/integration/test-sourceslist-trusted-options +++ b/test/integration/test-sourceslist-trusted-options @@ -199,3 +199,20 @@ insecureaptgetupdate everythingfails everythingfails -t stable everythingfails -t testing + +msgmsg 'Test conflicting trusted options are refused' +testsource() { + echo "$@" > rootdir/etc/apt/sources.list.d/example.list + testfailuremsg 'E: Conflicting values set for option Trusted concerning source http://example.org/bad/ unstable +E: The list of sources could not be read.' aptget update --print-uris +} +for VAL in 'yes' 'no'; do + testsource "deb http://example.org/bad unstable main +deb [trusted=${VAL}] http://example.org/bad unstable non-free" + testsource "deb [trusted=${VAL}] http://example.org/bad unstable main +deb http://example.org/bad unstable non-free" +done +testsource 'deb [trusted=yes] http://example.org/bad unstable main +deb [trusted=no] http://example.org/bad unstable non-free' +testsource 'deb [trusted=no] http://example.org/bad unstable main +deb [trusted=yes] http://example.org/bad unstable non-free' -- cgit v1.2.3 From 5ad0096a4e19e191b59634e8a8817995ec4045ad Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 23 Jun 2015 15:16:08 +0200 Subject: merge indexRecords into metaIndex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit indexRecords was used to parse the Release file – mostly the hashes – while metaIndex deals with downloading the Release file, storing all indexes coming from this release and … parsing the Release file, but this time mostly for the other fields. That wasn't a problem in metaIndex as this was done in the type specific subclass, but indexRecords while allowing to override the parsing method did expect by default a specific format. APT isn't really supporting different types at the moment, but this is a violation of the abstraction we have everywhere else and, which is the actual reason for this merge: Options e.g. coming from the sources.list come to metaIndex naturally, which needs to wrap them up and bring them into indexRecords, so the acquire system is told about it as they don't get to see the metaIndex, but they don't really belong in indexRecords as this is just for storing data loaded from the Release file… the result is a complete mess. I am not saying it is a lot prettier after the merge, but at least adding new options is now slightly easier and there is just one place responsible for parsing the Release file. That can't hurt. --- apt-pkg/acquire-item.cc | 113 +++++++------- apt-pkg/acquire-item.h | 9 +- apt-pkg/deb/debmetaindex.cc | 231 +++++++++++++++++++++++----- apt-pkg/deb/debmetaindex.h | 29 ++-- apt-pkg/indexcopy.cc | 18 ++- apt-pkg/indexcopy.h | 4 +- apt-pkg/indexrecords.cc | 284 ----------------------------------- apt-pkg/indexrecords.h | 88 ----------- apt-pkg/metaindex.cc | 76 ++++++++-- apt-pkg/metaindex.h | 66 ++++++-- apt-pkg/sourcelist.cc | 1 + cmdline/apt-get.cc | 35 ++--- test/integration/test-apt-cli-update | 4 +- 13 files changed, 423 insertions(+), 535 deletions(-) delete mode 100644 apt-pkg/indexrecords.cc delete mode 100644 apt-pkg/indexrecords.h diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 0ab52a0cd..100199bc1 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -109,9 +109,9 @@ static std::string GetDiffsPatchFileName(std::string const &Final) /*{{{*/ } /*}}}*/ -static bool AllowInsecureRepositories(indexRecords const * const MetaIndexParser, pkgAcqMetaClearSig * const TransactionManager, pkgAcquire::Item * const I) /*{{{*/ +static bool AllowInsecureRepositories(metaIndex const * const MetaIndexParser, pkgAcqMetaClearSig * const TransactionManager, pkgAcquire::Item * const I) /*{{{*/ { - if(MetaIndexParser->IsAlwaysTrusted() || _config->FindB("Acquire::AllowInsecureRepositories") == true) + if(MetaIndexParser->GetTrusted() == metaIndex::TRI_YES || _config->FindB("Acquire::AllowInsecureRepositories") == true) return true; _error->Error(_("Use --allow-insecure-repositories to force the update")); @@ -120,11 +120,11 @@ static bool AllowInsecureRepositories(indexRecords const * const MetaIndexParser return false; } /*}}}*/ -static HashStringList GetExpectedHashesFromFor(indexRecords * const Parser, std::string const &MetaKey)/*{{{*/ +static HashStringList GetExpectedHashesFromFor(metaIndex * const Parser, std::string const &MetaKey)/*{{{*/ { if (Parser == NULL) return HashStringList(); - indexRecords::checkSum * const R = Parser->Lookup(MetaKey); + metaIndex::checkSum * const R = Parser->Lookup(MetaKey); if (R == NULL) return HashStringList(); return R->Hashes; @@ -144,7 +144,8 @@ APT_CONST bool pkgAcqTransactionItem::HashesRequired() const we can at least trust them for integrity of the download itself. Only repositories without a Release file can (obviously) not have hashes – and they are very uncommon and strongly discouraged */ - return TransactionManager->MetaIndexParser != NULL; + return TransactionManager->MetaIndexParser != NULL && + TransactionManager->MetaIndexParser->GetLoadedSuccessfully() != metaIndex::TRI_UNSET; } HashStringList pkgAcqTransactionItem::GetExpectedHashes() const { @@ -900,26 +901,28 @@ bool pkgAcqMetaBase::CheckAuthDone(string const &Message) /*{{{*/ } if (RealFileExists(FinalInRelease) || RealFileExists(FinalRelease)) { - TransactionManager->LastMetaIndexParser = new indexRecords; - _error->PushToStack(); - if (RealFileExists(FinalInRelease)) - TransactionManager->LastMetaIndexParser->Load(FinalInRelease); - else - TransactionManager->LastMetaIndexParser->Load(FinalRelease); - // its unlikely to happen, but if what we have is bad ignore it - if (_error->PendingError()) + TransactionManager->LastMetaIndexParser = TransactionManager->MetaIndexParser->UnloadedClone(); + if (TransactionManager->LastMetaIndexParser != NULL) { - delete TransactionManager->LastMetaIndexParser; - TransactionManager->LastMetaIndexParser = NULL; + _error->PushToStack(); + if (RealFileExists(FinalInRelease)) + TransactionManager->LastMetaIndexParser->Load(FinalInRelease, NULL); + else + TransactionManager->LastMetaIndexParser->Load(FinalRelease, NULL); + // its unlikely to happen, but if what we have is bad ignore it + if (_error->PendingError()) + { + delete TransactionManager->LastMetaIndexParser; + TransactionManager->LastMetaIndexParser = NULL; + } + _error->RevertToStack(); } - _error->RevertToStack(); } } - if (TransactionManager->MetaIndexParser->Load(DestFile) == false) + if (TransactionManager->MetaIndexParser->Load(DestFile, &ErrorText) == false) { Status = StatAuthError; - ErrorText = TransactionManager->MetaIndexParser->ErrorText; return false; } @@ -1065,14 +1068,16 @@ bool pkgAcqMetaBase::VerifyVendor(string const &Message) /*{{{*/ TransactionManager->IMSHit = true; unlink(DestFile.c_str()); PartialFile = DestFile = GetFinalFilename(); - delete TransactionManager->MetaIndexParser; - TransactionManager->MetaIndexParser = TransactionManager->LastMetaIndexParser; + // load the 'old' file in the 'new' one instead of flipping pointers as + // the new one isn't owned by us, while the old one is so cleanup would be confused. + TransactionManager->MetaIndexParser->swapLoad(TransactionManager->LastMetaIndexParser); + delete TransactionManager->LastMetaIndexParser; TransactionManager->LastMetaIndexParser = NULL; } if (_config->FindB("Debug::pkgAcquire::Auth", false)) { - std::cerr << "Got Codename: " << TransactionManager->MetaIndexParser->GetDist() << std::endl; + std::cerr << "Got Codename: " << TransactionManager->MetaIndexParser->GetCodename() << std::endl; std::cerr << "Expecting Dist: " << TransactionManager->MetaIndexParser->GetExpectedDist() << std::endl; std::cerr << "Transformed Dist: " << Transformed << std::endl; } @@ -1083,14 +1088,14 @@ bool pkgAcqMetaBase::VerifyVendor(string const &Message) /*{{{*/ // Status = StatAuthError; // ErrorText = "Conflicting distribution; expected " // + MetaIndexParser->GetExpectedDist() + " but got " -// + MetaIndexParser->GetDist(); +// + MetaIndexParser->GetCodename(); // return false; if (!Transformed.empty()) { _error->Warning(_("Conflicting distribution: %s (expected %s but got %s)"), Desc.Description.c_str(), Transformed.c_str(), - TransactionManager->MetaIndexParser->GetDist().c_str()); + TransactionManager->MetaIndexParser->GetCodename().c_str()); } } @@ -1105,7 +1110,7 @@ pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/ IndexTarget const &ClearsignedTarget, IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget, std::vector const &IndexTargets, - indexRecords * const MetaIndexParser) : + metaIndex * const MetaIndexParser) : pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets), d(NULL), ClearsignedTarget(ClearsignedTarget), DetachedDataTarget(DetachedDataTarget), @@ -1118,8 +1123,6 @@ pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/ /*}}}*/ pkgAcqMetaClearSig::~pkgAcqMetaClearSig() /*{{{*/ { - if (MetaIndexParser != NULL) - delete MetaIndexParser; if (LastMetaIndexParser != NULL) delete LastMetaIndexParser; } @@ -1218,25 +1221,28 @@ void pkgAcqMetaClearSig::Failed(string const &Message,pkgAcquire::MethodConfig c // open the last Release if we have it if (TransactionManager->IMSHit == false) { - TransactionManager->LastMetaIndexParser = new indexRecords; - _error->PushToStack(); - if (RealFileExists(FinalInRelease)) - TransactionManager->LastMetaIndexParser->Load(FinalInRelease); - else - TransactionManager->LastMetaIndexParser->Load(FinalRelease); - // its unlikely to happen, but if what we have is bad ignore it - if (_error->PendingError()) + TransactionManager->LastMetaIndexParser = TransactionManager->MetaIndexParser->UnloadedClone(); + if (TransactionManager->LastMetaIndexParser != NULL) { - delete TransactionManager->LastMetaIndexParser; - TransactionManager->LastMetaIndexParser = NULL; + _error->PushToStack(); + if (RealFileExists(FinalInRelease)) + TransactionManager->LastMetaIndexParser->Load(FinalInRelease, NULL); + else + TransactionManager->LastMetaIndexParser->Load(FinalRelease, NULL); + // its unlikely to happen, but if what we have is bad ignore it + if (_error->PendingError()) + { + delete TransactionManager->LastMetaIndexParser; + TransactionManager->LastMetaIndexParser = NULL; + } + _error->RevertToStack(); } - _error->RevertToStack(); } } // we parse the indexes here because at this point the user wanted // a repository that may potentially harm him - if (TransactionManager->MetaIndexParser->Load(PartialRelease) == false || VerifyVendor(Message) == false) + if (TransactionManager->MetaIndexParser->Load(PartialRelease, &ErrorText) == false || VerifyVendor(Message) == false) /* expired Release files are still a problem you need extra force for */; else QueueIndexes(true); @@ -1303,8 +1309,6 @@ void pkgAcqMetaIndex::Failed(string const &Message, { // ensure old Release files are removed TransactionManager->TransactionStageRemoval(this, GetFinalFilename()); - delete TransactionManager->MetaIndexParser; - TransactionManager->MetaIndexParser = NULL; // queue without any kind of hashsum support QueueIndexes(false); @@ -1453,25 +1457,28 @@ void pkgAcqMetaSig::Failed(string const &Message,pkgAcquire::MethodConfig const // open the last Release if we have it if (TransactionManager->IMSHit == false) { - TransactionManager->LastMetaIndexParser = new indexRecords; - _error->PushToStack(); - if (RealFileExists(FinalInRelease)) - TransactionManager->LastMetaIndexParser->Load(FinalInRelease); - else - TransactionManager->LastMetaIndexParser->Load(FinalRelease); - // its unlikely to happen, but if what we have is bad ignore it - if (_error->PendingError()) + TransactionManager->LastMetaIndexParser = TransactionManager->MetaIndexParser->UnloadedClone(); + if (TransactionManager->LastMetaIndexParser != NULL) { - delete TransactionManager->LastMetaIndexParser; - TransactionManager->LastMetaIndexParser = NULL; + _error->PushToStack(); + if (RealFileExists(FinalInRelease)) + TransactionManager->LastMetaIndexParser->Load(FinalInRelease, NULL); + else + TransactionManager->LastMetaIndexParser->Load(FinalRelease, NULL); + // its unlikely to happen, but if what we have is bad ignore it + if (_error->PendingError()) + { + delete TransactionManager->LastMetaIndexParser; + TransactionManager->LastMetaIndexParser = NULL; + } + _error->RevertToStack(); } - _error->RevertToStack(); } } // we parse the indexes here because at this point the user wanted // a repository that may potentially harm him - if (TransactionManager->MetaIndexParser->Load(MetaIndex->DestFile) == false || MetaIndex->VerifyVendor(Message) == false) + if (TransactionManager->MetaIndexParser->Load(MetaIndex->DestFile, &ErrorText) == false || MetaIndex->VerifyVendor(Message) == false) /* expired Release files are still a problem you need extra force for */; else MetaIndex->QueueIndexes(true); diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 4d235dce2..10ece76c9 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -34,7 +34,6 @@ #include #include #include -#include #endif /** \addtogroup acquire @@ -43,11 +42,11 @@ * \file acquire-item.h */ -class indexRecords; class pkgRecords; class pkgSourceList; class pkgAcqMetaClearSig; class pkgAcqIndexMergeDiffs; +class metaIndex; class pkgAcquire::Item : public WeakPointable /*{{{*/ /** \brief Represents the process by which a pkgAcquire object should @@ -559,8 +558,8 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex public: /** \brief A package-system-specific parser for the meta-index file. */ - indexRecords *MetaIndexParser; - indexRecords *LastMetaIndexParser; + metaIndex *MetaIndexParser; + metaIndex *LastMetaIndexParser; virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); virtual std::string Custom600Headers() const; @@ -573,7 +572,7 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget, std::vector const &IndexTargets, - indexRecords * const MetaIndexParser); + metaIndex * const MetaIndexParser); virtual ~pkgAcqMetaClearSig(); }; /*}}}*/ diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 1f725ba05..f0b859eb4 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -45,10 +44,7 @@ class APT_HIDDEN debReleaseIndexPrivate /*{{{*/ std::vector DebEntries; std::vector DebSrcEntries; - debReleaseIndex::TriState Trusted; - - debReleaseIndexPrivate() : Trusted(debReleaseIndex::TRI_UNSET) {} - debReleaseIndexPrivate(bool const pTrusted) : Trusted(pTrusted ? debReleaseIndex::TRI_YES : debReleaseIndex::TRI_NO) {} + debReleaseIndexPrivate() {} }; /*}}}*/ // ReleaseIndex::MetaIndex* - display helpers /*{{{*/ @@ -92,27 +88,15 @@ std::string debReleaseIndex::MetaIndexURI(const char *Type) const return Res; } /*}}}*/ -std::string debReleaseIndex::LocalFileName() const /*{{{*/ -{ - // see if we have a InRelease file - std::string PathInRelease = MetaIndexFile("InRelease"); - if (FileExists(PathInRelease)) - return PathInRelease; - - // and if not return the normal one - if (FileExists(PathInRelease)) - return MetaIndexFile("Release"); - - return ""; -} - /*}}}*/ // ReleaseIndex Con- and Destructors /*{{{*/ debReleaseIndex::debReleaseIndex(std::string const &URI, std::string const &Dist) : metaIndex(URI, Dist, "deb"), d(new debReleaseIndexPrivate()) {} -debReleaseIndex::debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted) : - metaIndex(URI, Dist, "deb"), d(new debReleaseIndexPrivate(Trusted)) -{} +debReleaseIndex::debReleaseIndex(std::string const &URI, std::string const &Dist, bool const pTrusted) : + metaIndex(URI, Dist, "deb"), d(new debReleaseIndexPrivate()) +{ + Trusted = pTrusted ? TRI_YES : TRI_NO; +} debReleaseIndex::~debReleaseIndex() { if (d != NULL) delete d; @@ -227,22 +211,197 @@ void debReleaseIndex::AddComponent(bool const isSrc, std::string const &Name,/*{ } /*}}}*/ +bool debReleaseIndex::Load(std::string const &Filename, std::string * const ErrorText)/*{{{*/ +{ + LoadedSuccessfully = TRI_NO; + FileFd Fd; + if (OpenMaybeClearSignedFile(Filename, Fd) == false) + return false; + + pkgTagFile TagFile(&Fd, Fd.Size()); + if (_error->PendingError() == true) + { + if (ErrorText != NULL) + strprintf(*ErrorText, _("Unable to parse Release file %s"),Filename.c_str()); + return false; + } + + pkgTagSection Section; + const char *Start, *End; + if (TagFile.Step(Section) == false) + { + if (ErrorText != NULL) + strprintf(*ErrorText, _("No sections in Release file %s"), Filename.c_str()); + return false; + } + // FIXME: find better tag name + SupportsAcquireByHash = Section.FindB("Acquire-By-Hash", false); + + Suite = Section.FindS("Suite"); + Codename = Section.FindS("Codename"); + + bool FoundHashSum = false; + for (int i=0;HashString::SupportedHashes()[i] != NULL; i++) + { + if (!Section.Find(HashString::SupportedHashes()[i], Start, End)) + continue; + + std::string Name; + std::string Hash; + unsigned long long Size; + while (Start < End) + { + if (!parseSumData(Start, End, Name, Hash, Size)) + return false; + + if (Entries.find(Name) == Entries.end()) + { + metaIndex::checkSum *Sum = new metaIndex::checkSum; + Sum->MetaKeyFilename = Name; + Sum->Size = Size; + Sum->Hashes.FileSize(Size); + APT_IGNORE_DEPRECATED(Sum->Hash = HashString(HashString::SupportedHashes()[i],Hash);) + Entries[Name] = Sum; + } + Entries[Name]->Hashes.push_back(HashString(HashString::SupportedHashes()[i],Hash)); + FoundHashSum = true; + } + } + + if(FoundHashSum == false) + { + if (ErrorText != NULL) + strprintf(*ErrorText, _("No Hash entry in Release file %s"), Filename.c_str()); + return false; + } + + std::string const StrDate = Section.FindS("Date"); + if (RFC1123StrToTime(StrDate.c_str(), Date) == false) + { + if (ErrorText != NULL) + strprintf(*ErrorText, _("Invalid 'Date' entry in Release file %s"), Filename.c_str()); + return false; + } -bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const/*{{{*/ + std::string const Label = Section.FindS("Label"); + std::string const StrValidUntil = Section.FindS("Valid-Until"); + + // if we have a Valid-Until header in the Release file, use it as default + if (StrValidUntil.empty() == false) + { + if(RFC1123StrToTime(StrValidUntil.c_str(), ValidUntil) == false) + { + if (ErrorText != NULL) + strprintf(*ErrorText, _("Invalid 'Valid-Until' entry in Release file %s"), Filename.c_str()); + return false; + } + } + // get the user settings for this archive and use what expires earlier + int MaxAge = _config->FindI("Acquire::Max-ValidTime", 0); + if (Label.empty() == false) + MaxAge = _config->FindI(("Acquire::Max-ValidTime::" + Label).c_str(), MaxAge); + int MinAge = _config->FindI("Acquire::Min-ValidTime", 0); + if (Label.empty() == false) + MinAge = _config->FindI(("Acquire::Min-ValidTime::" + Label).c_str(), MinAge); + + LoadedSuccessfully = TRI_YES; + if(MaxAge == 0 && + (MinAge == 0 || ValidUntil == 0)) // No user settings, use the one from the Release file + return true; + + if (MinAge != 0 && ValidUntil != 0) { + time_t const min_date = Date + MinAge; + if (ValidUntil < min_date) + ValidUntil = min_date; + } + if (MaxAge != 0) { + time_t const max_date = Date + MaxAge; + if (ValidUntil == 0 || ValidUntil > max_date) + ValidUntil = max_date; + } + + return true; +} + /*}}}*/ +metaIndex * debReleaseIndex::UnloadedClone() const /*{{{*/ +{ + if (Trusted == TRI_NO) + return new debReleaseIndex(URI, Dist, false); + else if (Trusted == TRI_YES) + return new debReleaseIndex(URI, Dist, true); + else + return new debReleaseIndex(URI, Dist); +} + /*}}}*/ +bool debReleaseIndex::parseSumData(const char *&Start, const char *End, /*{{{*/ + std::string &Name, std::string &Hash, unsigned long long &Size) { - indexRecords * const iR = new indexRecords(Dist); - if (d->Trusted == TRI_YES) - iR->SetTrusted(true); - else if (d->Trusted == TRI_NO) - iR->SetTrusted(false); + Name = ""; + Hash = ""; + Size = 0; + /* Skip over the first blank */ + while ((*Start == '\t' || *Start == ' ' || *Start == '\n' || *Start == '\r') + && Start < End) + Start++; + if (Start >= End) + return false; - // special case for --print-uris + /* Move EntryEnd to the end of the first entry (the hash) */ + const char *EntryEnd = Start; + while ((*EntryEnd != '\t' && *EntryEnd != ' ') + && EntryEnd < End) + EntryEnd++; + if (EntryEnd == End) + return false; + + Hash.append(Start, EntryEnd-Start); + + /* Skip over intermediate blanks */ + Start = EntryEnd; + while (*Start == '\t' || *Start == ' ') + Start++; + if (Start >= End) + return false; + + EntryEnd = Start; + /* Find the end of the second entry (the size) */ + while ((*EntryEnd != '\t' && *EntryEnd != ' ' ) + && EntryEnd < End) + EntryEnd++; + if (EntryEnd == End) + return false; + + Size = strtoull (Start, NULL, 10); + + /* Skip over intermediate blanks */ + Start = EntryEnd; + while (*Start == '\t' || *Start == ' ') + Start++; + if (Start >= End) + return false; + + EntryEnd = Start; + /* Find the end of the third entry (the filename) */ + while ((*EntryEnd != '\t' && *EntryEnd != ' ' && + *EntryEnd != '\n' && *EntryEnd != '\r') + && EntryEnd < End) + EntryEnd++; + + Name.append(Start, EntryEnd-Start); + Start = EntryEnd; //prepare for the next round + return true; +} + /*}}}*/ + +bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll)/*{{{*/ +{ std::vector const targets = GetIndexTargets(); #define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X), false, std::map()) pkgAcqMetaClearSig * const TransactionManager = new pkgAcqMetaClearSig(Owner, APT_TARGET("InRelease"), APT_TARGET("Release"), APT_TARGET("Release.gpg"), - targets, iR); + targets, this); #undef APT_TARGET + // special case for --print-uris if (GetAll) { for (std::vector::const_iterator Target = targets.begin(); Target != targets.end(); ++Target) @@ -253,20 +412,20 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const/*{ } /*}}}*/ // ReleaseIndex::IsTrusted /*{{{*/ -bool debReleaseIndex::SetTrusted(TriState const Trusted) +bool debReleaseIndex::SetTrusted(TriState const pTrusted) { - if (d->Trusted == TRI_UNSET) - d->Trusted = Trusted; - else if (d->Trusted != Trusted) + if (Trusted == TRI_UNSET) + Trusted = pTrusted; + else if (Trusted != pTrusted) // TRANSLATOR: The first is an option name from sources.list manpage, the other two URI and Suite return _error->Error(_("Conflicting values set for option %s concerning source %s %s"), "Trusted", URI.c_str(), Dist.c_str()); return true; } bool debReleaseIndex::IsTrusted() const { - if (d->Trusted == TRI_YES) + if (Trusted == TRI_YES) return true; - else if (d->Trusted == TRI_NO) + else if (Trusted == TRI_NO) return false; diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index a6db4e287..19fe6806c 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -27,6 +27,8 @@ class APT_HIDDEN debReleaseIndex : public metaIndex { debReleaseIndexPrivate * const d; + APT_HIDDEN bool parseSumData(const char *&Start, const char *End, std::string &Name, + std::string &Hash, unsigned long long &Size); public: APT_HIDDEN std::string MetaIndexInfo(const char *Type) const; @@ -38,20 +40,18 @@ class APT_HIDDEN debReleaseIndex : public metaIndex virtual ~debReleaseIndex(); virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; - virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; + virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false); virtual std::vector GetIndexTargets() const; virtual std::string Describe() const; virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const; virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - virtual std::string LocalFileName() const; + virtual bool Load(std::string const &Filename, std::string * const ErrorText); + virtual metaIndex * UnloadedClone() const; virtual std::vector *GetIndexFiles(); - enum APT_HIDDEN TriState { - TRI_YES, TRI_DONTCARE, TRI_NO, TRI_UNSET - }; bool SetTrusted(TriState const Trusted); virtual bool IsTrusted() const; @@ -64,15 +64,15 @@ class APT_HIDDEN debReleaseIndex : public metaIndex class APT_HIDDEN debDebFileMetaIndex : public metaIndex { - private: - void * const d; +private: + void * const d; std::string DebFile; debDebPkgFileIndex *DebIndex; - public: +public: virtual std::string ArchiveURI(std::string const& /*File*/) const { return DebFile; } - virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) const { + virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) { return true; } virtual std::vector GetIndexTargets() const { @@ -84,6 +84,17 @@ class APT_HIDDEN debDebFileMetaIndex : public metaIndex virtual bool IsTrusted() const { return true; } + virtual bool Load(std::string const &, std::string * const ErrorText) + { + LoadedSuccessfully = TRI_NO; + if (ErrorText != NULL) + strprintf(*ErrorText, "Unparseable metaindex as it represents the standalone deb file %s", DebFile.c_str()); + return false; + } + virtual metaIndex * UnloadedClone() const + { + return NULL; + } debDebFileMetaIndex(std::string const &DebFile); virtual ~debDebFileMetaIndex(); diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 6d210e65b..f9adb2fb8 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -19,10 +19,11 @@ #include #include #include -#include +#include #include #include #include +#include #include #include @@ -476,9 +477,9 @@ bool SourceCopy::RewriteEntry(FileFd &Target, std::string const &File) } /*}}}*/ // SigVerify::Verify - Verify a files md5sum against its metaindex /*{{{*/ -bool SigVerify::Verify(string prefix, string file, indexRecords *MetaIndex) +bool SigVerify::Verify(string prefix, string file, metaIndex *MetaIndex) { - const indexRecords::checkSum *Record = MetaIndex->Lookup(file); + const metaIndex::checkSum *Record = MetaIndex->Lookup(file); bool const Debug = _config->FindB("Debug::aptcdrom",false); // we skip non-existing files in the verifcation of the Release file @@ -545,11 +546,11 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, // Read all Release files for (vector::iterator I = SigList.begin(); I != SigList.end(); ++I) - { + { if(Debug) cout << "Signature verify for: " << *I << endl; - indexRecords *MetaIndex = new indexRecords; + metaIndex *MetaIndex = new debReleaseIndex("",""); string prefix = *I; string const releasegpg = *I+"Release.gpg"; @@ -591,12 +592,13 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, } // Open the Release file and add it to the MetaIndex - if(!MetaIndex->Load(release)) + std::string ErrorText; + if(MetaIndex->Load(release, &ErrorText) == false) { - _error->Error("%s",MetaIndex->ErrorText.c_str()); + _error->Error("%s", ErrorText.c_str()); return false; } - + // go over the Indexfiles and see if they verify // if so, remove them from our copy of the lists vector keys = MetaIndex->MetaKeys(); diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index 4f4c47169..6eecad028 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -25,9 +25,9 @@ using std::vector; #endif class pkgTagSection; -class indexRecords; class pkgCdromStatus; class FileFd; +class metaIndex; class IndexCopy /*{{{*/ { @@ -106,7 +106,7 @@ class SigVerify /*{{{*/ /** \brief dpointer placeholder (for later in case we need it) */ void * const d; - APT_HIDDEN bool Verify(std::string prefix,std::string file, indexRecords *records); + APT_HIDDEN bool Verify(std::string prefix,std::string file, metaIndex *records); APT_HIDDEN bool CopyMetaIndex(std::string CDROM, std::string CDName, std::string prefix, std::string file); diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc deleted file mode 100644 index 03ba59460..000000000 --- a/apt-pkg/indexrecords.cc +++ /dev/null @@ -1,284 +0,0 @@ -// -*- mode: cpp; mode: fold -*- -// Description /*{{{*/ -// $Id: indexrecords.cc,v 1.1.2.4 2003/12/30 02:11:43 mdz Exp $ - /*}}}*/ -// Include Files /*{{{*/ -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - /*}}}*/ - -using std::string; - -APT_PURE string indexRecords::GetDist() const -{ - return this->Dist; -} - -APT_PURE string indexRecords::GetSuite() const -{ - return this->Suite; -} - -APT_PURE bool indexRecords::GetSupportsAcquireByHash() const -{ - return this->SupportsAcquireByHash; -} - -APT_PURE bool indexRecords::CheckDist(string const &MaybeDist) const -{ - return (this->Dist == MaybeDist - || this->Suite == MaybeDist); -} - -APT_PURE string indexRecords::GetExpectedDist() const -{ - return this->ExpectedDist; -} - -APT_PURE time_t indexRecords::GetValidUntil() const -{ - return this->ValidUntil; -} - -APT_PURE time_t indexRecords::GetDate() const -{ - return this->Date; -} - -APT_PURE indexRecords::checkSum *indexRecords::Lookup(string const &MetaKey) -{ - std::map::const_iterator sum = Entries.find(MetaKey); - if (sum == Entries.end()) - return NULL; - return sum->second; -} - -APT_PURE bool indexRecords::Exists(string const &MetaKey) const -{ - return Entries.find(MetaKey) != Entries.end(); -} - -bool indexRecords::Load(string const &Filename) /*{{{*/ -{ - FileFd Fd; - if (OpenMaybeClearSignedFile(Filename, Fd) == false) - return false; - - pkgTagFile TagFile(&Fd, Fd.Size()); - if (_error->PendingError() == true) - { - strprintf(ErrorText, _("Unable to parse Release file %s"),Filename.c_str()); - return false; - } - - pkgTagSection Section; - const char *Start, *End; - if (TagFile.Step(Section) == false) - { - strprintf(ErrorText, _("No sections in Release file %s"), Filename.c_str()); - return false; - } - // FIXME: find better tag name - SupportsAcquireByHash = Section.FindB("Acquire-By-Hash", false); - - Suite = Section.FindS("Suite"); - Dist = Section.FindS("Codename"); - - bool FoundHashSum = false; - for (int i=0;HashString::SupportedHashes()[i] != NULL; i++) - { - if (!Section.Find(HashString::SupportedHashes()[i], Start, End)) - continue; - - string Name; - string Hash; - unsigned long long Size; - while (Start < End) - { - if (!parseSumData(Start, End, Name, Hash, Size)) - return false; - - if (Entries.find(Name) == Entries.end()) - { - indexRecords::checkSum *Sum = new indexRecords::checkSum; - Sum->MetaKeyFilename = Name; - Sum->Size = Size; - Sum->Hashes.FileSize(Size); - APT_IGNORE_DEPRECATED(Sum->Hash = HashString(HashString::SupportedHashes()[i],Hash);) - Entries[Name] = Sum; - } - Entries[Name]->Hashes.push_back(HashString(HashString::SupportedHashes()[i],Hash)); - FoundHashSum = true; - } - } - - if(FoundHashSum == false) - { - strprintf(ErrorText, _("No Hash entry in Release file %s"), Filename.c_str()); - return false; - } - - string const StrDate = Section.FindS("Date"); - if (RFC1123StrToTime(StrDate.c_str(), Date) == false) - { - strprintf(ErrorText, _("Invalid 'Date' entry in Release file %s"), Filename.c_str()); - return false; - } - - string const Label = Section.FindS("Label"); - string const StrValidUntil = Section.FindS("Valid-Until"); - - // if we have a Valid-Until header in the Release file, use it as default - if (StrValidUntil.empty() == false) - { - if(RFC1123StrToTime(StrValidUntil.c_str(), ValidUntil) == false) - { - strprintf(ErrorText, _("Invalid 'Valid-Until' entry in Release file %s"), Filename.c_str()); - return false; - } - } - // get the user settings for this archive and use what expires earlier - int MaxAge = _config->FindI("Acquire::Max-ValidTime", 0); - if (Label.empty() == false) - MaxAge = _config->FindI(("Acquire::Max-ValidTime::" + Label).c_str(), MaxAge); - int MinAge = _config->FindI("Acquire::Min-ValidTime", 0); - if (Label.empty() == false) - MinAge = _config->FindI(("Acquire::Min-ValidTime::" + Label).c_str(), MinAge); - - if(MaxAge == 0 && - (MinAge == 0 || ValidUntil == 0)) // No user settings, use the one from the Release file - return true; - - if (MinAge != 0 && ValidUntil != 0) { - time_t const min_date = Date + MinAge; - if (ValidUntil < min_date) - ValidUntil = min_date; - } - if (MaxAge != 0) { - time_t const max_date = Date + MaxAge; - if (ValidUntil == 0 || ValidUntil > max_date) - ValidUntil = max_date; - } - - return true; -} - /*}}}*/ -std::vector indexRecords::MetaKeys() /*{{{*/ -{ - std::vector keys; - std::map::iterator I = Entries.begin(); - while(I != Entries.end()) { - keys.push_back((*I).first); - ++I; - } - return keys; -} - /*}}}*/ -bool indexRecords::parseSumData(const char *&Start, const char *End, /*{{{*/ - string &Name, string &Hash, unsigned long long &Size) -{ - Name = ""; - Hash = ""; - Size = 0; - /* Skip over the first blank */ - while ((*Start == '\t' || *Start == ' ' || *Start == '\n' || *Start == '\r') - && Start < End) - Start++; - if (Start >= End) - return false; - - /* Move EntryEnd to the end of the first entry (the hash) */ - const char *EntryEnd = Start; - while ((*EntryEnd != '\t' && *EntryEnd != ' ') - && EntryEnd < End) - EntryEnd++; - if (EntryEnd == End) - return false; - - Hash.append(Start, EntryEnd-Start); - - /* Skip over intermediate blanks */ - Start = EntryEnd; - while (*Start == '\t' || *Start == ' ') - Start++; - if (Start >= End) - return false; - - EntryEnd = Start; - /* Find the end of the second entry (the size) */ - while ((*EntryEnd != '\t' && *EntryEnd != ' ' ) - && EntryEnd < End) - EntryEnd++; - if (EntryEnd == End) - return false; - - Size = strtoull (Start, NULL, 10); - - /* Skip over intermediate blanks */ - Start = EntryEnd; - while (*Start == '\t' || *Start == ' ') - Start++; - if (Start >= End) - return false; - - EntryEnd = Start; - /* Find the end of the third entry (the filename) */ - while ((*EntryEnd != '\t' && *EntryEnd != ' ' && - *EntryEnd != '\n' && *EntryEnd != '\r') - && EntryEnd < End) - EntryEnd++; - - Name.append(Start, EntryEnd-Start); - Start = EntryEnd; //prepare for the next round - return true; -} - /*}}}*/ - -APT_PURE bool indexRecords::IsAlwaysTrusted() const -{ - if (Trusted == ALWAYS_TRUSTED) - return true; - return false; -} -APT_PURE bool indexRecords::IsNeverTrusted() const -{ - if (Trusted == NEVER_TRUSTED) - return true; - return false; -} -void indexRecords::SetTrusted(bool const Trusted) -{ - if (Trusted == true) - this->Trusted = ALWAYS_TRUSTED; - else - this->Trusted = NEVER_TRUSTED; -} - -indexRecords::indexRecords(const string &ExpectedDist) : - Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0), - SupportsAcquireByHash(false) -{ -} - -indexRecords::~indexRecords() { - for (std::map::const_iterator S = Entries.begin(); S != Entries.end(); ++S) - delete S->second; -} diff --git a/apt-pkg/indexrecords.h b/apt-pkg/indexrecords.h deleted file mode 100644 index 683247e42..000000000 --- a/apt-pkg/indexrecords.h +++ /dev/null @@ -1,88 +0,0 @@ -// -*- mode: cpp; mode: fold -*- -#ifndef PKGLIB_INDEXRECORDS_H -#define PKGLIB_INDEXRECORDS_H - -#include - -#include -#include -#include -#include - -#ifndef APT_8_CLEANER_HEADERS -#include -#endif -#ifndef APT_10_CLEANER_HEADERS -#include -#endif - -class indexRecords -{ - APT_HIDDEN bool parseSumData(const char *&Start, const char *End, std::string &Name, - std::string &Hash, unsigned long long &Size); - public: - struct checkSum; - std::string ErrorText; - - private: - enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; - // dpointer (for later) - void * const d; - - protected: - std::string Dist; - std::string Suite; - std::string ExpectedDist; - time_t Date; - time_t ValidUntil; - bool SupportsAcquireByHash; - - std::map Entries; - - public: - explicit indexRecords(const std::string &ExpectedDist = ""); - - // Lookup function - virtual checkSum *Lookup(std::string const &MetaKey); - /** \brief tests if a checksum for this file is available */ - bool Exists(std::string const &MetaKey) const; - std::vector MetaKeys(); - - virtual bool Load(std::string const &Filename); - virtual bool CheckDist(std::string const &MaybeDist) const; - - std::string GetDist() const; - std::string GetSuite() const; - bool GetSupportsAcquireByHash() const; - time_t GetValidUntil() const; - time_t GetDate() const; - std::string GetExpectedDist() const; - - /** \brief check if source is marked as always trusted */ - bool IsAlwaysTrusted() const; - /** \brief check if source is marked as never trusted */ - bool IsNeverTrusted() const; - - /** \brief sets an explicit trust value - * - * \b true means that the source should always be considered trusted, - * while \b false marks a source as always untrusted, even if we have - * a valid signature and everything. - */ - void SetTrusted(bool const Trusted); - - virtual ~indexRecords(); -}; - -APT_IGNORE_DEPRECATED_PUSH -struct indexRecords::checkSum -{ - std::string MetaKeyFilename; - HashStringList Hashes; - unsigned long long Size; - - APT_DEPRECATED HashString Hash; -}; -APT_IGNORE_DEPRECATED_POP - -#endif diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 0c88ee9cd..8bd13bb18 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -9,20 +9,6 @@ #include /*}}}*/ -#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) -std::string metaIndex::LocalFileName() const { return ""; } -#else -#include -std::string metaIndex::LocalFileName() const -{ - debReleaseIndex const * deb = dynamic_cast(this); - if (deb != NULL) - return deb->LocalFileName(); - - return ""; -} -#endif - std::string metaIndex::Describe() const { return "Release"; @@ -38,10 +24,11 @@ bool metaIndex::Merge(pkgCacheGenerator &Gen,OpProgress *) const return Gen.SelectReleaseFile("", ""); } - metaIndex::metaIndex(std::string const &URI, std::string const &Dist, char const * const Type) -: d(NULL), Indexes(NULL), Type(Type), URI(URI), Dist(Dist) +: d(NULL), Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(TRI_UNSET), + LoadedSuccessfully(TRI_UNSET), + Date(0), ValidUntil(0), SupportsAcquireByHash(false) { /* nothing */ } @@ -55,3 +42,60 @@ metaIndex::~metaIndex() delete *I; delete Indexes; } + +// one line Getters for public fields /*{{{*/ +APT_PURE std::string metaIndex::GetURI() const { return URI; } +APT_PURE std::string metaIndex::GetDist() const { return Dist; } +APT_PURE const char* metaIndex::GetType() const { return Type; } +APT_PURE metaIndex::TriState metaIndex::GetTrusted() const { return Trusted; } +APT_PURE std::string metaIndex::GetCodename() const { return Codename; } +APT_PURE std::string metaIndex::GetSuite() const { return Suite; } +APT_PURE bool metaIndex::GetSupportsAcquireByHash() const { return SupportsAcquireByHash; } +APT_PURE time_t metaIndex::GetValidUntil() const { return ValidUntil; } +APT_PURE time_t metaIndex::GetDate() const { return this->Date; } +APT_PURE metaIndex::TriState metaIndex::GetLoadedSuccessfully() const { return LoadedSuccessfully; } + +APT_PURE bool metaIndex::CheckDist(string const &MaybeDist) const +{ + return (this->Codename == MaybeDist + || this->Suite == MaybeDist); +} +APT_PURE std::string metaIndex::GetExpectedDist() const +{ + // TODO: Used to be an explicit value set in the constructor + return ""; +} + /*}}}*/ +APT_PURE metaIndex::checkSum *metaIndex::Lookup(string const &MetaKey) const /*{{{*/ +{ + std::map::const_iterator sum = Entries.find(MetaKey); + if (sum == Entries.end()) + return NULL; + return sum->second; +} + /*}}}*/ +APT_PURE bool metaIndex::Exists(string const &MetaKey) const /*{{{*/ +{ + return Entries.find(MetaKey) != Entries.end(); +} + /*}}}*/ +std::vector metaIndex::MetaKeys() const /*{{{*/ +{ + std::vector keys; + std::map::const_iterator I = Entries.begin(); + while(I != Entries.end()) { + keys.push_back((*I).first); + ++I; + } + return keys; +} + /*}}}*/ +void metaIndex::swapLoad(metaIndex * const OldMetaIndex) /*{{{*/ +{ + std::swap(Entries, OldMetaIndex->Entries); + std::swap(Date, OldMetaIndex->Date); + std::swap(ValidUntil, OldMetaIndex->ValidUntil); + std::swap(SupportsAcquireByHash, OldMetaIndex->SupportsAcquireByHash); + std::swap(LoadedSuccessfully, OldMetaIndex->LoadedSuccessfully); +} + /*}}}*/ diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 9667e1c92..5be7397ae 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -28,35 +28,81 @@ class OpProgress; class metaIndex { +public: + APT_IGNORE_DEPRECATED_PUSH + struct checkSum + { + std::string MetaKeyFilename; + HashStringList Hashes; + unsigned long long Size; + + APT_DEPRECATED HashString Hash; + }; + APT_IGNORE_DEPRECATED_POP + + enum APT_HIDDEN TriState { + TRI_YES, TRI_DONTCARE, TRI_NO, TRI_UNSET + }; +private: void * const d; - protected: +protected: std::vector *Indexes; + // parsed from the sources.list const char *Type; std::string URI; std::string Dist; + TriState Trusted; + TriState LoadedSuccessfully; - public: + // parsed from a file + std::string Suite; + std::string Codename; + time_t Date; + time_t ValidUntil; + bool SupportsAcquireByHash; + std::map Entries; +public: // Various accessors - virtual std::string GetURI() const {return URI;} - virtual std::string GetDist() const {return Dist;} - virtual const char* GetType() const {return Type;} + std::string GetURI() const; + std::string GetDist() const; + const char* GetType() const; + TriState GetTrusted() const; - // interface to to query it - /** \return the path of the local file (or "" if its not available) */ - virtual std::string LocalFileName() const; + std::string GetCodename() const; + std::string GetSuite() const; + bool GetSupportsAcquireByHash() const; + time_t GetValidUntil() const; + time_t GetDate() const; + + std::string GetExpectedDist() const; + bool CheckDist(std::string const &MaybeDist) const; // Interface for acquire + virtual std::string Describe() const; virtual std::string ArchiveURI(std::string const& File) const = 0; - virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const = 0; + virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) = 0; virtual std::vector GetIndexTargets() const = 0; virtual std::vector *GetIndexFiles() = 0; virtual bool IsTrusted() const = 0; + virtual bool Load(std::string const &Filename, std::string * const ErrorText) = 0; + /** @return a new metaIndex object based on this one, but without information from #Load */ + virtual metaIndex * UnloadedClone() const = 0; + // the given metaIndex is potentially invalid after this call and should be deleted + void swapLoad(metaIndex * const OldMetaIndex); - virtual std::string Describe() const; + // Lookup functions for parsed Hashes + checkSum *Lookup(std::string const &MetaKey) const; + /** \brief tests if a checksum for this file is available */ + bool Exists(std::string const &MetaKey) const; + std::vector MetaKeys() const; + TriState GetLoadedSuccessfully() const; + + // Interfaces for pkgCacheGen virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const; virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; + metaIndex(std::string const &URI, std::string const &Dist, char const * const Type); virtual ~metaIndex(); diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 69f7ac043..0502f0e1d 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -103,6 +103,7 @@ bool pkgSourceList::Type::ParseStanza(vector &List, /*{{{*/ APT_PLUSMINUS("Targets", "target"); #undef APT_PLUSMINUS mapping.insert(std::make_pair("Trusted", "trusted")); + for (std::map::const_iterator m = mapping.begin(); m != mapping.end(); ++m) if (Tags.Exists(m->first)) { diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 500a0a3c5..10d4b3cc5 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -137,11 +137,9 @@ static bool TryToInstallBuildDep(pkgCache::PkgIterator Pkg,pkgCacheFile &Cache, return true; } /*}}}*/ -// GetReleaseForSourceRecord - Return Suite for the given srcrecord /*{{{*/ -// --------------------------------------------------------------------- -/* */ -static std::string GetReleaseForSourceRecord(pkgSourceList *SrcList, - pkgSrcRecords::Parser *Parse) +// GetReleaseFileForSourceRecord - Return Suite for the given srcrecord /*{{{*/ +static pkgCache::RlsFileIterator GetReleaseFileForSourceRecord(CacheFile &CacheFile, + pkgSourceList *SrcList, pkgSrcRecords::Parser *Parse) { // try to find release const pkgIndexFile& CurrentIndexFile = Parse->Index(); @@ -154,18 +152,10 @@ static std::string GetReleaseForSourceRecord(pkgSourceList *SrcList, IF != Indexes->end(); ++IF) { if (&CurrentIndexFile == (*IF)) - { - std::string const path = (*S)->LocalFileName(); - if (path != "") - { - indexRecords records; - records.Load(path); - return records.GetSuite(); - } - } + return (*S)->FindInCache(CacheFile, false); } } - return ""; + return pkgCache::RlsFileIterator(CacheFile); } /*}}}*/ // FindSrc - Find a source record /*{{{*/ @@ -379,13 +369,16 @@ static pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, // See if we need to look for a specific release tag if (RelTag != "" && UserRequestedVerTag == "") { - const string Rel = GetReleaseForSourceRecord(SrcList, Parse); - - if (Rel == RelTag) + pkgCache::RlsFileIterator const Rls = GetReleaseFileForSourceRecord(CacheFile, SrcList, Parse); + if (Rls.end() == false) { - Last = Parse; - Offset = Parse->Offset(); - Version = Ver; + if ((Rls->Archive != 0 && RelTag == Rls.Archive()) || + (Rls->Codename != 0 && RelTag == Rls.Codename())) + { + Last = Parse; + Offset = Parse->Offset(); + Version = Ver; + } } } diff --git a/test/integration/test-apt-cli-update b/test/integration/test-apt-cli-update index d68ab25e4..dad365f7e 100755 --- a/test/integration/test-apt-cli-update +++ b/test/integration/test-apt-cli-update @@ -13,9 +13,7 @@ insertinstalledpackage 'foo' 'all' '1.0' setupaptarchive --no-update -APTARCHIVE=$(readlink -f ./aptarchive) - -testfailureequal 'E: The update command takes no arguments' apt update -q arguments +testfailuremsg 'E: The update command takes no arguments' apt update arguments testsuccessequal "1 package can be upgraded. Run 'apt list --upgradable' to see it." apt update -q -- cgit v1.2.3 From 0741daeb7ab870b4dd62a93fa12a1cf6330f9a72 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 23 Jun 2015 17:26:57 +0200 Subject: add sources.list Check-Valid-Until and Valid-Until-{Max,Min} options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These options could be set via configuration before, but the connection to the actual sources is so strong that they should really be set in the sources.list instead – especially as this can be done a lot more specific rather than e.g. disabling Valid-Until for all sources at once. Valid-Until-* names are chosen instead of the Min/Max-ValidTime as this seems like a better name and their use in the wild is probably low enough that this isn't going to confuse anyone if we have to names for the same thing in different areas. In the longrun, the config options should be removed, but for now documentation hinting at the new options is good enough as these are the kind of options you set once across many systems with different apt versions, so the new way should work everywhere first before we deprecate the old way. --- apt-pkg/acquire-item.cc | 4 +- apt-pkg/deb/debmetaindex.cc | 134 ++++++++++++++++++-------- apt-pkg/deb/debmetaindex.h | 3 + apt-pkg/sourcelist.cc | 3 + doc/apt-get.8.xml | 10 +- doc/apt.conf.5.xml | 8 +- doc/sources.list.5.xml | 55 +++++++++-- test/integration/test-releasefile-valid-until | 9 ++ 8 files changed, 170 insertions(+), 56 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 100199bc1..a30a5d154 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1041,8 +1041,8 @@ bool pkgAcqMetaBase::VerifyVendor(string const &Message) /*{{{*/ Transformed = ""; } - if (_config->FindB("Acquire::Check-Valid-Until", true) == true && - TransactionManager->MetaIndexParser->GetValidUntil() > 0) { + if (TransactionManager->MetaIndexParser->GetValidUntil() > 0) + { time_t const invalid_since = time(NULL) - TransactionManager->MetaIndexParser->GetValidUntil(); if (invalid_since > 0) { diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index f0b859eb4..5d7e539c7 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -44,7 +44,11 @@ class APT_HIDDEN debReleaseIndexPrivate /*{{{*/ std::vector DebEntries; std::vector DebSrcEntries; - debReleaseIndexPrivate() {} + metaIndex::TriState CheckValidUntil; + time_t ValidUntilMin; + time_t ValidUntilMax; + + debReleaseIndexPrivate() : CheckValidUntil(metaIndex::TRI_UNSET), ValidUntilMin(0), ValidUntilMax(0) {} }; /*}}}*/ // ReleaseIndex::MetaIndex* - display helpers /*{{{*/ @@ -283,43 +287,56 @@ bool debReleaseIndex::Load(std::string const &Filename, std::string * const Erro return false; } - std::string const Label = Section.FindS("Label"); - std::string const StrValidUntil = Section.FindS("Valid-Until"); + bool CheckValidUntil = _config->FindB("Acquire::Check-Valid-Until", true); + if (d->CheckValidUntil == metaIndex::TRI_NO) + CheckValidUntil = false; + else if (d->CheckValidUntil == metaIndex::TRI_YES) + CheckValidUntil = true; - // if we have a Valid-Until header in the Release file, use it as default - if (StrValidUntil.empty() == false) + if (CheckValidUntil == true) { - if(RFC1123StrToTime(StrValidUntil.c_str(), ValidUntil) == false) + std::string const Label = Section.FindS("Label"); + std::string const StrValidUntil = Section.FindS("Valid-Until"); + + // if we have a Valid-Until header in the Release file, use it as default + if (StrValidUntil.empty() == false) { - if (ErrorText != NULL) - strprintf(*ErrorText, _("Invalid 'Valid-Until' entry in Release file %s"), Filename.c_str()); - return false; + if(RFC1123StrToTime(StrValidUntil.c_str(), ValidUntil) == false) + { + if (ErrorText != NULL) + strprintf(*ErrorText, _("Invalid 'Valid-Until' entry in Release file %s"), Filename.c_str()); + return false; + } + } + // get the user settings for this archive and use what expires earlier + time_t MaxAge = d->ValidUntilMax; + if (MaxAge == 0) + { + MaxAge = _config->FindI("Acquire::Max-ValidTime", 0); + if (Label.empty() == false) + MaxAge = _config->FindI(("Acquire::Max-ValidTime::" + Label).c_str(), MaxAge); + } + time_t MinAge = d->ValidUntilMin; + if (MinAge == 0) + { + MinAge = _config->FindI("Acquire::Min-ValidTime", 0); + if (Label.empty() == false) + MinAge = _config->FindI(("Acquire::Min-ValidTime::" + Label).c_str(), MinAge); } - } - // get the user settings for this archive and use what expires earlier - int MaxAge = _config->FindI("Acquire::Max-ValidTime", 0); - if (Label.empty() == false) - MaxAge = _config->FindI(("Acquire::Max-ValidTime::" + Label).c_str(), MaxAge); - int MinAge = _config->FindI("Acquire::Min-ValidTime", 0); - if (Label.empty() == false) - MinAge = _config->FindI(("Acquire::Min-ValidTime::" + Label).c_str(), MinAge); - - LoadedSuccessfully = TRI_YES; - if(MaxAge == 0 && - (MinAge == 0 || ValidUntil == 0)) // No user settings, use the one from the Release file - return true; - if (MinAge != 0 && ValidUntil != 0) { - time_t const min_date = Date + MinAge; - if (ValidUntil < min_date) - ValidUntil = min_date; - } - if (MaxAge != 0) { - time_t const max_date = Date + MaxAge; - if (ValidUntil == 0 || ValidUntil > max_date) - ValidUntil = max_date; + if (MinAge != 0 && ValidUntil != 0) { + time_t const min_date = Date + MinAge; + if (ValidUntil < min_date) + ValidUntil = min_date; + } + if (MaxAge != 0) { + time_t const max_date = Date + MaxAge; + if (ValidUntil == 0 || ValidUntil > max_date) + ValidUntil = max_date; + } } + LoadedSuccessfully = TRI_YES; return true; } /*}}}*/ @@ -411,7 +428,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll)/*{{{*/ return true; } /*}}}*/ -// ReleaseIndex::IsTrusted /*{{{*/ +// ReleaseIndex::Set* TriState options /*{{{*/ bool debReleaseIndex::SetTrusted(TriState const pTrusted) { if (Trusted == TRI_UNSET) @@ -421,6 +438,32 @@ bool debReleaseIndex::SetTrusted(TriState const pTrusted) return _error->Error(_("Conflicting values set for option %s concerning source %s %s"), "Trusted", URI.c_str(), Dist.c_str()); return true; } +bool debReleaseIndex::SetCheckValidUntil(TriState const pCheckValidUntil) +{ + if (d->CheckValidUntil == TRI_UNSET) + d->CheckValidUntil = pCheckValidUntil; + else if (d->CheckValidUntil != pCheckValidUntil) + return _error->Error(_("Conflicting values set for option %s concerning source %s %s"), "Check-Valid-Until", URI.c_str(), Dist.c_str()); + return true; +} +bool debReleaseIndex::SetValidUntilMin(time_t const Valid) +{ + if (d->ValidUntilMin == 0) + d->ValidUntilMin = Valid; + else if (d->ValidUntilMin != Valid) + return _error->Error(_("Conflicting values set for option %s concerning source %s %s"), "Min-ValidTime", URI.c_str(), Dist.c_str()); + return true; +} +bool debReleaseIndex::SetValidUntilMax(time_t const Valid) +{ + if (d->ValidUntilMax == 0) + d->ValidUntilMax = Valid; + else if (d->ValidUntilMax != Valid) + return _error->Error(_("Conflicting values set for option %s concerning source %s %s"), "Max-ValidTime", URI.c_str(), Dist.c_str()); + return true; +} + /*}}}*/ +// ReleaseIndex::IsTrusted /*{{{*/ bool debReleaseIndex::IsTrusted() const { if (Trusted == TRI_YES) @@ -601,6 +644,22 @@ static std::vector parsePlusMinusOptions(std::string const &Name, / /*}}}*/ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ { + metaIndex::TriState GetTriStateOption(std::mapconst &Options, char const * const name) const + { + std::map::const_iterator const opt = Options.find(name); + if (opt != Options.end()) + return StringToBool(opt->second, false) ? metaIndex::TRI_YES : metaIndex::TRI_NO; + return metaIndex::TRI_DONTCARE; + } + + time_t GetTimeOption(std::mapconst &Options, char const * const name) const + { + std::map::const_iterator const opt = Options.find(name); + if (opt == Options.end()) + return 0; + return strtoull(opt->second.c_str(), NULL, 10); + } + protected: bool CreateItemInternal(std::vector &List, std::string const &URI, @@ -641,13 +700,10 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ parsePlusMinusOptions("lang", Options, APT::Configuration::getLanguages(true)) ); - std::map::const_iterator const trusted = Options.find("trusted"); - if (trusted != Options.end()) - { - if (Deb->SetTrusted(StringToBool(trusted->second, false) ? debReleaseIndex::TRI_YES : debReleaseIndex::TRI_NO) == false) - return false; - } - else if (Deb->SetTrusted(debReleaseIndex::TRI_DONTCARE) == false) + if (Deb->SetTrusted(GetTriStateOption(Options, "trusted")) == false || + Deb->SetCheckValidUntil(GetTriStateOption(Options, "check-valid-until")) == false || + Deb->SetValidUntilMax(GetTimeOption(Options, "valid-until-max")) == false || + Deb->SetValidUntilMin(GetTimeOption(Options, "valid-until-min")) == false) return false; return true; diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 19fe6806c..879eb3bfc 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -53,6 +53,9 @@ class APT_HIDDEN debReleaseIndex : public metaIndex virtual std::vector *GetIndexFiles(); bool SetTrusted(TriState const Trusted); + bool SetCheckValidUntil(TriState const Trusted); + bool SetValidUntilMin(time_t const Valid); + bool SetValidUntilMax(time_t const Valid); virtual bool IsTrusted() const; diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 0502f0e1d..0d65558ed 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -103,6 +103,9 @@ bool pkgSourceList::Type::ParseStanza(vector &List, /*{{{*/ APT_PLUSMINUS("Targets", "target"); #undef APT_PLUSMINUS mapping.insert(std::make_pair("Trusted", "trusted")); + mapping.insert(std::make_pair("Check-Valid-Until", "check-valid-until")); + mapping.insert(std::make_pair("Valid-Until-Min", "valid-until-min")); + mapping.insert(std::make_pair("Valid-Until-Max", "valid-until-max")); for (std::map::const_iterator m = mapping.begin(); m != mapping.end(); ++m) if (Tags.Exists(m->first)) diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index 5b6788ed4..b0fe390df 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -531,9 +531,13 @@ - Ignore if packages can't be authenticated and don't prompt about it. - This is useful for tools like pbuilder. - Configuration Item: APT::Get::AllowUnauthenticated. + Ignore if packages can't be authenticated and don't prompt + about it. This can be useful while working with local repositories, + but is a huge security risk if data authenticity isn't ensured in + another way by the user itself. The usage of the + option for &sources-list; entries should + usually be preferred over this global override. Configuration Item: + APT::Get::AllowUnauthenticated. diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 7d5f7e9b3..103d0622c 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -301,6 +301,8 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; Valid-Until header, but if they don't or a stricter value is desired the Max-ValidTime option below can be used. + The option of &sources-list; entries should be + preferred to disable the check selectively instead of using this global override. @@ -312,7 +314,8 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; the earlier date of the two is used as the expiration date. The default value is 0 which stands for "valid forever". Archive specific settings can be made by appending the label of the archive - to the option name. + to the option name. Preferably, the same can be achieved for specific + &sources-list; entries by using the option there. @@ -324,7 +327,8 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; frequently updated archive with a Valid-Until header instead of completely disabling the expiration date checking. Archive specific settings can and should be used by appending the label of - the archive to the option name. + the archive to the option name. Preferably, the same can be achieved for specific + &sources-list; entries by using the option there. diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index f87dcda23..aded8ecef 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -202,26 +202,26 @@ deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [. APT versions. - Architectures - (arch) is a multivalue option defining for + + () is a multivalue option defining for which architectures information should be downloaded. If this option isn't set the default is all architectures as defined by - the APT::Architectures config option. + the config option. - Languages - (lang) is a multivalue option defining for + + () is a multivalue option defining for which languages information like translated package descriptions should be downloaded. If this option isn't set the default is all languages as defined by the - Acquire::Languages config option. + config option. - Targets - (target) is a multivalue option defining + + () is a multivalue option defining which download targets apt will try to acquire from this source. If not specified, the default set is defined by the - APT::Acquire::Targets configuration scope. + configuration scope. @@ -232,7 +232,7 @@ deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [. anomalies. - Trusted (trusted) + () is a tri-state value which defaults to APT deciding if a source is considered trusted or if warnings should be raised before e.g. packages are installed from this source. This option can be used @@ -245,6 +245,41 @@ deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [. as untrusted even if the authentication checks passed successfully. The default value can't be set explicitly. + + () + is a yes/no value which controls if APT should try to detect + replay attacks. A repository creator can declare until then the + data provided in the repository should be considered valid and + if this time is reached, but no new data is provided the data + is considered expired and an error is raised. Beside + increasing security as a malicious attacker can't sent old data + forever denying a user to be able to upgrade to a new version, + this also helps users identify mirrors which are no longer + updated. Some repositories like historic archives aren't + updated anymore by design through, so this check can be + disabled by setting this option to no. + Defaults to the value of configuration option + which itself + defaults to yes. + + + + () and + + () can be used to raise or + lower the time period in seconds in which the data from this + repository is considered valid. -Max can be especially useful + if the repository provides no Valid-Until field on its Release + file to set your own value, while -Min can be used to increase + the valid time on seldomly updated (local) mirrors of a more + frequently updated but less accessible archive (which is in the + sources.list as well) instead of disabling the check entirely. + Default to the value of the configuration options + and + which are both unset by + default. + + diff --git a/test/integration/test-releasefile-valid-until b/test/integration/test-releasefile-valid-until index e000abf5d..43574ec3e 100755 --- a/test/integration/test-releasefile-valid-until +++ b/test/integration/test-releasefile-valid-until @@ -46,3 +46,12 @@ runtest 'accepted' 'good Min-Valid (bad Until, good Max-Valid) <' 'now - 7 days' runtest 'rejected' 'bad Max-Valid (bad Until, good Min-Valid) >' 'now - 7 days' 'now - 2 days' -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 runtest 'rejected' 'bad Max-Valid (bad Until, bad Min-Valid) <' 'now - 7 days' 'now - 2 days' -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 runtest 'rejected' 'bad Max-Valid (bad Until, bad Min-Valid) >' 'now - 7 days' 'now - 2 days' -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 + +sed -i -e 's#\(deb\(-src\)\?\) #\1 [check-valid-until=no] #' rootdir/etc/apt/sources.list.d/* +runtest 'accepted' 'bad Until but overriden by sources option' 'now - 7 days' 'now - 4 days' + +sed -i -e 's#\(deb\(-src\)\?\) \[check-valid-until=no\] #\1 [valid-until-max=86400] #' rootdir/etc/apt/sources.list.d/* +runtest 'rejected' 'bad Max-Valid (good Until) via sources option' 'now - 7 days' 'now + 4 days' + +sed -i -e 's#\(deb\(-src\)\?\) \[valid-until-max=86400\] #\1 [valid-until-min=1209600] #' rootdir/etc/apt/sources.list.d/* +runtest 'accepted' 'good Min-Valid (bad Until) via sources option' 'now - 7 days' 'now - 4 days' -- cgit v1.2.3 From b0d408547734100bf86781615f546487ecf390d9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 24 Jun 2015 19:31:22 +0200 Subject: implement Signed-By option for sources.list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Limits which key(s) can be used to sign a repository. Not immensely useful from a security perspective all by itself, but if the user has additional measures in place to confine a repository (like pinning) an attacker who gets the key for such a repository is limited to its potential and can't use the key to sign its attacks for an other (maybe less limited) repository… (yes, this is as weak as it sounds, but having the capability might come in handy for implementing other stuff later). --- apt-pkg/acquire-item.cc | 15 +++++++- apt-pkg/acquire-item.h | 1 + apt-pkg/contrib/gpgv.cc | 17 +++++++++- apt-pkg/contrib/gpgv.h | 5 ++- apt-pkg/deb/debmetaindex.cc | 35 +++++++++++++++++++ apt-pkg/deb/debmetaindex.h | 1 + apt-pkg/metaindex.cc | 4 +-- apt-pkg/metaindex.h | 4 ++- apt-pkg/sourcelist.cc | 28 ++++++++------- cmdline/apt-key.in | 22 ++++++++++-- doc/sources.list.5.xml | 24 ++++++------- methods/gpgv.cc | 18 +++++----- test/integration/framework | 23 +++++++++---- test/integration/test-apt-key | 37 ++++++++++++++++++-- test/integration/test-releasefile-verification | 47 +++++++++++++++++++++++--- 15 files changed, 225 insertions(+), 56 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index a30a5d154..01a679fe0 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -808,7 +808,6 @@ string pkgAcqMetaBase::Custom600Headers() const Header += MaximumSize; string const FinalFile = GetFinalFilename(); - struct stat Buf; if (stat(FinalFile.c_str(),&Buf) == 0) Header += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime); @@ -1132,6 +1131,10 @@ string pkgAcqMetaClearSig::Custom600Headers() const { string Header = pkgAcqMetaBase::Custom600Headers(); Header += "\nFail-Ignore: true"; + std::string const key = TransactionManager->MetaIndexParser->GetSignedBy(); + if (key.empty() == false) + Header += "\nSigned-By: " + key; + return Header; } /*}}}*/ @@ -1372,6 +1375,16 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner, /*}}}*/ pkgAcqMetaSig::~pkgAcqMetaSig() /*{{{*/ { +} + /*}}}*/ +// pkgAcqMetaSig::Custom600Headers - Insert custom request headers /*{{{*/ +std::string pkgAcqMetaSig::Custom600Headers() const +{ + std::string Header = pkgAcqTransactionItem::Custom600Headers(); + std::string const key = TransactionManager->MetaIndexParser->GetSignedBy(); + if (key.empty() == false) + Header += "\nSigned-By: " + key; + return Header; } /*}}}*/ // AcqMetaSig::Done - The signature was downloaded/verified /*{{{*/ diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 10ece76c9..1cd2a6d03 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -541,6 +541,7 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); virtual void Done(std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const Cnf); + virtual std::string Custom600Headers() const; /** \brief Create a new pkgAcqMetaSig. */ pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index a01e319eb..ef84da0d8 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -16,6 +16,8 @@ #include #include #include + +#include #include #include #include @@ -42,7 +44,7 @@ static char * GenerateTemporaryFileTemplate(const char *basename) /*{{{*/ of the lifting in regards to merging keyrings. Fun for the whole family. */ void ExecGPGV(std::string const &File, std::string const &FileGPG, - int const &statusfd, int fd[2]) + int const &statusfd, int fd[2], std::string const &key) { #define EINTERNAL 111 std::string const aptkey = _config->FindFile("Dir::Bin::apt-key", "/usr/bin/apt-key"); @@ -55,6 +57,19 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG, Args.push_back(aptkey.c_str()); Args.push_back("--quiet"); Args.push_back("--readonly"); + if (key.empty() == false) + { + if (key[0] == '/') + { + Args.push_back("--keyring"); + Args.push_back(key.c_str()); + } + else + { + Args.push_back("--keyid"); + Args.push_back(key.c_str()); + } + } Args.push_back("verify"); char statusfdstr[10]; diff --git a/apt-pkg/contrib/gpgv.h b/apt-pkg/contrib/gpgv.h index f018893fd..2a4cdad72 100644 --- a/apt-pkg/contrib/gpgv.h +++ b/apt-pkg/contrib/gpgv.h @@ -38,9 +38,12 @@ class FileFd; * * @param File is the message (unsigned or clear-signed) * @param FileSig is the signature (detached or clear-signed) + * @param statusfd is the fd given to gpgv as --status-fd + * @param fd is used as a pipe for the standard output of gpgv + * @param key is the specific one to be used instead of using all */ void ExecGPGV(std::string const &File, std::string const &FileSig, - int const &statusfd, int fd[2]) APT_NORETURN; + int const &statusfd, int fd[2], std::string const &Key = "") APT_NORETURN; inline APT_NORETURN void ExecGPGV(std::string const &File, std::string const &FileSig, int const &statusfd = -1) { int fd[2]; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 5d7e539c7..4bb03a942 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -461,6 +461,29 @@ bool debReleaseIndex::SetValidUntilMax(time_t const Valid) else if (d->ValidUntilMax != Valid) return _error->Error(_("Conflicting values set for option %s concerning source %s %s"), "Max-ValidTime", URI.c_str(), Dist.c_str()); return true; +} +bool debReleaseIndex::SetSignedBy(std::string const &pSignedBy) +{ + if (SignedBy.empty() == true && pSignedBy.empty() == false) + { + if (pSignedBy[0] == '/') // no check for existence as we could be chrooting later or such things + ; // absolute path to a keyring file + else + { + // we could go all fancy and allow short/long/string matches as gpgv/apt-key does, + // but fingerprints are harder to fake than the others and this option is set once, + // not interactively all the time so easy to type is not really a concern. + std::string finger = pSignedBy; + finger.erase(std::remove(finger.begin(), finger.end(), ' '), finger.end()); + std::transform(finger.begin(), finger.end(), finger.begin(), ::toupper); + if (finger.length() != 40 || finger.find_first_not_of("0123456789ABCDEF") != std::string::npos) + return _error->Error(_("Invalid value set for option %s concerning source %s %s (%s)"), "Signed-By", URI.c_str(), Dist.c_str(), "not a fingerprint"); + } + SignedBy = pSignedBy; + } + else if (SignedBy != pSignedBy) + return _error->Error(_("Conflicting values set for option %s concerning source %s %s"), "Signed-By", URI.c_str(), Dist.c_str()); + return true; } /*}}}*/ // ReleaseIndex::IsTrusted /*{{{*/ @@ -706,6 +729,18 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ Deb->SetValidUntilMin(GetTimeOption(Options, "valid-until-min")) == false) return false; + std::map::const_iterator const signedby = Options.find("signed-by"); + if (signedby == Options.end()) + { + if (Deb->SetSignedBy("") == false) + return false; + } + else + { + if (Deb->SetSignedBy(signedby->second) == false) + return false; + } + return true; } diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 879eb3bfc..bf5b7c1ce 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -56,6 +56,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex bool SetCheckValidUntil(TriState const Trusted); bool SetValidUntilMin(time_t const Valid); bool SetValidUntilMax(time_t const Valid); + bool SetSignedBy(std::string const &SignedBy); virtual bool IsTrusted() const; diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 8bd13bb18..baf695f16 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -27,8 +27,7 @@ bool metaIndex::Merge(pkgCacheGenerator &Gen,OpProgress *) const metaIndex::metaIndex(std::string const &URI, std::string const &Dist, char const * const Type) : d(NULL), Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(TRI_UNSET), - LoadedSuccessfully(TRI_UNSET), - Date(0), ValidUntil(0), SupportsAcquireByHash(false) + Date(0), ValidUntil(0), SupportsAcquireByHash(false), LoadedSuccessfully(TRI_UNSET) { /* nothing */ } @@ -48,6 +47,7 @@ APT_PURE std::string metaIndex::GetURI() const { return URI; } APT_PURE std::string metaIndex::GetDist() const { return Dist; } APT_PURE const char* metaIndex::GetType() const { return Type; } APT_PURE metaIndex::TriState metaIndex::GetTrusted() const { return Trusted; } +APT_PURE std::string metaIndex::GetSignedBy() const { return SignedBy; } APT_PURE std::string metaIndex::GetCodename() const { return Codename; } APT_PURE std::string metaIndex::GetSuite() const { return Suite; } APT_PURE bool metaIndex::GetSupportsAcquireByHash() const { return SupportsAcquireByHash; } diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 5be7397ae..d284655bf 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -52,7 +52,7 @@ protected: std::string URI; std::string Dist; TriState Trusted; - TriState LoadedSuccessfully; + std::string SignedBy; // parsed from a file std::string Suite; @@ -61,6 +61,7 @@ protected: time_t ValidUntil; bool SupportsAcquireByHash; std::map Entries; + TriState LoadedSuccessfully; public: // Various accessors @@ -68,6 +69,7 @@ public: std::string GetDist() const; const char* GetType() const; TriState GetTrusted() const; + std::string GetSignedBy() const; std::string GetCodename() const; std::string GetSuite() const; diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 0d65558ed..eef0ee709 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -93,27 +93,29 @@ bool pkgSourceList::Type::ParseStanza(vector &List, /*{{{*/ if (Enabled.empty() == false && StringToBool(Enabled) == false) return true; - std::map mapping; + std::map > mapping; #define APT_PLUSMINUS(X, Y) \ - mapping.insert(std::make_pair(X, Y)); \ - mapping.insert(std::make_pair(X "Add", Y "+")); \ - mapping.insert(std::make_pair(X "Remove", Y "-")) + mapping.insert(std::make_pair(X, std::make_pair(Y, true))); \ + mapping.insert(std::make_pair(X "Add", std::make_pair(Y "+", true))); \ + mapping.insert(std::make_pair(X "Remove", std::make_pair(Y "-", true))) APT_PLUSMINUS("Architectures", "arch"); APT_PLUSMINUS("Languages", "lang"); APT_PLUSMINUS("Targets", "target"); #undef APT_PLUSMINUS - mapping.insert(std::make_pair("Trusted", "trusted")); - mapping.insert(std::make_pair("Check-Valid-Until", "check-valid-until")); - mapping.insert(std::make_pair("Valid-Until-Min", "valid-until-min")); - mapping.insert(std::make_pair("Valid-Until-Max", "valid-until-max")); + mapping.insert(std::make_pair("Trusted", std::make_pair("trusted", false))); + mapping.insert(std::make_pair("Check-Valid-Until", std::make_pair("check-valid-until", false))); + mapping.insert(std::make_pair("Valid-Until-Min", std::make_pair("valid-until-min", false))); + mapping.insert(std::make_pair("Valid-Until-Max", std::make_pair("valid-until-max", false))); + mapping.insert(std::make_pair("Signed-By", std::make_pair("signed-by", false))); - for (std::map::const_iterator m = mapping.begin(); m != mapping.end(); ++m) + for (std::map >::const_iterator m = mapping.begin(); m != mapping.end(); ++m) if (Tags.Exists(m->first)) { - // for deb822 the " " is the delimiter, but the backend expects "," - std::string option = Tags.FindS(m->first); - std::replace(option.begin(), option.end(), ' ', ','); - Options[m->second] = option; + std::string option = Tags.FindS(m->first); + // for deb822 the " " is the delimiter, but the backend expects "," + if (m->second.second == true) + std::replace(option.begin(), option.end(), ' ', ','); + Options[m->second.first] = option; } // now create one item per suite/section diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index 2a66ad74d..16887bd50 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -199,7 +199,7 @@ remove_key_from_keyring() { foreach_keyring_do() { local ACTION="$1" shift - # if a --keyring was given, just remove from there + # if a --keyring was given, just work on this one if [ -n "$FORCED_KEYRING" ]; then $ACTION "$FORCED_KEYRING" "$@" else @@ -279,7 +279,14 @@ merge_back_changes() { } setup_merged_keyring() { - if [ -z "$FORCED_KEYRING" ]; then + if [ -n "$FORCED_KEYID" ]; then + foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/allrings.gpg" + FORCED_KEYRING="${GPGHOMEDIR}/forcedkeyid.gpg" + TRUSTEDFILE="${FORCED_KEYRING}" + GPG="$GPG --keyring $TRUSTEDFILE" + # ignore error as this "just" means we haven't found the forced keyid and the keyring will be empty + $GPG_CMD --batch --yes --keyring "${GPGHOMEDIR}/allrings.gpg" --export "$FORCED_KEYID" | $GPG --batch --yes --import || true + elif [ -z "$FORCED_KEYRING" ]; then foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg" if [ -r "${GPGHOMEDIR}/pubring.gpg" ]; then cp -a "${GPGHOMEDIR}/pubring.gpg" "${GPGHOMEDIR}/pubring.orig.gpg" @@ -328,12 +335,17 @@ while [ -n "$1" ]; do TRUSTEDFILE="$1" FORCED_KEYRING="$1" ;; + --keyid) + shift + FORCED_KEYID="$1" + ;; --secret-keyring) shift FORCED_SECRET_KEYRING="$1" ;; --readonly) merge_back_changes() { true; } + create_new_keyring() { true; } ;; --fakeroot) requires_root() { true; } @@ -460,7 +472,11 @@ case "$command" in verify) setup_merged_keyring if which gpgv >/dev/null 2>&1; then - gpgv --homedir "${GPGHOMEDIR}" --keyring "${GPGHOMEDIR}/pubring.gpg" --ignore-time-conflict "$@" + if [ -n "$FORCED_KEYRING" ]; then + gpgv --homedir "${GPGHOMEDIR}" --keyring "${FORCED_KEYRING}" --ignore-time-conflict "$@" + else + gpgv --homedir "${GPGHOMEDIR}" --keyring "${GPGHOMEDIR}/pubring.gpg" --ignore-time-conflict "$@" + fi else $GPG --verify "$@" fi diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index aded8ecef..12a7773f5 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -232,18 +232,18 @@ deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [. anomalies. - () - is a tri-state value which defaults to APT deciding if a source - is considered trusted or if warnings should be raised before e.g. - packages are installed from this source. This option can be used - to override this decision either with the value yes, - which lets APT consider this source always as a trusted source - even if it has no or fails authentication checks by disabling parts - of &apt-secure; and should therefore only be used in a local and trusted - context (if at all) as otherwise security is breached. The opposite - can be achieved with the value no, which causes the source to be handled - as untrusted even if the authentication checks passed successfully. - The default value can't be set explicitly. + () + is either an absolute path to a keyring file (has to be + accessible and readable for the _apt user, + so ensure everyone has read-permissions on the file) or a + fingerprint of a key in either the + trusted.gpg keyring or in one of the + keyrings in the trusted.gpg.d/ directory + (see apt-key fingerprint). If the option is + set only the key(s) in this keyring or only the key with this + fingerprint is used for the &apt-secure; verification of this + repository. Otherwise all keys in the trusted keyrings are + considered valid signers for this repository. () diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 41f138be6..014430041 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -37,13 +37,14 @@ class GPGVMethod : public pkgAcqMethod { private: string VerifyGetSigners(const char *file, const char *outfile, - vector &GoodSigners, + std::string const &key, + vector &GoodSigners, vector &BadSigners, vector &WorthlessSigners, vector &NoPubKeySigners); protected: - virtual bool Fetch(FetchItem *Itm); + virtual bool URIAcquire(std::string const &Message, FetchItem *Itm); virtual bool Configuration(string Message); public: @@ -61,6 +62,7 @@ bool GPGVMethod::Configuration(string Message) } string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, + std::string const &key, vector &GoodSigners, vector &BadSigners, vector &WorthlessSigners, @@ -80,7 +82,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, if (pid < 0) return string("Couldn't spawn new process") + strerror(errno); else if (pid == 0) - ExecGPGV(outfile, file, 3, fd); + ExecGPGV(outfile, file, 3, fd, key); close(fd[1]); FILE *pipein = fdopen(fd[0], "r"); @@ -174,11 +176,11 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, return _("Unknown error executing apt-key"); } -bool GPGVMethod::Fetch(FetchItem *Itm) +bool GPGVMethod::URIAcquire(std::string const &Message, FetchItem *Itm) { - URI Get = Itm->Uri; - string Path = Get.Host + Get.Path; // To account for relative paths - string keyID; + URI const Get = Itm->Uri; + string const Path = Get.Host + Get.Path; // To account for relative paths + std::string const key = LookupTag(Message, "Signed-By"); vector GoodSigners; vector BadSigners; // a worthless signature is a expired or revoked one @@ -190,7 +192,7 @@ bool GPGVMethod::Fetch(FetchItem *Itm) URIStart(Res); // Run apt-key on file, extract contents and get the key ID of the signer - string msg = VerifyGetSigners(Path.c_str(), Itm->DestFile.c_str(), + string msg = VerifyGetSigners(Path.c_str(), Itm->DestFile.c_str(), key, GoodSigners, BadSigners, WorthlessSigners, NoPubKeySigners); if (GoodSigners.empty() || !BadSigners.empty() || !NoPubKeySigners.empty()) diff --git a/test/integration/framework b/test/integration/framework index 059cba9fb..6ae5003f7 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1414,14 +1414,23 @@ testfailure() { else local EXITCODE=$? if expr match "$1" '^apt.*' >/dev/null; then - if grep -q -E ' runtime error: ' "$OUTPUT"; then - msgfailoutput 'compiler detected undefined behavior' "$OUTPUT" "$@" - elif grep -q -E '==ERROR' "$OUTPUT"; then - msgfailoutput 'compiler sanitizers reported errors' "$OUTPUT" "$@" - elif ! grep -q -E '^E: ' "$OUTPUT"; then - msgfailoutput "run failed with exitcode ${EXITCODE}, but with no errors" "$OUTPUT" "$@" + if [ "$1" = 'aptkey' ]; then + if grep -q -E " Can't check signature: " "$OUTPUT" || \ + grep -q -E " BAD signature from " "$OUTPUT"; then + msgpass + else + msgfailoutput "run failed with exitcode ${EXITCODE}, but no signature error" "$OUTPUT" "$@" + fi else - msgpass + if grep -q -E ' runtime error: ' "$OUTPUT"; then + msgfailoutput 'compiler detected undefined behavior' "$OUTPUT" "$@" + elif grep -q -E '==ERROR' "$OUTPUT"; then + msgfailoutput 'compiler sanitizers reported errors' "$OUTPUT" "$@" + elif ! grep -q -E '^E: ' "$OUTPUT"; then + msgfailoutput "run failed with exitcode ${EXITCODE}, but with no errors" "$OUTPUT" "$@" + else + msgpass + fi fi else msgpass diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key index 486acccc8..e1be08c65 100755 --- a/test/integration/test-apt-key +++ b/test/integration/test-apt-key @@ -73,7 +73,7 @@ pub 2048R/DBAC8DAE 2010-08-18' testsuccess aptkey --fakeroot del DBAC8DAE testempty aptkey list - msgtest 'Test key removal with' 'lowercase key ID' #keylength somewher between 8byte and short + msgtest 'Test key removal with' 'lowercase key ID' #keylength somewhere between 8byte and short cleanplate cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg testsuccess --nomsg aptkey --fakeroot del d141dbac8dae @@ -166,6 +166,40 @@ pub 2048R/528144E2 2011-01-16' msgtest 'Test merge-back of' 'removed duplicate keys' testsuccess --nomsg aptkey adv --batch --yes --delete-keys DBAC8DAE testaptkeys 'pub 2048R/528144E2 2011-01-16' + + cleanplate + cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg + cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg + msgtest 'Test signing a file' 'with a key' + echo 'Verify me. This is my signature.' > signature + testsuccess --nomsg aptkey --quiet --keyring keys/marvinparanoid.pub --secret-keyring keys/marvinparanoid.sec --readonly \ + adv --batch --yes --default-key 'Marvin' --armor --detach-sign --sign --output signature.gpg signature + + msgtest 'Test verify a file' 'with all keys' + testsuccess --nomsg aptkey --quiet --readonly verify signature.gpg signature + + msgtest 'Test verify a file' 'with good keyring' + testsuccess --nomsg aptkey --quiet --readonly --keyring keys/testcase-multikey.pub verify signature.gpg signature + + msgtest 'Test fail verify a file' 'with bad keyring' + testfailure --nomsg aptkey --quiet --readonly --keyring keys/joesixpack.pub verify signature.gpg signature + + msgtest 'Test fail verify a file' 'with non-existing keyring' + testfailure --nomsg aptkey --quiet --readonly --keyring keys/does-not-exist.pub verify signature.gpg signature + testfailure test -e keys/does-not-exist.pub + + msgtest 'Test verify a file' 'with good keyid' + testsuccess --nomsg aptkey --quiet --readonly --keyid 'Paranoid' verify signature.gpg signature + + msgtest 'Test fail verify a file' 'with bad keyid' + testfailure --nomsg aptkey --quiet --readonly --keyid 'Sixpack' verify signature.gpg signature + + msgtest 'Test fail verify a file' 'with non-existing keyid' + testfailure --nomsg aptkey --quiet --readonly --keyid 'Kalnischkies' verify signature.gpg signature + + msgtest 'Test verify fails on' 'bad file' + echo 'lalalalala' > signature + testfailure --nomsg aptkey --quiet --readonly verify signature.gpg signature } setupgpgcommand() { @@ -187,4 +221,3 @@ setupgpgcommand 'gpg' testrun setupgpgcommand 'gpg2' testrun - diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index e8419524c..1c3953c8b 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -139,11 +139,6 @@ runtest() { failaptold prepare ${PKGFILE}-new - # weborf doesn't support If-Range - for release in $(find rootdir/var/lib/apt/lists/partial/ -name '*Release'); do - rm $release - touch $release - done signreleasefiles 'Joe Sixpack' find aptarchive/ -name "$DELETEFILE" -delete msgmsg 'Bad warm archive signed by' 'Joe Sixpack' @@ -191,6 +186,48 @@ runtest() { testsuccessequal "$(cat ${PKGFILE}-new) " aptcache show apt installaptnew + + prepare ${PKGFILE} + rm -rf rootdir/var/lib/apt/lists + signreleasefiles 'Marvin Paranoid' + find aptarchive/ -name "$DELETEFILE" -delete + msgmsg 'Cold archive signed by good keyring' 'Marvin Paranoid' + local MARVIN="$(readlink -f keys/marvinparanoid.pub)" + sed -i "s#^\(deb\(-src\)\?\) #\1 [signed-by=$MARVIN] #" rootdir/etc/apt/sources.list.d/* + testsuccess aptget update -o Debug::pkgAcquire::Worker=1 + testsuccessequal "$(cat ${PKGFILE}) +" aptcache show apt + installaptold + + rm -rf rootdir/var/lib/apt/lists + signreleasefiles 'Joe Sixpack' + find aptarchive/ -name "$DELETEFILE" -delete + msgmsg 'Cold archive signed by bad keyring' 'Joe Sixpack' + updatewithwarnings '^W: .* NO_PUBKEY' + + sed -i "s#^\(deb\(-src\)\?\) \[signed-by=$MARVIN\] #\1 #" rootdir/etc/apt/sources.list.d/* + local MARVIN="$(aptkey --keyring $MARVIN finger | grep 'Key fingerprint' | cut -d'=' -f 2 | tr -d ' ')" + + prepare ${PKGFILE} + rm -rf rootdir/var/lib/apt/lists + signreleasefiles 'Marvin Paranoid' + find aptarchive/ -name "$DELETEFILE" -delete + msgmsg 'Cold archive signed by good keyid' 'Marvin Paranoid' + sed -i "s#^\(deb\(-src\)\?\) #\1 [signed-by=$MARVIN] #" rootdir/etc/apt/sources.list.d/* + cp keys/marvinparanoid.pub rootdir/etc/apt/trusted.gpg.d/marvinparanoid.gpg + testsuccess aptget update -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1 + testsuccessequal "$(cat ${PKGFILE}) +" aptcache show apt + installaptold + rm -f rootdir/etc/apt/trusted.gpg.d/marvinparanoid.gpg + + rm -rf rootdir/var/lib/apt/lists + signreleasefiles 'Joe Sixpack' + find aptarchive/ -name "$DELETEFILE" -delete + msgmsg 'Cold archive signed by bad keyid' 'Joe Sixpack' + updatewithwarnings '^W: .* NO_PUBKEY' + + sed -i "s#^\(deb\(-src\)\?\) \[signed-by=$MARVIN\] #\1 #" rootdir/etc/apt/sources.list.d/* } runtest2() { -- cgit v1.2.3 From 76b580bed96aaf0174ca81ba8ed2c4b54226ad85 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 24 Jun 2015 22:13:51 +0200 Subject: remove the longtime deprecated vendor{,list} stuff History suggests that this comes from an earlier apt-secure implementation, but never really became a thing, totally unused and marked as deprecated for "ages" now. Especially as it did nothing even if it would have been used (libapt itself didn't use it at all). --- apt-pkg/acquire-item.h | 1 - apt-pkg/init.cc | 2 - apt-pkg/metaindex.h | 1 - apt-pkg/sourcelist.h | 4 -- apt-pkg/vendor.cc | 41 ------------- apt-pkg/vendor.h | 37 ----------- apt-pkg/vendorlist.cc | 164 ------------------------------------------------- apt-pkg/vendorlist.h | 54 ---------------- 8 files changed, 304 deletions(-) delete mode 100644 apt-pkg/vendor.cc delete mode 100644 apt-pkg/vendor.h delete mode 100644 apt-pkg/vendorlist.cc delete mode 100644 apt-pkg/vendorlist.h diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 1cd2a6d03..93d812248 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -31,7 +31,6 @@ #include #ifndef APT_8_CLEANER_HEADERS -#include #include #include #endif diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 96966b249..1fbb035f7 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -62,8 +62,6 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("Dir::Etc","etc/apt/"); Cnf.CndSet("Dir::Etc::sourcelist","sources.list"); Cnf.CndSet("Dir::Etc::sourceparts","sources.list.d"); - Cnf.CndSet("Dir::Etc::vendorlist","vendors.list"); - Cnf.CndSet("Dir::Etc::vendorparts","vendors.list.d"); Cnf.CndSet("Dir::Etc::main","apt.conf"); Cnf.CndSet("Dir::Etc::netrc", "auth.conf"); Cnf.CndSet("Dir::Etc::parts","apt.conf.d"); diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index d284655bf..94aec2d1f 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -17,7 +17,6 @@ class OpProgress; #ifndef APT_8_CLEANER_HEADERS #include #include -#include using std::string; #endif diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index 079f3cb3d..d80131438 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -17,10 +17,6 @@ list all you have is a list of package index files that have the ability to be Acquired. - The vendor machanism is similar, except the vendor types are hard - wired. Before loading the source list the vendor list is loaded. - This doesn't load key data, just the checks to perform. - ##################################################################### */ /*}}}*/ #ifndef PKGLIB_SOURCELIST_H diff --git a/apt-pkg/vendor.cc b/apt-pkg/vendor.cc deleted file mode 100644 index d4add560e..000000000 --- a/apt-pkg/vendor.cc +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#include -#include - -#include -#include -#include -#include -#include - -Vendor::Vendor(std::string VendorID, - std::string Origin, - std::vector *FingerprintList) -{ - this->VendorID = VendorID; - this->Origin = Origin; - for (std::vector::iterator I = FingerprintList->begin(); - I != FingerprintList->end(); ++I) - { - if (_config->FindB("Debug::Vendor", false)) - std::cerr << "Vendor \"" << VendorID << "\": Mapping \"" - << (*I)->Print << "\" to \"" << (*I)->Description << '"' << std::endl; - Fingerprints[(*I)->Print] = (*I)->Description; - } - delete FingerprintList; -} - -const std::string Vendor::LookupFingerprint(std::string Print) const -{ - std::map::const_iterator Elt = Fingerprints.find(Print); - if (Elt == Fingerprints.end()) - return ""; - else - return (*Elt).second; -} - -APT_CONST bool Vendor::CheckDist(std::string /*Dist*/) -{ - return true; -} diff --git a/apt-pkg/vendor.h b/apt-pkg/vendor.h deleted file mode 100644 index 2d2e2b0ae..000000000 --- a/apt-pkg/vendor.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef PKGLIB_VENDOR_H -#define PKGLIB_VENDOR_H -#include -#include -#include - -#include - -#ifndef APT_8_CLEANER_HEADERS -using std::string; -#endif - -// A class representing a particular software provider. -class APT_DEPRECATED Vendor -{ - public: - struct Fingerprint - { - std::string Print; - std::string Description; - }; - - protected: - std::string VendorID; - std::string Origin; - std::map Fingerprints; - - public: - Vendor(std::string VendorID, std::string Origin, - std::vector *FingerprintList); - virtual const std::string& GetVendorID() const { return VendorID; }; - virtual const std::string LookupFingerprint(std::string Print) const; - virtual bool CheckDist(std::string Dist); - virtual ~Vendor(){}; -}; - -#endif diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc deleted file mode 100644 index db5b87fc0..000000000 --- a/apt-pkg/vendorlist.cc +++ /dev/null @@ -1,164 +0,0 @@ -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include - -// The whole vendor system is deprecated -APT_IGNORE_DEPRECATED_PUSH - -#include -#include - -using std::string; -using std::vector; - -pkgVendorList::~pkgVendorList() -{ - for (vector::const_iterator I = VendorList.begin(); - I != VendorList.end(); ++I) - delete *I; -} - -// pkgVendorList::ReadMainList - Read list of known package vendors /*{{{*/ -// --------------------------------------------------------------------- -/* This also scans a directory of vendor files similar to apt.conf.d - which can contain the usual suspects of distribution provided data. - The APT config mechanism allows the user to override these in their - configuration file. */ -bool pkgVendorList::ReadMainList() -{ - Configuration Cnf; - - string CnfFile = _config->FindDir("Dir::Etc::vendorparts"); - if (DirectoryExists(CnfFile) == true) - if (ReadConfigDir(Cnf,CnfFile,true) == false) - return false; - CnfFile = _config->FindFile("Dir::Etc::vendorlist"); - if (RealFileExists(CnfFile) == true) - if (ReadConfigFile(Cnf,CnfFile,true) == false) - return false; - - return CreateList(Cnf); -} - /*}}}*/ -bool pkgVendorList::Read(string File) /*{{{*/ -{ - Configuration Cnf; - if (ReadConfigFile(Cnf,File,true) == false) - return false; - - return CreateList(Cnf); -} - /*}}}*/ -bool pkgVendorList::CreateList(Configuration& Cnf) /*{{{*/ -{ - for (vector::const_iterator I = VendorList.begin(); - I != VendorList.end(); ++I) - delete *I; - VendorList.erase(VendorList.begin(),VendorList.end()); - - const Configuration::Item *Top = Cnf.Tree("Vendor"); - for (Top = (Top == 0?0:Top->Child); Top != 0; Top = Top->Next) - { - Configuration Block(Top); - string VendorID = Top->Tag; - vector *Fingerprints = new vector; - struct Vendor::Fingerprint *Fingerprint = new struct Vendor::Fingerprint(); - string Origin = Block.Find("Origin"); - - Fingerprint->Print = Block.Find("Fingerprint"); - Fingerprint->Description = Block.Find("Name"); - Fingerprints->push_back(Fingerprint); - - if (Fingerprint->Print.empty() || Fingerprint->Description.empty()) - { - _error->Error(_("Vendor block %s contains no fingerprint"), VendorID.c_str()); - delete Fingerprints; - continue; - } - if (_config->FindB("Debug::sourceList", false)) - std::cerr << "Adding vendor with ID: " << VendorID - << " Fingerprint: " << Fingerprint->Print << std::endl; - - VendorList.push_back(new Vendor(VendorID, Origin, Fingerprints)); - } - - /* Process 'group-key' type sections */ - Top = Cnf.Tree("group-key"); - for (Top = (Top == 0?0:Top->Child); Top != 0; Top = Top->Next) - { -// Configuration Block(Top); -// vector Fingerprints; -// string VendorID = Top->Tag; - -// while (Block->Next) -// { -// struct Vendor::Fingerprint Fingerprint = new struct Vendor::Fingerprint; -// Fingerprint->Print = Block.Find("Fingerprint"); -// Fingerprint->Description = Block.Find("Name"); -// if (Fingerprint->print.empty() || Fingerprint->Description.empty()) -// { -// _error->Error(_("Vendor block %s is invalid"), -// Vendor->VendorID.c_str()); -// delete Fingerprint; -// break; -// } -// Block = Block->Next->Next; -// } -// if (_error->PendingError()) -// { -// for (vector ::iterator I = Fingerprints.begin(); -// I != Fingerprints.end(); I++) -// delete *I; -// delete Fingerprints; -// continue; -// } - -// VendorList.push_back(new Vendor(VendorID, Fingerprints)); - } - - return !_error->PendingError(); -} - /*}}}*/ -const Vendor* pkgVendorList::LookupFingerprint(string Fingerprint) /*{{{*/ -{ - for (const_iterator I = VendorList.begin(); I != VendorList.end(); ++I) - { - if ((*I)->LookupFingerprint(Fingerprint) != "") - return *I; - } - - return NULL; -} - /*}}}*/ -const Vendor* pkgVendorList::FindVendor(const std::vector GPGVOutput) /*{{{*/ -{ - for (std::vector::const_iterator I = GPGVOutput.begin(); I != GPGVOutput.end(); ++I) - { - string::size_type pos = (*I).find("VALIDSIG "); - if (_config->FindB("Debug::Vendor", false)) - std::cerr << "Looking for VALIDSIG in \"" << (*I) << "\": pos " << pos << std::endl; - if (pos != std::string::npos) - { - string Fingerprint = (*I).substr(pos+sizeof("VALIDSIG")); - if (_config->FindB("Debug::Vendor", false)) - std::cerr << "Looking for \"" << Fingerprint << "\" in vendor..." << std::endl; - const Vendor* vendor = this->LookupFingerprint(Fingerprint); - if (vendor != NULL) - return vendor; - } - } - - return NULL; -} - /*}}}*/ - -APT_IGNORE_DEPRECATED_POP diff --git a/apt-pkg/vendorlist.h b/apt-pkg/vendorlist.h deleted file mode 100644 index bc3702a93..000000000 --- a/apt-pkg/vendorlist.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- mode: cpp; mode: fold -*- -// Description /*{{{*/ -// $Id: vendorlist.h,v 1.1.2.1 2003/12/24 23:09:17 mdz Exp $ -/* ###################################################################### - - VendorList - Manage a list of vendors - - The Vendor List class provides access to a list of vendors and - attributes associated with them, read from a configuration file. - - ##################################################################### */ - /*}}}*/ -#ifndef PKGLIB_VENDORLIST_H -#define PKGLIB_VENDORLIST_H - -#include -#include -#include - -#ifndef APT_8_CLEANER_HEADERS -#include -#include -using std::string; -using std::vector; -#endif - -class Vendor; -class Configuration; - -class APT_DEPRECATED pkgVendorList -{ - protected: - std::vector VendorList; - - bool CreateList(Configuration& Cnf); - const Vendor* LookupFingerprint(std::string Fingerprint); - - public: - typedef std::vector::const_iterator const_iterator; - bool ReadMainList(); - bool Read(std::string File); - - // List accessors - inline const_iterator begin() const {return VendorList.begin();}; - inline const_iterator end() const {return VendorList.end();}; - inline unsigned int size() const {return VendorList.size();}; - inline bool empty() const {return VendorList.empty();}; - - const Vendor* FindVendor(const std::vector GPGVOutput); - - ~pkgVendorList(); -}; - -#endif -- cgit v1.2.3 From 525bcd780d0284d980db805c62254e7d27507345 Mon Sep 17 00:00:00 2001 From: Yuri Kozlov Date: Wed, 24 Jun 2015 22:35:00 +0200 Subject: Russian program translation update Closes: 789709 --- po/ru.po | 3429 +++++++++++++++++++++++++++++++------------------------------- po/tr.po | 12 +- 2 files changed, 1711 insertions(+), 1730 deletions(-) diff --git a/po/ru.po b/po/ru.po index 2028e5420..7d30cb696 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1,4 +1,3 @@ -# translation of apt_0.7.25_ru.po to Russian # Russian messages for the apt suite. # # Vadim Kutchin , 2002. @@ -8,20 +7,20 @@ # Dmitry Astapov , 2004. # Dmitry Astapov , 2004. # Yuri Kozlov , 2004, 2005, 2006, 2007, 2008. -# Yuri Kozlov , 2009, 2010, 2012. +# Yuri Kozlov , 2009, 2010, 2012, 2015. msgid "" msgstr "" -"Project-Id-Version: apt rev2227.1.3\n" +"Project-Id-Version: apt 1.0.9.10\n" "Report-Msgid-Bugs-To: APT Development Team \n" -"POT-Creation-Date: 2015-03-09 02:17+0100\n" -"PO-Revision-Date: 2012-06-30 08:47+0400\n" +"POT-Creation-Date: 2015-05-22 17:45+0200\n" +"PO-Revision-Date: 2015-06-23 20:40+0300\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Lokalize 1.2\n" +"X-Generator: Lokalize 1.5\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" @@ -30,144 +29,148 @@ msgstr "" msgid "Package %s version %s has an unmet dep:\n" msgstr "Пакет %s версии %s имеет неудовлетворённую зависимость:\n" -#: cmdline/apt-cache.cc:320 +#: cmdline/apt-cache.cc:277 msgid "Total package names: " msgstr "Всего имён пакетов: " -#: cmdline/apt-cache.cc:322 +#: cmdline/apt-cache.cc:279 msgid "Total package structures: " msgstr "Всего структур пакетов: " -#: cmdline/apt-cache.cc:362 +#: cmdline/apt-cache.cc:319 msgid " Normal packages: " msgstr " Обычных пакетов: " -#: cmdline/apt-cache.cc:363 +#: cmdline/apt-cache.cc:320 msgid " Pure virtual packages: " msgstr " Полностью виртуальных пакетов: " -#: cmdline/apt-cache.cc:364 +#: cmdline/apt-cache.cc:321 msgid " Single virtual packages: " msgstr " Одиночных виртуальных пакетов: " -#: cmdline/apt-cache.cc:365 +#: cmdline/apt-cache.cc:322 msgid " Mixed virtual packages: " msgstr " Смешанных виртуальных пакетов: " -#: cmdline/apt-cache.cc:366 +#: cmdline/apt-cache.cc:323 msgid " Missing: " msgstr " Отсутствует: " -#: cmdline/apt-cache.cc:368 +#: cmdline/apt-cache.cc:325 msgid "Total distinct versions: " msgstr "Всего уникальных версий: " -#: cmdline/apt-cache.cc:370 +#: cmdline/apt-cache.cc:327 msgid "Total distinct descriptions: " msgstr "Всего уникальных описаний: " -#: cmdline/apt-cache.cc:372 +#: cmdline/apt-cache.cc:329 msgid "Total dependencies: " msgstr "Всего зависимостей: " -#: cmdline/apt-cache.cc:375 +#: cmdline/apt-cache.cc:332 msgid "Total ver/file relations: " msgstr "Всего отношений Версия/Файл: " -#: cmdline/apt-cache.cc:377 +#: cmdline/apt-cache.cc:334 msgid "Total Desc/File relations: " msgstr "Всего отношений Описание/Файл: " -#: cmdline/apt-cache.cc:379 +#: cmdline/apt-cache.cc:336 msgid "Total Provides mappings: " msgstr "Всего отношений Provides: " -#: cmdline/apt-cache.cc:433 +#: cmdline/apt-cache.cc:348 msgid "Total globbed strings: " msgstr "Всего развёрнутых строк: " -#: cmdline/apt-cache.cc:439 +#: cmdline/apt-cache.cc:362 +msgid "Total dependency version space: " +msgstr "Всего информации о зависимостях: " + +#: cmdline/apt-cache.cc:367 msgid "Total slack space: " msgstr "Пустого места в кэше: " -#: cmdline/apt-cache.cc:454 +#: cmdline/apt-cache.cc:375 msgid "Total space accounted for: " msgstr "Полное учтённое пространство: " -#: cmdline/apt-cache.cc:590 cmdline/apt-cache.cc:1239 +#: cmdline/apt-cache.cc:506 cmdline/apt-cache.cc:1155 #: apt-private/private-show.cc:58 #, c-format msgid "Package file %s is out of sync." msgstr "Список пакетов %s рассинхронизирован." -#: cmdline/apt-cache.cc:668 cmdline/apt-cache.cc:1526 -#: cmdline/apt-cache.cc:1528 cmdline/apt-cache.cc:1605 cmdline/apt-mark.cc:56 -#: cmdline/apt-mark.cc:103 cmdline/apt-mark.cc:229 +#: cmdline/apt-cache.cc:584 cmdline/apt-cache.cc:1442 +#: cmdline/apt-cache.cc:1444 cmdline/apt-cache.cc:1521 cmdline/apt-mark.cc:59 +#: cmdline/apt-mark.cc:106 cmdline/apt-mark.cc:232 #: apt-private/private-show.cc:171 apt-private/private-show.cc:173 msgid "No packages found" msgstr "Не найдено ни одного пакета" -#: cmdline/apt-cache.cc:1338 apt-private/private-search.cc:41 +#: cmdline/apt-cache.cc:1254 apt-private/private-search.cc:41 msgid "You must give at least one search pattern" msgstr "Вы должны задать не менее одно шаблона поиска" -#: cmdline/apt-cache.cc:1505 +#: cmdline/apt-cache.cc:1421 msgid "This command is deprecated. Please use 'apt-mark showauto' instead." msgstr "Эта команда устарела. Используйте вместо неё «apt-mark showauto»." -#: cmdline/apt-cache.cc:1600 apt-pkg/cacheset.cc:653 +#: cmdline/apt-cache.cc:1516 apt-pkg/cacheset.cc:596 #, c-format msgid "Unable to locate package %s" msgstr "Не удалось найти пакет %s" -#: cmdline/apt-cache.cc:1630 +#: cmdline/apt-cache.cc:1546 msgid "Package files:" msgstr "Списки пакетов:" -#: cmdline/apt-cache.cc:1637 cmdline/apt-cache.cc:1728 +#: cmdline/apt-cache.cc:1553 cmdline/apt-cache.cc:1644 msgid "Cache is out of sync, can't x-ref a package file" msgstr "Кэш рассинхронизирован, невозможно обнаружить ссылку на список пакетов" #. Show any packages have explicit pins -#: cmdline/apt-cache.cc:1651 +#: cmdline/apt-cache.cc:1567 msgid "Pinned packages:" msgstr "Зафиксированные пакеты:" -#: cmdline/apt-cache.cc:1663 cmdline/apt-cache.cc:1708 +#: cmdline/apt-cache.cc:1579 cmdline/apt-cache.cc:1624 msgid "(not found)" msgstr "(не найдено)" -#: cmdline/apt-cache.cc:1671 +#: cmdline/apt-cache.cc:1587 msgid " Installed: " msgstr " Установлен: " -#: cmdline/apt-cache.cc:1672 +#: cmdline/apt-cache.cc:1588 msgid " Candidate: " msgstr " Кандидат: " -#: cmdline/apt-cache.cc:1690 cmdline/apt-cache.cc:1698 +#: cmdline/apt-cache.cc:1606 cmdline/apt-cache.cc:1614 msgid "(none)" msgstr "(отсутствует)" -#: cmdline/apt-cache.cc:1705 +#: cmdline/apt-cache.cc:1621 msgid " Package pin: " msgstr " Фиксатор пакета: " #. Show the priority tables -#: cmdline/apt-cache.cc:1714 +#: cmdline/apt-cache.cc:1630 msgid " Version table:" msgstr " Таблица версий:" -#: cmdline/apt-cache.cc:1827 cmdline/apt-cdrom.cc:208 cmdline/apt-config.cc:83 -#: cmdline/apt-get.cc:1610 cmdline/apt-helper.cc:86 cmdline/apt-mark.cc:446 -#: cmdline/apt.cc:42 cmdline/apt-extracttemplates.cc:222 -#: ftparchive/apt-ftparchive.cc:619 cmdline/apt-internal-solver.cc:47 -#: cmdline/apt-sortpkgs.cc:149 +#: cmdline/apt-cache.cc:1743 cmdline/apt-cdrom.cc:207 cmdline/apt-config.cc:83 +#: cmdline/apt-get.cc:1591 cmdline/apt-helper.cc:84 cmdline/apt-mark.cc:388 +#: cmdline/apt.cc:42 cmdline/apt-extracttemplates.cc:217 +#: ftparchive/apt-ftparchive.cc:620 cmdline/apt-internal-solver.cc:45 +#: cmdline/apt-sortpkgs.cc:147 #, c-format msgid "%s %s for %s compiled on %s %s\n" msgstr "%s %s для %s скомпилирован %s %s\n" -#: cmdline/apt-cache.cc:1834 +#: cmdline/apt-cache.cc:1750 msgid "" "Usage: apt-cache [options] command\n" " apt-cache [options] showpkg pkg1 [pkg2 ...]\n" @@ -237,28 +240,34 @@ msgstr "" " -o=? Задать значение произвольной настройки, например, -o dir::cache=/tmp\n" "Подробности в справочных страницах apt-cache(8) и apt.conf(5).\n" -#: cmdline/apt-cdrom.cc:77 +#: cmdline/apt-cdrom.cc:76 msgid "Please provide a name for this Disc, such as 'Debian 5.0.3 Disk 1'" msgstr "Задайте имя для этого диска, например «Debian 5.0.3 Disk 1»" -#: cmdline/apt-cdrom.cc:92 +#: cmdline/apt-cdrom.cc:91 msgid "Please insert a Disc in the drive and press enter" msgstr "Вставьте диск в устройство и нажмите ввод" -#: cmdline/apt-cdrom.cc:140 +#: cmdline/apt-cdrom.cc:139 #, c-format msgid "Failed to mount '%s' to '%s'" msgstr "Не удалось примонтировать «%s» к «%s»" -#: cmdline/apt-cdrom.cc:179 +#: cmdline/apt-cdrom.cc:178 msgid "" "No CD-ROM could be auto-detected or found using the default mount point.\n" "You may try the --cdrom option to set the CD-ROM mount point.\n" "See 'man apt-cdrom' for more information about the CD-ROM auto-detection and " "mount point." msgstr "" +"Не удалось автоматически обнаружить CD-ROM и в точке монтирования по " +"умолчанию\n" +"также ничего нет. Вы можете использовать параметр --cdrom, чтобы указать " +"точку\n" +"монтирования CD-ROM. Подробней о точке монтирования и автоматическом\n" +"обнаружении CD-ROM смотрите в «man apt-cdrom»." -#: cmdline/apt-cdrom.cc:183 +#: cmdline/apt-cdrom.cc:182 msgid "Repeat this process for the rest of the CDs in your set." msgstr "Повторите этот процесс для всех имеющихся CD." @@ -295,48 +304,48 @@ msgstr "" " -o=? Задать значение произвольной настройке, например, -o dir::cache=/" "tmp\n" -#: cmdline/apt-get.cc:224 -#, fuzzy, c-format +#: cmdline/apt-get.cc:245 +#, c-format msgid "Can not find a package for architecture '%s'" -msgstr "Не удалось найти пакет по регулярному выражению «%s»" +msgstr "Не удалось найти пакет для архитектуры «%s»" -#: cmdline/apt-get.cc:311 -#, fuzzy, c-format +#: cmdline/apt-get.cc:327 +#, c-format msgid "Can not find a package '%s' with version '%s'" -msgstr "Не удалось найти пакет по регулярному выражению «%s»" +msgstr "Не удалось найти пакет «%s» версии «%s»" -#: cmdline/apt-get.cc:314 -#, fuzzy, c-format +#: cmdline/apt-get.cc:330 +#, c-format msgid "Can not find a package '%s' with release '%s'" -msgstr "Не удалось найти пакет по регулярному выражению «%s»" +msgstr "Не удалось найти пакет «%s» в выпуске «%s»" -#: cmdline/apt-get.cc:358 +#: cmdline/apt-get.cc:367 #, c-format msgid "Picking '%s' as source package instead of '%s'\n" msgstr "Используется «%s» в качестве исходного пакета вместо «%s»\n" -#: cmdline/apt-get.cc:414 -#, fuzzy, c-format +#: cmdline/apt-get.cc:423 +#, c-format msgid "Can not find version '%s' of package '%s'" -msgstr "Игнорируется недоступная версия «%s» пакета «%s»" +msgstr "Не удалось найти версию «%s» пакета «%s»" -#: cmdline/apt-get.cc:445 +#: cmdline/apt-get.cc:454 #, c-format msgid "Couldn't find package %s" msgstr "Не удалось найти пакет %s" -#: cmdline/apt-get.cc:450 cmdline/apt-mark.cc:78 -#: apt-private/private-install.cc:863 +#: cmdline/apt-get.cc:459 cmdline/apt-mark.cc:81 +#: apt-private/private-install.cc:865 #, c-format msgid "%s set to manually installed.\n" msgstr "%s установлен вручную.\n" -#: cmdline/apt-get.cc:452 cmdline/apt-mark.cc:80 +#: cmdline/apt-get.cc:461 cmdline/apt-mark.cc:83 #, c-format msgid "%s set to automatically installed.\n" msgstr "%s выбран для автоматической установки.\n" -#: cmdline/apt-get.cc:460 cmdline/apt-mark.cc:124 +#: cmdline/apt-get.cc:469 cmdline/apt-mark.cc:127 msgid "" "This command is deprecated. Please use 'apt-mark auto' and 'apt-mark manual' " "instead." @@ -344,25 +353,25 @@ msgstr "" "Эта команда устарела. Используйте вместо неё «apt-mark auto» и «apt-mark " "manual»." -#: cmdline/apt-get.cc:529 cmdline/apt-get.cc:537 +#: cmdline/apt-get.cc:538 cmdline/apt-get.cc:546 msgid "Internal error, problem resolver broke stuff" msgstr "Внутренняя ошибка, решатель проблем всё поломал" -#: cmdline/apt-get.cc:598 +#: cmdline/apt-get.cc:574 cmdline/apt-get.cc:611 msgid "Unable to lock the download directory" msgstr "Невозможно заблокировать каталог, куда складываются скачиваемые файлы" -#: cmdline/apt-get.cc:716 +#: cmdline/apt-get.cc:726 msgid "Must specify at least one package to fetch source for" msgstr "" "Укажите как минимум один пакет, исходный код которого необходимо получить" -#: cmdline/apt-get.cc:760 cmdline/apt-get.cc:1074 +#: cmdline/apt-get.cc:766 cmdline/apt-get.cc:1071 #, c-format msgid "Unable to find a source package for %s" msgstr "Невозможно найти пакет с исходным кодом для %s" -#: cmdline/apt-get.cc:780 +#: cmdline/apt-get.cc:786 #, c-format msgid "" "NOTICE: '%s' packaging is maintained in the '%s' version control system at:\n" @@ -371,7 +380,7 @@ msgstr "" "ВНИМАНИЕ: упаковка «%s» поддерживается в системе контроля версий «%s»:\n" "%s\n" -#: cmdline/apt-get.cc:785 +#: cmdline/apt-get.cc:791 #, c-format msgid "" "Please use:\n" @@ -382,69 +391,80 @@ msgstr "" "bzr branch %s\n" "для получения последних (возможно не выпущенных) обновлений пакета.\n" -#: cmdline/apt-get.cc:833 +#: cmdline/apt-get.cc:839 #, c-format msgid "Skipping already downloaded file '%s'\n" msgstr "Пропускаем уже скачанный файл «%s»\n" +#: cmdline/apt-get.cc:873 cmdline/apt-get.cc:876 +#: apt-private/private-install.cc:187 apt-private/private-install.cc:190 +#, c-format +msgid "Couldn't determine free space in %s" +msgstr "Не удалось определить количество свободного места в %s" + +#: cmdline/apt-get.cc:886 +#, c-format +msgid "You don't have enough free space in %s" +msgstr "Недостаточно места в %s" + #. TRANSLATOR: The required space between number and unit is already included #. in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB -#: cmdline/apt-get.cc:863 +#: cmdline/apt-get.cc:895 #, c-format msgid "Need to get %sB/%sB of source archives.\n" msgstr "Необходимо получить %sб/%sб архивов исходного кода.\n" #. TRANSLATOR: The required space between number and unit is already included #. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB -#: cmdline/apt-get.cc:868 +#: cmdline/apt-get.cc:900 #, c-format msgid "Need to get %sB of source archives.\n" msgstr "Необходимо получить %sб архивов исходного кода.\n" -#: cmdline/apt-get.cc:874 +#: cmdline/apt-get.cc:906 #, c-format msgid "Fetch source %s\n" msgstr "Получение исходного кода %s\n" -#: cmdline/apt-get.cc:899 +#: cmdline/apt-get.cc:924 msgid "Failed to fetch some archives." msgstr "Некоторые архивы не удалось получить." -#: cmdline/apt-get.cc:904 apt-private/private-install.cc:289 +#: cmdline/apt-get.cc:929 apt-private/private-install.cc:314 msgid "Download complete and in download only mode" msgstr "Указан режим «только скачивание», и скачивание завершено" -#: cmdline/apt-get.cc:929 +#: cmdline/apt-get.cc:954 #, c-format msgid "Skipping unpack of already unpacked source in %s\n" msgstr "Пропускается распаковка уже распакованного исходного кода в %s\n" -#: cmdline/apt-get.cc:942 +#: cmdline/apt-get.cc:967 #, c-format msgid "Unpack command '%s' failed.\n" msgstr "Команда распаковки «%s» завершилась неудачно.\n" -#: cmdline/apt-get.cc:943 +#: cmdline/apt-get.cc:968 #, c-format msgid "Check if the 'dpkg-dev' package is installed.\n" msgstr "Проверьте, установлен ли пакет «dpkg-dev».\n" -#: cmdline/apt-get.cc:971 +#: cmdline/apt-get.cc:996 #, c-format msgid "Build command '%s' failed.\n" msgstr "Команда сборки «%s» завершилась неудачно.\n" -#: cmdline/apt-get.cc:990 +#: cmdline/apt-get.cc:1015 msgid "Child process failed" msgstr "Порождённый процесс завершился неудачно" -#: cmdline/apt-get.cc:1009 +#: cmdline/apt-get.cc:1034 msgid "Must specify at least one package to check builddeps for" msgstr "" "Для проверки зависимостей для сборки необходимо указать как минимум один " "пакет" -#: cmdline/apt-get.cc:1030 +#: cmdline/apt-get.cc:1059 #, c-format msgid "" "No architecture information available for %s. See apt.conf(5) APT::" @@ -453,27 +473,17 @@ msgstr "" "У %s отсутствует информация об архитектуре. Для её настройки смотрите apt." "conf(5) APT::Architectures" -#: cmdline/apt-get.cc:1047 -#, c-format -msgid "Note, using directory '%s' to get the build dependencies\n" -msgstr "" - -#: cmdline/apt-get.cc:1057 -#, fuzzy, c-format -msgid "Note, using file '%s' to get the build dependencies\n" -msgstr "Обработка зависимостей для сборки завершилась неудачно" - -#: cmdline/apt-get.cc:1086 cmdline/apt-get.cc:1089 +#: cmdline/apt-get.cc:1083 cmdline/apt-get.cc:1086 #, c-format msgid "Unable to get build-dependency information for %s" msgstr "Невозможно получить информацию о зависимостях для сборки %s" -#: cmdline/apt-get.cc:1109 +#: cmdline/apt-get.cc:1106 #, c-format msgid "%s has no build depends.\n" msgstr "%s не имеет зависимостей для сборки.\n" -#: cmdline/apt-get.cc:1279 +#: cmdline/apt-get.cc:1276 #, c-format msgid "" "%s dependency for %s can't be satisfied because %s is not allowed on '%s' " @@ -482,7 +492,7 @@ msgstr "" "Зависимость типа %s для %s не может быть удовлетворена, так как %s не " "разрешён для пакетов «%s»" -#: cmdline/apt-get.cc:1297 +#: cmdline/apt-get.cc:1294 #, c-format msgid "" "%s dependency for %s cannot be satisfied because the package %s cannot be " @@ -491,14 +501,14 @@ msgstr "" "Зависимость типа %s для %s не может быть удовлетворена, так как пакет %s не " "найден" -#: cmdline/apt-get.cc:1320 +#: cmdline/apt-get.cc:1317 #, c-format msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new" msgstr "" "Не удалось удовлетворить зависимость типа %s для пакета %s: Установленный " "пакет %s новее, чем надо" -#: cmdline/apt-get.cc:1359 +#: cmdline/apt-get.cc:1356 #, c-format msgid "" "%s dependency for %s cannot be satisfied because candidate version of " @@ -507,7 +517,7 @@ msgstr "" "Зависимость типа %s для %s не может быть удовлетворена, так как версия-" "кандидат пакета %s не может удовлетворить требованиям по версии" -#: cmdline/apt-get.cc:1365 +#: cmdline/apt-get.cc:1362 #, c-format msgid "" "%s dependency for %s cannot be satisfied because package %s has no candidate " @@ -516,30 +526,30 @@ msgstr "" "Зависимость типа %s для %s не может быть удовлетворена, так как пакет %s не " "имеет версии-кандидата" -#: cmdline/apt-get.cc:1388 +#: cmdline/apt-get.cc:1385 #, c-format msgid "Failed to satisfy %s dependency for %s: %s" msgstr "Невозможно удовлетворить зависимость типа %s для пакета %s: %s" -#: cmdline/apt-get.cc:1403 +#: cmdline/apt-get.cc:1400 #, c-format msgid "Build-dependencies for %s could not be satisfied." msgstr "Зависимости для сборки %s не могут быть удовлетворены." -#: cmdline/apt-get.cc:1408 +#: cmdline/apt-get.cc:1405 msgid "Failed to process build dependencies" msgstr "Обработка зависимостей для сборки завершилась неудачно" -#: cmdline/apt-get.cc:1501 cmdline/apt-get.cc:1516 +#: cmdline/apt-get.cc:1498 cmdline/apt-get.cc:1510 #, c-format msgid "Changelog for %s (%s)" msgstr "Changelog для %s (%s)" -#: cmdline/apt-get.cc:1615 +#: cmdline/apt-get.cc:1596 msgid "Supported modules:" msgstr "Поддерживаемые модули:" -#: cmdline/apt-get.cc:1656 +#: cmdline/apt-get.cc:1637 msgid "" "Usage: apt-get [options] command\n" " apt-get [options] install|remove pkg1 [pkg2 ...]\n" @@ -633,19 +643,17 @@ msgstr "" #: cmdline/apt-helper.cc:36 msgid "Need one URL as argument" -msgstr "" +msgstr "В качестве аргумента требуется URL" #: cmdline/apt-helper.cc:49 -#, fuzzy msgid "Must specify at least one pair url/filename" -msgstr "" -"Укажите как минимум один пакет, исходный код которого необходимо получить" +msgstr "Укажите, как минимум, одну пару url/имя файла" -#: cmdline/apt-helper.cc:75 cmdline/apt-helper.cc:79 +#: cmdline/apt-helper.cc:73 cmdline/apt-helper.cc:77 msgid "Download Failed" -msgstr "" +msgstr "Ошибка при скачивании" -#: cmdline/apt-helper.cc:93 +#: cmdline/apt-helper.cc:91 msgid "" "Usage: apt-helper [options] command\n" " apt-helper [options] download-file uri target-path\n" @@ -658,56 +666,64 @@ msgid "" "\n" " This APT helper has Super Meep Powers.\n" msgstr "" +"Использование: apt-helper [параметры] команда\n" +" apt-helper [параметры] download-file uri target-path\n" +"\n" +"apt-helper — вспомогательная программа для apt\n" +"\n" +"Команды:\n" +" download-file — скачать файл по заданному uri в target-path\n" +" auto-detect-proxy — определять прокси с помощью apt.conf\n" +"\n" +" В этой программе есть Super Meep Powers.\n" -#: cmdline/apt-mark.cc:65 +#: cmdline/apt-mark.cc:68 #, c-format msgid "%s can not be marked as it is not installed.\n" msgstr "%s не может быть помечен, так он не установлен.\n" -#: cmdline/apt-mark.cc:71 +#: cmdline/apt-mark.cc:74 #, c-format msgid "%s was already set to manually installed.\n" msgstr "%s уже помечен как установленный вручную.\n" -#: cmdline/apt-mark.cc:73 +#: cmdline/apt-mark.cc:76 #, c-format msgid "%s was already set to automatically installed.\n" msgstr "%s уже помечен как установленный автоматически.\n" -#: cmdline/apt-mark.cc:238 +#: cmdline/apt-mark.cc:241 #, c-format msgid "%s was already set on hold.\n" msgstr "%s уже помечен как зафиксированный.\n" -#: cmdline/apt-mark.cc:240 +#: cmdline/apt-mark.cc:243 #, c-format msgid "%s was already not hold.\n" msgstr "%s уже помечен как не зафиксированный.\n" -#: cmdline/apt-mark.cc:255 cmdline/apt-mark.cc:333 cmdline/apt-mark.cc:397 -#: apt-pkg/contrib/fileutl.cc:834 apt-pkg/contrib/gpgv.cc:192 -#: apt-pkg/deb/dpkgpm.cc:1303 +#: cmdline/apt-mark.cc:258 cmdline/apt-mark.cc:339 apt-pkg/deb/dpkgpm.cc:1317 +#: apt-pkg/contrib/fileutl.cc:813 apt-pkg/contrib/gpgv.cc:219 #, c-format msgid "Waited for %s but it wasn't there" msgstr "Ожидалось завершение процесса %s, но он не был запущен" -#: cmdline/apt-mark.cc:270 cmdline/apt-mark.cc:380 +#: cmdline/apt-mark.cc:273 cmdline/apt-mark.cc:322 #, c-format msgid "%s set on hold.\n" msgstr "%s помечен как зафиксированный.\n" -#: cmdline/apt-mark.cc:272 cmdline/apt-mark.cc:385 +#: cmdline/apt-mark.cc:275 cmdline/apt-mark.cc:327 #, c-format msgid "Canceled hold on %s.\n" msgstr "Отмена фиксации для %s.\n" -#: cmdline/apt-mark.cc:337 cmdline/apt-mark.cc:403 +#: cmdline/apt-mark.cc:345 msgid "Executing dpkg failed. Are you root?" msgstr "" "Выполнение dpkg завершилось с ошибкой. У вас есть права суперпользователя?" -#: cmdline/apt-mark.cc:450 -#, fuzzy +#: cmdline/apt-mark.cc:392 msgid "" "Usage: apt-mark [options] {auto|manual} pkg1 [pkg2 ...]\n" "\n" @@ -740,8 +756,13 @@ msgstr "" "Также может показывать списки помеченных пакетов.\n" "\n" "Команды:\n" -" auto - пометить указанные пакеты, как установленные автоматически\n" -" manual - пометить указанные пакеты, как установленные вручную\n" +" auto — пометить указанные пакеты, как установленные автоматически\n" +" manual — пометить указанные пакеты, как установленные вручную\n" +" hold — пометить пакет как зафиксированный\n" +" unhold — снять метку пакета, что он зафиксирован\n" +" showauto — вывести список автоматически установленных пакетов\n" +" showmanual — вывести список пакетов установленных вручную\n" +" showhold — вывести список зафиксированных пакетов\n" "\n" "Параметры:\n" " -h эта справка\n" @@ -753,7 +774,7 @@ msgstr "" " -o=? задать значение произвольному параметру настройки,\n" " например, -o dir::cache=/tmp\n" "В справочных страницах apt-mark(8) и apt.conf(5)\n" -"содержится подробная информация и описание параметров." +"содержится дополнительная информация." #: cmdline/apt.cc:47 msgid "" @@ -776,6 +797,23 @@ msgid "" "\n" " edit-sources - edit the source information file\n" msgstr "" +"Использование: apt [параметры] команда\n" +"\n" +"Интерфейс командной строки для apt.\n" +"Основные команды: \n" +" list — показать список пакетов из указанных имён пакетов\n" +" search — искать в описаниях пакетов\n" +" show — показать дополнительные данные о пакете\n" +"\n" +" update — обновить список доступных пакетов\n" +"\n" +" install — установить пакеты\n" +" remove — удалить пакеты\n" +"\n" +" upgrade — обновить систему, устанавливая/обновляя пакеты\n" +" full-upgrade — обновить систему, удаляя/устанавливая/обновляя пакеты\n" +"\n" +" edit-sources — редактировать файл с источниками пакетов\n" #: methods/cdrom.cc:203 #, c-format @@ -807,12 +845,12 @@ msgstr "Диск не найден." msgid "File not found" msgstr "Файл не найден" -#: methods/copy.cc:61 methods/gzip.cc:127 methods/rred.cc:598 +#: methods/copy.cc:61 methods/gzip.cc:117 methods/rred.cc:598 #: methods/rred.cc:608 msgid "Failed to stat" msgstr "Не удалось получить атрибуты" -#: methods/copy.cc:113 methods/gzip.cc:134 methods/rred.cc:605 +#: methods/copy.cc:105 methods/gzip.cc:124 methods/rred.cc:605 msgid "Failed to set modification time" msgstr "Не удалось установить время модификации" @@ -821,34 +859,34 @@ msgid "Invalid URI, local URIS must not start with //" msgstr "Неправильный URI, локальный URI не должен начинаться с //" #. Login must be before getpeername otherwise dante won't work. -#: methods/ftp.cc:178 +#: methods/ftp.cc:177 msgid "Logging in" msgstr "Вход в систему" -#: methods/ftp.cc:184 +#: methods/ftp.cc:183 msgid "Unable to determine the peer name" msgstr "Невозможно определить имя удалённого сервера" -#: methods/ftp.cc:189 +#: methods/ftp.cc:188 msgid "Unable to determine the local name" msgstr "Невозможно определить локальное имя" -#: methods/ftp.cc:220 methods/ftp.cc:248 +#: methods/ftp.cc:219 methods/ftp.cc:247 #, c-format msgid "The server refused the connection and said: %s" msgstr "Сервер разорвал соединение и сообщил: %s" -#: methods/ftp.cc:226 +#: methods/ftp.cc:225 #, c-format msgid "USER failed, server said: %s" msgstr "Команда USER не выполнена, сервер сообщил: %s" -#: methods/ftp.cc:233 +#: methods/ftp.cc:232 #, c-format msgid "PASS failed, server said: %s" msgstr "Команда PASS не выполнена, сервер сообщил: %s" -#: methods/ftp.cc:253 +#: methods/ftp.cc:252 msgid "" "A proxy server was specified but no login script, Acquire::ftp::ProxyLogin " "is empty." @@ -856,127 +894,127 @@ msgstr "" "Proxy-сервер указан, однако нет сценария входа в систему, Acquire::ftp::" "ProxyLogin пуст." -#: methods/ftp.cc:281 +#: methods/ftp.cc:280 #, c-format msgid "Login script command '%s' failed, server said: %s" msgstr "" "Команда «%s» сценария входа в систему завершилась неудачно, сервер сообщил: " "%s" -#: methods/ftp.cc:307 +#: methods/ftp.cc:306 #, c-format msgid "TYPE failed, server said: %s" msgstr "Команда TYPE не выполнена, сервер сообщил: %s" -#: methods/ftp.cc:345 methods/ftp.cc:457 methods/rsh.cc:195 methods/rsh.cc:243 +#: methods/ftp.cc:344 methods/ftp.cc:456 methods/rsh.cc:195 methods/rsh.cc:243 msgid "Connection timeout" msgstr "Допустимое время ожидания для соединения истекло" -#: methods/ftp.cc:351 +#: methods/ftp.cc:350 msgid "Server closed the connection" msgstr "Сервер прервал соединение" -#: methods/ftp.cc:354 methods/rsh.cc:202 apt-pkg/contrib/fileutl.cc:1515 -#: apt-pkg/contrib/fileutl.cc:1524 apt-pkg/contrib/fileutl.cc:1529 -#: apt-pkg/contrib/fileutl.cc:1531 +#: methods/ftp.cc:353 methods/rsh.cc:202 apt-pkg/contrib/fileutl.cc:1477 +#: apt-pkg/contrib/fileutl.cc:1486 apt-pkg/contrib/fileutl.cc:1491 +#: apt-pkg/contrib/fileutl.cc:1493 msgid "Read error" msgstr "Ошибка чтения" -#: methods/ftp.cc:361 methods/rsh.cc:209 +#: methods/ftp.cc:360 methods/rsh.cc:209 msgid "A response overflowed the buffer." msgstr "Ответ переполнил буфер." -#: methods/ftp.cc:378 methods/ftp.cc:390 +#: methods/ftp.cc:377 methods/ftp.cc:389 msgid "Protocol corruption" msgstr "Искажение протокола" -#: methods/ftp.cc:463 methods/rsh.cc:249 apt-pkg/contrib/fileutl.cc:911 -#: apt-pkg/contrib/fileutl.cc:1637 apt-pkg/contrib/fileutl.cc:1646 -#: apt-pkg/contrib/fileutl.cc:1651 apt-pkg/contrib/fileutl.cc:1653 -#: apt-pkg/contrib/fileutl.cc:1678 +#: methods/ftp.cc:462 methods/rsh.cc:249 apt-pkg/contrib/fileutl.cc:873 +#: apt-pkg/contrib/fileutl.cc:1599 apt-pkg/contrib/fileutl.cc:1608 +#: apt-pkg/contrib/fileutl.cc:1613 apt-pkg/contrib/fileutl.cc:1615 +#: apt-pkg/contrib/fileutl.cc:1640 msgid "Write error" msgstr "Ошибка записи" -#: methods/ftp.cc:702 methods/ftp.cc:708 methods/ftp.cc:743 +#: methods/ftp.cc:701 methods/ftp.cc:707 methods/ftp.cc:742 msgid "Could not create a socket" msgstr "Не удалось создать сокет" -#: methods/ftp.cc:713 +#: methods/ftp.cc:712 msgid "Could not connect data socket, connection timed out" msgstr "" "Не удалось присоединиться к сокету данных, время на установление соединения " "истекло" -#: methods/ftp.cc:717 methods/connect.cc:116 +#: methods/ftp.cc:716 methods/connect.cc:116 msgid "Failed" msgstr "Неудачно" -#: methods/ftp.cc:719 +#: methods/ftp.cc:718 msgid "Could not connect passive socket." msgstr "Невозможно присоединить пассивный сокет" -#: methods/ftp.cc:736 +#: methods/ftp.cc:735 msgid "getaddrinfo was unable to get a listening socket" msgstr "Вызов getaddrinfo не смог получить сокет" -#: methods/ftp.cc:750 +#: methods/ftp.cc:749 msgid "Could not bind a socket" msgstr "Невозможно присоединиться к сокету" -#: methods/ftp.cc:754 +#: methods/ftp.cc:753 msgid "Could not listen on the socket" msgstr "Не удалось принимать соединения на сокете" -#: methods/ftp.cc:761 +#: methods/ftp.cc:760 msgid "Could not determine the socket's name" msgstr "Не удалось определить имя сокета" -#: methods/ftp.cc:793 +#: methods/ftp.cc:792 msgid "Unable to send PORT command" msgstr "Невозможно послать команду PORT" -#: methods/ftp.cc:803 +#: methods/ftp.cc:802 #, c-format msgid "Unknown address family %u (AF_*)" msgstr "Неизвестное семейство адресов %u (AF_*)" -#: methods/ftp.cc:812 +#: methods/ftp.cc:811 #, c-format msgid "EPRT failed, server said: %s" msgstr "Команда EPRT не выполнена, сервер сообщил: %s" -#: methods/ftp.cc:832 +#: methods/ftp.cc:831 msgid "Data socket connect timed out" msgstr "Время установления соединения для сокета данных истекло" -#: methods/ftp.cc:839 +#: methods/ftp.cc:838 msgid "Unable to accept connection" msgstr "Невозможно принять соединение" -#: methods/ftp.cc:879 methods/server.cc:362 methods/rsh.cc:319 +#: methods/ftp.cc:877 methods/server.cc:367 methods/rsh.cc:319 msgid "Problem hashing file" msgstr "Проблема при хешировании файла" -#: methods/ftp.cc:892 +#: methods/ftp.cc:890 #, c-format msgid "Unable to fetch file, server said '%s'" msgstr "Невозможно получить файл, сервер сообщил: «%s»" -#: methods/ftp.cc:907 methods/rsh.cc:338 +#: methods/ftp.cc:905 methods/rsh.cc:338 msgid "Data socket timed out" msgstr "Время ожидания соединения для сокета данных истекло" -#: methods/ftp.cc:944 +#: methods/ftp.cc:935 #, c-format msgid "Data transfer failed, server said '%s'" msgstr "Передача данных завершилась неудачно, сервер сообщил: «%s»" #. Get the files information -#: methods/ftp.cc:1027 +#: methods/ftp.cc:1014 msgid "Query" msgstr "Запрос" -#: methods/ftp.cc:1141 +#: methods/ftp.cc:1128 msgid "Unable to invoke " msgstr "Невозможно вызвать " @@ -1028,9 +1066,9 @@ msgid "Temporary failure resolving '%s'" msgstr "Временная ошибка при попытке получить IP-адрес «%s»" #: methods/connect.cc:209 -#, fuzzy, c-format +#, c-format msgid "System error resolving '%s:%s'" -msgstr "Что-то странное произошло при определении «%s:%s» (%i - %s)" +msgstr "Системная ошибка при определении «%s:%s»" #: methods/connect.cc:211 #, c-format @@ -1042,39 +1080,40 @@ msgstr "Что-то странное произошло при определе msgid "Unable to connect to %s:%s:" msgstr "Невозможно соединиться с %s: %s:" -#: methods/gpgv.cc:158 +#: methods/gpgv.cc:168 msgid "" "Internal error: Good signature, but could not determine key fingerprint?!" msgstr "" "Внутренняя ошибка: Правильная подпись, но не удалось определить отпечаток " "ключа?!" -#: methods/gpgv.cc:162 +#: methods/gpgv.cc:172 msgid "At least one invalid signature was encountered." msgstr "Найдена как минимум одна неправильная подпись." -#: methods/gpgv.cc:164 +#: methods/gpgv.cc:174 msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)" -msgstr "" -"Не удалось выполнить «apt-key» для проверки подписи (gnupg установлена?)" +msgstr "Не удалось выполнить «apt-key» для проверки подписи (gnupg установлена?)" #. TRANSLATORS: %s is a single techy word like 'NODATA' -#: methods/gpgv.cc:170 +#: methods/gpgv.cc:180 #, c-format msgid "" "Clearsigned file isn't valid, got '%s' (does the network require " "authentication?)" msgstr "" +"Некорректный подписанный файл, получено «%s» (возможно в сети " +"требуется аутентификация?)" -#: methods/gpgv.cc:174 +#: methods/gpgv.cc:184 msgid "Unknown error executing apt-key" msgstr "Неизвестная ошибка при выполнении apt-key" -#: methods/gpgv.cc:207 methods/gpgv.cc:214 +#: methods/gpgv.cc:217 methods/gpgv.cc:224 msgid "The following signatures were invalid:\n" msgstr "Следующие подписи неверные:\n" -#: methods/gpgv.cc:221 +#: methods/gpgv.cc:231 msgid "" "The following signatures couldn't be verified because the public key is not " "available:\n" @@ -1082,35 +1121,35 @@ msgstr "" "Следующие подписи не могут быть проверены, так как недоступен открытый " "ключ:\n" -#: methods/gzip.cc:79 +#: methods/gzip.cc:69 msgid "Empty files can't be valid archives" msgstr "Пустые файлы не могут быть допустимыми архивами" -#: methods/http.cc:517 +#: methods/http.cc:513 msgid "Error writing to the file" msgstr "Ошибка записи в файл" -#: methods/http.cc:531 +#: methods/http.cc:527 msgid "Error reading from server. Remote end closed connection" msgstr "Ошибка чтения, удалённый сервер прервал соединение" -#: methods/http.cc:533 +#: methods/http.cc:529 msgid "Error reading from server" msgstr "Ошибка чтения с сервера" -#: methods/http.cc:569 +#: methods/http.cc:565 msgid "Error writing to file" msgstr "Ошибка записи в файл" -#: methods/http.cc:629 +#: methods/http.cc:625 msgid "Select failed" msgstr "Ошибка в select" -#: methods/http.cc:634 +#: methods/http.cc:630 msgid "Connection timed out" msgstr "Время ожидания для соединения истекло" -#: methods/http.cc:657 +#: methods/http.cc:653 msgid "Error writing to output file" msgstr "Ошибка записи в выходной файл" @@ -1130,433 +1169,180 @@ msgstr "Http-сервер послал неверный заголовок" msgid "The HTTP server sent an invalid Content-Length header" msgstr "Http сервер послал неверный заголовок Content-Length" -#: methods/server.cc:193 +#: methods/server.cc:200 msgid "The HTTP server sent an invalid Content-Range header" msgstr "Http-сервер послал неверный заголовок Content-Range" -#: methods/server.cc:195 +#: methods/server.cc:202 msgid "This HTTP server has broken range support" msgstr "Этот HTTP-сервер не поддерживает скачивание фрагментов файлов" -#: methods/server.cc:219 +#: methods/server.cc:229 msgid "Unknown date format" msgstr "Неизвестный формат данных" -#: methods/server.cc:506 +#: methods/server.cc:504 msgid "Bad header data" msgstr "Неверный заголовок данных" -#: methods/server.cc:523 methods/server.cc:617 +#: methods/server.cc:521 methods/server.cc:577 msgid "Connection failed" msgstr "Соединение разорвано" -#: methods/server.cc:589 -#, c-format -msgid "" -"Automatically disabled %s due to incorrect response from server/proxy. (man " -"5 apt.conf)" -msgstr "" - -#: methods/server.cc:712 +#: methods/server.cc:669 msgid "Internal error" msgstr "Внутренняя ошибка" -#: apt-private/private-list.cc:121 -msgid "Listing" -msgstr "" - -#: apt-private/private-list.cc:151 -#, c-format -msgid "There is %i additional version. Please use the '-a' switch to see it" -msgid_plural "" -"There are %i additional versions. Please use the '-a' switch to see them." -msgstr[0] "" -msgstr[1] "" -msgstr[2] "" - -#: apt-private/private-cachefile.cc:95 -msgid "Correcting dependencies..." -msgstr "Исправление зависимостей…" - -#: apt-private/private-cachefile.cc:98 -msgid " failed." -msgstr " не удалось." - -#: apt-private/private-cachefile.cc:101 -msgid "Unable to correct dependencies" -msgstr "Невозможно скорректировать зависимости" - -#: apt-private/private-cachefile.cc:104 -msgid "Unable to minimize the upgrade set" -msgstr "Невозможно минимизировать набор обновлений" - -#: apt-private/private-cachefile.cc:106 -msgid " Done" -msgstr " Готово" - -#: apt-private/private-cachefile.cc:110 -msgid "You might want to run 'apt-get -f install' to correct these." -msgstr "" -"Возможно, для исправления этих ошибок вы захотите воспользоваться «apt-get -" -"f install»." - -#: apt-private/private-cachefile.cc:113 -msgid "Unmet dependencies. Try using -f." -msgstr "Неудовлетворённые зависимости. Попытайтесь использовать -f." +#: apt-private/private-cacheset.cc:37 apt-private/private-search.cc:65 +msgid "Sorting" +msgstr "Сортировка" -#: apt-private/private-output.cc:103 apt-private/private-show.cc:84 -#: apt-private/private-show.cc:89 -msgid "unknown" +#: apt-private/private-install.cc:82 +msgid "Internal error, InstallPackages was called with broken packages!" msgstr "" +"Внутренняя ошибка, InstallPackages была вызвана с неработоспособными " +"пакетами!" -#: apt-private/private-output.cc:265 -#, fuzzy, c-format -msgid "[installed,upgradable to: %s]" -msgstr " [Установлен]" +#: apt-private/private-install.cc:91 +msgid "Packages need to be removed but remove is disabled." +msgstr "Пакеты необходимо удалить, но удаление запрещено." -#: apt-private/private-output.cc:268 -#, fuzzy -msgid "[installed,local]" -msgstr " [Установлен]" +#: apt-private/private-install.cc:110 +msgid "Internal error, Ordering didn't finish" +msgstr "Внутренняя ошибка, Ordering не завершилась" -#: apt-private/private-output.cc:270 -msgid "[installed,auto-removable]" -msgstr "" +#: apt-private/private-install.cc:148 +msgid "How odd... The sizes didn't match, email apt@packages.debian.org" +msgstr "Странно. Несовпадение размеров, напишите на apt@packages.debian.org" -#: apt-private/private-output.cc:272 -#, fuzzy -msgid "[installed,automatic]" -msgstr " [Установлен]" +#. TRANSLATOR: The required space between number and unit is already included +#. in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB +#: apt-private/private-install.cc:155 +#, c-format +msgid "Need to get %sB/%sB of archives.\n" +msgstr "Необходимо скачать %sB/%sB архивов.\n" -#: apt-private/private-output.cc:274 -#, fuzzy -msgid "[installed]" -msgstr " [Установлен]" +#. TRANSLATOR: The required space between number and unit is already included +#. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB +#: apt-private/private-install.cc:160 +#, c-format +msgid "Need to get %sB of archives.\n" +msgstr "Необходимо скачать %sБ архивов.\n" -#: apt-private/private-output.cc:277 +#. TRANSLATOR: The required space between number and unit is already included +#. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB +#: apt-private/private-install.cc:167 #, c-format -msgid "[upgradable from: %s]" +msgid "After this operation, %sB of additional disk space will be used.\n" msgstr "" +"После данной операции, объём занятого дискового пространства возрастёт на " +"%sB.\n" -#: apt-private/private-output.cc:281 -msgid "[residual-config]" +#. TRANSLATOR: The required space between number and unit is already included +#. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB +#: apt-private/private-install.cc:172 +#, c-format +msgid "After this operation, %sB disk space will be freed.\n" msgstr "" +"После данной операции, объём занятого дискового пространства уменьшится на " +"%sB.\n" -#: apt-private/private-output.cc:455 +#: apt-private/private-install.cc:200 #, c-format -msgid "but %s is installed" -msgstr "но %s уже установлен" +msgid "You don't have enough free space in %s." +msgstr "Недостаточно свободного места в %s." -#: apt-private/private-output.cc:457 -#, c-format -msgid "but %s is to be installed" -msgstr "но %s будет установлен" +#: apt-private/private-install.cc:210 apt-private/private-download.cc:59 +msgid "There are problems and -y was used without --force-yes" +msgstr "Существуют проблемы, а параметр -y указан без --force-yes" -#: apt-private/private-output.cc:464 -msgid "but it is not installable" -msgstr "но он не может быть установлен" +#: apt-private/private-install.cc:216 apt-private/private-install.cc:238 +msgid "Trivial Only specified but this is not a trivial operation." +msgstr "" +"Запрошено выполнение только тривиальных операций, но это не тривиальная " +"операция." -#: apt-private/private-output.cc:466 -msgid "but it is a virtual package" -msgstr "но это виртуальный пакет" +#. TRANSLATOR: This string needs to be typed by the user as a confirmation, so be +#. careful with hard to type or special characters (like non-breaking spaces) +#: apt-private/private-install.cc:220 +msgid "Yes, do as I say!" +msgstr "Да, делать, как я скажу!" -#: apt-private/private-output.cc:469 -msgid "but it is not installed" -msgstr "но он не установлен" +#: apt-private/private-install.cc:222 +#, c-format +msgid "" +"You are about to do something potentially harmful.\n" +"To continue type in the phrase '%s'\n" +" ?] " +msgstr "" +"То, что вы хотите сделать, может иметь нежелательные последствия.\n" +"Чтобы продолжить, введите фразу: «%s»\n" +" ?] " -#: apt-private/private-output.cc:469 -msgid "but it is not going to be installed" -msgstr "но он не будет установлен" +#: apt-private/private-install.cc:228 apt-private/private-install.cc:246 +msgid "Abort." +msgstr "Аварийное завершение." -#: apt-private/private-output.cc:474 -msgid " or" -msgstr " или" +#: apt-private/private-install.cc:243 +msgid "Do you want to continue?" +msgstr "Хотите продолжить?" -#: apt-private/private-output.cc:488 apt-private/private-output.cc:500 -msgid "The following packages have unmet dependencies:" -msgstr "Пакеты, имеющие неудовлетворённые зависимости:" +#: apt-private/private-install.cc:313 +msgid "Some files failed to download" +msgstr "Некоторые файлы скачать не удалось" -#: apt-private/private-output.cc:523 -msgid "The following NEW packages will be installed:" -msgstr "НОВЫЕ пакеты, которые будут установлены:" +#: apt-private/private-install.cc:320 +msgid "" +"Unable to fetch some archives, maybe run apt-get update or try with --fix-" +"missing?" +msgstr "" +"Невозможно получить некоторые архивы, вероятно надо запустить apt-get update " +"или попытаться повторить запуск с ключом --fix-missing" -#: apt-private/private-output.cc:549 -msgid "The following packages will be REMOVED:" -msgstr "Пакеты, которые будут УДАЛЕНЫ:" +#: apt-private/private-install.cc:324 +msgid "--fix-missing and media swapping is not currently supported" +msgstr "--fix-missing и смена носителя в данный момент не поддерживаются" -#: apt-private/private-output.cc:571 -msgid "The following packages have been kept back:" -msgstr "Пакеты, которые будут оставлены в неизменном виде:" +#: apt-private/private-install.cc:329 +msgid "Unable to correct missing packages." +msgstr "Невозможно исправить ситуацию с пропущенными пакетами." -#: apt-private/private-output.cc:592 -msgid "The following packages will be upgraded:" -msgstr "Пакеты, которые будут обновлены:" +#: apt-private/private-install.cc:330 +msgid "Aborting install." +msgstr "Аварийное завершение установки." -#: apt-private/private-output.cc:613 -msgid "The following packages will be DOWNGRADED:" -msgstr "Пакеты, будут заменены на более СТАРЫЕ версии:" +#: apt-private/private-install.cc:366 +msgid "" +"The following package disappeared from your system as\n" +"all files have been overwritten by other packages:" +msgid_plural "" +"The following packages disappeared from your system as\n" +"all files have been overwritten by other packages:" +msgstr[0] "" +"Следующий пакет исчез из системы, так как все их файлы\n" +"теперь берутся из других пакетов:" +msgstr[1] "" +"Следующие пакеты исчез из системы, так как все их файлы\n" +"теперь берутся из других пакетов:" +msgstr[2] "" +"Следующие пакеты исчез из системы, так как все их файлы\n" +"теперь берутся из других пакетов:" -#: apt-private/private-output.cc:633 -msgid "The following held packages will be changed:" -msgstr "" -"Пакеты, которые должны были бы остаться без изменений, но будут заменены:" +#: apt-private/private-install.cc:370 +msgid "Note: This is done automatically and on purpose by dpkg." +msgstr "Замечание: это сделано автоматически и специально программой dpkg." -#: apt-private/private-output.cc:688 -#, c-format -msgid "%s (due to %s) " -msgstr "%s (вследствие %s) " +#: apt-private/private-install.cc:391 +msgid "We are not supposed to delete stuff, can't start AutoRemover" +msgstr "Не предполагалось удалять stuff, невозможно запустить AutoRemover" -#: apt-private/private-output.cc:696 +#: apt-private/private-install.cc:499 msgid "" -"WARNING: The following essential packages will be removed.\n" -"This should NOT be done unless you know exactly what you are doing!" +"Hmm, seems like the AutoRemover destroyed something which really\n" +"shouldn't happen. Please file a bug report against apt." msgstr "" -"ВНИМАНИЕ: Эти существенно важные пакеты будут удалены.\n" -"НЕ ДЕЛАЙТЕ этого, если вы НЕ представляете себе все возможные последствия!" - -#: apt-private/private-output.cc:727 -#, c-format -msgid "%lu upgraded, %lu newly installed, " -msgstr "обновлено %lu, установлено %lu новых пакетов, " - -#: apt-private/private-output.cc:731 -#, c-format -msgid "%lu reinstalled, " -msgstr "переустановлено %lu переустановлено, " - -#: apt-private/private-output.cc:733 -#, c-format -msgid "%lu downgraded, " -msgstr "%lu пакетов заменены на старые версии, " - -#: apt-private/private-output.cc:735 -#, c-format -msgid "%lu to remove and %lu not upgraded.\n" -msgstr "для удаления отмечено %lu пакетов, и %lu пакетов не обновлено.\n" - -#: apt-private/private-output.cc:739 -#, c-format -msgid "%lu not fully installed or removed.\n" -msgstr "не установлено до конца или удалено %lu пакетов.\n" - -#. TRANSLATOR: Yes/No question help-text: defaulting to Y[es] -#. e.g. "Do you want to continue? [Y/n] " -#. The user has to answer with an input matching the -#. YESEXPR/NOEXPR defined in your l10n. -#: apt-private/private-output.cc:761 -msgid "[Y/n]" -msgstr "[Д/н]" - -#. TRANSLATOR: Yes/No question help-text: defaulting to N[o] -#. e.g. "Should this file be removed? [y/N] " -#. The user has to answer with an input matching the -#. YESEXPR/NOEXPR defined in your l10n. -#: apt-private/private-output.cc:767 -msgid "[y/N]" -msgstr "" - -#. TRANSLATOR: "Yes" answer printed for a yes/no question if --assume-yes is set -#: apt-private/private-output.cc:778 -msgid "Y" -msgstr "д" - -#. TRANSLATOR: "No" answer printed for a yes/no question if --assume-no is set -#: apt-private/private-output.cc:784 -msgid "N" -msgstr "н" - -#: apt-private/private-output.cc:806 apt-pkg/cachefilter.cc:40 -#, c-format -msgid "Regex compilation error - %s" -msgstr "Ошибка компиляции регулярного выражения — %s" - -#: apt-private/private-update.cc:31 -msgid "The update command takes no arguments" -msgstr "Команде update не нужны аргументы" - -#: apt-private/private-update.cc:95 -#, c-format -msgid "%i package can be upgraded. Run 'apt list --upgradable' to see it.\n" -msgid_plural "" -"%i packages can be upgraded. Run 'apt list --upgradable' to see them.\n" -msgstr[0] "" -msgstr[1] "" -msgstr[2] "" - -#: apt-private/private-update.cc:99 -msgid "All packages are up to date." -msgstr "" - -#: apt-private/private-cacheset.cc:37 apt-private/private-search.cc:65 -msgid "Sorting" -msgstr "" - -#: apt-private/private-show.cc:156 -#, c-format -msgid "There is %i additional record. Please use the '-a' switch to see it" -msgid_plural "" -"There are %i additional records. Please use the '-a' switch to see them." -msgstr[0] "" -msgstr[1] "" -msgstr[2] "" - -#: apt-private/private-show.cc:163 -msgid "not a real package (virtual)" -msgstr "" - -#: apt-private/private-main.cc:32 -msgid "" -"NOTE: This is only a simulation!\n" -" apt-get needs root privileges for real execution.\n" -" Keep also in mind that locking is deactivated,\n" -" so don't depend on the relevance to the real current situation!" -msgstr "" -"ЗАМЕЧАНИЕ: Производить только имитация работы!\n" -" Для реальной работы apt-get требуются права суперпользователя.\n" -" Учтите, что блокировка не используется,\n" -" поэтому нет полного соответствия с текущей реальной ситуацией!" - -#: apt-private/private-install.cc:81 -msgid "Internal error, InstallPackages was called with broken packages!" -msgstr "" -"Внутренняя ошибка, InstallPackages была вызвана с неработоспособными " -"пакетами!" - -#: apt-private/private-install.cc:90 -msgid "Packages need to be removed but remove is disabled." -msgstr "Пакеты необходимо удалить, но удаление запрещено." - -#: apt-private/private-install.cc:109 -msgid "Internal error, Ordering didn't finish" -msgstr "Внутренняя ошибка, Ordering не завершилась" - -#: apt-private/private-install.cc:147 -msgid "How odd... The sizes didn't match, email apt@packages.debian.org" -msgstr "Странно. Несовпадение размеров, напишите на apt@packages.debian.org" - -#. TRANSLATOR: The required space between number and unit is already included -#. in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB -#: apt-private/private-install.cc:154 -#, c-format -msgid "Need to get %sB/%sB of archives.\n" -msgstr "Необходимо скачать %sB/%sB архивов.\n" - -#. TRANSLATOR: The required space between number and unit is already included -#. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB -#: apt-private/private-install.cc:159 -#, c-format -msgid "Need to get %sB of archives.\n" -msgstr "Необходимо скачать %sБ архивов.\n" - -#. TRANSLATOR: The required space between number and unit is already included -#. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB -#: apt-private/private-install.cc:166 -#, c-format -msgid "After this operation, %sB of additional disk space will be used.\n" -msgstr "" -"После данной операции, объём занятого дискового пространства возрастёт на " -"%sB.\n" - -#. TRANSLATOR: The required space between number and unit is already included -#. in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB -#: apt-private/private-install.cc:171 -#, c-format -msgid "After this operation, %sB disk space will be freed.\n" -msgstr "" -"После данной операции, объём занятого дискового пространства уменьшится на " -"%sB.\n" - -#: apt-private/private-install.cc:185 apt-private/private-download.cc:117 -msgid "There are problems and -y was used without --force-yes" -msgstr "Существуют проблемы, а параметр -y указан без --force-yes" - -#: apt-private/private-install.cc:191 apt-private/private-install.cc:213 -msgid "Trivial Only specified but this is not a trivial operation." -msgstr "" -"Запрошено выполнение только тривиальных операций, но это не тривиальная " -"операция." - -#. TRANSLATOR: This string needs to be typed by the user as a confirmation, so be -#. careful with hard to type or special characters (like non-breaking spaces) -#: apt-private/private-install.cc:195 -msgid "Yes, do as I say!" -msgstr "Да, делать, как я скажу!" - -#: apt-private/private-install.cc:197 -#, c-format -msgid "" -"You are about to do something potentially harmful.\n" -"To continue type in the phrase '%s'\n" -" ?] " -msgstr "" -"То, что вы хотите сделать, может иметь нежелательные последствия.\n" -"Чтобы продолжить, введите фразу: «%s»\n" -" ?] " - -#: apt-private/private-install.cc:203 apt-private/private-install.cc:221 -msgid "Abort." -msgstr "Аварийное завершение." - -#: apt-private/private-install.cc:218 -msgid "Do you want to continue?" -msgstr "Хотите продолжить?" - -#: apt-private/private-install.cc:288 -msgid "Some files failed to download" -msgstr "Некоторые файлы скачать не удалось" - -#: apt-private/private-install.cc:295 -msgid "" -"Unable to fetch some archives, maybe run apt-get update or try with --fix-" -"missing?" -msgstr "" -"Невозможно получить некоторые архивы, вероятно надо запустить apt-get update " -"или попытаться повторить запуск с ключом --fix-missing" - -#: apt-private/private-install.cc:299 -msgid "--fix-missing and media swapping is not currently supported" -msgstr "--fix-missing и смена носителя в данный момент не поддерживаются" - -#: apt-private/private-install.cc:304 -msgid "Unable to correct missing packages." -msgstr "Невозможно исправить ситуацию с пропущенными пакетами." - -#: apt-private/private-install.cc:305 -msgid "Aborting install." -msgstr "Аварийное завершение установки." - -#: apt-private/private-install.cc:341 -msgid "" -"The following package disappeared from your system as\n" -"all files have been overwritten by other packages:" -msgid_plural "" -"The following packages disappeared from your system as\n" -"all files have been overwritten by other packages:" -msgstr[0] "" -"Следующий пакет исчез из системы, так как все их файлы\n" -"теперь берутся из других пакетов:" -msgstr[1] "" -"Следующие пакеты исчез из системы, так как все их файлы\n" -"теперь берутся из других пакетов:" -msgstr[2] "" -"Следующие пакеты исчез из системы, так как все их файлы\n" -"теперь берутся из других пакетов:" - -#: apt-private/private-install.cc:345 -msgid "Note: This is done automatically and on purpose by dpkg." -msgstr "Замечание: это сделано автоматически и специально программой dpkg." - -#: apt-private/private-install.cc:366 -msgid "We are not supposed to delete stuff, can't start AutoRemover" -msgstr "Не предполагалось удалять stuff, невозможно запустить AutoRemover" - -#: apt-private/private-install.cc:474 -msgid "" -"Hmm, seems like the AutoRemover destroyed something which really\n" -"shouldn't happen. Please file a bug report against apt." -msgstr "" -"Хм, кажется, что AutoRemover был как-то удалён, чего не должно\n" -"было случиться. Пожалуйста, отправьте сообщение об ошибке в пакете apt." +"Хм, кажется, что AutoRemover был как-то удалён, чего не должно\n" +"было случиться. Пожалуйста, отправьте сообщение об ошибке в пакете apt." #. #. if (Packages == 1) @@ -1568,15 +1354,15 @@ msgstr "" #. "that package should be filed.") << std::endl; #. } #. -#: apt-private/private-install.cc:477 apt-private/private-install.cc:627 +#: apt-private/private-install.cc:502 apt-private/private-install.cc:653 msgid "The following information may help to resolve the situation:" msgstr "Следующая информация, возможно, поможет вам:" -#: apt-private/private-install.cc:481 +#: apt-private/private-install.cc:506 msgid "Internal Error, AutoRemover broke stuff" msgstr "Внутренняя ошибка, AutoRemover всё поломал" -#: apt-private/private-install.cc:488 +#: apt-private/private-install.cc:513 msgid "" "The following package was automatically installed and is no longer required:" msgid_plural "" @@ -1588,7 +1374,7 @@ msgstr[1] "" msgstr[2] "" "Следующие пакеты устанавливались автоматически и больше не требуются:" -#: apt-private/private-install.cc:492 +#: apt-private/private-install.cc:517 #, c-format msgid "%lu package was automatically installed and is no longer required.\n" msgid_plural "" @@ -1597,20 +1383,20 @@ msgstr[0] "%lu пакет был установлен автоматически msgstr[1] "%lu пакета было установлено автоматически и больше не требуется.\n" msgstr[2] "%lu пакетов было установлены автоматически и больше не требуются.\n" -#: apt-private/private-install.cc:494 +#: apt-private/private-install.cc:519 msgid "Use 'apt-get autoremove' to remove it." msgid_plural "Use 'apt-get autoremove' to remove them." msgstr[0] "Для его удаления используйте «apt-get autoremove»." msgstr[1] "Для их удаления используйте «apt-get autoremove»." msgstr[2] "Для их удаления используйте «apt-get autoremove»." -#: apt-private/private-install.cc:587 +#: apt-private/private-install.cc:612 msgid "You might want to run 'apt-get -f install' to correct these:" msgstr "" "Возможно, для исправления этих ошибок вы захотите воспользоваться «apt-get -" "f install»:" -#: apt-private/private-install.cc:589 +#: apt-private/private-install.cc:614 msgid "" "Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a " "solution)." @@ -1618,7 +1404,7 @@ msgstr "" "Неудовлетворённые зависимости. Попытайтесь выполнить «apt-get -f install», " "не указывая имени пакета, (или найдите другое решение)." -#: apt-private/private-install.cc:612 +#: apt-private/private-install.cc:638 msgid "" "Some packages could not be installed. This may mean that you have\n" "requested an impossible situation or if you are using the unstable\n" @@ -1629,149 +1415,389 @@ msgstr "" "или же используете нестабильную версию дистрибутива, где запрошенные вами\n" "пакеты ещё не созданы или были удалены из Incoming." -#: apt-private/private-install.cc:633 +#: apt-private/private-install.cc:659 msgid "Broken packages" msgstr "Сломанные пакеты" -#: apt-private/private-install.cc:710 +#: apt-private/private-install.cc:712 msgid "The following extra packages will be installed:" msgstr "Будут установлены следующие дополнительные пакеты:" -#: apt-private/private-install.cc:800 +#: apt-private/private-install.cc:802 msgid "Suggested packages:" msgstr "Предлагаемые пакеты:" -#: apt-private/private-install.cc:801 +#: apt-private/private-install.cc:803 msgid "Recommended packages:" msgstr "Рекомендуемые пакеты:" -#: apt-private/private-install.cc:823 +#: apt-private/private-install.cc:825 #, c-format msgid "Skipping %s, it is already installed and upgrade is not set.\n" msgstr "Пропускается %s — пакет уже установлен и нет команды upgrade.\n" -#: apt-private/private-install.cc:827 +#: apt-private/private-install.cc:829 #, c-format msgid "Skipping %s, it is not installed and only upgrades are requested.\n" msgstr "" "Пропускается %s — пакет не установлен, а запрошено только обновление.\n" -#: apt-private/private-install.cc:839 +#: apt-private/private-install.cc:841 #, c-format msgid "Reinstallation of %s is not possible, it cannot be downloaded.\n" msgstr "Переустановка %s невозможна, он не скачивается.\n" -#: apt-private/private-install.cc:844 +#: apt-private/private-install.cc:846 #, c-format msgid "%s is already the newest version.\n" msgstr "Уже установлена самая новая версия %s.\n" -#: apt-private/private-install.cc:892 +#: apt-private/private-install.cc:894 #, c-format msgid "Selected version '%s' (%s) for '%s'\n" msgstr "Выбрана версия «%s» (%s) для «%s»\n" -#: apt-private/private-install.cc:897 +#: apt-private/private-install.cc:899 #, c-format msgid "Selected version '%s' (%s) for '%s' because of '%s'\n" msgstr "Выбрана версия «%s» (%s) для «%s» из-за «%s»\n" #. TRANSLATORS: Note, this is not an interactive question -#: apt-private/private-install.cc:939 +#: apt-private/private-install.cc:941 #, c-format msgid "Package '%s' is not installed, so not removed. Did you mean '%s'?\n" msgstr "" "Пакет «%s» не установлен, поэтому не может быть удалён. Возможно имелся в " "виду «%s»?\n" -#: apt-private/private-install.cc:945 +#: apt-private/private-install.cc:947 #, c-format msgid "Package '%s' is not installed, so not removed\n" msgstr "Пакет «%s» не установлен, поэтому не может быть удалён\n" -#: apt-private/private-download.cc:62 -#, c-format -msgid "" -"Can't drop privileges for downloading as file '%s' couldn't be accessed by " -"user '%s'." -msgstr "" +#: apt-private/private-list.cc:129 +msgid "Listing" +msgstr "Вывод списка" -#: apt-private/private-download.cc:94 -msgid "WARNING: The following packages cannot be authenticated!" -msgstr "ВНИМАНИЕ: Следующие пакеты невозможно аутентифицировать!" +#: apt-private/private-list.cc:159 +#, c-format +msgid "There is %i additional version. Please use the '-a' switch to see it" +msgid_plural "" +"There are %i additional versions. Please use the '-a' switch to see them." +msgstr[0] "Есть %i дополнительная версия. Используйте «-a» для просмотра" +msgstr[1] "Есть %i дополнительные версии. Используйте «-a» для их просмотра" +msgstr[2] "Есть %i дополнительных версий. Используйте «-a» для их просмотра" -#: apt-private/private-download.cc:98 -msgid "Authentication warning overridden.\n" -msgstr "Предупреждение об аутентификации не принято в внимание.\n" +#: apt-private/private-cachefile.cc:93 +msgid "Correcting dependencies..." +msgstr "Исправление зависимостей…" -#: apt-private/private-download.cc:103 apt-private/private-download.cc:110 -msgid "Some packages could not be authenticated" -msgstr "Некоторые пакеты невозможно аутентифицировать" +#: apt-private/private-cachefile.cc:96 +msgid " failed." +msgstr " не удалось." -#: apt-private/private-download.cc:108 -msgid "Install these packages without verification?" -msgstr "Установить эти пакеты без проверки?" +#: apt-private/private-cachefile.cc:99 +msgid "Unable to correct dependencies" +msgstr "Невозможно скорректировать зависимости" -#: apt-private/private-download.cc:149 apt-pkg/update.cc:77 -#, c-format -msgid "Failed to fetch %s %s\n" -msgstr "Не удалось получить %s %s\n" +#: apt-private/private-cachefile.cc:102 +msgid "Unable to minimize the upgrade set" +msgstr "Невозможно минимизировать набор обновлений" -#: apt-private/private-download.cc:171 apt-private/private-download.cc:174 -#, c-format -msgid "Couldn't determine free space in %s" -msgstr "Не удалось определить количество свободного места в %s" +#: apt-private/private-cachefile.cc:104 +msgid " Done" +msgstr " Готово" -#: apt-private/private-download.cc:188 -#, c-format -msgid "You don't have enough free space in %s." -msgstr "Недостаточно свободного места в %s." +#: apt-private/private-cachefile.cc:108 +msgid "You might want to run 'apt-get -f install' to correct these." +msgstr "" +"Возможно, для исправления этих ошибок вы захотите воспользоваться «apt-get -" +"f install»." + +#: apt-private/private-cachefile.cc:111 +msgid "Unmet dependencies. Try using -f." +msgstr "Неудовлетворённые зависимости. Попытайтесь использовать -f." + +#: apt-private/private-output.cc:103 apt-private/private-show.cc:84 +#: apt-private/private-show.cc:89 +msgid "unknown" +msgstr "неизвестно" + +#: apt-private/private-output.cc:265 +#, c-format +msgid "[installed,upgradable to: %s]" +msgstr "[установлен, может быть обновлён до: %s]" + +#: apt-private/private-output.cc:268 +msgid "[installed,local]" +msgstr "[установлен, локальный]" + +#: apt-private/private-output.cc:270 +msgid "[installed,auto-removable]" +msgstr "[установлен, удаляется автоматически]" + +#: apt-private/private-output.cc:272 +msgid "[installed,automatic]" +msgstr "[установлен, автоматически]" + +#: apt-private/private-output.cc:274 +msgid "[installed]" +msgstr "[установлен]" + +#: apt-private/private-output.cc:277 +#, c-format +msgid "[upgradable from: %s]" +msgstr "[может быть обновлён до: %s]" + +#: apt-private/private-output.cc:281 +msgid "[residual-config]" +msgstr "[остались файлы настроек]" + +#: apt-private/private-output.cc:455 +#, c-format +msgid "but %s is installed" +msgstr "но %s уже установлен" + +#: apt-private/private-output.cc:457 +#, c-format +msgid "but %s is to be installed" +msgstr "но %s будет установлен" + +#: apt-private/private-output.cc:464 +msgid "but it is not installable" +msgstr "но он не может быть установлен" + +#: apt-private/private-output.cc:466 +msgid "but it is a virtual package" +msgstr "но это виртуальный пакет" + +#: apt-private/private-output.cc:469 +msgid "but it is not installed" +msgstr "но он не установлен" + +#: apt-private/private-output.cc:469 +msgid "but it is not going to be installed" +msgstr "но он не будет установлен" + +#: apt-private/private-output.cc:474 +msgid " or" +msgstr " или" + +#: apt-private/private-output.cc:488 apt-private/private-output.cc:500 +msgid "The following packages have unmet dependencies:" +msgstr "Пакеты, имеющие неудовлетворённые зависимости:" + +#: apt-private/private-output.cc:523 +msgid "The following NEW packages will be installed:" +msgstr "НОВЫЕ пакеты, которые будут установлены:" + +#: apt-private/private-output.cc:549 +msgid "The following packages will be REMOVED:" +msgstr "Пакеты, которые будут УДАЛЕНЫ:" + +#: apt-private/private-output.cc:571 +msgid "The following packages have been kept back:" +msgstr "Пакеты, которые будут оставлены в неизменном виде:" + +#: apt-private/private-output.cc:592 +msgid "The following packages will be upgraded:" +msgstr "Пакеты, которые будут обновлены:" + +#: apt-private/private-output.cc:613 +msgid "The following packages will be DOWNGRADED:" +msgstr "Пакеты, будут заменены на более СТАРЫЕ версии:" + +#: apt-private/private-output.cc:633 +msgid "The following held packages will be changed:" +msgstr "" +"Пакеты, которые должны были бы остаться без изменений, но будут заменены:" + +#: apt-private/private-output.cc:688 +#, c-format +msgid "%s (due to %s) " +msgstr "%s (вследствие %s) " + +#: apt-private/private-output.cc:696 +msgid "" +"WARNING: The following essential packages will be removed.\n" +"This should NOT be done unless you know exactly what you are doing!" +msgstr "" +"ВНИМАНИЕ: Эти существенно важные пакеты будут удалены.\n" +"НЕ ДЕЛАЙТЕ этого, если вы НЕ представляете себе все возможные последствия!" + +#: apt-private/private-output.cc:727 +#, c-format +msgid "%lu upgraded, %lu newly installed, " +msgstr "обновлено %lu, установлено %lu новых пакетов, " + +#: apt-private/private-output.cc:731 +#, c-format +msgid "%lu reinstalled, " +msgstr "переустановлено %lu переустановлено, " + +#: apt-private/private-output.cc:733 +#, c-format +msgid "%lu downgraded, " +msgstr "%lu пакетов заменены на старые версии, " + +#: apt-private/private-output.cc:735 +#, c-format +msgid "%lu to remove and %lu not upgraded.\n" +msgstr "для удаления отмечено %lu пакетов, и %lu пакетов не обновлено.\n" + +#: apt-private/private-output.cc:739 +#, c-format +msgid "%lu not fully installed or removed.\n" +msgstr "не установлено до конца или удалено %lu пакетов.\n" + +#. TRANSLATOR: Yes/No question help-text: defaulting to Y[es] +#. e.g. "Do you want to continue? [Y/n] " +#. The user has to answer with an input matching the +#. YESEXPR/NOEXPR defined in your l10n. +#: apt-private/private-output.cc:761 +msgid "[Y/n]" +msgstr "[Д/н]" + +#. TRANSLATOR: Yes/No question help-text: defaulting to N[o] +#. e.g. "Should this file be removed? [y/N] " +#. The user has to answer with an input matching the +#. YESEXPR/NOEXPR defined in your l10n. +#: apt-private/private-output.cc:767 +msgid "[y/N]" +msgstr "[д/Н]" + +#. TRANSLATOR: "Yes" answer printed for a yes/no question if --assume-yes is set +#: apt-private/private-output.cc:778 +msgid "Y" +msgstr "Д" + +#. TRANSLATOR: "No" answer printed for a yes/no question if --assume-no is set +#: apt-private/private-output.cc:784 +msgid "N" +msgstr "Н" + +#: apt-private/private-output.cc:806 apt-pkg/cachefilter.cc:35 +#, c-format +msgid "Regex compilation error - %s" +msgstr "Ошибка компиляции регулярного выражения — %s" + +#: apt-private/private-update.cc:31 +msgid "The update command takes no arguments" +msgstr "Команде update не нужны аргументы" + +#: apt-private/private-update.cc:97 +#, c-format +msgid "%i package can be upgraded. Run 'apt list --upgradable' to see it.\n" +msgid_plural "" +"%i packages can be upgraded. Run 'apt list --upgradable' to see them.\n" +msgstr[0] "" +"Может быть обновлён %i пакет. Запустите «apt list --upgradable» для показа.\n" +msgstr[1] "" +"Может быть обновлено %i пакета. Запустите «apt list --upgradable» для их " +"показа.\n" +msgstr[2] "" +"Может быть обновлено %i пакетов. Запустите «apt list --upgradable» для их " +"показа.\n" + +#: apt-private/private-update.cc:101 +msgid "All packages are up to date." +msgstr "Все пакеты имеют последние версии." + +#: apt-private/private-show.cc:156 +#, c-format +msgid "There is %i additional record. Please use the '-a' switch to see it" +msgid_plural "" +"There are %i additional records. Please use the '-a' switch to see them." +msgstr[0] "Есть %i дополнительная запись. Используйте «-a» для просмотра" +msgstr[1] "Есть %i дополнительные записи. Используйте «-a» для их просмотра" +msgstr[2] "Есть %i дополнительных записей. Используйте «-a» для их просмотра" + +#: apt-private/private-show.cc:163 +msgid "not a real package (virtual)" +msgstr "не реальный (виртуальный) пакет" + +#: apt-private/private-main.cc:32 +msgid "" +"NOTE: This is only a simulation!\n" +" apt-get needs root privileges for real execution.\n" +" Keep also in mind that locking is deactivated,\n" +" so don't depend on the relevance to the real current situation!" +msgstr "" +"ЗАМЕЧАНИЕ: Производить только имитация работы!\n" +" Для реальной работы apt-get требуются права суперпользователя.\n" +" Учтите, что блокировка не используется,\n" +" поэтому нет полного соответствия с текущей реальной ситуацией!" + +#: apt-private/private-download.cc:36 +msgid "WARNING: The following packages cannot be authenticated!" +msgstr "ВНИМАНИЕ: Следующие пакеты невозможно аутентифицировать!" + +#: apt-private/private-download.cc:40 +msgid "Authentication warning overridden.\n" +msgstr "Предупреждение об аутентификации не принято в внимание.\n" + +#: apt-private/private-download.cc:45 apt-private/private-download.cc:52 +msgid "Some packages could not be authenticated" +msgstr "Некоторые пакеты невозможно аутентифицировать" + +#: apt-private/private-download.cc:50 +msgid "Install these packages without verification?" +msgstr "Установить эти пакеты без проверки?" + +#: apt-private/private-download.cc:91 apt-pkg/update.cc:77 +#, c-format +msgid "Failed to fetch %s %s\n" +msgstr "Не удалось получить %s %s\n" #: apt-private/private-sources.cc:58 -#, fuzzy, c-format +#, c-format msgid "Failed to parse %s. Edit again? " -msgstr "Не удалось переименовать %s в %s" +msgstr "Не удалось разобрать «%s». Повторить редактирование? " #: apt-private/private-sources.cc:70 #, c-format msgid "Your '%s' file changed, please run 'apt-get update'." -msgstr "" +msgstr "Файл «%s» изменён, запустите «apt-get update»." #: apt-private/private-search.cc:69 msgid "Full Text Search" -msgstr "" +msgstr "Полнотекстовый поиск" + +#: apt-private/private-upgrade.cc:25 +msgid "Calculating upgrade" +msgstr "Расчёт обновлений" + +#: apt-private/private-upgrade.cc:28 +msgid "Done" +msgstr "Готово" #: apt-private/acqprogress.cc:66 -#, c-format -msgid "Hit:%lu %s" -msgstr "В кэше:%lu %s" +msgid "Hit " +msgstr "В кэше " -#: apt-private/acqprogress.cc:88 -#, c-format -msgid "Get:%lu %s" -msgstr "Получено:%lu %s" +#: apt-private/acqprogress.cc:90 +msgid "Get:" +msgstr "Получено:" -#: apt-private/acqprogress.cc:119 -#, c-format -msgid "Ign:%lu %s" -msgstr "Игн:%lu %s" +#: apt-private/acqprogress.cc:121 +msgid "Ign " +msgstr "Игн " -#: apt-private/acqprogress.cc:126 -#, c-format -msgid "Err:%lu %s" -msgstr "Ош:%lu %s" +#: apt-private/acqprogress.cc:125 +msgid "Err " +msgstr "Ош " -#: apt-private/acqprogress.cc:150 +#: apt-private/acqprogress.cc:146 #, c-format msgid "Fetched %sB in %s (%sB/s)\n" msgstr "Получено %sБ за %s (%sБ/c)\n" -#: apt-private/acqprogress.cc:240 +#: apt-private/acqprogress.cc:236 #, c-format msgid " [Working]" msgstr " [Обработка]" -#: apt-private/acqprogress.cc:301 +#: apt-private/acqprogress.cc:297 #, c-format msgid "" "Media change: please insert the disc labeled\n" @@ -1784,18 +1810,18 @@ msgstr "" #. Only warn if there are no sources.list.d. #. Only warn if there is no sources.list file. -#: methods/mirror.cc:95 apt-pkg/init.cc:113 apt-pkg/init.cc:121 -#: apt-pkg/sourcelist.cc:280 apt-pkg/sourcelist.cc:286 apt-pkg/clean.cc:43 -#: apt-pkg/acquire.cc:557 apt-pkg/policy.cc:381 apt-pkg/contrib/fileutl.cc:374 -#: apt-pkg/contrib/fileutl.cc:487 apt-pkg/contrib/cdromutl.cc:205 -#: apt-inst/extract.cc:471 +#: methods/mirror.cc:95 apt-inst/extract.cc:471 apt-pkg/init.cc:103 +#: apt-pkg/init.cc:111 apt-pkg/acquire.cc:494 apt-pkg/clean.cc:43 +#: apt-pkg/policy.cc:381 apt-pkg/sourcelist.cc:280 apt-pkg/sourcelist.cc:286 +#: apt-pkg/contrib/fileutl.cc:368 apt-pkg/contrib/fileutl.cc:481 +#: apt-pkg/contrib/cdromutl.cc:205 #, c-format msgid "Unable to read %s" msgstr "Невозможно прочитать %s" -#: methods/mirror.cc:101 methods/mirror.cc:130 apt-pkg/clean.cc:49 -#: apt-pkg/clean.cc:67 apt-pkg/clean.cc:130 apt-pkg/acquire.cc:563 -#: apt-pkg/acquire.cc:588 apt-pkg/contrib/cdromutl.cc:201 +#: methods/mirror.cc:101 methods/mirror.cc:130 apt-pkg/acquire.cc:500 +#: apt-pkg/acquire.cc:525 apt-pkg/clean.cc:49 apt-pkg/clean.cc:67 +#: apt-pkg/clean.cc:130 apt-pkg/contrib/cdromutl.cc:201 #: apt-pkg/contrib/cdromutl.cc:235 #, c-format msgid "Unable to change to %s" @@ -1816,9 +1842,9 @@ msgid "Can not read mirror file '%s'" msgstr "Невозможно прочитать файл на зеркале «%s»" #: methods/mirror.cc:315 -#, fuzzy, c-format +#, c-format msgid "No entry found in mirror file '%s'" -msgstr "Невозможно прочитать файл на зеркале «%s»" +msgstr "Не найден элемент в файл на зеркале «%s»" #: methods/mirror.cc:445 #, c-format @@ -1871,460 +1897,205 @@ msgstr "" msgid "Merging available information" msgstr "Слияние доступной информации" -#: cmdline/apt-extracttemplates.cc:229 -msgid "" -"Usage: apt-extracttemplates file1 [file2 ...]\n" -"\n" -"apt-extracttemplates is a tool to extract config and template info\n" -"from debian packages\n" -"\n" -"Options:\n" -" -h This help text\n" -" -t Set the temp dir\n" -" -c=? Read this configuration file\n" -" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" -msgstr "" -"Использование: apt-extracttemplates файл1 [файл2…]\n" -"\n" -"apt-extracttemplates извлекает из пакетов Debian данные config и template\n" -"\n" -"Параметры:\n" -" -h Этот текст\n" -" -t Задать каталог для временных файлов\n" -" -c=? Читать указанный файл настройки\n" -" -o=? Задать значение произвольной настройке, например, -o dir::cache=/tmp\n" +#: apt-inst/filelist.cc:380 +msgid "DropNode called on still linked node" +msgstr "DropNode вызван для узла, который ещё используется" -#: cmdline/apt-extracttemplates.cc:259 apt-pkg/contrib/fileutl.cc:2092 -#, fuzzy, c-format -msgid "Unable to mkstemp %s" -msgstr "Невозможно получить атрибуты %s" +#: apt-inst/filelist.cc:412 +msgid "Failed to locate the hash element!" +msgstr "Не удалось найти элемент хеша!" -#: cmdline/apt-extracttemplates.cc:264 apt-pkg/pkgcachegen.cc:1385 -#: apt-pkg/contrib/fileutl.cc:2097 -#, c-format -msgid "Unable to write to %s" -msgstr "Невозможно записать в %s" +#: apt-inst/filelist.cc:459 +msgid "Failed to allocate diversion" +msgstr "Не удалось создать diversion" -#: cmdline/apt-extracttemplates.cc:305 -msgid "Cannot get debconf version. Is debconf installed?" -msgstr "Невозможно определить версию debconf. Он установлен?" - -#: ftparchive/apt-ftparchive.cc:186 ftparchive/apt-ftparchive.cc:370 -msgid "Package extension list is too long" -msgstr "Список расширений, допустимых для пакетов, слишком длинен" - -#: ftparchive/apt-ftparchive.cc:188 ftparchive/apt-ftparchive.cc:205 -#: ftparchive/apt-ftparchive.cc:228 ftparchive/apt-ftparchive.cc:282 -#: ftparchive/apt-ftparchive.cc:296 ftparchive/apt-ftparchive.cc:318 -#, c-format -msgid "Error processing directory %s" -msgstr "Ошибка обработки каталога %s" - -#: ftparchive/apt-ftparchive.cc:280 -msgid "Source extension list is too long" -msgstr "Список расширений источников слишком длинен" - -#: ftparchive/apt-ftparchive.cc:400 -msgid "Error writing header to contents file" -msgstr "" -"Ошибка записи заголовка в полный перечень содержимого пакетов (Contents)" - -#: ftparchive/apt-ftparchive.cc:430 -#, c-format -msgid "Error processing contents %s" -msgstr "ошибка обработки полного перечня содержимого пакетов (Contents) %s" - -#: ftparchive/apt-ftparchive.cc:625 -msgid "" -"Usage: apt-ftparchive [options] command\n" -"Commands: packages binarypath [overridefile [pathprefix]]\n" -" sources srcpath [overridefile [pathprefix]]\n" -" contents path\n" -" release path\n" -" generate config [groups]\n" -" clean config\n" -"\n" -"apt-ftparchive generates index files for Debian archives. It supports\n" -"many styles of generation from fully automated to functional replacements\n" -"for dpkg-scanpackages and dpkg-scansources\n" -"\n" -"apt-ftparchive generates Package files from a tree of .debs. The\n" -"Package file contains the contents of all the control fields from\n" -"each package as well as the MD5 hash and filesize. An override file\n" -"is supported to force the value of Priority and Section.\n" -"\n" -"Similarly apt-ftparchive generates Sources files from a tree of .dscs.\n" -"The --source-override option can be used to specify a src override file\n" -"\n" -"The 'packages' and 'sources' command should be run in the root of the\n" -"tree. BinaryPath should point to the base of the recursive search and \n" -"override file should contain the override flags. Pathprefix is\n" -"appended to the filename fields if present. Example usage from the \n" -"Debian archive:\n" -" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n" -" dists/potato/main/binary-i386/Packages\n" -"\n" -"Options:\n" -" -h This help text\n" -" --md5 Control MD5 generation\n" -" -s=? Source override file\n" -" -q Quiet\n" -" -d=? Select the optional caching database\n" -" --no-delink Enable delinking debug mode\n" -" --contents Control contents file generation\n" -" -c=? Read this configuration file\n" -" -o=? Set an arbitrary configuration option" -msgstr "" -"Использование: apt-ftparchive [параметры] команда\n" -"Команды: packages binarypath [overridefile [pathprefix]]\n" -" sources srcpath [overridefile [pathprefix]]\n" -" contents path\n" -" release path\n" -" generate config [groups]\n" -" clean config\n" -"\n" -"apt-ftparchive генерирует индексные файлы архивов Debian. Он поддерживает\n" -"множество стилей генерации: от полностью автоматического до функциональной " -"замены\n" -"программ dpkg-scanpackages и dpkg-scansources\n" -"\n" -"apt-ftparchive генерирует файлы Package (списки пакетов) для дерева\n" -"каталогов, содержащих файлы .deb. Файл Package включает в себя управляющие\n" -"поля каждого пакета, а также хеш MD5 и размер файла. Значения управляющих\n" -"полей «приоритет» (Priority) и «секция» (Section) могут быть изменены с\n" -"помощью файла override.\n" -"\n" -"Кроме того, apt-ftparchive может генерировать файлы Sources из дерева\n" -"каталогов, содержащих файлы .dsc. Для указания файла override в этом \n" -"режиме можно использовать параметр --source-override.\n" -"\n" -"Команды «packages» и «sources» надо выполнять, находясь в корневом каталоге\n" -"дерева, которое вы хотите обработать. BinaryPath должен указывать на место,\n" -"с которого начинается рекурсивный обход, а файл переназначений (override)\n" -"должен содержать записи о переназначениях управляющих полей. Если был " -"указан\n" -"Pathprefix, то его значение добавляется к управляющим полям, содержащим\n" -"имена файлов. Пример использования для архива Debian:\n" -" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n" -" dists/potato/main/binary-i386/Packages\n" -"\n" -"Параметры:\n" -" -h Этот текст\n" -" --md5 Управление генерацией MD5-хешей\n" -" -s=? Указать файл переназначений (override) для источников\n" -" -q Не выводить сообщения в процессе работы\n" -" -d=? Указать кэширующую базу данных (не обязательно)\n" -" --no-delink Включить режим отладки процесса удаления файлов\n" -" --contents Управление генерацией полного перечня содержимого пакетов\n" -" (файла Contents)\n" -" -c=? Использовать указанный файл настройки\n" -" -o=? Задать значение произвольному параметру настройки" - -#: ftparchive/apt-ftparchive.cc:821 -msgid "No selections matched" -msgstr "Совпадений не обнаружено" - -#: ftparchive/apt-ftparchive.cc:906 -#, c-format -msgid "Some files are missing in the package file group `%s'" -msgstr "В группе пакетов «%s» отсутствуют некоторые файлы" - -#: ftparchive/cachedb.cc:67 -#, c-format -msgid "DB was corrupted, file renamed to %s.old" -msgstr "БД была повреждена, файл переименован в %s.old" - -#: ftparchive/cachedb.cc:85 -#, c-format -msgid "DB is old, attempting to upgrade %s" -msgstr "DB устарела, попытка обновить %s" - -#: ftparchive/cachedb.cc:96 -msgid "" -"DB format is invalid. If you upgraded from an older version of apt, please " -"remove and re-create the database." -msgstr "" -"Некорректный формат базы данных (DB). Если вы обновляли версию apt, удалите " -"и создайте базу данных заново." - -#: ftparchive/cachedb.cc:101 -#, c-format -msgid "Unable to open DB file %s: %s" -msgstr "Не удалось открыть DB файл %s: %s" - -#: ftparchive/cachedb.cc:184 apt-inst/extract.cc:186 apt-inst/extract.cc:199 -#: apt-inst/extract.cc:216 -#, c-format -msgid "Failed to stat %s" -msgstr "Не удалось получить атрибуты %s" - -#: ftparchive/cachedb.cc:326 -#, fuzzy -msgid "Failed to read .dsc" -msgstr "Не удалось прочесть ссылку %s" - -#: ftparchive/cachedb.cc:359 -msgid "Archive has no control record" -msgstr "В архиве нет поля control" - -#: ftparchive/cachedb.cc:526 -msgid "Unable to get a cursor" -msgstr "Невозможно получить курсор" - -#: ftparchive/writer.cc:104 -#, c-format -msgid "W: Unable to read directory %s\n" -msgstr "W: Не удалось прочитать каталог %s\n" - -#: ftparchive/writer.cc:109 -#, c-format -msgid "W: Unable to stat %s\n" -msgstr "W: Не удалось прочитать атрибуты %s\n" - -#: ftparchive/writer.cc:165 -msgid "E: " -msgstr "E: " - -#: ftparchive/writer.cc:167 -msgid "W: " -msgstr "W: " - -#: ftparchive/writer.cc:174 -msgid "E: Errors apply to file " -msgstr "E: Ошибки относятся к файлу " +#: apt-inst/filelist.cc:464 +msgid "Internal error in AddDiversion" +msgstr "Внутренняя ошибка в AddDiversion" -#: ftparchive/writer.cc:192 ftparchive/writer.cc:224 +#: apt-inst/filelist.cc:477 #, c-format -msgid "Failed to resolve %s" -msgstr "Не удалось проследовать по ссылке %s" - -#: ftparchive/writer.cc:205 -msgid "Tree walking failed" -msgstr "Не удалось совершить обход дерева" +msgid "Trying to overwrite a diversion, %s -> %s and %s/%s" +msgstr "Попытка изменения diversion, %s -> %s и %s/%s" -#: ftparchive/writer.cc:232 +#: apt-inst/filelist.cc:506 #, c-format -msgid "Failed to open %s" -msgstr "Не удалось открыть %s" +msgid "Double add of diversion %s -> %s" +msgstr "Двойное добавление diversion %s -> %s" -#: ftparchive/writer.cc:291 +#: apt-inst/filelist.cc:549 #, c-format -msgid " DeLink %s [%s]\n" -msgstr "DeLink %s [%s]\n" +msgid "Duplicate conf file %s/%s" +msgstr "Повторно указан файл настройки %s/%s" -#: ftparchive/writer.cc:299 +#: apt-inst/extract.cc:101 apt-inst/extract.cc:172 #, c-format -msgid "Failed to readlink %s" -msgstr "Не удалось прочесть ссылку %s" +msgid "The path %s is too long" +msgstr "Слишком длинный путь %s" -#: ftparchive/writer.cc:303 +#: apt-inst/extract.cc:132 #, c-format -msgid "Failed to unlink %s" -msgstr "Не удалось удалить %s" +msgid "Unpacking %s more than once" +msgstr "Повторная распаковка %s" -#: ftparchive/writer.cc:311 +#: apt-inst/extract.cc:142 #, c-format -msgid "*** Failed to link %s to %s" -msgstr "*** Не удалось создать ссылку %s на %s" +msgid "The directory %s is diverted" +msgstr "Каталог %s входит в список diverted" -#: ftparchive/writer.cc:321 +#: apt-inst/extract.cc:152 #, c-format -msgid " DeLink limit of %sB hit.\n" -msgstr " Превышен лимит в %sB в DeLink.\n" +msgid "The package is trying to write to the diversion target %s/%s" +msgstr "Пакет пытается писать в diversion %s/%s" -#: ftparchive/writer.cc:427 -msgid "Archive had no package field" -msgstr "В архиве нет поля package" +#: apt-inst/extract.cc:162 apt-inst/extract.cc:306 +msgid "The diversion path is too long" +msgstr "Путь diversion слишком длинен" -#: ftparchive/writer.cc:435 ftparchive/writer.cc:698 +#: apt-inst/extract.cc:186 apt-inst/extract.cc:199 apt-inst/extract.cc:216 +#: ftparchive/cachedb.cc:182 #, c-format -msgid " %s has no override entry\n" -msgstr " Нет записи о переназначении (override) для %s\n" +msgid "Failed to stat %s" +msgstr "Не удалось получить атрибуты %s" -#: ftparchive/writer.cc:502 ftparchive/writer.cc:862 +#: apt-inst/extract.cc:194 ftparchive/multicompress.cc:374 #, c-format -msgid " %s maintainer is %s not %s\n" -msgstr " пакет %s сопровождает %s, а не %s\n" +msgid "Failed to rename %s to %s" +msgstr "Не удалось переименовать %s в %s" -#: ftparchive/writer.cc:712 +#: apt-inst/extract.cc:249 #, c-format -msgid " %s has no source override entry\n" -msgstr " Нет записи source override для %s\n" +msgid "The directory %s is being replaced by a non-directory" +msgstr "Каталог %s был заменён не-каталогом" -#: ftparchive/writer.cc:716 -#, c-format -msgid " %s has no binary override entry either\n" -msgstr " Нет записи binary override для %s\n" +#: apt-inst/extract.cc:289 +msgid "Failed to locate node in its hash bucket" +msgstr "Не удалось разместить узел в хеше" -#: ftparchive/contents.cc:351 ftparchive/contents.cc:382 -msgid "realloc - Failed to allocate memory" -msgstr "realloc — не удалось выделить память" +#: apt-inst/extract.cc:293 +msgid "The path is too long" +msgstr "Путь слишком длинен" -#: ftparchive/override.cc:38 ftparchive/override.cc:142 +#: apt-inst/extract.cc:421 #, c-format -msgid "Unable to open %s" -msgstr "Не удалось открыть %s" - -#. skip spaces -#. find end of word -#: ftparchive/override.cc:68 -#, fuzzy, c-format -msgid "Malformed override %s line %llu (%s)" -msgstr "Неправильная запись о переназначении (override) %s в строке %llu #1" +msgid "Overwrite package match with no version for %s" +msgstr "Файлы заменяются содержимым пакета %s без версии" -#: ftparchive/override.cc:127 ftparchive/override.cc:201 +#: apt-inst/extract.cc:438 #, c-format -msgid "Failed to read the override file %s" -msgstr "Не удалось прочесть файл переназначений (override) %s" +msgid "File %s/%s overwrites the one in the package %s" +msgstr "Файл %s/%s переписывает файл в пакете %s" -#: ftparchive/override.cc:166 +#: apt-inst/extract.cc:498 #, c-format -msgid "Malformed override %s line %llu #1" -msgstr "Неправильная запись о переназначении (override) %s в строке %llu #1" +msgid "Unable to stat %s" +msgstr "Невозможно получить атрибуты %s" -#: ftparchive/override.cc:178 +#: apt-inst/dirstream.cc:42 apt-inst/dirstream.cc:49 apt-inst/dirstream.cc:54 #, c-format -msgid "Malformed override %s line %llu #2" -msgstr "Неправильная запись о переназначении (override) %s в строке %llu #2" +msgid "Failed to write file %s" +msgstr "Не удалось записать в файл %s" -#: ftparchive/override.cc:191 +#: apt-inst/dirstream.cc:105 #, c-format -msgid "Malformed override %s line %llu #3" -msgstr "Неправильная запись о переназначении (override) %s в строке %llu #3" +msgid "Failed to close file %s" +msgstr "Не удалось закрыть файл %s" -#: ftparchive/multicompress.cc:73 +#: apt-inst/deb/debfile.cc:47 apt-inst/deb/debfile.cc:54 +#: apt-inst/deb/debfile.cc:63 #, c-format -msgid "Unknown compression algorithm '%s'" -msgstr "Неизвестный алгоритм сжатия «%s»" +msgid "This is not a valid DEB archive, missing '%s' member" +msgstr "Это неправильный DEB-архив — отсутствует составная часть «%s»" -#: ftparchive/multicompress.cc:103 +#: apt-inst/deb/debfile.cc:132 #, c-format -msgid "Compressed output %s needs a compression set" -msgstr "" -"Для получения сжатого вывода %s необходимо включить использования сжатия" - -#: ftparchive/multicompress.cc:192 -msgid "Failed to create FILE*" -msgstr "Не удалось создать FILE*" +msgid "Internal error, could not locate member %s" +msgstr "Внутренняя ошибка, не удалось найти составную часть %s" -#: ftparchive/multicompress.cc:195 -msgid "Failed to fork" -msgstr "Не удалось запустить порождённый процесс" +#: apt-inst/deb/debfile.cc:227 +msgid "Unparsable control file" +msgstr "Не удалось прочесть содержимое control-файла" -#: ftparchive/multicompress.cc:209 -msgid "Compress child" -msgstr "Процесс-потомок, производящий сжатие" +#: apt-inst/contrib/arfile.cc:76 +msgid "Invalid archive signature" +msgstr "Неверная сигнатура архива" -#: ftparchive/multicompress.cc:232 +#: apt-inst/contrib/arfile.cc:84 +msgid "Error reading archive member header" +msgstr "Ошибка чтения заголовка элемента архива" + +#: apt-inst/contrib/arfile.cc:96 #, c-format -msgid "Internal error, failed to create %s" -msgstr "Внутренняя ошибка, не удалось создать %s" +msgid "Invalid archive member header %s" +msgstr "Неправильный заголовок элемента архива %s" -#: ftparchive/multicompress.cc:305 -msgid "IO to subprocess/file failed" -msgstr "Ошибка ввода/вывода в подпроцесс/файл" +#: apt-inst/contrib/arfile.cc:108 +msgid "Invalid archive member header" +msgstr "Неправильный заголовок элемента архива" -#: ftparchive/multicompress.cc:343 -msgid "Failed to read while computing MD5" -msgstr "Ошибка чтения во время вычисления MD5" +#: apt-inst/contrib/arfile.cc:137 +msgid "Archive is too short" +msgstr "Слишком короткий архив" -#: ftparchive/multicompress.cc:359 -#, c-format -msgid "Problem unlinking %s" -msgstr "Не удалось удалить %s" +#: apt-inst/contrib/arfile.cc:141 +msgid "Failed to read the archive headers" +msgstr "Не удалось прочитать заголовки архива" -#: ftparchive/multicompress.cc:374 apt-inst/extract.cc:194 -#, c-format -msgid "Failed to rename %s to %s" -msgstr "Не удалось переименовать %s в %s" +#: apt-inst/contrib/extracttar.cc:124 +msgid "Failed to create pipes" +msgstr "Не удалось создать каналы" -#: cmdline/apt-internal-solver.cc:51 -msgid "" -"Usage: apt-internal-solver\n" -"\n" -"apt-internal-solver is an interface to use the current internal\n" -"like an external resolver for the APT family for debugging or alike\n" -"\n" -"Options:\n" -" -h This help text.\n" -" -q Loggable output - no progress indicator\n" -" -c=? Read this configuration file\n" -" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" -msgstr "" -"Использование: apt-internal-solver\n" -"\n" -"apt-internal-solver — интерфейс к внутреннему решателю, предназначен\n" -"для отладки, подобен интерфейсу внешнего решателя семейства APT\n" -"\n" -"Параметры:\n" -" -h Этот текст\n" -" -q Вывод протокола работы — индикатор выполнения отключён\n" -" -c=? Читать указанный файл настройки\n" -" -o=? Задать значение произвольной настройке, например, -o dir::cache=/tmp\n" +#: apt-inst/contrib/extracttar.cc:151 +msgid "Failed to exec gzip " +msgstr "Не удалось выполнить gzip " -#: cmdline/apt-sortpkgs.cc:91 -msgid "Unknown package record!" -msgstr "Запись о неизвестном пакете!" +#: apt-inst/contrib/extracttar.cc:188 apt-inst/contrib/extracttar.cc:218 +msgid "Corrupted archive" +msgstr "Повреждённый архив" -#: cmdline/apt-sortpkgs.cc:155 -msgid "" -"Usage: apt-sortpkgs [options] file1 [file2 ...]\n" -"\n" -"apt-sortpkgs is a simple tool to sort package files. The -s option is used\n" -"to indicate what kind of file it is.\n" -"\n" -"Options:\n" -" -h This help text\n" -" -s Use source file sorting\n" -" -c=? Read this configuration file\n" -" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" -msgstr "" -"Использование: apt-sortpkgs [параметры] файл1 [файл2…]\n" -"\n" -"apt-sortpkgs — простой инструмент для сортировки списков пакетов. Параметр -" -"s\n" -"используется для указания типа списка.\n" -"\n" -"Параметры:\n" -" -h этот текст\n" -" -s сортировать список файлов пакетов исходного кода\n" -" -c=? читать указанный файл настройки\n" -" -o=? Задать значение произвольной настройке, например, -o dir::cache=/tmp\n" +#: apt-inst/contrib/extracttar.cc:203 +msgid "Tar checksum failed, archive corrupted" +msgstr "Неправильная контрольная сумма Tar, архив повреждён" + +#: apt-inst/contrib/extracttar.cc:308 +#, c-format +msgid "Unknown TAR header type %u, member %s" +msgstr "Неизвестный заголовок в архиве TAR. Тип %u, элемент %s" -#: apt-pkg/install-progress.cc:59 +#: apt-pkg/install-progress.cc:57 #, c-format msgid "Progress: [%3i%%]" -msgstr "" +msgstr "Ход выполнения: [%3i%%]" -#: apt-pkg/install-progress.cc:93 apt-pkg/install-progress.cc:176 +#: apt-pkg/install-progress.cc:91 apt-pkg/install-progress.cc:174 msgid "Running dpkg" msgstr "Запускается dpkg" -#: apt-pkg/init.cc:156 +#: apt-pkg/init.cc:146 #, c-format msgid "Packaging system '%s' is not supported" msgstr "Система пакетирования «%s» не поддерживается" -#: apt-pkg/init.cc:172 +#: apt-pkg/init.cc:162 msgid "Unable to determine a suitable packaging system type" msgstr "Невозможно определить подходящий тип системы пакетирования" -#: apt-pkg/indexcopy.cc:236 apt-pkg/indexcopy.cc:775 +#: apt-pkg/indexcopy.cc:236 apt-pkg/indexcopy.cc:773 #, c-format msgid "Wrote %i records.\n" msgstr "Сохранено %i записей.\n" -#: apt-pkg/indexcopy.cc:238 apt-pkg/indexcopy.cc:777 +#: apt-pkg/indexcopy.cc:238 apt-pkg/indexcopy.cc:775 #, c-format msgid "Wrote %i records with %i missing files.\n" msgstr "Сохранено %i записей с %i отсутствующими файлами.\n" -#: apt-pkg/indexcopy.cc:241 apt-pkg/indexcopy.cc:780 +#: apt-pkg/indexcopy.cc:241 apt-pkg/indexcopy.cc:778 #, c-format msgid "Wrote %i records with %i mismatched files\n" msgstr "Сохранено %i записей с %i несовпадающими файлами\n" -#: apt-pkg/indexcopy.cc:244 apt-pkg/indexcopy.cc:783 +#: apt-pkg/indexcopy.cc:244 apt-pkg/indexcopy.cc:781 #, c-format msgid "Wrote %i records with %i missing files and %i mismatched files\n" msgstr "" @@ -2341,26 +2112,6 @@ msgstr "Не удалось найти аутентификационную за msgid "Hash mismatch for: %s" msgstr "Не совпадает хеш сумма для: %s" -#: apt-pkg/acquire-worker.cc:133 -#, c-format -msgid "The method driver %s could not be found." -msgstr "Драйвер для метода %s не найден." - -#: apt-pkg/acquire-worker.cc:135 -#, fuzzy, c-format -msgid "Is the package %s installed?" -msgstr "Проверьте, установлен ли пакет «dpkg-dev».\n" - -#: apt-pkg/acquire-worker.cc:186 -#, c-format -msgid "Method %s did not start correctly" -msgstr "Метод %s запустился не корректно" - -#: apt-pkg/acquire-worker.cc:485 -#, c-format -msgid "Please insert the disc labeled: '%s' in the drive '%s' and press enter." -msgstr "Вставьте диск с меткой «%s» в устройство «%s» и нажмите ввод." - #: apt-pkg/cachefile.cc:94 msgid "The package lists or status file could not be parsed or opened." msgstr "Списки пакетов или файл состояния не могут быть открыты или прочитаны." @@ -2373,340 +2124,156 @@ msgstr "Вы можете запустить «apt-get update» для испр msgid "The list of sources could not be read." msgstr "Не читается перечень источников." -#: apt-pkg/pkgcache.cc:154 +#: apt-pkg/pkgcache.cc:155 msgid "Empty package cache" msgstr "Кэш пакетов пуст" -#: apt-pkg/pkgcache.cc:160 apt-pkg/pkgcache.cc:171 +#: apt-pkg/pkgcache.cc:161 msgid "The package cache file is corrupted" msgstr "Кэш пакетов повреждён" -#: apt-pkg/pkgcache.cc:165 +#: apt-pkg/pkgcache.cc:166 msgid "The package cache file is an incompatible version" msgstr "Не поддерживаемая версия кэша пакетов" -#: apt-pkg/pkgcache.cc:168 +#: apt-pkg/pkgcache.cc:169 msgid "The package cache file is corrupted, it is too small" msgstr "Кэш пакетов повреждён, он слишком мал" -#: apt-pkg/pkgcache.cc:175 +#: apt-pkg/pkgcache.cc:174 #, c-format msgid "This APT does not support the versioning system '%s'" msgstr "Эта версия APT не поддерживает систему версий «%s»" -#: apt-pkg/pkgcache.cc:185 -#, fuzzy, c-format -msgid "The package cache was built for different architectures: %s vs %s" +#: apt-pkg/pkgcache.cc:179 +msgid "The package cache was built for a different architecture" msgstr "Кэш пакетов был собран для другой архитектуры" -#: apt-pkg/pkgcache.cc:322 +#: apt-pkg/pkgcache.cc:309 msgid "Depends" msgstr "Зависит" -#: apt-pkg/pkgcache.cc:322 +#: apt-pkg/pkgcache.cc:309 msgid "PreDepends" msgstr "ПредЗависит" -#: apt-pkg/pkgcache.cc:322 +#: apt-pkg/pkgcache.cc:309 msgid "Suggests" msgstr "Предлагает" -#: apt-pkg/pkgcache.cc:323 +#: apt-pkg/pkgcache.cc:310 msgid "Recommends" msgstr "Рекомендует" -#: apt-pkg/pkgcache.cc:323 +#: apt-pkg/pkgcache.cc:310 msgid "Conflicts" msgstr "Конфликтует" -#: apt-pkg/pkgcache.cc:323 +#: apt-pkg/pkgcache.cc:310 msgid "Replaces" msgstr "Заменяет" -#: apt-pkg/pkgcache.cc:324 +#: apt-pkg/pkgcache.cc:311 msgid "Obsoletes" msgstr "Замещает" -#: apt-pkg/pkgcache.cc:324 +#: apt-pkg/pkgcache.cc:311 msgid "Breaks" msgstr "Ломает" -#: apt-pkg/pkgcache.cc:324 +#: apt-pkg/pkgcache.cc:311 msgid "Enhances" msgstr "Улучшает" -#: apt-pkg/pkgcache.cc:335 +#: apt-pkg/pkgcache.cc:322 msgid "important" msgstr "важный" -#: apt-pkg/pkgcache.cc:335 +#: apt-pkg/pkgcache.cc:322 msgid "required" msgstr "необходимый" -#: apt-pkg/pkgcache.cc:335 +#: apt-pkg/pkgcache.cc:322 msgid "standard" msgstr "стандартный" -#: apt-pkg/pkgcache.cc:336 -msgid "optional" -msgstr "необязательный" - -#: apt-pkg/pkgcache.cc:336 -msgid "extra" -msgstr "дополнительный" - -#: apt-pkg/upgrade.cc:34 apt-pkg/upgrade.cc:136 apt-pkg/upgrade.cc:182 -msgid "Calculating upgrade" -msgstr "Расчёт обновлений" - -#: apt-pkg/pkgrecords.cc:38 -#, c-format -msgid "Index file type '%s' is not supported" -msgstr "Не поддерживается индексный файл типа «%s»" - -#: apt-pkg/sourcelist.cc:127 -#, fuzzy, c-format -msgid "Malformed stanza %u in source list %s (URI parse)" -msgstr "Искажённая строка %lu в списке источников %s (анализ URI)" - -#: apt-pkg/sourcelist.cc:170 -#, c-format -msgid "Malformed line %lu in source list %s ([option] unparseable)" -msgstr "Искажённая строка %lu в списке источников %s ([параметр] неразбираем)" - -#: apt-pkg/sourcelist.cc:173 -#, c-format -msgid "Malformed line %lu in source list %s ([option] too short)" -msgstr "" -"Искажённая строка %lu в списке источников %s ([параметр] слишком короткий)" - -#: apt-pkg/sourcelist.cc:184 -#, c-format -msgid "Malformed line %lu in source list %s ([%s] is not an assignment)" -msgstr "Искажённая строка %lu в списке источников %s (([%s] не назначаем)" - -#: apt-pkg/sourcelist.cc:190 -#, c-format -msgid "Malformed line %lu in source list %s ([%s] has no key)" -msgstr "Искажённая строка %lu в списке источников %s ([%s] не имеет ключа)" - -#: apt-pkg/sourcelist.cc:193 -#, c-format -msgid "Malformed line %lu in source list %s ([%s] key %s has no value)" -msgstr "" -"Искажённая строка %lu в списке источников %s (([%s] ключ %s не имеет " -"значения)" - -#: apt-pkg/sourcelist.cc:206 -#, c-format -msgid "Malformed line %lu in source list %s (URI)" -msgstr "Искажённая строка %lu в списке источников %s (проблема в URI)" - -#: apt-pkg/sourcelist.cc:208 -#, c-format -msgid "Malformed line %lu in source list %s (dist)" -msgstr "" -"Искажённая строка %lu в списке источников %s (проблема в имени дистрибутива)" - -#: apt-pkg/sourcelist.cc:211 -#, c-format -msgid "Malformed line %lu in source list %s (URI parse)" -msgstr "Искажённая строка %lu в списке источников %s (анализ URI)" - -#: apt-pkg/sourcelist.cc:217 -#, c-format -msgid "Malformed line %lu in source list %s (absolute dist)" -msgstr "Искажённая строка %lu в списке источников %s (absolute dist)" - -#: apt-pkg/sourcelist.cc:224 -#, c-format -msgid "Malformed line %lu in source list %s (dist parse)" -msgstr "Искажённая строка %lu в списке источников %s (dist parse)" - -#: apt-pkg/sourcelist.cc:335 -#, c-format -msgid "Opening %s" -msgstr "Открытие %s" - -#: apt-pkg/sourcelist.cc:347 apt-pkg/cdrom.cc:497 -#, c-format -msgid "Line %u too long in source list %s." -msgstr "Строка %u в списке источников %s слишком длинна." - -#: apt-pkg/sourcelist.cc:371 -#, c-format -msgid "Malformed line %u in source list %s (type)" -msgstr "Искажённая строка %u в списке источников %s (тип)" - -#: apt-pkg/sourcelist.cc:375 -#, c-format -msgid "Type '%s' is not known on line %u in source list %s" -msgstr "Неизвестный тип «%s» в строке %u в списке источников %s" - -#: apt-pkg/sourcelist.cc:416 -#, fuzzy, c-format -msgid "Type '%s' is not known on stanza %u in source list %s" -msgstr "Неизвестный тип «%s» в строке %u в списке источников %s" - -#: apt-pkg/clean.cc:39 apt-pkg/acquire.cc:553 -#, fuzzy, c-format -msgid "Clean of %s is not supported" -msgstr "Не поддерживается индексный файл типа «%s»" - -#: apt-pkg/clean.cc:64 -#, c-format -msgid "Unable to stat %s." -msgstr "Невозможно получить атрибуты %s." - -#: apt-pkg/pkgcachegen.cc:113 -msgid "Cache has an incompatible versioning system" -msgstr "Кэш имеет несовместимую систему версий" - -#. TRANSLATOR: The first placeholder is a package name, -#. the other two should be copied verbatim as they include debug info -#: apt-pkg/pkgcachegen.cc:240 apt-pkg/pkgcachegen.cc:250 -#: apt-pkg/pkgcachegen.cc:316 apt-pkg/pkgcachegen.cc:382 -#: apt-pkg/pkgcachegen.cc:386 apt-pkg/pkgcachegen.cc:403 -#: apt-pkg/pkgcachegen.cc:411 apt-pkg/pkgcachegen.cc:415 -#: apt-pkg/pkgcachegen.cc:419 apt-pkg/pkgcachegen.cc:440 -#: apt-pkg/pkgcachegen.cc:479 apt-pkg/pkgcachegen.cc:525 -#: apt-pkg/pkgcachegen.cc:539 apt-pkg/pkgcachegen.cc:570 -#: apt-pkg/pkgcachegen.cc:584 -#, c-format -msgid "Error occurred while processing %s (%s%d)" -msgstr "Произошла ошибка во время обработки %s (%s%d)" - -#: apt-pkg/pkgcachegen.cc:273 -msgid "Wow, you exceeded the number of package names this APT is capable of." -msgstr "" -"Превышено допустимое количество имён пакетов, которое способен обработать " -"APT." - -#: apt-pkg/pkgcachegen.cc:276 -msgid "Wow, you exceeded the number of versions this APT is capable of." -msgstr "" -"Превышено допустимое количество версий, которое способен обработать APT." - -#: apt-pkg/pkgcachegen.cc:279 -msgid "Wow, you exceeded the number of descriptions this APT is capable of." -msgstr "" -"Превышено допустимое количество описаний, которое способен обработать APT." - -#: apt-pkg/pkgcachegen.cc:282 -msgid "Wow, you exceeded the number of dependencies this APT is capable of." -msgstr "" -"Превышено допустимое количество зависимостей, которое способен обработать " -"APT." +#: apt-pkg/pkgcache.cc:323 +msgid "optional" +msgstr "необязательный" + +#: apt-pkg/pkgcache.cc:323 +msgid "extra" +msgstr "дополнительный" -#: apt-pkg/pkgcachegen.cc:591 +#: apt-pkg/acquire-worker.cc:116 #, c-format -msgid "Package %s %s was not found while processing file dependencies" -msgstr "Во время обработки файла зависимостей не найден пакет %s %s" +msgid "The method driver %s could not be found." +msgstr "Драйвер для метода %s не найден." -#: apt-pkg/pkgcachegen.cc:1196 +#: apt-pkg/acquire-worker.cc:118 #, c-format -msgid "Couldn't stat source package list %s" -msgstr "Не удалось получить атрибуты списка пакетов исходного кода %s" +msgid "Is the package %s installed?" +msgstr "Проверьте, установлен ли пакет %s?" -#: apt-pkg/pkgcachegen.cc:1284 apt-pkg/pkgcachegen.cc:1388 -#: apt-pkg/pkgcachegen.cc:1394 apt-pkg/pkgcachegen.cc:1551 -msgid "Reading package lists" -msgstr "Чтение списков пакетов" +#: apt-pkg/acquire-worker.cc:169 +#, c-format +msgid "Method %s did not start correctly" +msgstr "Метод %s запустился не корректно" -#: apt-pkg/pkgcachegen.cc:1301 -msgid "Collecting File Provides" -msgstr "Сбор информации о Provides" +#: apt-pkg/acquire-worker.cc:455 +#, c-format +msgid "Please insert the disc labeled: '%s' in the drive '%s' and press enter." +msgstr "Вставьте диск с меткой «%s» в устройство «%s» и нажмите ввод." -#: apt-pkg/pkgcachegen.cc:1493 apt-pkg/pkgcachegen.cc:1500 -msgid "IO Error saving source cache" -msgstr "Ошибка ввода/вывода при попытке сохранить кэш источников" +#: apt-pkg/pkgrecords.cc:38 +#, c-format +msgid "Index file type '%s' is not supported" +msgstr "Не поддерживается индексный файл типа «%s»" -#: apt-pkg/edsp.cc:52 apt-pkg/edsp.cc:78 -msgid "Send scenario to solver" -msgstr "Отправка сценария решателю" +#: apt-pkg/depcache.cc:138 apt-pkg/depcache.cc:167 +msgid "Building dependency tree" +msgstr "Построение дерева зависимостей" -#: apt-pkg/edsp.cc:244 -msgid "Send request to solver" -msgstr "Отправка запроса решателю" +#: apt-pkg/depcache.cc:139 +msgid "Candidate versions" +msgstr "Версии-кандидаты" -#: apt-pkg/edsp.cc:323 -msgid "Prepare for receiving solution" -msgstr "Подготовка к приёму решения" +#: apt-pkg/depcache.cc:168 +msgid "Dependency generation" +msgstr "Генерирование зависимостей" -#: apt-pkg/edsp.cc:330 -msgid "External solver failed without a proper error message" -msgstr "Внешний решатель завершился с ошибкой не передав сообщения об ошибке" +#: apt-pkg/depcache.cc:188 apt-pkg/depcache.cc:221 apt-pkg/depcache.cc:225 +msgid "Reading state information" +msgstr "Чтение информации о состоянии" -#: apt-pkg/edsp.cc:622 apt-pkg/edsp.cc:625 apt-pkg/edsp.cc:630 -msgid "Execute external solver" -msgstr "Запустить внешний решатель" +#: apt-pkg/depcache.cc:250 +#, c-format +msgid "Failed to open StateFile %s" +msgstr "Не удалось открыть StateFile %s" -#: apt-pkg/acquire-item.cc:98 -msgid "Use --allow-insecure-repositories to force the update" -msgstr "" +#: apt-pkg/depcache.cc:256 +#, c-format +msgid "Failed to write temporary StateFile %s" +msgstr "Не удалось записать временный StateFile %s" -#: apt-pkg/acquire-item.cc:215 apt-pkg/contrib/fileutl.cc:2108 +#: apt-pkg/acquire-item.cc:148 apt-pkg/contrib/fileutl.cc:2048 #, c-format msgid "rename failed, %s (%s -> %s)." msgstr "переименовать не удалось, %s (%s -> %s)." -#: apt-pkg/acquire-item.cc:240 +#: apt-pkg/acquire-item.cc:163 msgid "Hash Sum mismatch" msgstr "Хеш сумма не совпадает" -#: apt-pkg/acquire-item.cc:245 +#: apt-pkg/acquire-item.cc:168 msgid "Size mismatch" msgstr "Не совпадает размер" -#: apt-pkg/acquire-item.cc:250 -#, fuzzy +#: apt-pkg/acquire-item.cc:173 msgid "Invalid file format" -msgstr "Неверная операция %s" - -#: apt-pkg/acquire-item.cc:255 -#, fuzzy -msgid "Signature error" -msgstr "Ошибка записи" +msgstr "Неправильный формат файла" -#: apt-pkg/acquire-item.cc:259 -#, fuzzy -msgid "Does not start with a cleartext signature" -msgstr "Файл %s не начинается с прозрачно подписанного сообщения" - -#: apt-pkg/acquire-item.cc:1584 -#, c-format -msgid "" -"An error occurred during the signature verification. The repository is not " -"updated and the previous index files will be used. GPG error: %s: %s\n" -msgstr "" -"Произошла ошибка при проверке подписи. Репозиторий не обновлён и будут " -"использованы предыдущие индексные файлы. Ошибка GPG: %s: %s\n" - -#. Invalid signature file, reject (LP: #346386) (Closes: #627642) -#: apt-pkg/acquire-item.cc:1594 apt-pkg/acquire-item.cc:1600 -#, c-format -msgid "GPG error: %s: %s" -msgstr "Ошибка GPG: %s: %s" - -#: apt-pkg/acquire-item.cc:1707 -#, fuzzy, c-format -msgid "The repository '%s' is no longer signed." -msgstr "Каталог %s входит в список diverted" - -#: apt-pkg/acquire-item.cc:1714 -msgid "" -"This is normally not allowed, but the option Acquire::" -"AllowDowngradeToInsecureRepositories was given to override it." -msgstr "" - -#: apt-pkg/acquire-item.cc:1727 apt-pkg/acquire-item.cc:2202 -#, c-format -msgid "" -"The data from '%s' is not signed. Packages from that repository can not be " -"authenticated." -msgstr "" - -#: apt-pkg/acquire-item.cc:1956 +#: apt-pkg/acquire-item.cc:1650 #, c-format msgid "" "Unable to find expected entry '%s' in Release file (Wrong sources.list entry " @@ -2715,16 +2282,16 @@ msgstr "" "Невозможно найти ожидаемый элемент «%s» в файле Release (некорректная запись " "в sources.list или файл)" -#: apt-pkg/acquire-item.cc:1975 +#: apt-pkg/acquire-item.cc:1666 #, c-format msgid "Unable to find hash sum for '%s' in Release file" msgstr "Невозможно найти хеш-сумму «%s» в файле Release" -#: apt-pkg/acquire-item.cc:1999 +#: apt-pkg/acquire-item.cc:1708 msgid "There is no public key available for the following key IDs:\n" msgstr "Недоступен открытый ключ для следующих ID ключей:\n" -#: apt-pkg/acquire-item.cc:2037 +#: apt-pkg/acquire-item.cc:1746 #, c-format msgid "" "Release file for %s is expired (invalid since %s). Updates for this " @@ -2733,19 +2300,27 @@ msgstr "" "Файл Release для %s просрочен (недостоверный начиная с %s). Обновление этого " "репозитория производиться не будет." -#: apt-pkg/acquire-item.cc:2059 +#: apt-pkg/acquire-item.cc:1768 #, c-format msgid "Conflicting distribution: %s (expected %s but got %s)" msgstr "Конфликт распространения: %s (ожидался %s, но получен %s)" -#: apt-pkg/acquire-item.cc:2078 +#: apt-pkg/acquire-item.cc:1798 #, c-format msgid "" -"The repository '%s' does not have a Release file. This is deprecated, please " -"contact the owner of the repository." +"An error occurred during the signature verification. The repository is not " +"updated and the previous index files will be used. GPG error: %s: %s\n" msgstr "" +"Произошла ошибка при проверке подписи. Репозиторий не обновлён и будут " +"использованы предыдущие индексные файлы. Ошибка GPG: %s: %s\n" + +#. Invalid signature file, reject (LP: #346386) (Closes: #627642) +#: apt-pkg/acquire-item.cc:1808 apt-pkg/acquire-item.cc:1813 +#, c-format +msgid "GPG error: %s: %s" +msgstr "Ошибка GPG: %s: %s" -#: apt-pkg/acquire-item.cc:2249 +#: apt-pkg/acquire-item.cc:1936 #, c-format msgid "" "I wasn't able to locate a file for the %s package. This might mean you need " @@ -2754,53 +2329,140 @@ msgstr "" "Не удалось обнаружить файл пакета %s. Это может означать, что вам придётся " "вручную исправить этот пакет (возможно, пропущен arch)" -#: apt-pkg/acquire-item.cc:2315 +#: apt-pkg/acquire-item.cc:2002 #, c-format msgid "Can't find a source to download version '%s' of '%s'" msgstr "Невозможно найти источник для загрузки «%2$s» версии «%1$s»" -#: apt-pkg/acquire-item.cc:2351 +#: apt-pkg/acquire-item.cc:2060 #, c-format msgid "" "The package index files are corrupted. No Filename: field for package %s." msgstr "Некорректный перечень пакетов. Нет поля Filename: для пакета %s." -#: apt-pkg/vendorlist.cc:83 +#: apt-pkg/pkgcachegen.cc:93 +msgid "Cache has an incompatible versioning system" +msgstr "Кэш имеет несовместимую систему версий" + +#. TRANSLATOR: The first placeholder is a package name, +#. the other two should be copied verbatim as they include debug info +#: apt-pkg/pkgcachegen.cc:224 apt-pkg/pkgcachegen.cc:234 +#: apt-pkg/pkgcachegen.cc:300 apt-pkg/pkgcachegen.cc:327 +#: apt-pkg/pkgcachegen.cc:340 apt-pkg/pkgcachegen.cc:382 +#: apt-pkg/pkgcachegen.cc:386 apt-pkg/pkgcachegen.cc:403 +#: apt-pkg/pkgcachegen.cc:411 apt-pkg/pkgcachegen.cc:415 +#: apt-pkg/pkgcachegen.cc:419 apt-pkg/pkgcachegen.cc:440 +#: apt-pkg/pkgcachegen.cc:479 apt-pkg/pkgcachegen.cc:517 +#: apt-pkg/pkgcachegen.cc:524 apt-pkg/pkgcachegen.cc:555 +#: apt-pkg/pkgcachegen.cc:569 +#, c-format +msgid "Error occurred while processing %s (%s%d)" +msgstr "Произошла ошибка во время обработки %s (%s%d)" + +#: apt-pkg/pkgcachegen.cc:257 +msgid "Wow, you exceeded the number of package names this APT is capable of." +msgstr "" +"Превышено допустимое количество имён пакетов, которое способен обработать " +"APT." + +#: apt-pkg/pkgcachegen.cc:260 +msgid "Wow, you exceeded the number of versions this APT is capable of." +msgstr "" +"Превышено допустимое количество версий, которое способен обработать APT." + +#: apt-pkg/pkgcachegen.cc:263 +msgid "Wow, you exceeded the number of descriptions this APT is capable of." +msgstr "" +"Превышено допустимое количество описаний, которое способен обработать APT." + +#: apt-pkg/pkgcachegen.cc:266 +msgid "Wow, you exceeded the number of dependencies this APT is capable of." +msgstr "" +"Превышено допустимое количество зависимостей, которое способен обработать " +"APT." + +#: apt-pkg/pkgcachegen.cc:576 +#, c-format +msgid "Package %s %s was not found while processing file dependencies" +msgstr "Во время обработки файла зависимостей не найден пакет %s %s" + +#: apt-pkg/pkgcachegen.cc:1211 +#, c-format +msgid "Couldn't stat source package list %s" +msgstr "Не удалось получить атрибуты списка пакетов исходного кода %s" + +#: apt-pkg/pkgcachegen.cc:1299 apt-pkg/pkgcachegen.cc:1403 +#: apt-pkg/pkgcachegen.cc:1409 apt-pkg/pkgcachegen.cc:1566 +msgid "Reading package lists" +msgstr "Чтение списков пакетов" + +#: apt-pkg/pkgcachegen.cc:1316 +msgid "Collecting File Provides" +msgstr "Сбор информации о Provides" + +#: apt-pkg/pkgcachegen.cc:1400 cmdline/apt-extracttemplates.cc:259 +#, c-format +msgid "Unable to write to %s" +msgstr "Невозможно записать в %s" + +#: apt-pkg/pkgcachegen.cc:1508 apt-pkg/pkgcachegen.cc:1515 +msgid "IO Error saving source cache" +msgstr "Ошибка ввода/вывода при попытке сохранить кэш источников" + +#: apt-pkg/vendorlist.cc:85 #, c-format msgid "Vendor block %s contains no fingerprint" msgstr "Блок поставщика %s не содержит отпечатка (fingerprint)" -#: apt-pkg/acquire.cc:126 apt-pkg/acquire.cc:146 apt-pkg/cdrom.cc:832 +#: apt-pkg/acquire.cc:87 apt-pkg/cdrom.cc:829 #, c-format msgid "List directory %spartial is missing." msgstr "Каталог списка %spartial отсутствует." -#: apt-pkg/acquire.cc:129 apt-pkg/acquire.cc:151 +#: apt-pkg/acquire.cc:91 #, c-format msgid "Archives directory %spartial is missing." msgstr "Архивный каталог %spartial отсутствует." -#: apt-pkg/acquire.cc:162 +#: apt-pkg/acquire.cc:99 #, c-format msgid "Unable to lock directory %s" msgstr "Невозможно заблокировать каталог %s" +#: apt-pkg/acquire.cc:490 apt-pkg/clean.cc:39 +#, c-format +msgid "Clean of %s is not supported" +msgstr "Очистка «%s» не поддерживается" + #. only show the ETA if it makes sense #. two days -#: apt-pkg/acquire.cc:981 +#: apt-pkg/acquire.cc:902 #, c-format msgid "Retrieving file %li of %li (%s remaining)" msgstr "Скачивается файл %li из %li (осталось %s)" -#: apt-pkg/acquire.cc:983 +#: apt-pkg/acquire.cc:904 #, c-format msgid "Retrieving file %li of %li" msgstr "Скачивается файл %li из %li" +#: apt-pkg/update.cc:103 apt-pkg/update.cc:105 +msgid "" +"Some index files failed to download. They have been ignored, or old ones " +"used instead." +msgstr "" +"Некоторые индексные файлы не скачались. Они были проигнорированы или вместо " +"них были использованы старые версии." + #: apt-pkg/srcrecords.cc:53 msgid "You must put some 'source' URIs in your sources.list" msgstr "Вы должны заполнить sources.list, поместив туда URI источников пакетов" +#: apt-pkg/clean.cc:64 +#, c-format +msgid "Unable to stat %s." +msgstr "Невозможно получить атрибуты %s." + #: apt-pkg/policy.cc:83 #, c-format msgid "" @@ -2824,7 +2486,7 @@ msgstr "Неизвестный тип фиксации %s" msgid "No priority (or zero) specified for pin" msgstr "Для фиксации не указан приоритет (или указан нулевой)" -#: apt-pkg/packagemanager.cc:304 apt-pkg/packagemanager.cc:984 +#: apt-pkg/packagemanager.cc:303 apt-pkg/packagemanager.cc:957 #, c-format msgid "" "Could not perform immediate configuration on '%s'. Please see man 5 apt.conf " @@ -2833,12 +2495,12 @@ msgstr "" "Не удалось выполнить оперативную настройку «%s». Подробней, смотрите в man 5 " "apt.conf о APT::Immediate-Configure. (%d)" -#: apt-pkg/packagemanager.cc:563 apt-pkg/packagemanager.cc:593 +#: apt-pkg/packagemanager.cc:550 apt-pkg/packagemanager.cc:580 #, c-format msgid "Could not configure '%s'. " msgstr "Не удалось настроить «%s»." -#: apt-pkg/packagemanager.cc:643 +#: apt-pkg/packagemanager.cc:630 #, c-format msgid "" "This installation run will require temporarily removing the essential " @@ -2851,13 +2513,10 @@ msgstr "" "Если вы действительно хотите продолжить, установите параметр APT::Force-" "LoopBreak." -#: apt-pkg/update.cc:103 apt-pkg/update.cc:105 -msgid "" -"Some index files failed to download. They have been ignored, or old ones " -"used instead." -msgstr "" -"Некоторые индексные файлы не скачались. Они были проигнорированы или вместо " -"них были использованы старые версии." +#: apt-pkg/cdrom.cc:497 apt-pkg/sourcelist.cc:347 +#, c-format +msgid "Line %u too long in source list %s." +msgstr "Строка %u в списке источников %s слишком длинна." #: apt-pkg/cdrom.cc:571 msgid "Unmounting CD-ROM...\n" @@ -2928,219 +2587,440 @@ msgstr "" msgid "Copying package lists..." msgstr "Копирование списков пакетов…" -#: apt-pkg/cdrom.cc:866 +#: apt-pkg/cdrom.cc:863 msgid "Writing new source list\n" msgstr "Запись нового списка источников\n" -#: apt-pkg/cdrom.cc:877 +#: apt-pkg/cdrom.cc:874 msgid "Source list entries for this disc are:\n" msgstr "Записи в списке источников для этого диска:\n" #: apt-pkg/algorithms.cc:265 #, c-format -msgid "" -"The package %s needs to be reinstalled, but I can't find an archive for it." +msgid "" +"The package %s needs to be reinstalled, but I can't find an archive for it." +msgstr "" +"Пакет %s нуждается в переустановке, но найти архив для него не удалось." + +#: apt-pkg/algorithms.cc:1086 +msgid "" +"Error, pkgProblemResolver::Resolve generated breaks, this may be caused by " +"held packages." +msgstr "" +"Ошибка, pkgProblemResolver::Resolve сгенерировал повреждённые пакеты. Это " +"может быть вызвано отложенными (held) пакетами." + +#: apt-pkg/algorithms.cc:1088 +msgid "Unable to correct problems, you have held broken packages." +msgstr "Невозможно исправить ошибки, у вас отложены (held) битые пакеты." + +#: apt-pkg/edsp.cc:52 apt-pkg/edsp.cc:78 +msgid "Send scenario to solver" +msgstr "Отправка сценария решателю" + +#: apt-pkg/edsp.cc:241 +msgid "Send request to solver" +msgstr "Отправка запроса решателю" + +#: apt-pkg/edsp.cc:320 +msgid "Prepare for receiving solution" +msgstr "Подготовка к приёму решения" + +#: apt-pkg/edsp.cc:327 +msgid "External solver failed without a proper error message" +msgstr "Внешний решатель завершился с ошибкой не передав сообщения об ошибке" + +#: apt-pkg/edsp.cc:619 apt-pkg/edsp.cc:622 apt-pkg/edsp.cc:627 +msgid "Execute external solver" +msgstr "Запустить внешний решатель" + +#: apt-pkg/tagfile.cc:140 +#, c-format +msgid "Unable to parse package file %s (1)" +msgstr "Невозможно разобрать содержимое пакета %s (1)" + +#: apt-pkg/tagfile.cc:237 +#, c-format +msgid "Unable to parse package file %s (2)" +msgstr "Невозможно разобрать содержимое пакета %s (2)" + +#: apt-pkg/indexrecords.cc:78 +#, c-format +msgid "Unable to parse Release file %s" +msgstr "Невозможно разобрать содержимое файла Release (%s)" + +#: apt-pkg/indexrecords.cc:86 +#, c-format +msgid "No sections in Release file %s" +msgstr "Отсутствуют разделы в файле Release (%s)" + +#: apt-pkg/indexrecords.cc:117 +#, c-format +msgid "No Hash entry in Release file %s" +msgstr "Отсутствуют элементы Hash в файле Release (%s)" + +#: apt-pkg/indexrecords.cc:130 +#, c-format +msgid "Invalid 'Valid-Until' entry in Release file %s" +msgstr "Неправильный элемент «Valid-Until» в файле Release %s" + +#: apt-pkg/indexrecords.cc:149 +#, c-format +msgid "Invalid 'Date' entry in Release file %s" +msgstr "Неправильный элемент «Date» в файле Release %s" + +#: apt-pkg/sourcelist.cc:127 +#, c-format +msgid "Malformed stanza %u in source list %s (URI parse)" +msgstr "Искажённая строфа %u в списке источников %s (анализ URI)" + +#: apt-pkg/sourcelist.cc:170 +#, c-format +msgid "Malformed line %lu in source list %s ([option] unparseable)" +msgstr "Искажённая строка %lu в списке источников %s ([параметр] неразбираем)" + +#: apt-pkg/sourcelist.cc:173 +#, c-format +msgid "Malformed line %lu in source list %s ([option] too short)" +msgstr "" +"Искажённая строка %lu в списке источников %s ([параметр] слишком короткий)" + +#: apt-pkg/sourcelist.cc:184 +#, c-format +msgid "Malformed line %lu in source list %s ([%s] is not an assignment)" +msgstr "Искажённая строка %lu в списке источников %s (([%s] не назначаем)" + +#: apt-pkg/sourcelist.cc:190 +#, c-format +msgid "Malformed line %lu in source list %s ([%s] has no key)" +msgstr "Искажённая строка %lu в списке источников %s ([%s] не имеет ключа)" + +#: apt-pkg/sourcelist.cc:193 +#, c-format +msgid "Malformed line %lu in source list %s ([%s] key %s has no value)" msgstr "" -"Пакет %s нуждается в переустановке, но найти архив для него не удалось." +"Искажённая строка %lu в списке источников %s (([%s] ключ %s не имеет " +"значения)" -#: apt-pkg/algorithms.cc:1090 -msgid "" -"Error, pkgProblemResolver::Resolve generated breaks, this may be caused by " -"held packages." -msgstr "" -"Ошибка, pkgProblemResolver::Resolve сгенерировал повреждённые пакеты. Это " -"может быть вызвано отложенными (held) пакетами." +#: apt-pkg/sourcelist.cc:206 +#, c-format +msgid "Malformed line %lu in source list %s (URI)" +msgstr "Искажённая строка %lu в списке источников %s (проблема в URI)" -#: apt-pkg/algorithms.cc:1092 -msgid "Unable to correct problems, you have held broken packages." -msgstr "Невозможно исправить ошибки, у вас отложены (held) битые пакеты." +#: apt-pkg/sourcelist.cc:208 +#, c-format +msgid "Malformed line %lu in source list %s (dist)" +msgstr "" +"Искажённая строка %lu в списке источников %s (проблема в имени дистрибутива)" -#: apt-pkg/depcache.cc:138 apt-pkg/depcache.cc:167 -msgid "Building dependency tree" -msgstr "Построение дерева зависимостей" +#: apt-pkg/sourcelist.cc:211 +#, c-format +msgid "Malformed line %lu in source list %s (URI parse)" +msgstr "Искажённая строка %lu в списке источников %s (анализ URI)" -#: apt-pkg/depcache.cc:139 -msgid "Candidate versions" -msgstr "Версии-кандидаты" +#: apt-pkg/sourcelist.cc:217 +#, c-format +msgid "Malformed line %lu in source list %s (absolute dist)" +msgstr "Искажённая строка %lu в списке источников %s (absolute dist)" -#: apt-pkg/depcache.cc:168 -msgid "Dependency generation" -msgstr "Генерирование зависимостей" +#: apt-pkg/sourcelist.cc:224 +#, c-format +msgid "Malformed line %lu in source list %s (dist parse)" +msgstr "Искажённая строка %lu в списке источников %s (dist parse)" -#: apt-pkg/depcache.cc:188 apt-pkg/depcache.cc:221 apt-pkg/depcache.cc:225 -msgid "Reading state information" -msgstr "Чтение информации о состоянии" +#: apt-pkg/sourcelist.cc:335 +#, c-format +msgid "Opening %s" +msgstr "Открытие %s" -#: apt-pkg/depcache.cc:252 +#: apt-pkg/sourcelist.cc:371 #, c-format -msgid "Failed to open StateFile %s" -msgstr "Не удалось открыть StateFile %s" +msgid "Malformed line %u in source list %s (type)" +msgstr "Искажённая строка %u в списке источников %s (тип)" -#: apt-pkg/depcache.cc:258 +#: apt-pkg/sourcelist.cc:375 #, c-format -msgid "Failed to write temporary StateFile %s" -msgstr "Не удалось записать временный StateFile %s" +msgid "Type '%s' is not known on line %u in source list %s" +msgstr "Неизвестный тип «%s» в строке %u в списке источников %s" -#: apt-pkg/tagfile.cc:186 apt-pkg/tagfile.cc:286 apt-pkg/deb/debrecords.cc:207 +#: apt-pkg/sourcelist.cc:416 #, c-format -msgid "Unable to parse package file %s (%d)" -msgstr "Невозможно разобрать содержимое пакета %s (%d)" +msgid "Type '%s' is not known on stanza %u in source list %s" +msgstr "Неизвестный тип «%s» в строфе %u в списке источников %s" -#: apt-pkg/cacheset.cc:501 +#: apt-pkg/cacheset.cc:489 #, c-format msgid "Release '%s' for '%s' was not found" msgstr "Выпуск «%s» для «%s» не найден" -#: apt-pkg/cacheset.cc:504 +#: apt-pkg/cacheset.cc:492 #, c-format msgid "Version '%s' for '%s' was not found" msgstr "Версия «%s» для «%s» не найдена" -#: apt-pkg/cacheset.cc:629 +#: apt-pkg/cacheset.cc:603 #, c-format msgid "Couldn't find task '%s'" msgstr "Не удалось найти задачу «%s»" -#: apt-pkg/cacheset.cc:635 +#: apt-pkg/cacheset.cc:609 #, c-format msgid "Couldn't find any package by regex '%s'" -msgstr "Не удалось найти пакет по регулярному выражению «%s»" +msgstr "Не удалось найти пакет с помощью regex «%s»" -#: apt-pkg/cacheset.cc:641 -#, fuzzy, c-format +#: apt-pkg/cacheset.cc:615 +#, c-format msgid "Couldn't find any package by glob '%s'" -msgstr "Не удалось найти пакет по регулярному выражению «%s»" +msgstr "Не удалось найти пакет с помощью glob «%s»" -#: apt-pkg/cacheset.cc:680 +#: apt-pkg/cacheset.cc:626 #, c-format msgid "Can't select versions from package '%s' as it is purely virtual" msgstr "" "Не удалось выбрать версии из пакета «%s», так как он полностью виртуальный" -#: apt-pkg/cacheset.cc:719 +#: apt-pkg/cacheset.cc:633 apt-pkg/cacheset.cc:640 +#, c-format +msgid "" +"Can't select installed nor candidate version from package '%s' as it has " +"neither of them" +msgstr "" +"Не удалось выбрать ни установленную, ни версию кандидата из пакета «%s», так " +"как в нём нет ни той, ни другой" + +#: apt-pkg/cacheset.cc:647 #, c-format msgid "Can't select newest version from package '%s' as it is purely virtual" msgstr "" "Не удалось выбрать самую новую версию из пакета «%s», так как он полностью " "виртуальный" -#: apt-pkg/cacheset.cc:727 +#: apt-pkg/cacheset.cc:655 #, c-format msgid "Can't select candidate version from package %s as it has no candidate" msgstr "" "Не удалось выбрать самую версию кандидата из пакета %s, так как у него нет " "кандидатов" -#: apt-pkg/cacheset.cc:735 +#: apt-pkg/cacheset.cc:663 #, c-format msgid "Can't select installed version from package %s as it is not installed" msgstr "" "Не удалось выбрать установленную версию из пакета %s, так как он не " "установлен" -#: apt-pkg/cacheset.cc:743 apt-pkg/cacheset.cc:751 +#: apt-pkg/deb/dpkgpm.cc:112 #, c-format -msgid "" -"Can't select installed nor candidate version from package '%s' as it has " -"neither of them" -msgstr "" -"Не удалось выбрать ни установленную, ни версию кандидата из пакета «%s», так " -"как в нём нет ни той, ни другой" +msgid "Installing %s" +msgstr "Устанавливается %s" -#: apt-pkg/indexrecords.cc:83 +#: apt-pkg/deb/dpkgpm.cc:113 apt-pkg/deb/dpkgpm.cc:1016 #, c-format -msgid "Unable to parse Release file %s" -msgstr "Невозможно разобрать содержимое файла Release (%s)" +msgid "Configuring %s" +msgstr "Настраивается %s" -#: apt-pkg/indexrecords.cc:91 +#: apt-pkg/deb/dpkgpm.cc:114 apt-pkg/deb/dpkgpm.cc:1023 #, c-format -msgid "No sections in Release file %s" -msgstr "Отсутствуют разделы в файле Release (%s)" +msgid "Removing %s" +msgstr "Удаляется %s" -#: apt-pkg/indexrecords.cc:132 +#: apt-pkg/deb/dpkgpm.cc:115 #, c-format -msgid "No Hash entry in Release file %s" -msgstr "Отсутствуют элементы Hash в файле Release (%s)" +msgid "Completely removing %s" +msgstr "Выполняется полное удаление %s" -#: apt-pkg/indexrecords.cc:145 +#: apt-pkg/deb/dpkgpm.cc:116 #, c-format -msgid "Invalid 'Valid-Until' entry in Release file %s" -msgstr "Неправильный элемент «Valid-Until» в файле Release %s" +msgid "Noting disappearance of %s" +msgstr "Уведомление об исчезновении %s" -#: apt-pkg/indexrecords.cc:164 +#: apt-pkg/deb/dpkgpm.cc:117 #, c-format -msgid "Invalid 'Date' entry in Release file %s" -msgstr "Неправильный элемент «Date» в файле Release %s" +msgid "Running post-installation trigger %s" +msgstr "Выполняется послеустановочный триггер %s" -#. d means days, h means hours, min means minutes, s means seconds -#: apt-pkg/contrib/strutl.cc:425 +#. FIXME: use a better string after freeze +#: apt-pkg/deb/dpkgpm.cc:847 #, c-format -msgid "%lid %lih %limin %lis" -msgstr "%liд %liч %liмин %liс" +msgid "Directory '%s' missing" +msgstr "Отсутствует каталог «%s»" -#. h means hours, min means minutes, s means seconds -#: apt-pkg/contrib/strutl.cc:432 +#: apt-pkg/deb/dpkgpm.cc:862 apt-pkg/deb/dpkgpm.cc:884 #, c-format -msgid "%lih %limin %lis" -msgstr "%liч %liмин %liс" +msgid "Could not open file '%s'" +msgstr "Не удалось открыть файл «%s»" -#. min means minutes, s means seconds -#: apt-pkg/contrib/strutl.cc:439 +#: apt-pkg/deb/dpkgpm.cc:1009 #, c-format -msgid "%limin %lis" -msgstr "%liмин %liс" +msgid "Preparing %s" +msgstr "Подготавливается %s" -#. s means seconds -#: apt-pkg/contrib/strutl.cc:444 +#: apt-pkg/deb/dpkgpm.cc:1010 #, c-format -msgid "%lis" -msgstr "%liс" +msgid "Unpacking %s" +msgstr "Распаковывается %s" -#: apt-pkg/contrib/strutl.cc:1290 +#: apt-pkg/deb/dpkgpm.cc:1015 #, c-format -msgid "Selection %s not found" -msgstr "Не найдено: %s" +msgid "Preparing to configure %s" +msgstr "Подготавливается для настройки %s" + +#: apt-pkg/deb/dpkgpm.cc:1017 +#, c-format +msgid "Installed %s" +msgstr "Установлен %s" + +#: apt-pkg/deb/dpkgpm.cc:1022 +#, c-format +msgid "Preparing for removal of %s" +msgstr "Подготавливается для удаления %s" + +#: apt-pkg/deb/dpkgpm.cc:1024 +#, c-format +msgid "Removed %s" +msgstr "Удалён %s" + +#: apt-pkg/deb/dpkgpm.cc:1029 +#, c-format +msgid "Preparing to completely remove %s" +msgstr "Подготовка к полному удалению %s" + +#: apt-pkg/deb/dpkgpm.cc:1030 +#, c-format +msgid "Completely removed %s" +msgstr "%s полностью удалён" + +#: apt-pkg/deb/dpkgpm.cc:1091 apt-pkg/deb/dpkgpm.cc:1179 +#, c-format +msgid "Can not write log (%s)" +msgstr "Невозможно записать журнал (%s)" + +#: apt-pkg/deb/dpkgpm.cc:1091 apt-pkg/deb/dpkgpm.cc:1179 +msgid "Is /dev/pts mounted?" +msgstr "Смонтирован ли /dev/pts?" + +#: apt-pkg/deb/dpkgpm.cc:1670 +msgid "Operation was interrupted before it could finish" +msgstr "Действие прервано до его завершения" + +#: apt-pkg/deb/dpkgpm.cc:1732 +msgid "No apport report written because MaxReports is reached already" +msgstr "Отчёты apport не записаны, так достигнут MaxReports" + +#. check if its not a follow up error +#: apt-pkg/deb/dpkgpm.cc:1737 +msgid "dependency problems - leaving unconfigured" +msgstr "проблемы с зависимостями — оставляем ненастроенным" + +#: apt-pkg/deb/dpkgpm.cc:1739 +msgid "" +"No apport report written because the error message indicates its a followup " +"error from a previous failure." +msgstr "" +"Отчёты apport не записаны, так как сообщение об ошибке указывает на " +"повторную ошибку от предыдущего отказа." + +#: apt-pkg/deb/dpkgpm.cc:1745 +msgid "" +"No apport report written because the error message indicates a disk full " +"error" +msgstr "" +"Отчёты apport не записаны, так как получено сообщение об ошибке о нехватке " +"места на диске" + +#: apt-pkg/deb/dpkgpm.cc:1752 +msgid "" +"No apport report written because the error message indicates a out of memory " +"error" +msgstr "" +"Отчёты apport не записаны, так как получено сообщение об ошибке о нехватке " +"памяти" + +#: apt-pkg/deb/dpkgpm.cc:1759 apt-pkg/deb/dpkgpm.cc:1765 +msgid "" +"No apport report written because the error message indicates an issue on the " +"local system" +msgstr "" +"Отчёты apport не записаны, так как получено сообщение о проблеме в локальной " +"системе" + +#: apt-pkg/deb/dpkgpm.cc:1787 +msgid "" +"No apport report written because the error message indicates a dpkg I/O error" +msgstr "" +"Отчёты apport не записаны, так как получено сообщение об ошибке об ошибке " +"ввода-выводы dpkg" + +#: apt-pkg/deb/debsystem.cc:91 +#, c-format +msgid "" +"Unable to lock the administration directory (%s), is another process using " +"it?" +msgstr "" +"Не удалось выполнить блокировку управляющего каталога (%s); он уже " +"используется другим процессом?" + +#: apt-pkg/deb/debsystem.cc:94 +#, c-format +msgid "Unable to lock the administration directory (%s), are you root?" +msgstr "" +"Не удалось выполнить блокировку управляющего каталога (%s); у вас есть права " +"суперпользователя?" + +#. TRANSLATORS: the %s contains the recovery command, usually +#. dpkg --configure -a +#: apt-pkg/deb/debsystem.cc:110 +#, c-format +msgid "" +"dpkg was interrupted, you must manually run '%s' to correct the problem. " +msgstr "" +"Работа dpkg прервана, вы должны вручную запустить «%s» для устранения " +"проблемы. " + +#: apt-pkg/deb/debsystem.cc:128 +msgid "Not locked" +msgstr "Не заблокирован" -#: apt-pkg/contrib/fileutl.cc:196 +#: apt-pkg/contrib/fileutl.cc:190 #, c-format msgid "Not using locking for read only lock file %s" msgstr "" "Блокировка не используется, так как файл блокировки %s доступен только для " "чтения" -#: apt-pkg/contrib/fileutl.cc:201 +#: apt-pkg/contrib/fileutl.cc:195 #, c-format msgid "Could not open lock file %s" msgstr "Не удалось открыть файл блокировки %s" -#: apt-pkg/contrib/fileutl.cc:224 +#: apt-pkg/contrib/fileutl.cc:218 #, c-format msgid "Not using locking for nfs mounted lock file %s" msgstr "" "Блокировка не используется, так как файл блокировки %s находится на файловой " "системе nfs" -#: apt-pkg/contrib/fileutl.cc:229 +#: apt-pkg/contrib/fileutl.cc:223 #, c-format msgid "Could not get lock %s" msgstr "Не удалось получить доступ к файлу блокировки %s" -#: apt-pkg/contrib/fileutl.cc:366 apt-pkg/contrib/fileutl.cc:480 +#: apt-pkg/contrib/fileutl.cc:360 apt-pkg/contrib/fileutl.cc:474 #, c-format msgid "List of files can't be created as '%s' is not a directory" msgstr "Список файлов не может быть создан, так как «%s» не является каталогом" -#: apt-pkg/contrib/fileutl.cc:400 +#: apt-pkg/contrib/fileutl.cc:394 #, c-format msgid "Ignoring '%s' in directory '%s' as it is not a regular file" msgstr "Файл «%s» в каталоге «%s» игнорируется, так как это необычный файл" -#: apt-pkg/contrib/fileutl.cc:418 +#: apt-pkg/contrib/fileutl.cc:412 #, c-format msgid "Ignoring file '%s' in directory '%s' as it has no filename extension" msgstr "Файл «%s» в каталоге «%s» игнорируется, так как он не имеет расширения" -#: apt-pkg/contrib/fileutl.cc:427 +#: apt-pkg/contrib/fileutl.cc:421 #, c-format msgid "" "Ignoring file '%s' in directory '%s' as it has an invalid filename extension" @@ -3148,77 +3028,77 @@ msgstr "" "Файл «%s» в каталоге «%s» игнорируется, так как он не имеет неправильное " "расширение" -#: apt-pkg/contrib/fileutl.cc:846 +#: apt-pkg/contrib/fileutl.cc:825 #, c-format msgid "Sub-process %s received a segmentation fault." msgstr "" "Нарушение защиты памяти (segmentation fault) в порождённом процессе %s." -#: apt-pkg/contrib/fileutl.cc:848 +#: apt-pkg/contrib/fileutl.cc:827 #, c-format msgid "Sub-process %s received signal %u." msgstr "Порождённый процесс %s получил сигнал %u." -#: apt-pkg/contrib/fileutl.cc:852 apt-pkg/contrib/gpgv.cc:212 +#: apt-pkg/contrib/fileutl.cc:831 apt-pkg/contrib/gpgv.cc:239 #, c-format msgid "Sub-process %s returned an error code (%u)" msgstr "Порождённый процесс %s вернул код ошибки (%u)" -#: apt-pkg/contrib/fileutl.cc:854 apt-pkg/contrib/gpgv.cc:205 +#: apt-pkg/contrib/fileutl.cc:833 apt-pkg/contrib/gpgv.cc:232 #, c-format msgid "Sub-process %s exited unexpectedly" msgstr "Порождённый процесс %s неожиданно завершился" -#: apt-pkg/contrib/fileutl.cc:952 +#: apt-pkg/contrib/fileutl.cc:914 #, c-format msgid "Problem closing the gzip file %s" msgstr "Проблема закрытия gzip-файла %s" -#: apt-pkg/contrib/fileutl.cc:1140 +#: apt-pkg/contrib/fileutl.cc:1102 #, c-format msgid "Could not open file %s" msgstr "Не удалось открыть файл %s" -#: apt-pkg/contrib/fileutl.cc:1199 apt-pkg/contrib/fileutl.cc:1246 +#: apt-pkg/contrib/fileutl.cc:1161 apt-pkg/contrib/fileutl.cc:1208 #, c-format msgid "Could not open file descriptor %d" msgstr "Не удалось открыть файловый дескриптор %d" -#: apt-pkg/contrib/fileutl.cc:1354 apt-pkg/contrib/fileutl.cc:2123 +#: apt-pkg/contrib/fileutl.cc:1316 msgid "Failed to create subprocess IPC" msgstr "Не удалось создать IPC с порождённым процессом" -#: apt-pkg/contrib/fileutl.cc:1412 +#: apt-pkg/contrib/fileutl.cc:1374 msgid "Failed to exec compressor " msgstr "Не удалось выполнить компрессор " -#: apt-pkg/contrib/fileutl.cc:1553 +#: apt-pkg/contrib/fileutl.cc:1515 #, c-format msgid "read, still have %llu to read but none left" msgstr "" "ошибка при чтении; собирались прочесть ещё %llu байт, но ничего больше нет" -#: apt-pkg/contrib/fileutl.cc:1666 apt-pkg/contrib/fileutl.cc:1688 +#: apt-pkg/contrib/fileutl.cc:1628 apt-pkg/contrib/fileutl.cc:1650 #, c-format msgid "write, still have %llu to write but couldn't" msgstr "ошибка при записи; собирались записать ещё %llu байт, но не смогли" -#: apt-pkg/contrib/fileutl.cc:1954 +#: apt-pkg/contrib/fileutl.cc:1916 #, c-format msgid "Problem closing the file %s" msgstr "Проблема закрытия файла %s" -#: apt-pkg/contrib/fileutl.cc:1965 +#: apt-pkg/contrib/fileutl.cc:1928 #, c-format msgid "Problem renaming the file %s to %s" msgstr "Проблема при переименовании файла %s в %s" -#: apt-pkg/contrib/fileutl.cc:1976 +#: apt-pkg/contrib/fileutl.cc:1939 #, c-format msgid "Problem unlinking the file %s" msgstr "Проблема при удалении файла %s" -#: apt-pkg/contrib/fileutl.cc:1989 +#: apt-pkg/contrib/fileutl.cc:1952 msgid "Problem syncing the file" msgstr "Проблема при синхронизации файла" @@ -3236,11 +3116,40 @@ msgstr "%c%s… Готово" msgid "..." msgstr "…" -#. Print the spinner -#: apt-pkg/contrib/progress.cc:197 +#. Print the spinner +#: apt-pkg/contrib/progress.cc:197 +#, c-format +msgid "%c%s... %u%%" +msgstr "%c%s… %u%%" + +#. d means days, h means hours, min means minutes, s means seconds +#: apt-pkg/contrib/strutl.cc:418 +#, c-format +msgid "%lid %lih %limin %lis" +msgstr "%liд %liч %liмин %liс" + +#. h means hours, min means minutes, s means seconds +#: apt-pkg/contrib/strutl.cc:425 +#, c-format +msgid "%lih %limin %lis" +msgstr "%liч %liмин %liс" + +#. min means minutes, s means seconds +#: apt-pkg/contrib/strutl.cc:432 +#, c-format +msgid "%limin %lis" +msgstr "%liмин %liс" + +#. s means seconds +#: apt-pkg/contrib/strutl.cc:437 +#, c-format +msgid "%lis" +msgstr "%liс" + +#: apt-pkg/contrib/strutl.cc:1258 #, c-format -msgid "%c%s... %u%%" -msgstr "%c%s… %u%%" +msgid "Selection %s not found" +msgstr "Не найдено: %s" #: apt-pkg/contrib/mmap.cc:79 msgid "Can't mmap an empty file" @@ -3306,449 +3215,518 @@ msgstr "Невозможно прочитать атрибуты точки мо msgid "Failed to stat the cdrom" msgstr "Невозможно получить атрибуты cdrom" -#: apt-pkg/contrib/configuration.cc:522 +#: apt-pkg/contrib/configuration.cc:519 #, c-format msgid "Unrecognized type abbreviation: '%c'" msgstr "Неизвестная аббревиатура типа: «%c»" -#: apt-pkg/contrib/configuration.cc:636 +#: apt-pkg/contrib/configuration.cc:633 #, c-format msgid "Opening configuration file %s" msgstr "Открытие файла настройки %s" -#: apt-pkg/contrib/configuration.cc:804 +#: apt-pkg/contrib/configuration.cc:801 #, c-format msgid "Syntax error %s:%u: Block starts with no name." msgstr "Синтаксическая ошибка %s:%u: в начале блока нет имени." -#: apt-pkg/contrib/configuration.cc:823 +#: apt-pkg/contrib/configuration.cc:820 #, c-format msgid "Syntax error %s:%u: Malformed tag" msgstr "Синтаксическая ошибка %s:%u: искажённый тег" -#: apt-pkg/contrib/configuration.cc:840 +#: apt-pkg/contrib/configuration.cc:837 #, c-format msgid "Syntax error %s:%u: Extra junk after value" msgstr "Синтаксическая ошибка %s:%u: лишние символы после значения" -#: apt-pkg/contrib/configuration.cc:880 +#: apt-pkg/contrib/configuration.cc:877 #, c-format msgid "Syntax error %s:%u: Directives can only be done at the top level" msgstr "" "Синтаксическая ошибка %s:%u: директивы могут задаваться только на верхнем " "уровне" -#: apt-pkg/contrib/configuration.cc:887 +#: apt-pkg/contrib/configuration.cc:884 #, c-format msgid "Syntax error %s:%u: Too many nested includes" msgstr "Синтаксическая ошибка %s:%u: слишком много вложенных include" -#: apt-pkg/contrib/configuration.cc:891 apt-pkg/contrib/configuration.cc:896 +#: apt-pkg/contrib/configuration.cc:888 apt-pkg/contrib/configuration.cc:893 #, c-format msgid "Syntax error %s:%u: Included from here" msgstr "Синтаксическая ошибка %s:%u вызвана include из этого места" -#: apt-pkg/contrib/configuration.cc:900 +#: apt-pkg/contrib/configuration.cc:897 #, c-format msgid "Syntax error %s:%u: Unsupported directive '%s'" msgstr "Синтаксическая ошибка %s:%u: не поддерживаемая директива «%s»" -#: apt-pkg/contrib/configuration.cc:903 +#: apt-pkg/contrib/configuration.cc:900 #, c-format msgid "Syntax error %s:%u: clear directive requires an option tree as argument" msgstr "" "Синтаксическая ошибка %s:%u: для директивы clear требуется третий параметр в " "качестве аргумента" -#: apt-pkg/contrib/configuration.cc:953 +#: apt-pkg/contrib/configuration.cc:950 #, c-format msgid "Syntax error %s:%u: Extra junk at end of file" msgstr "Синтаксическая ошибка %s:%u: лишние символы в конце файла" -#: apt-pkg/contrib/cmndline.cc:127 +#. TRANSLATOR: %s is the trusted keyring parts directory +#: apt-pkg/contrib/gpgv.cc:72 +#, c-format +msgid "No keyring installed in %s." +msgstr "Связка ключей в %s не установлена." + +#: apt-pkg/contrib/cmndline.cc:124 #, c-format msgid "Command line option '%c' [from %s] is not known." msgstr "Неизвестный параметр командной строки «%c» [из %s]." -#: apt-pkg/contrib/cmndline.cc:152 apt-pkg/contrib/cmndline.cc:161 -#: apt-pkg/contrib/cmndline.cc:169 +#: apt-pkg/contrib/cmndline.cc:149 apt-pkg/contrib/cmndline.cc:158 +#: apt-pkg/contrib/cmndline.cc:166 #, c-format msgid "Command line option %s is not understood" msgstr "Не распознанный параметр командной строки %s" -#: apt-pkg/contrib/cmndline.cc:174 +#: apt-pkg/contrib/cmndline.cc:171 #, c-format msgid "Command line option %s is not boolean" msgstr "Параметр командной строки %s — не логический переключатель \"да/нет\"" -#: apt-pkg/contrib/cmndline.cc:215 apt-pkg/contrib/cmndline.cc:236 +#: apt-pkg/contrib/cmndline.cc:212 apt-pkg/contrib/cmndline.cc:233 #, c-format msgid "Option %s requires an argument." msgstr "Для параметра %s требуется аргумент." -#: apt-pkg/contrib/cmndline.cc:249 apt-pkg/contrib/cmndline.cc:255 +#: apt-pkg/contrib/cmndline.cc:246 apt-pkg/contrib/cmndline.cc:252 #, c-format msgid "Option %s: Configuration item specification must have an =." msgstr "Значение параметра %s должно иметь вид =." -#: apt-pkg/contrib/cmndline.cc:284 +#: apt-pkg/contrib/cmndline.cc:281 #, c-format msgid "Option %s requires an integer argument, not '%s'" msgstr "Для параметра %s требуется аргумент в виде целого числа, а не «%s»" -#: apt-pkg/contrib/cmndline.cc:315 +#: apt-pkg/contrib/cmndline.cc:312 #, c-format msgid "Option '%s' is too long" msgstr "Параметр «%s» слишком длинный" -#: apt-pkg/contrib/cmndline.cc:347 +#: apt-pkg/contrib/cmndline.cc:344 #, c-format msgid "Sense %s is not understood, try true or false." msgstr "Смысл %s не ясен, используйте true или false." -#: apt-pkg/contrib/cmndline.cc:397 +#: apt-pkg/contrib/cmndline.cc:394 #, c-format msgid "Invalid operation %s" msgstr "Неверная операция %s" -#: apt-pkg/deb/dpkgpm.cc:112 -#, c-format -msgid "Installing %s" -msgstr "Устанавливается %s" - -#: apt-pkg/deb/dpkgpm.cc:113 apt-pkg/deb/dpkgpm.cc:1008 -#, c-format -msgid "Configuring %s" -msgstr "Настраивается %s" - -#: apt-pkg/deb/dpkgpm.cc:114 apt-pkg/deb/dpkgpm.cc:1015 -#, c-format -msgid "Removing %s" -msgstr "Удаляется %s" - -#: apt-pkg/deb/dpkgpm.cc:115 -#, c-format -msgid "Completely removing %s" -msgstr "Выполняется полное удаление %s" +#: cmdline/apt-extracttemplates.cc:224 +msgid "" +"Usage: apt-extracttemplates file1 [file2 ...]\n" +"\n" +"apt-extracttemplates is a tool to extract config and template info\n" +"from debian packages\n" +"\n" +"Options:\n" +" -h This help text\n" +" -t Set the temp dir\n" +" -c=? Read this configuration file\n" +" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" +msgstr "" +"Использование: apt-extracttemplates файл1 [файл2…]\n" +"\n" +"apt-extracttemplates извлекает из пакетов Debian данные config и template\n" +"\n" +"Параметры:\n" +" -h Этот текст\n" +" -t Задать каталог для временных файлов\n" +" -c=? Читать указанный файл настройки\n" +" -o=? Задать значение произвольной настройке, например, -o dir::cache=/tmp\n" -#: apt-pkg/deb/dpkgpm.cc:116 +#: cmdline/apt-extracttemplates.cc:254 #, c-format -msgid "Noting disappearance of %s" -msgstr "Уведомление об исчезновении %s" +msgid "Unable to mkstemp %s" +msgstr "Невозможно выполнить mkstemp %s" -#: apt-pkg/deb/dpkgpm.cc:117 -#, c-format -msgid "Running post-installation trigger %s" -msgstr "Выполняется послеустановочный триггер %s" +#: cmdline/apt-extracttemplates.cc:300 +msgid "Cannot get debconf version. Is debconf installed?" +msgstr "Невозможно определить версию debconf. Он установлен?" -#. FIXME: use a better string after freeze -#: apt-pkg/deb/dpkgpm.cc:839 -#, c-format -msgid "Directory '%s' missing" -msgstr "Отсутствует каталог «%s»" +#: ftparchive/apt-ftparchive.cc:187 ftparchive/apt-ftparchive.cc:371 +msgid "Package extension list is too long" +msgstr "Список расширений, допустимых для пакетов, слишком длинен" -#: apt-pkg/deb/dpkgpm.cc:854 apt-pkg/deb/dpkgpm.cc:876 +#: ftparchive/apt-ftparchive.cc:189 ftparchive/apt-ftparchive.cc:206 +#: ftparchive/apt-ftparchive.cc:229 ftparchive/apt-ftparchive.cc:283 +#: ftparchive/apt-ftparchive.cc:297 ftparchive/apt-ftparchive.cc:319 #, c-format -msgid "Could not open file '%s'" -msgstr "Не удалось открыть файл «%s»" +msgid "Error processing directory %s" +msgstr "Ошибка обработки каталога %s" -#: apt-pkg/deb/dpkgpm.cc:1001 -#, c-format -msgid "Preparing %s" -msgstr "Подготавливается %s" +#: ftparchive/apt-ftparchive.cc:281 +msgid "Source extension list is too long" +msgstr "Список расширений источников слишком длинен" -#: apt-pkg/deb/dpkgpm.cc:1002 -#, c-format -msgid "Unpacking %s" -msgstr "Распаковывается %s" +#: ftparchive/apt-ftparchive.cc:401 +msgid "Error writing header to contents file" +msgstr "" +"Ошибка записи заголовка в полный перечень содержимого пакетов (Contents)" -#: apt-pkg/deb/dpkgpm.cc:1007 +#: ftparchive/apt-ftparchive.cc:431 #, c-format -msgid "Preparing to configure %s" -msgstr "Подготавливается для настройки %s" +msgid "Error processing contents %s" +msgstr "ошибка обработки полного перечня содержимого пакетов (Contents) %s" -#: apt-pkg/deb/dpkgpm.cc:1009 -#, c-format -msgid "Installed %s" -msgstr "Установлен %s" +#: ftparchive/apt-ftparchive.cc:626 +msgid "" +"Usage: apt-ftparchive [options] command\n" +"Commands: packages binarypath [overridefile [pathprefix]]\n" +" sources srcpath [overridefile [pathprefix]]\n" +" contents path\n" +" release path\n" +" generate config [groups]\n" +" clean config\n" +"\n" +"apt-ftparchive generates index files for Debian archives. It supports\n" +"many styles of generation from fully automated to functional replacements\n" +"for dpkg-scanpackages and dpkg-scansources\n" +"\n" +"apt-ftparchive generates Package files from a tree of .debs. The\n" +"Package file contains the contents of all the control fields from\n" +"each package as well as the MD5 hash and filesize. An override file\n" +"is supported to force the value of Priority and Section.\n" +"\n" +"Similarly apt-ftparchive generates Sources files from a tree of .dscs.\n" +"The --source-override option can be used to specify a src override file\n" +"\n" +"The 'packages' and 'sources' command should be run in the root of the\n" +"tree. BinaryPath should point to the base of the recursive search and \n" +"override file should contain the override flags. Pathprefix is\n" +"appended to the filename fields if present. Example usage from the \n" +"Debian archive:\n" +" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n" +" dists/potato/main/binary-i386/Packages\n" +"\n" +"Options:\n" +" -h This help text\n" +" --md5 Control MD5 generation\n" +" -s=? Source override file\n" +" -q Quiet\n" +" -d=? Select the optional caching database\n" +" --no-delink Enable delinking debug mode\n" +" --contents Control contents file generation\n" +" -c=? Read this configuration file\n" +" -o=? Set an arbitrary configuration option" +msgstr "" +"Использование: apt-ftparchive [параметры] команда\n" +"Команды: packages binarypath [overridefile [pathprefix]]\n" +" sources srcpath [overridefile [pathprefix]]\n" +" contents path\n" +" release path\n" +" generate config [groups]\n" +" clean config\n" +"\n" +"apt-ftparchive генерирует индексные файлы архивов Debian. Он поддерживает\n" +"множество стилей генерации: от полностью автоматического до функциональной " +"замены\n" +"программ dpkg-scanpackages и dpkg-scansources\n" +"\n" +"apt-ftparchive генерирует файлы Package (списки пакетов) для дерева\n" +"каталогов, содержащих файлы .deb. Файл Package включает в себя управляющие\n" +"поля каждого пакета, а также хеш MD5 и размер файла. Значения управляющих\n" +"полей «приоритет» (Priority) и «секция» (Section) могут быть изменены с\n" +"помощью файла override.\n" +"\n" +"Кроме того, apt-ftparchive может генерировать файлы Sources из дерева\n" +"каталогов, содержащих файлы .dsc. Для указания файла override в этом \n" +"режиме можно использовать параметр --source-override.\n" +"\n" +"Команды «packages» и «sources» надо выполнять, находясь в корневом каталоге\n" +"дерева, которое вы хотите обработать. BinaryPath должен указывать на место,\n" +"с которого начинается рекурсивный обход, а файл переназначений (override)\n" +"должен содержать записи о переназначениях управляющих полей. Если был " +"указан\n" +"Pathprefix, то его значение добавляется к управляющим полям, содержащим\n" +"имена файлов. Пример использования для архива Debian:\n" +" apt-ftparchive packages dists/potato/main/binary-i386/ > \\\n" +" dists/potato/main/binary-i386/Packages\n" +"\n" +"Параметры:\n" +" -h Этот текст\n" +" --md5 Управление генерацией MD5-хешей\n" +" -s=? Указать файл переназначений (override) для источников\n" +" -q Не выводить сообщения в процессе работы\n" +" -d=? Указать кэширующую базу данных (не обязательно)\n" +" --no-delink Включить режим отладки процесса удаления файлов\n" +" --contents Управление генерацией полного перечня содержимого пакетов\n" +" (файла Contents)\n" +" -c=? Использовать указанный файл настройки\n" +" -o=? Задать значение произвольному параметру настройки" -#: apt-pkg/deb/dpkgpm.cc:1014 -#, c-format -msgid "Preparing for removal of %s" -msgstr "Подготавливается для удаления %s" +#: ftparchive/apt-ftparchive.cc:822 +msgid "No selections matched" +msgstr "Совпадений не обнаружено" -#: apt-pkg/deb/dpkgpm.cc:1016 +#: ftparchive/apt-ftparchive.cc:907 #, c-format -msgid "Removed %s" -msgstr "Удалён %s" +msgid "Some files are missing in the package file group `%s'" +msgstr "В группе пакетов «%s» отсутствуют некоторые файлы" -#: apt-pkg/deb/dpkgpm.cc:1021 +#: ftparchive/cachedb.cc:65 #, c-format -msgid "Preparing to completely remove %s" -msgstr "Подготовка к полному удалению %s" +msgid "DB was corrupted, file renamed to %s.old" +msgstr "БД была повреждена, файл переименован в %s.old" -#: apt-pkg/deb/dpkgpm.cc:1022 +#: ftparchive/cachedb.cc:83 #, c-format -msgid "Completely removed %s" -msgstr "%s полностью удалён" - -#: apt-pkg/deb/dpkgpm.cc:1081 apt-pkg/deb/dpkgpm.cc:1169 -#, fuzzy, c-format -msgid "Can not write log (%s)" -msgstr "Невозможно записать в %s" - -#: apt-pkg/deb/dpkgpm.cc:1081 apt-pkg/deb/dpkgpm.cc:1169 -msgid "Is /dev/pts mounted?" -msgstr "" - -#: apt-pkg/deb/dpkgpm.cc:1656 -msgid "Operation was interrupted before it could finish" -msgstr "Действие прервано до его завершения" - -#: apt-pkg/deb/dpkgpm.cc:1718 -msgid "No apport report written because MaxReports is reached already" -msgstr "Отчёты apport не записаны, так достигнут MaxReports" - -#. check if its not a follow up error -#: apt-pkg/deb/dpkgpm.cc:1723 -msgid "dependency problems - leaving unconfigured" -msgstr "проблемы с зависимостями — оставляем ненастроенным" - -#: apt-pkg/deb/dpkgpm.cc:1725 -msgid "" -"No apport report written because the error message indicates its a followup " -"error from a previous failure." -msgstr "" -"Отчёты apport не записаны, так как сообщение об ошибке указывает на " -"повторную ошибку от предыдущего отказа." +msgid "DB is old, attempting to upgrade %s" +msgstr "DB устарела, попытка обновить %s" -#: apt-pkg/deb/dpkgpm.cc:1731 +#: ftparchive/cachedb.cc:94 msgid "" -"No apport report written because the error message indicates a disk full " -"error" +"DB format is invalid. If you upgraded from an older version of apt, please " +"remove and re-create the database." msgstr "" -"Отчёты apport не записаны, так как получено сообщение об ошибке о нехватке " -"места на диске" +"Некорректный формат базы данных (DB). Если вы обновляли версию apt, удалите " +"и создайте базу данных заново." -#: apt-pkg/deb/dpkgpm.cc:1738 -msgid "" -"No apport report written because the error message indicates a out of memory " -"error" -msgstr "" -"Отчёты apport не записаны, так как получено сообщение об ошибке о нехватке " -"памяти" +#: ftparchive/cachedb.cc:99 +#, c-format +msgid "Unable to open DB file %s: %s" +msgstr "Не удалось открыть DB файл %s: %s" -#: apt-pkg/deb/dpkgpm.cc:1745 apt-pkg/deb/dpkgpm.cc:1751 -#, fuzzy -msgid "" -"No apport report written because the error message indicates an issue on the " -"local system" -msgstr "" -"Отчёты apport не записаны, так как получено сообщение об ошибке о нехватке " -"места на диске" +#: ftparchive/cachedb.cc:332 +msgid "Failed to read .dsc" +msgstr "Не удалось прочесть .dsc" -#: apt-pkg/deb/dpkgpm.cc:1773 -msgid "" -"No apport report written because the error message indicates a dpkg I/O error" -msgstr "" -"Отчёты apport не записаны, так как получено сообщение об ошибке об ошибке " -"ввода-выводы dpkg" +#: ftparchive/cachedb.cc:365 +msgid "Archive has no control record" +msgstr "В архиве нет поля control" -#: apt-pkg/deb/debsystem.cc:91 -#, c-format -msgid "" -"Unable to lock the administration directory (%s), is another process using " -"it?" -msgstr "" -"Не удалось выполнить блокировку управляющего каталога (%s); он уже " -"используется другим процессом?" +#: ftparchive/cachedb.cc:594 +msgid "Unable to get a cursor" +msgstr "Невозможно получить курсор" -#: apt-pkg/deb/debsystem.cc:94 +#: ftparchive/writer.cc:91 #, c-format -msgid "Unable to lock the administration directory (%s), are you root?" -msgstr "" -"Не удалось выполнить блокировку управляющего каталога (%s); у вас есть права " -"суперпользователя?" +msgid "W: Unable to read directory %s\n" +msgstr "W: Не удалось прочитать каталог %s\n" -#. TRANSLATORS: the %s contains the recovery command, usually -#. dpkg --configure -a -#: apt-pkg/deb/debsystem.cc:110 +#: ftparchive/writer.cc:96 #, c-format -msgid "" -"dpkg was interrupted, you must manually run '%s' to correct the problem. " -msgstr "" -"Работа dpkg прервана, вы должны вручную запустить «%s» для устранения " -"проблемы. " +msgid "W: Unable to stat %s\n" +msgstr "W: Не удалось прочитать атрибуты %s\n" -#: apt-pkg/deb/debsystem.cc:128 -msgid "Not locked" -msgstr "Не заблокирован" +#: ftparchive/writer.cc:152 +msgid "E: " +msgstr "E: " -#: apt-inst/filelist.cc:380 -msgid "DropNode called on still linked node" -msgstr "DropNode вызван для узла, который ещё используется" +#: ftparchive/writer.cc:154 +msgid "W: " +msgstr "W: " -#: apt-inst/filelist.cc:412 -msgid "Failed to locate the hash element!" -msgstr "Не удалось найти элемент хеша!" +#: ftparchive/writer.cc:161 +msgid "E: Errors apply to file " +msgstr "E: Ошибки относятся к файлу " -#: apt-inst/filelist.cc:459 -msgid "Failed to allocate diversion" -msgstr "Не удалось создать diversion" +#: ftparchive/writer.cc:179 ftparchive/writer.cc:211 +#, c-format +msgid "Failed to resolve %s" +msgstr "Не удалось проследовать по ссылке %s" -#: apt-inst/filelist.cc:464 -msgid "Internal error in AddDiversion" -msgstr "Внутренняя ошибка в AddDiversion" +#: ftparchive/writer.cc:192 +msgid "Tree walking failed" +msgstr "Не удалось совершить обход дерева" -#: apt-inst/filelist.cc:477 +#: ftparchive/writer.cc:219 #, c-format -msgid "Trying to overwrite a diversion, %s -> %s and %s/%s" -msgstr "Попытка изменения diversion, %s -> %s и %s/%s" +msgid "Failed to open %s" +msgstr "Не удалось открыть %s" -#: apt-inst/filelist.cc:506 +#: ftparchive/writer.cc:278 #, c-format -msgid "Double add of diversion %s -> %s" -msgstr "Двойное добавление diversion %s -> %s" +msgid " DeLink %s [%s]\n" +msgstr "DeLink %s [%s]\n" -#: apt-inst/filelist.cc:549 +#: ftparchive/writer.cc:286 #, c-format -msgid "Duplicate conf file %s/%s" -msgstr "Повторно указан файл настройки %s/%s" +msgid "Failed to readlink %s" +msgstr "Не удалось прочесть ссылку %s" -#: apt-inst/extract.cc:101 apt-inst/extract.cc:172 +#: ftparchive/writer.cc:290 #, c-format -msgid "The path %s is too long" -msgstr "Слишком длинный путь %s" +msgid "Failed to unlink %s" +msgstr "Не удалось удалить %s" -#: apt-inst/extract.cc:132 +#: ftparchive/writer.cc:298 #, c-format -msgid "Unpacking %s more than once" -msgstr "Повторная распаковка %s" +msgid "*** Failed to link %s to %s" +msgstr "*** Не удалось создать ссылку %s на %s" -#: apt-inst/extract.cc:142 +#: ftparchive/writer.cc:308 #, c-format -msgid "The directory %s is diverted" -msgstr "Каталог %s входит в список diverted" +msgid " DeLink limit of %sB hit.\n" +msgstr " Превышен лимит в %sB в DeLink.\n" -#: apt-inst/extract.cc:152 +#: ftparchive/writer.cc:417 +msgid "Archive had no package field" +msgstr "В архиве нет поля package" + +#: ftparchive/writer.cc:425 ftparchive/writer.cc:684 #, c-format -msgid "The package is trying to write to the diversion target %s/%s" -msgstr "Пакет пытается писать в diversion %s/%s" +msgid " %s has no override entry\n" +msgstr " Нет записи о переназначении (override) для %s\n" -#: apt-inst/extract.cc:162 apt-inst/extract.cc:306 -msgid "The diversion path is too long" -msgstr "Путь diversion слишком длинен" +#: ftparchive/writer.cc:493 ftparchive/writer.cc:840 +#, c-format +msgid " %s maintainer is %s not %s\n" +msgstr " пакет %s сопровождает %s, а не %s\n" -#: apt-inst/extract.cc:249 +#: ftparchive/writer.cc:698 #, c-format -msgid "The directory %s is being replaced by a non-directory" -msgstr "Каталог %s был заменён не-каталогом" +msgid " %s has no source override entry\n" +msgstr " Нет записи source override для %s\n" -#: apt-inst/extract.cc:289 -msgid "Failed to locate node in its hash bucket" -msgstr "Не удалось разместить узел в хеше" +#: ftparchive/writer.cc:702 +#, c-format +msgid " %s has no binary override entry either\n" +msgstr " Нет записи binary override для %s\n" -#: apt-inst/extract.cc:293 -msgid "The path is too long" -msgstr "Путь слишком длинен" +#: ftparchive/contents.cc:351 ftparchive/contents.cc:382 +msgid "realloc - Failed to allocate memory" +msgstr "realloc — не удалось выделить память" -#: apt-inst/extract.cc:421 +#: ftparchive/override.cc:38 ftparchive/override.cc:142 #, c-format -msgid "Overwrite package match with no version for %s" -msgstr "Файлы заменяются содержимым пакета %s без версии" +msgid "Unable to open %s" +msgstr "Не удалось открыть %s" -#: apt-inst/extract.cc:438 +#. skip spaces +#. find end of word +#: ftparchive/override.cc:68 #, c-format -msgid "File %s/%s overwrites the one in the package %s" -msgstr "Файл %s/%s переписывает файл в пакете %s" +msgid "Malformed override %s line %llu (%s)" +msgstr "Неправильная запись о переназначении (override) %s в строке %llu (%s)" -#: apt-inst/extract.cc:498 +#: ftparchive/override.cc:127 ftparchive/override.cc:201 #, c-format -msgid "Unable to stat %s" -msgstr "Невозможно получить атрибуты %s" +msgid "Failed to read the override file %s" +msgstr "Не удалось прочесть файл переназначений (override) %s" -#: apt-inst/dirstream.cc:42 apt-inst/dirstream.cc:49 apt-inst/dirstream.cc:54 +#: ftparchive/override.cc:166 #, c-format -msgid "Failed to write file %s" -msgstr "Не удалось записать в файл %s" +msgid "Malformed override %s line %llu #1" +msgstr "Неправильная запись о переназначении (override) %s в строке %llu #1" -#: apt-inst/dirstream.cc:104 +#: ftparchive/override.cc:178 #, c-format -msgid "Failed to close file %s" -msgstr "Не удалось закрыть файл %s" +msgid "Malformed override %s line %llu #2" +msgstr "Неправильная запись о переназначении (override) %s в строке %llu #2" -#: apt-inst/deb/debfile.cc:47 apt-inst/deb/debfile.cc:54 -#: apt-inst/deb/debfile.cc:63 +#: ftparchive/override.cc:191 #, c-format -msgid "This is not a valid DEB archive, missing '%s' member" -msgstr "Это неправильный DEB-архив — отсутствует составная часть «%s»" +msgid "Malformed override %s line %llu #3" +msgstr "Неправильная запись о переназначении (override) %s в строке %llu #3" -#: apt-inst/deb/debfile.cc:132 +#: ftparchive/multicompress.cc:73 #, c-format -msgid "Internal error, could not locate member %s" -msgstr "Внутренняя ошибка, не удалось найти составную часть %s" - -#: apt-inst/deb/debfile.cc:231 -msgid "Unparsable control file" -msgstr "Не удалось прочесть содержимое control-файла" - -#: apt-inst/contrib/arfile.cc:76 -msgid "Invalid archive signature" -msgstr "Неверная сигнатура архива" - -#: apt-inst/contrib/arfile.cc:84 -msgid "Error reading archive member header" -msgstr "Ошибка чтения заголовка элемента архива" +msgid "Unknown compression algorithm '%s'" +msgstr "Неизвестный алгоритм сжатия «%s»" -#: apt-inst/contrib/arfile.cc:96 +#: ftparchive/multicompress.cc:103 #, c-format -msgid "Invalid archive member header %s" -msgstr "Неправильный заголовок элемента архива %s" - -#: apt-inst/contrib/arfile.cc:108 -msgid "Invalid archive member header" -msgstr "Неправильный заголовок элемента архива" +msgid "Compressed output %s needs a compression set" +msgstr "" +"Для получения сжатого вывода %s необходимо включить использования сжатия" -#: apt-inst/contrib/arfile.cc:137 -msgid "Archive is too short" -msgstr "Слишком короткий архив" +#: ftparchive/multicompress.cc:192 +msgid "Failed to create FILE*" +msgstr "Не удалось создать FILE*" -#: apt-inst/contrib/arfile.cc:141 -msgid "Failed to read the archive headers" -msgstr "Не удалось прочитать заголовки архива" +#: ftparchive/multicompress.cc:195 +msgid "Failed to fork" +msgstr "Не удалось запустить порождённый процесс" -#: apt-inst/contrib/extracttar.cc:128 -msgid "Failed to create pipes" -msgstr "Не удалось создать каналы" +#: ftparchive/multicompress.cc:209 +msgid "Compress child" +msgstr "Процесс-потомок, производящий сжатие" -#: apt-inst/contrib/extracttar.cc:155 -msgid "Failed to exec gzip " -msgstr "Не удалось выполнить gzip " +#: ftparchive/multicompress.cc:232 +#, c-format +msgid "Internal error, failed to create %s" +msgstr "Внутренняя ошибка, не удалось создать %s" -#: apt-inst/contrib/extracttar.cc:192 apt-inst/contrib/extracttar.cc:222 -msgid "Corrupted archive" -msgstr "Повреждённый архив" +#: ftparchive/multicompress.cc:305 +msgid "IO to subprocess/file failed" +msgstr "Ошибка ввода/вывода в подпроцесс/файл" -#: apt-inst/contrib/extracttar.cc:207 -msgid "Tar checksum failed, archive corrupted" -msgstr "Неправильная контрольная сумма Tar, архив повреждён" +#: ftparchive/multicompress.cc:343 +msgid "Failed to read while computing MD5" +msgstr "Ошибка чтения во время вычисления MD5" -#: apt-inst/contrib/extracttar.cc:312 +#: ftparchive/multicompress.cc:359 #, c-format -msgid "Unknown TAR header type %u, member %s" -msgstr "Неизвестный заголовок в архиве TAR. Тип %u, элемент %s" - -#~ msgid "Total dependency version space: " -#~ msgstr "Всего информации о зависимостях: " +msgid "Problem unlinking %s" +msgstr "Не удалось удалить %s" -#~ msgid "You don't have enough free space in %s" -#~ msgstr "Недостаточно места в %s" +#: cmdline/apt-internal-solver.cc:49 +msgid "" +"Usage: apt-internal-solver\n" +"\n" +"apt-internal-solver is an interface to use the current internal\n" +"like an external resolver for the APT family for debugging or alike\n" +"\n" +"Options:\n" +" -h This help text.\n" +" -q Loggable output - no progress indicator\n" +" -c=? Read this configuration file\n" +" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" +msgstr "" +"Использование: apt-internal-solver\n" +"\n" +"apt-internal-solver — интерфейс к внутреннему решателю, предназначен\n" +"для отладки, подобен интерфейсу внешнего решателя семейства APT\n" +"\n" +"Параметры:\n" +" -h Этот текст\n" +" -q Вывод протокола работы — индикатор выполнения отключён\n" +" -c=? Читать указанный файл настройки\n" +" -o=? Задать значение произвольной настройке, например, -o dir::cache=/tmp\n" -#~ msgid "Done" -#~ msgstr "Готово" +#: cmdline/apt-sortpkgs.cc:89 +msgid "Unknown package record!" +msgstr "Запись о неизвестном пакете!" -#~ msgid "No keyring installed in %s." -#~ msgstr "Связка ключей в %s не установлена." +#: cmdline/apt-sortpkgs.cc:153 +msgid "" +"Usage: apt-sortpkgs [options] file1 [file2 ...]\n" +"\n" +"apt-sortpkgs is a simple tool to sort package files. The -s option is used\n" +"to indicate what kind of file it is.\n" +"\n" +"Options:\n" +" -h This help text\n" +" -s Use source file sorting\n" +" -c=? Read this configuration file\n" +" -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" +msgstr "" +"Использование: apt-sortpkgs [параметры] файл1 [файл2…]\n" +"\n" +"apt-sortpkgs — простой инструмент для сортировки списков пакетов. Параметр -" +"s\n" +"используется для указания типа списка.\n" +"\n" +"Параметры:\n" +" -h этот текст\n" +" -s сортировать список файлов пакетов исходного кода\n" +" -c=? читать указанный файл настройки\n" +" -o=? Задать значение произвольной настройке, например, -o dir::cache=/tmp\n" #, fuzzy #~ msgid "Internal error, Upgrade broke stuff" @@ -3840,6 +3818,9 @@ msgstr "Неизвестный заголовок в архиве TAR. Тип %u #~ "Не удалось записать в журнал, неудачное выполнение openpty() (/dev/pts не " #~ "смонтирован?)\n" +#~ msgid "File %s doesn't start with a clearsigned message" +#~ msgstr "Файл %s не начинается с прозрачно подписанного сообщения" + #~ msgid "Skipping nonexistent file %s" #~ msgstr "Пропускается несуществующий файл %s" diff --git a/po/tr.po b/po/tr.po index d6d632436..79945ebd3 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1077,8 +1077,8 @@ msgid "At least one invalid signature was encountered." msgstr "En az bir geçersiz imza ile karşılaşıldı." #: methods/gpgv.cc:174 -msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)" -msgstr "İmza doğrulama için 'gpgv' çalıştırılamadı (gpgv kurulu mu?)" +msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)" +msgstr "İmza doğrulama için 'apt-key' çalıştırılamadı (gnupg kurulu mu?)" #. TRANSLATORS: %s is a single techy word like 'NODATA' #: methods/gpgv.cc:180 @@ -1091,8 +1091,8 @@ msgstr "" "gerektiriyor mu?)" #: methods/gpgv.cc:184 -msgid "Unknown error executing gpgv" -msgstr "gpgv çalıştırılırken bilinmeyen hata" +msgid "Unknown error executing apt-key" +msgstr "apt-key çalıştırılırken bilinmeyen hata" #: methods/gpgv.cc:217 methods/gpgv.cc:224 msgid "The following signatures were invalid:\n" @@ -1740,8 +1740,8 @@ msgid "Full Text Search" msgstr "Tam Metin Arama" #: apt-private/private-upgrade.cc:25 -msgid "Calculating upgrade... " -msgstr "Yükseltme hesaplanıyor... " +msgid "Calculating upgrade" +msgstr "Yükseltme hesaplanıyor" #: apt-private/private-upgrade.cc:28 msgid "Done" -- cgit v1.2.3 From 653ef26c70dc9c0e2cbfdd4e79117876bb63e87d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Jun 2015 10:53:51 +0200 Subject: allow individual targets to be kept compressed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is an option to keep all targets (Packages, Sources, …) compressed for a while now, but the all-or-nothing approach is a bit limited for our purposes with additional targets as some of them are very big (Contents) and rarely used in comparison, so keeping them compressed by default can make sense, while others are still unpacked. Most interesting is the copy-change maybe: Copy is used by the acquire system as an uncompressor and it is hence expected that it returns the hashes for the "output", not the input. Now, in the case of keeping a file compressed, the output is never written to disk, but generated in memory and we should still validated it, so for compressed files copy is expected to return the hashes of the uncompressed file. We used to use the config option to enable on-the-fly decompress in the method, but in reality copy is never used in a way where it shouldn't decompress a compressed file to get its hashes, so we can save us the trouble of sending this information to the method and just do it always. --- apt-pkg/acquire-item.cc | 14 +++++++------- apt-pkg/deb/debmetaindex.cc | 7 +++++-- apt-pkg/indexfile.cc | 5 +++-- apt-pkg/indexfile.h | 5 ++++- methods/copy.cc | 8 ++------ test/integration/test-apt-acquire-additional-files | 18 +++++++++++++++++- test/integration/test-compressed-indexes | 2 +- 7 files changed, 39 insertions(+), 20 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 01a679fe0..b6466115e 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -80,18 +80,18 @@ static std::string GetFinalFileNameFromURI(std::string const &uri) /*{{{*/ return _config->FindDir("Dir::State::lists") + URItoFileName(uri); } /*}}}*/ -static std::string GetCompressedFileName(std::string const &URI, std::string const &Name, std::string const &Ext) /*{{{*/ +static std::string GetCompressedFileName(IndexTarget const &Target, std::string const &Name, std::string const &Ext) /*{{{*/ { if (Ext.empty() || Ext == "uncompressed") return Name; // do not reverify cdrom sources as apt-cdrom may rewrite the Packages // file when its doing the indexcopy - if (URI.substr(0,6) == "cdrom:") + if (Target.URI.substr(0,6) == "cdrom:") return Name; // adjust DestFile if its compressed on disk - if (_config->FindB("Acquire::GzipIndexes",false) == true) + if (Target.KeepCompressed == true) return Name + '.' + Ext; return Name; } @@ -269,7 +269,7 @@ std::string pkgAcqDiffIndex::GetFinalFilename() const std::string pkgAcqIndex::GetFinalFilename() const { std::string const FinalFile = GetFinalFileNameFromURI(Target.URI); - return GetCompressedFileName(Target.URI, FinalFile, CurrentCompressionExtension); + return GetCompressedFileName(Target, FinalFile, CurrentCompressionExtension); } std::string pkgAcqMetaSig::GetFinalFilename() const { @@ -2456,7 +2456,7 @@ void pkgAcqIndex::ReverifyAfterIMS() { // update destfile to *not* include the compression extension when doing // a reverify (as its uncompressed on disk already) - DestFile = GetCompressedFileName(Target.URI, GetPartialFileNameFromURI(Target.URI), CurrentCompressionExtension); + DestFile = GetCompressedFileName(Target, GetPartialFileNameFromURI(Target.URI), CurrentCompressionExtension); // copy FinalFile into partial/ so that we check the hash again string FinalFile = GetFinalFilename(); @@ -2532,8 +2532,8 @@ void pkgAcqIndex::StageDownloadDone(string const &Message, HashStringList const return; } - // If we have compressed indexes enabled, queue for hash verification - if (_config->FindB("Acquire::GzipIndexes",false)) + // If we want compressed indexes, just copy in place for hash verification + if (Target.KeepCompressed == true) { DestFile = GetPartialFileNameFromURI(Target.URI + '.' + CurrentCompressionExtension); EraseFileName = ""; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 4bb03a942..10ab0f844 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -123,6 +123,7 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI, std::string const Release = (Dist == "/") ? "" : Dist; std::string const Site = ::URI::ArchiveOnly(URI); + bool const GzipIndex = _config->FindB("Acquire::GzipIndexes", false); for (std::vector::const_iterator E = entries.begin(); E != entries.end(); ++E) { for (std::vector::const_iterator T = E->Targets.begin(); T != E->Targets.end(); ++T) @@ -131,7 +132,8 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI, std::string const tplMetaKey = APT_T_CONFIG(flatArchive ? "flatMetaKey" : "MetaKey"); std::string const tplShortDesc = APT_T_CONFIG("ShortDescription"); std::string const tplLongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); - bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::deb-src::") + *T + "::Optional", true); + bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::") + Type + "::" + *T + "::Optional", true); + bool const KeepCompressed = _config->FindB(std::string("APT::Acquire::Targets::") + Type + "::" + *T + "::KeepCompressed", GzipIndex); #undef APT_T_CONFIG if (tplMetaKey.empty()) continue; @@ -173,6 +175,7 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI, LongDesc, Options.find("BASE_URI")->second + MetaKey, IsOptional, + KeepCompressed, Options ); IndexTargets.push_back(Target); @@ -413,7 +416,7 @@ bool debReleaseIndex::parseSumData(const char *&Start, const char *End, /*{{{*/ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll)/*{{{*/ { std::vector const targets = GetIndexTargets(); -#define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X), false, std::map()) +#define APT_TARGET(X) IndexTarget("", X, MetaIndexInfo(X), MetaIndexURI(X), false, false, std::map()) pkgAcqMetaClearSig * const TransactionManager = new pkgAcqMetaClearSig(Owner, APT_TARGET("InRelease"), APT_TARGET("Release"), APT_TARGET("Release.gpg"), targets, this); diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index e9e1b08c3..cce17403d 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -115,8 +115,9 @@ APT_DEPRECATED std::string pkgIndexFile::LanguageCode() { // IndexTarget - Constructor /*{{{*/ IndexTarget::IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, std::string const &LongDesc, std::string const &URI, bool const IsOptional, - std::map const &Options) : - URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey), IsOptional(IsOptional), Options(Options) + bool const KeepCompressed, std::map const &Options) : + URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey), + IsOptional(IsOptional), KeepCompressed(KeepCompressed), Options(Options) { } /*}}}*/ diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 7eeccdbd3..44d39110d 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -60,6 +60,9 @@ class IndexTarget /*{{{*/ /** \brief Is it okay if the file isn't found in the meta index */ bool IsOptional; + /** \brief If the file is downloaded compressed, do not unpack it */ + bool KeepCompressed; + /** \brief options with which this target was created Prefer the usage of #Option if at all possible. Beware: Not all of these options are intended for public use */ @@ -67,7 +70,7 @@ class IndexTarget /*{{{*/ IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, std::string const &LongDesc, std::string const &URI, bool const IsOptional, - std::map const &Options); + bool const KeepCompressed, std::map const &Options); enum OptionKeys { SITE, diff --git a/methods/copy.cc b/methods/copy.cc index a8e289df5..4bdc15f75 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -38,11 +38,7 @@ class CopyMethod : public pkgAcqMethod void CopyMethod::CalculateHashes(FetchItem const * const Itm, FetchResult &Res) { Hashes Hash(Itm->ExpectedHashes); - FileFd::CompressMode CompressMode = FileFd::None; - if (_config->FindB("Acquire::GzipIndexes", false) == true) - CompressMode = FileFd::Extension; - - FileFd Fd(Res.Filename, FileFd::ReadOnly, CompressMode); + FileFd Fd(Res.Filename, FileFd::ReadOnly, FileFd::Extension); Hash.AddFD(Fd); Res.TakeHashes(Hash); } @@ -53,7 +49,7 @@ void CopyMethod::CalculateHashes(FetchItem const * const Itm, FetchResult &Res) bool CopyMethod::Fetch(FetchItem *Itm) { // this ensures that relative paths work in copy - std::string File = Itm->Uri.substr(Itm->Uri.find(':')+1); + std::string const File = Itm->Uri.substr(Itm->Uri.find(':')+1); // Stat the file and send a start message struct stat Buf; diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files index 3465c0a16..fecdf30bf 100755 --- a/test/integration/test-apt-acquire-additional-files +++ b/test/integration/test-apt-acquire-additional-files @@ -57,7 +57,23 @@ testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64)" aptget files --format '$(FILENAME)' 'Created-By: Contents' testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64' 'aptarchive/dists/unstable/main/Contents-amd64' -# no automatic uncompress based on the name please, +rm ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64 +testempty aptget files --format '$(FILENAME)' 'Created-By: Contents' + +# if we asked for keeping it compressed, keep it +echo 'APT::Acquire::Targets::deb::Contents::KeepCompressed "true";' >> rootdir/etc/apt/apt.conf.d/content-target.conf +testsuccessequal "Hit:1 http://localhost:8080 unstable InRelease +Get:2 http://localhost:8080 unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] +Reading package lists..." aptget update + +testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' find rootdir/var/lib/apt/lists -name '*Contents*' +testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz)" aptget files --format '$(FILENAME)' 'Created-By: Contents' +testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' 'aptarchive/dists/unstable/main/Contents-amd64.gz' + +rm ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz +testempty aptget files --format '$(FILENAME)' 'Created-By: Contents' + +# and no automatic uncompress based on the name please, # only if we downloaded a compressed file, but target was uncompressed cat > rootdir/etc/apt/apt.conf.d/content-target.conf </dev/null testsuccessequal 'Reading package lists... -- cgit v1.2.3 From c1642be522a9d9cf5a4a9f2dd8794cfaf0264fb5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Jul 2015 16:44:01 +0200 Subject: enhance apt-key debugging options It is sometimes handy to know how apt-key exactly called gpg, so adding a pair of options to be able to see this if wanted is added. Two are needed as some commands output is redirected to /dev/null, while sfor others stdout is piped into another gpg call so in both cases you wouldn't see all and hence you can choose. Git-Dch: Ignore --- cmdline/apt-key.in | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index 16887bd50..e37745357 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -73,7 +73,7 @@ add_keys_with_verify_against_master_keyring() { local TMP_KEYRING="${GPGHOMEDIR}/tmp-keyring.gpg" $GPG_CMD --batch --yes --keyring "$ADD_KEYRING" --output "$TMP_KEYRING" --export "$add_key" if ! $GPG_CMD --batch --yes --keyring "$TMP_KEYRING" --import "$MASTER" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then - cat "${GPGHOMEDIR}/gpgoutput.log" + cat >&2 "${GPGHOMEDIR}/gpgoutput.log" false fi # check if signed with the master key and only add in this case @@ -235,7 +235,7 @@ import_keys_from_keyring() { local IMPORT="$1" local KEYRINGFILE="$2" if ! $GPG_CMD --keyring "$KEYRINGFILE" --batch --import "$IMPORT" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then - cat "${GPGHOMEDIR}/gpgoutput.log" + cat >&2 "${GPGHOMEDIR}/gpgoutput.log" false fi } @@ -244,7 +244,7 @@ merge_keys_into_keyrings() { local KEYRINGFILE="$1" local IMPORT="$2" if ! $GPG_CMD --keyring "$KEYRINGFILE" --batch --import --import-options 'merge-only' "$IMPORT" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then - cat "${GPGHOMEDIR}/gpgoutput.log" + cat >&2 "${GPGHOMEDIR}/gpgoutput.log" false fi } @@ -269,7 +269,7 @@ merge_back_changes() { # key is part of new keyring, so we need to import it create_new_keyring "$TRUSTEDFILE" if ! $GPG --batch --yes --export "$key" | $GPG_CMD --keyring "$TRUSTEDFILE" --batch --yes --import > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then - cat "${GPGHOMEDIR}/gpgoutput.log" + cat >&2 "${GPGHOMEDIR}/gpgoutput.log" false fi else @@ -353,6 +353,14 @@ while [ -n "$1" ]; do --quiet) aptkey_echo() { true; } ;; + --debug1) + # some cmds like finger redirect stderr to /dev/null … + aptkey_execute() { echo 'EXEC:' "$@"; "$@"; } + ;; + --debug2) + # … other more complicated ones pipe gpg into gpg. + aptkey_execute() { echo >&2 'EXEC:' "$@"; "$@"; } + ;; --*) echo >&2 "Unknown option: $1" usage @@ -392,6 +400,9 @@ if [ "$command" != "help" ]; then exit 255 fi + if type aptkey_execute >/dev/null 2>&1; then + GPG_EXE="aptkey_execute $GPG_EXE" + fi GPG_CMD="$GPG_EXE --ignore-time-conflict --no-options --no-default-keyring" # gpg needs (in different versions more or less) files to function correctly, -- cgit v1.2.3 From f14cde2ca702f72415486bf5c310208a7c500e9c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Jul 2015 21:15:45 +0200 Subject: support gpg 2.1.x in apt-key The output of gpg slightly changes in 2.1 which breaks the testcase, but the real problem is that this branch introduces a new default keyring format (which is called keybox) and mixing it with simple keyrings (the previous default format) has various problems like failing in the keybox to keyring import (#790665) or [older] gpgv versions not being able to deal with keyboxes (and newer versions as well currently: https://bugs.gnupg.org/gnupg/issue2025). We fix this by being a bit more careful in who creates keyrings (aka: we do it or we take a simple keyring as base) to ensure we always have a keyring instead of a keybox. This way we can ensure that any version combination of gpv/gpgv2 and gnupg/gnupg2 without doing explicit version checks and use the same code for all of them. Closes: 781042 --- cmdline/apt-key.in | 85 ++++++++++++++++++++++--------- test/integration/test-apt-key | 115 +++++++++++++++++++++++------------------- 2 files changed, 124 insertions(+), 76 deletions(-) diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index e37745357..b15f71f6d 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -145,7 +145,7 @@ update() { # attacker might as well replace the master-archive-keyring file # in the package and add his own keys. so this check wouldn't # add any security. we *need* this check on net-update though - $GPG_CMD --quiet --batch --keyring $ARCHIVE_KEYRING --export | $GPG --import + import_keyring_into_keyring "$ARCHIVE_KEYRING" '' && cat "${GPGHOMEDIR}/gpgoutput.log" if [ -r "$REMOVED_KEYS" ]; then # remove no-longer supported/used keys @@ -231,22 +231,49 @@ run_cmd_on_keyring() { $GPG_CMD --keyring "$KEYRINGFILE" --batch "$@" 2>/dev/null || true } -import_keys_from_keyring() { - local IMPORT="$1" - local KEYRINGFILE="$2" - if ! $GPG_CMD --keyring "$KEYRINGFILE" --batch --import "$IMPORT" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then - cat >&2 "${GPGHOMEDIR}/gpgoutput.log" - false +import_keyring_into_keyring() { + local FROM="${1:-${GPGHOMEDIR}/pubring.gpg}" + local TO="${2:-${GPGHOMEDIR}/pubring.gpg}" + shift 2 + rm -f "${GPGHOMEDIR}/gpgoutput.log" + # the idea is simple: We take keys from one keyring and copy it to another + # we do this with so many checks inbetween to ensure that WE control the + # creation, so we know that the (potentially) created $TO keyring is a + # simple keyring rather than a keybox as gpg2 would create it which in turn + # can't be read by gpgv. + # BEWARE: This is designed more in the way to work with the current + # callers, than to have a well defined it would be easy to add new callers to. + if [ ! -s "$TO" ]; then + if [ -s "$FROM" ]; then + if [ -z "$2" ]; then + if ! $GPG_CMD --keyring "$FROM" --export ${1:+"$1"} > "$TO" 2> "${GPGHOMEDIR}/gpgoutput.log"; then + cat >&2 "${GPGHOMEDIR}/gpgoutput.log" + false + else + chmod 0644 -- "$TO" + fi + else + create_new_keyring "$TO" + fi + else + create_new_keyring "$TO" + fi + elif [ -s "$FROM" ]; then + local EXPORTLIMIT="$1" + if [ -n "$1$2" ]; then shift; fi + if ! $GPG_CMD --keyring "$FROM" --export ${EXPORTLIMIT:+"$EXPORTLIMIT"} | $GPG_CMD --keyring "$TO" --batch --import "$@" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then + cat >&2 "${GPGHOMEDIR}/gpgoutput.log" + false + fi fi } +import_keys_from_keyring() { + import_keyring_into_keyring "$1" "$2" +} + merge_keys_into_keyrings() { - local KEYRINGFILE="$1" - local IMPORT="$2" - if ! $GPG_CMD --keyring "$KEYRINGFILE" --batch --import --import-options 'merge-only' "$IMPORT" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then - cat >&2 "${GPGHOMEDIR}/gpgoutput.log" - false - fi + import_keyring_into_keyring "$2" "$1" '' --import-options 'merge-only' } merge_back_changes() { @@ -267,11 +294,7 @@ merge_back_changes() { foreach_keyring_do 'remove_key_from_keyring' "$key" elif grep -q "^${key}$" "${GPGHOMEDIR}/pubring.keylst"; then # key is part of new keyring, so we need to import it - create_new_keyring "$TRUSTEDFILE" - if ! $GPG --batch --yes --export "$key" | $GPG_CMD --keyring "$TRUSTEDFILE" --batch --yes --import > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then - cat >&2 "${GPGHOMEDIR}/gpgoutput.log" - false - fi + import_keyring_into_keyring '' "$TRUSTEDFILE" "$key" else echo >&2 "Errror: Key ${key} (dis)appeared out of nowhere" fi @@ -280,12 +303,12 @@ merge_back_changes() { setup_merged_keyring() { if [ -n "$FORCED_KEYID" ]; then - foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/allrings.gpg" + foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg" FORCED_KEYRING="${GPGHOMEDIR}/forcedkeyid.gpg" TRUSTEDFILE="${FORCED_KEYRING}" GPG="$GPG --keyring $TRUSTEDFILE" # ignore error as this "just" means we haven't found the forced keyid and the keyring will be empty - $GPG_CMD --batch --yes --keyring "${GPGHOMEDIR}/allrings.gpg" --export "$FORCED_KEYID" | $GPG --batch --yes --import || true + import_keyring_into_keyring '' "$TRUSTEDFILE" "$FORCED_KEYID" || true elif [ -z "$FORCED_KEYRING" ]; then foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg" if [ -r "${GPGHOMEDIR}/pubring.gpg" ]; then @@ -295,8 +318,8 @@ setup_merged_keyring() { fi GPG="$GPG --keyring ${GPGHOMEDIR}/pubring.gpg" else - GPG="$GPG --keyring $TRUSTEDFILE" create_new_keyring "$TRUSTEDFILE" + GPG="$GPG --keyring $TRUSTEDFILE" fi } @@ -345,7 +368,7 @@ while [ -n "$1" ]; do ;; --readonly) merge_back_changes() { true; } - create_new_keyring() { true; } + create_new_keyring() { if [ ! -r $FORCED_KEYRING ]; then TRUSTEDFILE='/dev/null'; FORCED_KEYRING="$TRUSTEDFILE"; fi; } ;; --fakeroot) requires_root() { true; } @@ -437,6 +460,12 @@ if [ "$command" != "help" ]; then rm -f "$SECRETKEYRING" cp -a "$FORCED_SECRET_KEYRING" "$SECRETKEYRING" fi + + # older gpg versions need a secring file, but newer versions take it as + # a hint to start a migration from earlier versions. The file is empty + # anyhow, so nothing actually happens, but its three lines of output + # nobody expects to see in apt-key context, so trigger it in silence + echo -n | $GPG --batch --import >/dev/null 2>&1 || true fi case "$command" in @@ -482,11 +511,17 @@ case "$command" in ;; verify) setup_merged_keyring - if which gpgv >/dev/null 2>&1; then + GPGV='' + eval $(apt-config shell GPGV Apt::Key::gpgvcommand) + if [ -n "$GPGV" ] && ! which "$GPGV" >/dev/null 2>&1; then GPGV=''; + elif which gpgv >/dev/null 2>&1; then GPGV='gpgv'; + elif which gpgv2 >/dev/null 2>&1; then GPGV='gpgv2'; + fi + if [ -n "$GPGV" ]; then if [ -n "$FORCED_KEYRING" ]; then - gpgv --homedir "${GPGHOMEDIR}" --keyring "${FORCED_KEYRING}" --ignore-time-conflict "$@" + $GPGV --homedir "${GPGHOMEDIR}" --keyring "${FORCED_KEYRING}" --ignore-time-conflict "$@" else - gpgv --homedir "${GPGHOMEDIR}" --keyring "${GPGHOMEDIR}/pubring.gpg" --ignore-time-conflict "$@" + $GPGV --homedir "${GPGHOMEDIR}" --keyring "${GPGHOMEDIR}/pubring.gpg" --ignore-time-conflict "$@" fi else $GPG --verify "$@" diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key index e1be08c65..4dbf3d66d 100755 --- a/test/integration/test-apt-key +++ b/test/integration/test-apt-key @@ -13,11 +13,33 @@ cleanplate() { mkdir rootdir/etc/apt/trusted.gpg.d/ } +createlistofkeys() { + while [ -n "$1" ]; do + # gpg 2.1 has a slightly different output format + if grep -q ' rsa2048/' aptkey.list; then + case "$1" in + *Joe*|*Sixpack*) echo 'pub rsa2048/DBAC8DAE 2010-08-18';; + *Rex*|*Expired*) echo 'pub rsa2048/27CE74F9 2013-07-12 [expired: 2013-07-13]';; + *Marvin*|*Paranoid*) echo 'pub rsa2048/528144E2 2011-01-16';; + *) echo 'UNKNOWN KEY';; + esac + else + case "$1" in + *Joe*|*Sixpack*) echo 'pub 2048R/DBAC8DAE 2010-08-18';; + *Rex*|*Expired*) echo 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]';; + *Marvin*|*Paranoid*) echo 'pub 2048R/528144E2 2011-01-16';; + *) echo 'UNKNOWN KEY';; + esac + fi + shift + done +} + testaptkeys() { if ! aptkey list | grep '^pub' > aptkey.list; then echo -n > aptkey.list fi - testfileequal './aptkey.list' "$1" + testfileequal './aptkey.list' "$(createlistofkeys "$@")" } echo 'APT::Key::ArchiveKeyring "./keys/joesixpack.pub"; @@ -32,16 +54,15 @@ testrun() { msgtest 'Check that paths in finger output are not' 'double-slashed' aptkey finger 2>&1 | grep -q '//' && msgfail || msgpass - - testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18' + testaptkeys 'Joe Sixpack' testsuccessequal 'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) " not changed gpg: Total number processed: 1 gpg: unchanged: 1' aptkey --fakeroot update - testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18' - + testaptkeys 'Joe Sixpack' testfailure test -e rootdir/etc/apt/trusted.gpg + testsuccess aptkey --fakeroot add ./keys/rexexpired.pub msgtest 'Check if trusted.gpg is created with permissions set to' '0644' if [ "$(stat -c '%a' rootdir/etc/apt/trusted.gpg )" = '644' ]; then @@ -50,8 +71,7 @@ gpg: unchanged: 1' aptkey --fakeroot update msgfail fi - testaptkeys 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13] -pub 2048R/DBAC8DAE 2010-08-18' + testaptkeys 'Rex Expired' 'Joe Sixpack' msgtest 'Check that Sixpack key can be' 'exported' aptkey export 'Sixpack' > aptkey.export @@ -63,12 +83,12 @@ pub 2048R/DBAC8DAE 2010-08-18' msgtest 'Execute update again to trigger removal of' 'Rex Expired key' testsuccess --nomsg aptkey --fakeroot update - testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18' + testaptkeys 'Joe Sixpack' msgtest "Try to remove a key which exists, but isn't in the" 'forced keyring' testsuccess --nomsg aptkey --fakeroot --keyring rootdir/etc/apt/trusted.gpg del DBAC8DAE - testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18' + testaptkeys 'Joe Sixpack' testsuccess aptkey --fakeroot del DBAC8DAE testempty aptkey list @@ -114,22 +134,21 @@ pub 2048R/DBAC8DAE 2010-08-18' cleanplate testsuccess aptkey --fakeroot add ./keys/joesixpack.pub testsuccess aptkey --fakeroot add ./keys/marvinparanoid.pub - testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18 -pub 2048R/528144E2 2011-01-16' + testaptkeys 'Joe Sixpack' 'Marvin Paranoid' cp -a rootdir/etc/apt/trusted.gpg keys/testcase-multikey.pub # store for reuse msgtest 'Test key removal with' 'multi key in real file' cleanplate cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg testsuccess --nomsg aptkey --fakeroot del DBAC8DAE - testaptkeys 'pub 2048R/528144E2 2011-01-16' + testaptkeys 'Marvin Paranoid' testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ msgtest 'Test key removal with' 'multi key in softlink' cleanplate ln -s $(readlink -f ./keys/testcase-multikey.pub) rootdir/etc/apt/trusted.gpg.d/multikey.gpg testsuccess --nomsg aptkey --fakeroot del DBAC8DAE - testaptkeys 'pub 2048R/528144E2 2011-01-16' + testaptkeys 'Marvin Paranoid' testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ testfailure test -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg testsuccess test -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ @@ -139,7 +158,7 @@ pub 2048R/528144E2 2011-01-16' cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg testsuccess --nomsg aptkey --fakeroot del DBAC8DAE - testaptkeys 'pub 2048R/528144E2 2011-01-16' + testaptkeys 'Marvin Paranoid' testfailure test -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~ testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ @@ -147,25 +166,18 @@ pub 2048R/528144E2 2011-01-16' cleanplate cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg - testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18 -pub 2048R/DBAC8DAE 2010-08-18 -pub 2048R/528144E2 2011-01-16' + testaptkeys 'Joe Sixpack' 'Joe Sixpack' 'Marvin Paranoid' msgtest 'Test merge-back of' 'added keys' testsuccess --nomsg aptkey adv --batch --yes --import keys/rexexpired.pub - testaptkeys 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13] -pub 2048R/DBAC8DAE 2010-08-18 -pub 2048R/DBAC8DAE 2010-08-18 -pub 2048R/528144E2 2011-01-16' + testaptkeys 'Rex Expired' 'Joe Sixpack' 'Joe Sixpack' 'Marvin Paranoid' msgtest 'Test merge-back of' 'removed keys' testsuccess --nomsg aptkey adv --batch --yes --delete-keys 27CE74F9 - testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18 -pub 2048R/DBAC8DAE 2010-08-18 -pub 2048R/528144E2 2011-01-16' + testaptkeys 'Joe Sixpack' 'Joe Sixpack' 'Marvin Paranoid' msgtest 'Test merge-back of' 'removed duplicate keys' testsuccess --nomsg aptkey adv --batch --yes --delete-keys DBAC8DAE - testaptkeys 'pub 2048R/528144E2 2011-01-16' + testaptkeys 'Marvin Paranoid' cleanplate cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg @@ -175,43 +187,44 @@ pub 2048R/528144E2 2011-01-16' testsuccess --nomsg aptkey --quiet --keyring keys/marvinparanoid.pub --secret-keyring keys/marvinparanoid.sec --readonly \ adv --batch --yes --default-key 'Marvin' --armor --detach-sign --sign --output signature.gpg signature - msgtest 'Test verify a file' 'with all keys' - testsuccess --nomsg aptkey --quiet --readonly verify signature.gpg signature - msgtest 'Test verify a file' 'with good keyring' - testsuccess --nomsg aptkey --quiet --readonly --keyring keys/testcase-multikey.pub verify signature.gpg signature + for GPGV in 'gpgv' 'gpgv2' '/does/not/exist'; do + echo "APT::Key::GPGVCommand \"$GPGV\";" > rootdir/etc/apt/apt.conf.d/00gpgvcmd + + msgtest 'Test verify a file' 'with all keys' + testsuccess --nomsg aptkey --quiet --readonly verify signature.gpg signature - msgtest 'Test fail verify a file' 'with bad keyring' - testfailure --nomsg aptkey --quiet --readonly --keyring keys/joesixpack.pub verify signature.gpg signature + msgtest 'Test verify a file' 'with good keyring' + testsuccess --nomsg aptkey --quiet --readonly --keyring keys/testcase-multikey.pub verify signature.gpg signature - msgtest 'Test fail verify a file' 'with non-existing keyring' - testfailure --nomsg aptkey --quiet --readonly --keyring keys/does-not-exist.pub verify signature.gpg signature - testfailure test -e keys/does-not-exist.pub + msgtest 'Test fail verify a file' 'with bad keyring' + testfailure --nomsg aptkey --quiet --readonly --keyring keys/joesixpack.pub verify signature.gpg signature - msgtest 'Test verify a file' 'with good keyid' - testsuccess --nomsg aptkey --quiet --readonly --keyid 'Paranoid' verify signature.gpg signature + msgtest 'Test fail verify a file' 'with non-existing keyring' + testfailure --nomsg aptkey --quiet --readonly --keyring keys/does-not-exist.pub verify signature.gpg signature + testfailure test -e keys/does-not-exist.pub - msgtest 'Test fail verify a file' 'with bad keyid' - testfailure --nomsg aptkey --quiet --readonly --keyid 'Sixpack' verify signature.gpg signature + msgtest 'Test verify a file' 'with good keyid' + testsuccess --nomsg aptkey --quiet --readonly --keyid 'Paranoid' verify signature.gpg signature - msgtest 'Test fail verify a file' 'with non-existing keyid' - testfailure --nomsg aptkey --quiet --readonly --keyid 'Kalnischkies' verify signature.gpg signature + msgtest 'Test fail verify a file' 'with bad keyid' + testfailure --nomsg aptkey --quiet --readonly --keyid 'Sixpack' verify signature.gpg signature - msgtest 'Test verify fails on' 'bad file' - echo 'lalalalala' > signature - testfailure --nomsg aptkey --quiet --readonly verify signature.gpg signature + msgtest 'Test fail verify a file' 'with non-existing keyid' + testfailure --nomsg aptkey --quiet --readonly --keyid 'Kalnischkies' verify signature.gpg signature + + msgtest 'Test verify fails on' 'bad file' + echo 'lalalalala' > signature2 + testfailure --nomsg aptkey --quiet --readonly verify signature.gpg signature2 + done } setupgpgcommand() { echo "APT::Key::GPGCommand \"$1\";" > rootdir/etc/apt/apt.conf.d/00gpgcmd - msgtest 'Test that apt-key uses for the following tests command' "$1" - aptkey adv --version >aptkey.version 2>&1 - if grep -q "^Executing: $1 --" aptkey.version; then - msgpass - else - cat aptkey.version - msgfail - fi + msgmsg 'Force tests to be run with' "$1" + testsuccess aptkey --readonly adv --version + cp rootdir/tmp/testsuccess.output aptkey.version + testsuccess grep "^Executing: $1 --" aptkey.version } # run with default (whatever this is) -- cgit v1.2.3 From 25f2731928f0b571f7521d7d7a7e301499d0f6ee Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 7 Jul 2015 11:46:39 +0200 Subject: merge keyrings with cat instead of gpg in apt-key If all keyrings are simple keyrings we can merge the keyrings with cat rather than doing a detour over gpg --export | --import (see #790665), which means 'apt-key verify' can do without gpg and just use gpgv as before the merging change. We declare this gpgv usage explicit now in the dependencies. This isn't a new dependency as gnupg as well as debian-archive-keyring depend on and we used it before unconditionally, just that we didn't declare it. The handling of the merged keyring needs to be slightly different as our merged keyring can end up containing the same key multiple times, but at least currently gpg does remove only the first occurrence with --delete-keys, so we move the handling to a if one is gone, all are gone rather than an (implicit) quid pro quo or even no effect. Thanks: Daniel Kahn Gillmor for the suggestion --- cmdline/apt-key.in | 128 ++++++++++++++++++++++++++++-------------- debian/control | 2 +- test/integration/test-apt-key | 2 +- 3 files changed, 88 insertions(+), 44 deletions(-) diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index b15f71f6d..881f8a990 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -34,7 +34,8 @@ get_fingerprints_of_keyring() { elif [ "${fprline%%:*}" != 'fpr' ]; then continue; fi echo "$fprline" | cut -d':' -f 10 done - done + # order in the keyring shouldn't be important + done | sort } add_keys_with_verify_against_master_keyring() { @@ -167,8 +168,10 @@ remove_key_from_keyring() { local GPG="$GPG_CMD --keyring $KEYRINGFILE" for KEY in "$@"; do - # check if the key is in this keyring: the key id is in the 5 column at the end - if ! get_fingerprints_of_keyring "$KEYRINGFILE" | grep -iq "^[0-9A-F]*${KEY}$"; then + local FINGERPRINTS="${GPGHOMEDIR}/keyringfile.keylst" + get_fingerprints_of_keyring "$KEYRINGFILE" > "$FINGERPRINTS" + # check if the key is in this keyring + if ! grep -iq "^[0-9A-F]*${KEY}$" "$FINGERPRINTS"; then continue fi if [ ! -w "$KEYRINGFILE" ]; then @@ -176,7 +179,7 @@ remove_key_from_keyring() { continue fi # check if it is the only key in the keyring and if so remove the keyring altogether - if [ '1' = "$(get_fingerprints_of_keyring "$KEYRINGFILE" | wc -l)" ]; then + if [ '1' = "$(uniq "$FINGERPRINTS" | wc -l)" ]; then mv -f "$KEYRINGFILE" "${KEYRINGFILE}~" # behave like gpg return fi @@ -188,7 +191,7 @@ remove_key_from_keyring() { cp -a "$REALTARGET" "$KEYRINGFILE" fi # delete the key from the keyring - $GPG --batch --delete-key --yes "$KEY" + $GPG --batch --delete-keys --yes "$KEY" if [ -n "$REALTARGET" ]; then # the real backup is the old link, not the copy we made mv -f "${KEYRINGFILE}.dpkg-tmp" "${KEYRINGFILE}~" @@ -268,6 +271,33 @@ import_keyring_into_keyring() { fi } +merge_all_trusted_keyrings_into_pubring() { + # does the same as: + # foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg" + # but without using gpg, just cat and find + local PUBRING="${GPGHOMEDIR}/pubring.gpg" + # if a --keyring was given, just use this one + if [ -n "$FORCED_KEYRING" ]; then + if [ -s "$FORCED_KEYRING" ]; then + cp --dereference "$FORCED_KEYRING" "$PUBRING" + fi + else + # otherwise all known keyrings are merged + local TRUSTEDPARTS="/etc/apt/trusted.gpg.d" + eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d) + if [ -d "$TRUSTEDPARTS" ]; then + # ignore errors mostly for non-existing $TRUSTEDFILE + cat /dev/null "$TRUSTEDFILE" $(find -L "$TRUSTEDPARTS" -type f -name '*.gpg') > "$PUBRING" 2>/dev/null || true + elif [ -s "$TRUSTEDFILE" ]; then + cp --dereference "$TRUSTEDFILE" "$PUBRING" + fi + fi + + if [ ! -s "$PUBRING" ]; then + touch "$PUBRING" + fi +} + import_keys_from_keyring() { import_keyring_into_keyring "$1" "$2" } @@ -288,29 +318,29 @@ merge_back_changes() { # look for keys which were added or removed get_fingerprints_of_keyring "${GPGHOMEDIR}/pubring.orig.gpg" > "${GPGHOMEDIR}/pubring.orig.keylst" get_fingerprints_of_keyring "${GPGHOMEDIR}/pubring.gpg" > "${GPGHOMEDIR}/pubring.keylst" - sort "${GPGHOMEDIR}/pubring.keylst" "${GPGHOMEDIR}/pubring.orig.keylst" | uniq --unique | while read key; do - if grep -q "^${key}$" "${GPGHOMEDIR}/pubring.orig.keylst"; then - # key isn't part of new keyring, so remove - foreach_keyring_do 'remove_key_from_keyring' "$key" - elif grep -q "^${key}$" "${GPGHOMEDIR}/pubring.keylst"; then - # key is part of new keyring, so we need to import it - import_keyring_into_keyring '' "$TRUSTEDFILE" "$key" - else - echo >&2 "Errror: Key ${key} (dis)appeared out of nowhere" - fi + comm -3 "${GPGHOMEDIR}/pubring.keylst" "${GPGHOMEDIR}/pubring.orig.keylst" > "${GPGHOMEDIR}/pubring.diff" + # key isn't part of new keyring, so remove + cut -f 2 "${GPGHOMEDIR}/pubring.diff" | while read key; do + if [ -z "$key" ]; then continue; fi + foreach_keyring_do 'remove_key_from_keyring' "$key" + done + # key is only part of new keyring, so we need to import it + cut -f 1 "${GPGHOMEDIR}/pubring.diff" | while read key; do + if [ -z "$key" ]; then continue; fi + import_keyring_into_keyring '' "$TRUSTEDFILE" "$key" done } setup_merged_keyring() { if [ -n "$FORCED_KEYID" ]; then - foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg" + merge_all_trusted_keyrings_into_pubring FORCED_KEYRING="${GPGHOMEDIR}/forcedkeyid.gpg" TRUSTEDFILE="${FORCED_KEYRING}" GPG="$GPG --keyring $TRUSTEDFILE" # ignore error as this "just" means we haven't found the forced keyid and the keyring will be empty import_keyring_into_keyring '' "$TRUSTEDFILE" "$FORCED_KEYID" || true elif [ -z "$FORCED_KEYRING" ]; then - foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg" + merge_all_trusted_keyrings_into_pubring if [ -r "${GPGHOMEDIR}/pubring.gpg" ]; then cp -a "${GPGHOMEDIR}/pubring.gpg" "${GPGHOMEDIR}/pubring.orig.gpg" else @@ -407,7 +437,23 @@ if [ -z "$command" ]; then fi shift -if [ "$command" != "help" ]; then +create_gpg_home() { + # gpg needs (in different versions more or less) files to function correctly, + # so we give it its own homedir and generate some valid content for it later on + if [ -n "$TMPDIR" ]; then + # tmpdir is a directory and current user has rwx access to it + # same tests as in apt-pkg/contrib/fileutl.cc GetTempDir() + if [ ! -d "$TMPDIR" ] || [ ! -r "$TMPDIR" ] || [ ! -w "$TMPDIR" ] || [ ! -x "$TMPDIR" ]; then + unset TMPDIR + fi + fi + GPGHOMEDIR="$(mktemp -d)" + CURRENTTRAP="${CURRENTTRAP} rm -rf '${GPGHOMEDIR}';" + trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + chmod 700 "$GPGHOMEDIR" +} + +prepare_gpg_home() { eval $(apt-config shell GPG_EXE Apt::Key::gpgcommand) if [ -n "$GPG_EXE" ] && which "$GPG_EXE" >/dev/null 2>&1; then @@ -418,7 +464,7 @@ if [ "$command" != "help" ]; then GPG_EXE="gpg2" else echo >&2 "Error: gnupg or gnupg2 do not seem to be installed," - echo >&2 "Error: but apt-key requires gnupg or gnupg2 for operation." + echo >&2 "Error: but apt-key requires gnupg or gnupg2 for this operation." echo >&2 exit 255 fi @@ -428,19 +474,8 @@ if [ "$command" != "help" ]; then fi GPG_CMD="$GPG_EXE --ignore-time-conflict --no-options --no-default-keyring" - # gpg needs (in different versions more or less) files to function correctly, - # so we give it its own homedir and generate some valid content for it - if [ -n "$TMPDIR" ]; then - # tmpdir is a directory and current user has rwx access to it - # same tests as in apt-pkg/contrib/fileutl.cc GetTempDir() - if [ ! -d "$TMPDIR" ] || [ ! -r "$TMPDIR" ] || [ ! -w "$TMPDIR" ] || [ ! -x "$TMPDIR" ]; then - unset TMPDIR - fi - fi - GPGHOMEDIR="$(mktemp -d)" - CURRENTTRAP="${CURRENTTRAP} rm -rf '${GPGHOMEDIR}';" - trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM - chmod 700 "$GPGHOMEDIR" + create_gpg_home + # We don't use a secret keyring, of course, but gpg panics and # implodes if there isn't one available - and writeable for imports SECRETKEYRING="${GPGHOMEDIR}/secring.gpg" @@ -466,6 +501,10 @@ if [ "$command" != "help" ]; then # anyhow, so nothing actually happens, but its three lines of output # nobody expects to see in apt-key context, so trigger it in silence echo -n | $GPG --batch --import >/dev/null 2>&1 || true +} + +if [ "$command" != 'help' ] && [ "$command" != 'verify' ]; then + prepare_gpg_home fi case "$command" in @@ -500,7 +539,7 @@ case "$command" in foreach_keyring_do 'run_cmd_on_keyring' --fingerprint "$@" ;; export|exportall) - foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg" + merge_all_trusted_keyrings_into_pubring $GPG_CMD --keyring "${GPGHOMEDIR}/pubring.gpg" --armor --export "$@" ;; adv*) @@ -510,21 +549,26 @@ case "$command" in merge_back_changes ;; verify) - setup_merged_keyring GPGV='' eval $(apt-config shell GPGV Apt::Key::gpgvcommand) - if [ -n "$GPGV" ] && ! which "$GPGV" >/dev/null 2>&1; then GPGV=''; + if [ -n "$GPGV" ] && which "$GPGV" >/dev/null 2>&1; then true; elif which gpgv >/dev/null 2>&1; then GPGV='gpgv'; elif which gpgv2 >/dev/null 2>&1; then GPGV='gpgv2'; + else + echo >&2 'ERROR: gpgv or gpgv2 required for verification' + exit 29 fi - if [ -n "$GPGV" ]; then - if [ -n "$FORCED_KEYRING" ]; then - $GPGV --homedir "${GPGHOMEDIR}" --keyring "${FORCED_KEYRING}" --ignore-time-conflict "$@" - else - $GPGV --homedir "${GPGHOMEDIR}" --keyring "${GPGHOMEDIR}/pubring.gpg" --ignore-time-conflict "$@" - fi + # for a forced keyid we need gpg --export, so full wrapping required + if [ -n "$FORCED_KEYID" ]; then + prepare_gpg_home + else + create_gpg_home + fi + setup_merged_keyring + if [ -n "$FORCED_KEYRING" ]; then + $GPGV --homedir "${GPGHOMEDIR}" --keyring "${FORCED_KEYRING}" --ignore-time-conflict "$@" else - $GPG --verify "$@" + $GPGV --homedir "${GPGHOMEDIR}" --keyring "${GPGHOMEDIR}/pubring.gpg" --ignore-time-conflict "$@" fi ;; help) diff --git a/debian/control b/debian/control index e71cb5103..7e2db7373 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,7 @@ XS-Testsuite: autopkgtest Package: apt Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${apt:keyring}, gnupg | gnupg2, adduser +Depends: ${shlibs:Depends}, ${misc:Depends}, ${apt:keyring}, gpgv | gpgv2, gnupg | gnupg2, adduser Replaces: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~), sun-java6-jdk (>> 0), sun-java5-jdk (>> 0), openjdk-6-jdk (<< 6b24-1.11-0ubuntu1~) Breaks: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~), sun-java6-jdk (>> 0), sun-java5-jdk (>> 0), openjdk-6-jdk (<< 6b24-1.11-0ubuntu1~) Conflicts: python-apt (<< 0.7.93.2~) diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key index 4dbf3d66d..1226e7dc4 100755 --- a/test/integration/test-apt-key +++ b/test/integration/test-apt-key @@ -188,7 +188,7 @@ gpg: unchanged: 1' aptkey --fakeroot update adv --batch --yes --default-key 'Marvin' --armor --detach-sign --sign --output signature.gpg signature - for GPGV in 'gpgv' 'gpgv2' '/does/not/exist'; do + for GPGV in '' 'gpgv' 'gpgv2'; do echo "APT::Key::GPGVCommand \"$GPGV\";" > rootdir/etc/apt/apt.conf.d/00gpgvcmd msgtest 'Test verify a file' 'with all keys' -- cgit v1.2.3 From 4e03c47de15164f2656d9655edab6fb3570cb2f2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 7 Jul 2015 22:11:20 +0200 Subject: implement Signed-By without using gpg for verification The previous commit returns to the possibility of using just gpgv for verification proposes. There is one problem through: We can't enforce a specific keyid without using gpg, but our acquire method can as it parses gpgv output anyway, so it can deal with good signatures from not expected signatures and treats them as unknown keys instead. Git-Dch: Ignore --- methods/gpgv.cc | 69 ++++++++++++++++++++++---- test/integration/test-apt-key | 1 + test/integration/test-releasefile-verification | 4 +- 3 files changed, 63 insertions(+), 11 deletions(-) diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 014430041..d88a06789 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -15,6 +15,8 @@ #include #include #include + +#include #include #include #include @@ -74,6 +76,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, std::clog << "inside VerifyGetSigners" << std::endl; int fd[2]; + bool const keyIsID = (key.empty() == false && key[0] != '/'); if (pipe(fd) < 0) return "Couldn't create pipe"; @@ -82,12 +85,13 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, if (pid < 0) return string("Couldn't spawn new process") + strerror(errno); else if (pid == 0) - ExecGPGV(outfile, file, 3, fd, key); + ExecGPGV(outfile, file, 3, fd, (keyIsID ? "" : key)); close(fd[1]); FILE *pipein = fdopen(fd[0], "r"); // Loop over the output of apt-key (which really is gnupg), and check the signatures. + std::vector ValidSigners; size_t buffersize = 0; char *buffer = NULL; while (1) @@ -107,32 +111,31 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, std::clog << "Got BADSIG! " << std::endl; BadSigners.push_back(string(buffer+sizeof(GNUPGPREFIX))); } - - if (strncmp(buffer, GNUPGNOPUBKEY, sizeof(GNUPGNOPUBKEY)-1) == 0) + else if (strncmp(buffer, GNUPGNOPUBKEY, sizeof(GNUPGNOPUBKEY)-1) == 0) { if (Debug == true) std::clog << "Got NO_PUBKEY " << std::endl; NoPubKeySigners.push_back(string(buffer+sizeof(GNUPGPREFIX))); } - if (strncmp(buffer, GNUPGNODATA, sizeof(GNUPGBADSIG)-1) == 0) + else if (strncmp(buffer, GNUPGNODATA, sizeof(GNUPGBADSIG)-1) == 0) { if (Debug == true) std::clog << "Got NODATA! " << std::endl; BadSigners.push_back(string(buffer+sizeof(GNUPGPREFIX))); } - if (strncmp(buffer, GNUPGKEYEXPIRED, sizeof(GNUPGKEYEXPIRED)-1) == 0) + else if (strncmp(buffer, GNUPGKEYEXPIRED, sizeof(GNUPGKEYEXPIRED)-1) == 0) { if (Debug == true) std::clog << "Got KEYEXPIRED! " << std::endl; WorthlessSigners.push_back(string(buffer+sizeof(GNUPGPREFIX))); } - if (strncmp(buffer, GNUPGREVKEYSIG, sizeof(GNUPGREVKEYSIG)-1) == 0) + else if (strncmp(buffer, GNUPGREVKEYSIG, sizeof(GNUPGREVKEYSIG)-1) == 0) { if (Debug == true) std::clog << "Got REVKEYSIG! " << std::endl; WorthlessSigners.push_back(string(buffer+sizeof(GNUPGPREFIX))); } - if (strncmp(buffer, GNUPGGOODSIG, sizeof(GNUPGGOODSIG)-1) == 0) + else if (strncmp(buffer, GNUPGGOODSIG, sizeof(GNUPGGOODSIG)-1) == 0) { char *sig = buffer + sizeof(GNUPGPREFIX); char *p = sig + sizeof("GOODSIG"); @@ -143,10 +146,48 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, std::clog << "Got GOODSIG, key ID:" << sig << std::endl; GoodSigners.push_back(string(sig)); } + else if (strncmp(buffer, GNUPGVALIDSIG, sizeof(GNUPGVALIDSIG)-1) == 0) + { + char *sig = buffer + sizeof(GNUPGVALIDSIG); + char *p = sig; + while (*p && isxdigit(*p)) + p++; + *p = 0; + if (Debug == true) + std::clog << "Got VALIDSIG, key ID: " << sig << std::endl; + ValidSigners.push_back(string(sig)); + } } fclose(pipein); free(buffer); + // apt-key has a --keyid parameter, but this requires gpg, so we call it without it + // and instead check after the fact which keyids where used for verification + if (keyIsID == true) + { + if (Debug == true) + std::clog << "GoodSigs needs to be limited to keyid " << key << std::endl; + std::vector::iterator const foundItr = std::find(ValidSigners.begin(), ValidSigners.end(), key); + bool const found = (foundItr != ValidSigners.end()); + std::copy(GoodSigners.begin(), GoodSigners.end(), std::back_insert_iterator >(NoPubKeySigners)); + if (found) + { + // we look for GOODSIG here as well as an expired sig is a valid sig as well (but not a good one) + std::string const goodlongkeyid = "GOODSIG " + key.substr(24, 16); + bool const foundGood = std::find(GoodSigners.begin(), GoodSigners.end(), goodlongkeyid) != GoodSigners.end(); + if (Debug == true) + std::clog << "Key " << key << " is valid sig, is " << goodlongkeyid << " also a good one? " << (foundGood ? "yes" : "no") << std::endl; + GoodSigners.clear(); + if (foundGood) + { + GoodSigners.push_back(goodlongkeyid); + NoPubKeySigners.erase(std::remove(NoPubKeySigners.begin(), NoPubKeySigners.end(), goodlongkeyid), NoPubKeySigners.end()); + } + } + else + GoodSigners.clear(); + } + int status; waitpid(pid, &status, 0); if (Debug == true) @@ -156,8 +197,18 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, if (WEXITSTATUS(status) == 0) { - if (GoodSigners.empty()) - return _("Internal error: Good signature, but could not determine key fingerprint?!"); + if (keyIsID) + { + // gpgv will report success, but we want to enforce a certain keyring + // so if we haven't found the key the valid we found is in fact invalid + if (GoodSigners.empty()) + return _("At least one invalid signature was encountered."); + } + else + { + if (GoodSigners.empty()) + return _("Internal error: Good signature, but could not determine key fingerprint?!"); + } return ""; } else if (WEXITSTATUS(status) == 1) diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key index 1226e7dc4..a1a0d883d 100755 --- a/test/integration/test-apt-key +++ b/test/integration/test-apt-key @@ -204,6 +204,7 @@ gpg: unchanged: 1' aptkey --fakeroot update testfailure --nomsg aptkey --quiet --readonly --keyring keys/does-not-exist.pub verify signature.gpg signature testfailure test -e keys/does-not-exist.pub + # note: this isn't how apts gpgv method implements keyid for verify msgtest 'Test verify a file' 'with good keyid' testsuccess --nomsg aptkey --quiet --readonly --keyid 'Paranoid' verify signature.gpg signature diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index 1c3953c8b..759242514 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -92,7 +92,7 @@ touch aptarchive/apt.deb PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')" updatewithwarnings() { - testwarning aptget update + testwarning aptget update -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1 testsuccess grep -E "$1" rootdir/tmp/testwarning.output } @@ -225,7 +225,7 @@ runtest() { signreleasefiles 'Joe Sixpack' find aptarchive/ -name "$DELETEFILE" -delete msgmsg 'Cold archive signed by bad keyid' 'Joe Sixpack' - updatewithwarnings '^W: .* NO_PUBKEY' + updatewithwarnings '^W: .* be verified because the public key is not available: .*' sed -i "s#^\(deb\(-src\)\?\) \[signed-by=$MARVIN\] #\1 #" rootdir/etc/apt/sources.list.d/* } -- cgit v1.2.3 From ffb081b79263a699a612583fcf1b9957b5900a77 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 8 Jul 2015 16:37:04 +0200 Subject: prepare cachesets for -std=c++11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "problem" is mostly in the erase() definitions as they slightly conflict and in pre-c++11 are not uniformly in different containers. By differenciating based on the standard we can provide erase() methods for both standards – and as the method is in a template and inline we don't need to worry about symbols here. The rest is adding wrappings for the new forward_list and unordered_set containers and correcting our iterators to use the same trait as the iterator they are wrapping instead of having all of them be simple forward iterators. This allows the use of specialized algorithms which are picked based on iterator_traits and implementing them all is simple to do as we can declare all methods easily and only if they are called they will generate errors (if the underlying iterator doesn't support these). Git-Dch: Ignore --- apt-pkg/cacheset.h | 284 ++++++++++++++++++++++++++++++++--------- apt-private/private-install.cc | 2 +- 2 files changed, 223 insertions(+), 63 deletions(-) diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 29f7540ca..df437084b 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -12,6 +12,10 @@ #include #include #include +#if __cplusplus >= 201103L +#include +#include +#endif #include #include #include @@ -308,35 +312,66 @@ template class PackageContainer : public PackageContainerInterf public: /*{{{*/ /** \brief smell like a pkgCache::PkgIterator */ class const_iterator : public PackageContainerInterface::const_iterator,/*{{{*/ - public std::iterator { - typename Container::const_iterator _iter; + public std::iterator::iterator_category, typename Container::const_iterator> { + typedef typename Container::const_iterator container_iterator; + container_iterator _iter; + typedef const_iterator iterator_type; public: - explicit const_iterator(typename Container::const_iterator i) : _iter(i) {} - pkgCache::PkgIterator getPkg(void) const { return *_iter; } + explicit const_iterator(container_iterator i) : _iter(i) {} + inline pkgCache::PkgIterator getPkg(void) const { return *_iter; } inline pkgCache::PkgIterator operator*(void) const { return *_iter; } - operator typename Container::const_iterator(void) const { return _iter; } - inline const_iterator& operator++() { ++_iter; return *this; } - inline const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; } - inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; } - inline bool operator==(const_iterator const &i) const { return _iter == i._iter; } - friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); } + operator container_iterator(void) const { return _iter; } + inline iterator_type& operator++() { ++_iter; return *this; } + inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } + inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); } + inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; } + inline iterator_type& operator--() { --_iter; return *this; } + inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } + inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); } + inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; } + inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } + inline bool operator==(iterator_type const &i) const { return _iter == i._iter; } + inline bool operator<(iterator_type const &i) const { return _iter < i._iter; } + inline bool operator>(iterator_type const &i) const { return _iter > i._iter; } + inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; } + inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; } + inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; } + + friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); } + friend class PackageContainer; }; class iterator : public PackageContainerInterface::const_iterator, - public std::iterator { - typename Container::iterator _iter; + public std::iterator::iterator_category, typename Container::iterator> { + typedef typename Container::iterator container_iterator; + container_iterator _iter; + typedef iterator iterator_type; public: - explicit iterator(typename Container::iterator i) : _iter(i) {} - pkgCache::PkgIterator getPkg(void) const { return *_iter; } + explicit iterator(container_iterator i) : _iter(i) {} + inline pkgCache::PkgIterator getPkg(void) const { return *_iter; } inline pkgCache::PkgIterator operator*(void) const { return *_iter; } - operator typename Container::iterator(void) const { return _iter; } + operator container_iterator(void) const { return _iter; } + inline iterator_type& operator++() { ++_iter; return *this; } + inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } + inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); } + inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; } + inline iterator_type& operator--() { --_iter; return *this; } + inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } + inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); } + inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; } + inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } + inline bool operator==(iterator_type const &i) const { return _iter == i._iter; } + inline bool operator<(iterator_type const &i) const { return _iter < i._iter; } + inline bool operator>(iterator_type const &i) const { return _iter > i._iter; } + inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; } + inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; } + inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; } + operator typename PackageContainer::const_iterator() { return typename PackageContainer::const_iterator(_iter); } - inline iterator& operator++() { ++_iter; return *this; } - inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; } - inline bool operator!=(iterator const &i) const { return _iter != i._iter; } - inline bool operator==(iterator const &i) const { return _iter == i._iter; } - inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; } - inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; } - friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); } + inline iterator& operator=(iterator_type const &i) { _iter = i._iter; return *this; } + inline iterator& operator=(container_iterator const &i) { _iter = i; return *this; } + + friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); } + friend class PackageContainer; }; /*}}}*/ @@ -347,11 +382,17 @@ public: /*{{{*/ bool empty() const { return _cont.empty(); } void clear() { return _cont.clear(); } size_t size() const { return _cont.size(); } - iterator erase( iterator pos ) { return iterator(_cont.erase(pos)); } - iterator erase( iterator first, iterator last ) { return iterator(_cont.erase(first, last)); } - size_t erase(pkgCache::PkgIterator const & P) { size_t oldsize = size(); _cont.erase(std::remove(_cont.begin(), _cont.end(), P), _cont.end()); return oldsize - size(); } +#if __cplusplus >= 201103L + iterator erase( const_iterator pos ) { return iterator(_cont.erase(pos._iter)); } + iterator erase( const_iterator first, const_iterator last ) { return iterator(_cont.erase(first._iter, last._iter)); } +#else + iterator erase( iterator pos ) { return iterator(_cont.erase(pos._iter)); } + iterator erase( iterator first, iterator last ) { return iterator(_cont.erase(first._iter, last._iter)); } +#endif const_iterator begin() const { return const_iterator(_cont.begin()); } const_iterator end() const { return const_iterator(_cont.end()); } + const_iterator cbegin() const { return const_iterator(_cont.cbegin()); } + const_iterator cend() const { return const_iterator(_cont.cend()); } iterator begin() { return iterator(_cont.begin()); } iterator end() { return iterator(_cont.end()); } const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); } @@ -510,11 +551,17 @@ template<> template void PackageContainer::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p) _cont.push_back(*p); } +#if __cplusplus >= 201103L +template<> template void PackageContainer >::insert(PackageContainer const &pkgcont) { + for (typename PackageContainer::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p) + _cont.push_front(*p); +} +#endif template<> template void PackageContainer >::insert(PackageContainer const &pkgcont) { for (typename PackageContainer::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p) _cont.push_back(*p); } -// these two are 'inline' as otherwise the linker has problems with seeing these untemplated +// these are 'inline' as otherwise the linker has problems with seeing these untemplated // specializations again and again - but we need to see them, so that library users can use them template<> inline bool PackageContainer >::insert(pkgCache::PkgIterator const &P) { if (P.end() == true) @@ -522,6 +569,14 @@ template<> inline bool PackageContainer >::inse _cont.push_back(P); return true; } +#if __cplusplus >= 201103L +template<> inline bool PackageContainer >::insert(pkgCache::PkgIterator const &P) { + if (P.end() == true) + return false; + _cont.push_front(P); + return true; +} +#endif template<> inline bool PackageContainer >::insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; @@ -532,16 +587,42 @@ template<> inline void PackageContainer >::inse for (const_iterator p = begin; p != end; ++p) _cont.push_back(*p); } +#if __cplusplus >= 201103L +template<> inline void PackageContainer >::insert(const_iterator begin, const_iterator end) { + for (const_iterator p = begin; p != end; ++p) + _cont.push_front(*p); +} +#endif template<> inline void PackageContainer >::insert(const_iterator begin, const_iterator end) { for (const_iterator p = begin; p != end; ++p) _cont.push_back(*p); } +#if __cplusplus < 201103L +template<> inline PackageContainer >::iterator PackageContainer >::erase(iterator i) { + _cont.erase(i._iter); + return end(); +} +template<> inline PackageContainer >::iterator PackageContainer >::erase(iterator first, iterator last) { + _cont.erase(first, last); + return end(); +} +#endif /*}}}*/ template<> template inline bool PackageContainer >::sort(Compare Comp) { std::sort(_cont.begin(), _cont.end(), Comp); return true; } +template<> template inline bool PackageContainer >::sort(Compare Comp) { + _cont.sort(Comp); + return true; +} +#if __cplusplus >= 201103L +template<> template inline bool PackageContainer >::sort(Compare Comp) { + _cont.sort(Comp); + return true; +} +#endif // class PackageUniverse - pkgCache as PackageContainerInterface /*{{{*/ /** \class PackageUniverse @@ -563,6 +644,8 @@ public: APT_PUBLIC const_iterator begin() const { return _cont->PkgBegin(); } APT_PUBLIC const_iterator end() const { return _cont->PkgEnd(); } + APT_PUBLIC const_iterator cbegin() const { return _cont->PkgBegin(); } + APT_PUBLIC const_iterator cend() const { return _cont->PkgEnd(); } APT_PUBLIC iterator begin() { return _cont->PkgBegin(); } APT_PUBLIC iterator end() { return _cont->PkgEnd(); } @@ -575,12 +658,15 @@ private: void insert(const_iterator, const_iterator) { } void clear() { } - iterator erase( iterator pos ); - iterator erase( iterator first, iterator last ); - size_t erase(pkgCache::PkgIterator const & P); + iterator erase( const_iterator pos ); + iterator erase( const_iterator first, const_iterator last ); }; /*}}}*/ typedef PackageContainer > PackageSet; +#if __cplusplus >= 201103L +typedef PackageContainer > PackageUnorderedSet; +typedef PackageContainer > PackageForwardList; +#endif typedef PackageContainer > PackageList; typedef PackageContainer > PackageVector; @@ -739,36 +825,67 @@ template class VersionContainer : public VersionContainerInterf Container _cont; public: /*{{{*/ /** \brief smell like a pkgCache::VerIterator */ - class const_iterator : public VersionContainerInterface::const_iterator, - public std::iterator {/*{{{*/ - typename Container::const_iterator _iter; + class const_iterator : public VersionContainerInterface::const_iterator,/*{{{*/ + public std::iterator::iterator_category, typename Container::const_iterator> { + typedef typename Container::const_iterator container_iterator; + container_iterator _iter; + typedef const_iterator iterator_type; public: - explicit const_iterator(typename Container::const_iterator i) : _iter(i) {} - pkgCache::VerIterator getVer(void) const { return *_iter; } + explicit const_iterator(container_iterator i) : _iter(i) {} + inline pkgCache::VerIterator getVer(void) const { return *_iter; } inline pkgCache::VerIterator operator*(void) const { return *_iter; } - operator typename Container::const_iterator(void) const { return _iter; } - inline const_iterator& operator++() { ++_iter; return *this; } - inline const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; } - inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; } - inline bool operator==(const_iterator const &i) const { return _iter == i._iter; } - friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); } + operator container_iterator(void) const { return _iter; } + inline iterator_type& operator++() { ++_iter; return *this; } + inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } + inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); } + inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; } + inline iterator_type& operator--() { --_iter; return *this; } + inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } + inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); } + inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; } + inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } + inline bool operator==(iterator_type const &i) const { return _iter == i._iter; } + inline bool operator<(iterator_type const &i) const { return _iter < i._iter; } + inline bool operator>(iterator_type const &i) const { return _iter > i._iter; } + inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; } + inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; } + inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; } + + friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); } + friend class VersionContainer; }; class iterator : public VersionContainerInterface::const_iterator, - public std::iterator { - typename Container::iterator _iter; + public std::iterator::iterator_category, typename Container::iterator> { + typedef typename Container::iterator container_iterator; + container_iterator _iter; + typedef iterator iterator_type; public: - explicit iterator(typename Container::iterator i) : _iter(i) {} - pkgCache::VerIterator getVer(void) const { return *_iter; } + explicit iterator(container_iterator i) : _iter(i) {} + inline pkgCache::VerIterator getVer(void) const { return *_iter; } inline pkgCache::VerIterator operator*(void) const { return *_iter; } - operator typename Container::iterator(void) const { return _iter; } + operator container_iterator(void) const { return _iter; } + inline iterator_type& operator++() { ++_iter; return *this; } + inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } + inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); } + inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; } + inline iterator_type& operator--() { --_iter; return *this; } + inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } + inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); } + inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; } + inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } + inline bool operator==(iterator_type const &i) const { return _iter == i._iter; } + inline bool operator<(iterator_type const &i) const { return _iter < i._iter; } + inline bool operator>(iterator_type const &i) const { return _iter > i._iter; } + inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; } + inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; } + inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; } + operator typename VersionContainer::const_iterator() { return typename VersionContainer::const_iterator(_iter); } - inline iterator& operator++() { ++_iter; return *this; } - inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; } - inline bool operator!=(iterator const &i) const { return _iter != i._iter; } - inline bool operator==(iterator const &i) const { return _iter == i._iter; } - inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; } - inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; } - friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); } + inline iterator& operator=(iterator_type const &i) { _iter = i._iter; return *this; } + inline iterator& operator=(container_iterator const &i) { _iter = i; return *this; } + + friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); } + friend class VersionContainer; }; /*}}}*/ @@ -778,12 +895,18 @@ public: /*{{{*/ bool empty() const { return _cont.empty(); } void clear() { return _cont.clear(); } size_t size() const { return _cont.size(); } - iterator erase( iterator pos ) { return iterator(_cont.erase(pos)); } - iterator erase( iterator first, iterator last ) { return iterator(_cont.erase(first, last)); } - size_t erase(pkgCache::VerIterator const & V) { size_t oldsize = size(); _cont.erase(std::remove(_cont.begin(), _cont.end(), V), _cont.end()); return oldsize - size(); } +#if __cplusplus >= 201103L + iterator erase( const_iterator pos ) { return iterator(_cont.erase(pos._iter)); } + iterator erase( const_iterator first, const_iterator last ) { return iterator(_cont.erase(first._iter, last._iter)); } +#else + iterator erase( iterator pos ) { return iterator(_cont.erase(pos._iter)); } + iterator erase( iterator first, iterator last ) { return iterator(_cont.erase(first._iter, last._iter)); } +#endif const_iterator begin() const { return const_iterator(_cont.begin()); } const_iterator end() const { return const_iterator(_cont.end()); } + const_iterator cbegin() const { return const_iterator(_cont.cbegin()); } + const_iterator cend() const { return const_iterator(_cont.cend()); } iterator begin() { return iterator(_cont.begin()); } iterator end() { return iterator(_cont.end()); } const_iterator find(pkgCache::VerIterator const &V) const { return const_iterator(_cont.find(V)); } @@ -956,11 +1079,17 @@ template<> template void VersionContainer::const_iterator v = vercont.begin(); v != vercont.end(); ++v) _cont.push_back(*v); } +#if __cplusplus >= 201103L +template<> template void VersionContainer >::insert(VersionContainer const &vercont) { + for (typename VersionContainer::const_iterator v = vercont.begin(); v != vercont.end(); ++v) + _cont.push_front(*v); +} +#endif template<> template void VersionContainer >::insert(VersionContainer const &vercont) { for (typename VersionContainer::const_iterator v = vercont.begin(); v != vercont.end(); ++v) _cont.push_back(*v); } -// these two are 'inline' as otherwise the linker has problems with seeing these untemplated +// these are 'inline' as otherwise the linker has problems with seeing these untemplated // specializations again and again - but we need to see them, so that library users can use them template<> inline bool VersionContainer >::insert(pkgCache::VerIterator const &V) { if (V.end() == true) @@ -968,6 +1097,14 @@ template<> inline bool VersionContainer >::inse _cont.push_back(V); return true; } +#if __cplusplus >= 201103L +template<> inline bool VersionContainer >::insert(pkgCache::VerIterator const &V) { + if (V.end() == true) + return false; + _cont.push_front(V); + return true; +} +#endif template<> inline bool VersionContainer >::insert(pkgCache::VerIterator const &V) { if (V.end() == true) return false; @@ -978,25 +1115,48 @@ template<> inline void VersionContainer >::inse for (const_iterator v = begin; v != end; ++v) _cont.push_back(*v); } +#if __cplusplus >= 201103L +template<> inline void VersionContainer >::insert(const_iterator begin, const_iterator end) { + for (const_iterator v = begin; v != end; ++v) + _cont.push_front(*v); +} +#endif template<> inline void VersionContainer >::insert(const_iterator begin, const_iterator end) { for (const_iterator v = begin; v != end; ++v) _cont.push_back(*v); } - /*}}}*/ - -template<> inline size_t PackageContainer >::erase(pkgCache::PkgIterator const &P) { - return _cont.erase(P); +#if __cplusplus < 201103L +template<> inline VersionContainer >::iterator VersionContainer >::erase(iterator i) { + _cont.erase(i._iter); + return end(); } -template<> inline size_t VersionContainer >::erase(pkgCache::VerIterator const &V) { - return _cont.erase(V); +template<> inline VersionContainer >::iterator VersionContainer >::erase(iterator first, iterator last) { + _cont.erase(first, last); + return end(); } +#endif + /*}}}*/ template<> template inline bool VersionContainer >::sort(Compare Comp) { std::sort(_cont.begin(), _cont.end(), Comp); return true; } +template<> template inline bool VersionContainer >::sort(Compare Comp) { + _cont.sort(Comp); + return true; +} +#if __cplusplus >= 201103L +template<> template inline bool VersionContainer >::sort(Compare Comp) { + _cont.sort(Comp); + return true; +} +#endif typedef VersionContainer > VersionSet; +#if __cplusplus >= 201103L +typedef VersionContainer > VersionUnorderedSet; +typedef VersionContainer > VersionForwardList; +#endif typedef VersionContainer > VersionList; typedef VersionContainer > VersionVector; } diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index acc6d42c2..3474d262a 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -419,7 +419,7 @@ static bool DoAutomaticRemove(CacheFile &Cache) bool Changed; do { Changed = false; - for (APT::PackageSet::const_iterator Pkg = tooMuch.begin(); + for (APT::PackageSet::iterator Pkg = tooMuch.begin(); Pkg != tooMuch.end(); ++Pkg) { APT::PackageSet too; -- cgit v1.2.3 From 2893325927f6e4d55dc4bd148093351d4f8300f9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 8 Jul 2015 22:44:09 +0200 Subject: implement reverse_iterators for cachesets By further abstracting the iterator templates we can wrap the reverse iterators of the wrapped containers and share code in a way that iterator creating is now more template intensive, but shorter in code. Git-Dch: Ignore --- apt-pkg/cacheset.h | 349 ++++++++++++++++++++++------------------------- apt-pkg/contrib/macros.h | 6 + 2 files changed, 167 insertions(+), 188 deletions(-) diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index df437084b..03f3605a1 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -209,7 +209,82 @@ protected: private: void * const d; }; /*}}}*/ +// Iterator templates for our Containers /*{{{*/ +template class Container_iterator_base : + public std::iterator::iterator_category, container_iterator>, + public Interface::iterator_base +{ +protected: + container_iterator _iter; + inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *_iter; } +public: + explicit Container_iterator_base(container_iterator i) : _iter(i) {} + inline typename Container::value_type operator*(void) const { return *_iter; } + operator container_iterator(void) const { return _iter; } + inline iterator_type& operator++() { ++_iter; return static_cast(*this); } + inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } + inline iterator_type operator+(typename container_iterator::difference_type const &n) { return iterator_type(_iter + n); } + inline iterator_type operator+=(typename container_iterator::difference_type const &n) { _iter += n; return static_cast(*this); } + inline iterator_type& operator--() { --_iter;; return static_cast(*this); } + inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } + inline iterator_type operator-(typename container_iterator::difference_type const &n) { return iterator_type(_iter - n); } + inline iterator_type operator-=(typename container_iterator::difference_type const &n) { _iter -= n; return static_cast(*this); } + inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } + inline bool operator==(iterator_type const &i) const { return _iter == i._iter; } + inline bool operator<(iterator_type const &i) const { return _iter < i._iter; } + inline bool operator>(iterator_type const &i) const { return _iter > i._iter; } + inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; } + inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; } + inline typename container_iterator::reference operator[](typename container_iterator::difference_type const &n) const { return _iter[n]; } + + friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); } + friend Master; +}; +template class Container_const_iterator : + public Container_iterator_base, typename Container::const_iterator> +{ + typedef Container_const_iterator iterator_type; + typedef typename Container::const_iterator container_iterator; +public: + explicit Container_const_iterator(container_iterator i) : + Container_iterator_base(i) {} +}; +template class Container_iterator : + public Container_iterator_base, typename Container::iterator> +{ + typedef Container_iterator iterator_type; + typedef typename Container::iterator container_iterator; +public: + explicit Container_iterator(container_iterator i) : + Container_iterator_base(i) {} + + operator typename Master::const_iterator() { return typename Master::const_iterator(this->_iter); } + inline iterator_type& operator=(iterator_type const &i) { this->_iter = i._iter; return static_cast(*this); } + inline iterator_type& operator=(container_iterator const &i) { this->_iter = i; return static_cast(*this); } +}; +template class Container_const_reverse_iterator : + public Container_iterator_base, typename Container::const_reverse_iterator> +{ + typedef Container_const_reverse_iterator iterator_type; + typedef typename Container::const_reverse_iterator container_iterator; +public: + explicit Container_const_reverse_iterator(container_iterator i) : + Container_iterator_base(i) {} +}; +template class Container_reverse_iterator : + public Container_iterator_base, typename Container::reverse_iterator> +{ + typedef Container_reverse_iterator iterator_type; + typedef typename Container::reverse_iterator container_iterator; +public: + explicit Container_reverse_iterator(container_iterator i) : + Container_iterator_base(i) {} + operator typename Master::const_iterator() { return typename Master::const_iterator(this->_iter); } + inline iterator_type& operator=(iterator_type const &i) { this->_iter = i._iter; return static_cast(*this); } + inline iterator_type& operator=(container_iterator const &i) { this->_iter = i; return static_cast(*this); } +}; + /*}}}*/ class PackageContainerInterface { /*{{{*/ /** \class PackageContainerInterface @@ -221,41 +296,43 @@ class PackageContainerInterface { /*{{{*/ * This class mostly protects use from the need to write all implementation * of the methods working on containers in the template */ public: - class const_iterator { /*{{{*/ + class iterator_base { /*{{{*/ + protected: + virtual pkgCache::PkgIterator getType() const = 0; public: - virtual pkgCache::PkgIterator getPkg() const = 0; - operator pkgCache::PkgIterator(void) const { return getPkg(); } + operator pkgCache::PkgIterator(void) const { return getType(); } - inline const char *Name() const {return getPkg().Name(); } - inline std::string FullName(bool const Pretty) const { return getPkg().FullName(Pretty); } - inline std::string FullName() const { return getPkg().FullName(); } + inline const char *Name() const {return getType().Name(); } + inline std::string FullName(bool const Pretty) const { return getType().FullName(Pretty); } + inline std::string FullName() const { return getType().FullName(); } APT_DEPRECATED inline const char *Section() const { APT_IGNORE_DEPRECATED_PUSH - return getPkg().Section(); + return getType().Section(); APT_IGNORE_DEPRECATED_POP } - inline bool Purge() const {return getPkg().Purge(); } - inline const char *Arch() const {return getPkg().Arch(); } - inline pkgCache::GrpIterator Group() const { return getPkg().Group(); } - inline pkgCache::VerIterator VersionList() const { return getPkg().VersionList(); } - inline pkgCache::VerIterator CurrentVer() const { return getPkg().CurrentVer(); } - inline pkgCache::DepIterator RevDependsList() const { return getPkg().RevDependsList(); } - inline pkgCache::PrvIterator ProvidesList() const { return getPkg().ProvidesList(); } - inline pkgCache::PkgIterator::OkState State() const { return getPkg().State(); } - inline const char *CandVersion() const { return getPkg().CandVersion(); } - inline const char *CurVersion() const { return getPkg().CurVersion(); } - inline pkgCache *Cache() const { return getPkg().Cache(); } - inline unsigned long Index() const {return getPkg().Index();} + inline bool Purge() const {return getType().Purge(); } + inline const char *Arch() const {return getType().Arch(); } + inline pkgCache::GrpIterator Group() const { return getType().Group(); } + inline pkgCache::VerIterator VersionList() const { return getType().VersionList(); } + inline pkgCache::VerIterator CurrentVer() const { return getType().CurrentVer(); } + inline pkgCache::DepIterator RevDependsList() const { return getType().RevDependsList(); } + inline pkgCache::PrvIterator ProvidesList() const { return getType().ProvidesList(); } + inline pkgCache::PkgIterator::OkState State() const { return getType().State(); } + inline const char *CandVersion() const { return getType().CandVersion(); } + inline const char *CurVersion() const { return getType().CurVersion(); } + inline pkgCache *Cache() const { return getType().Cache(); } + inline unsigned long Index() const {return getType().Index();} // we have only valid iterators here inline bool end() const { return false; } - inline pkgCache::Package const * operator->() const {return &*getPkg();} + inline pkgCache::Package const * operator->() const {return &*getType();} }; /*}}}*/ virtual bool insert(pkgCache::PkgIterator const &P) = 0; virtual bool empty() const = 0; virtual void clear() = 0; + virtual size_t size() const = 0; // FIXME: This is a bloody hack removed soon. Use CacheSetHelper::PkgSelector ! enum APT_DEPRECATED Constructor { UNKNOWN = CacheSetHelper::UNKNOWN, @@ -311,77 +388,18 @@ template class PackageContainer : public PackageContainerInterf Container _cont; public: /*{{{*/ /** \brief smell like a pkgCache::PkgIterator */ - class const_iterator : public PackageContainerInterface::const_iterator,/*{{{*/ - public std::iterator::iterator_category, typename Container::const_iterator> { - typedef typename Container::const_iterator container_iterator; - container_iterator _iter; - typedef const_iterator iterator_type; - public: - explicit const_iterator(container_iterator i) : _iter(i) {} - inline pkgCache::PkgIterator getPkg(void) const { return *_iter; } - inline pkgCache::PkgIterator operator*(void) const { return *_iter; } - operator container_iterator(void) const { return _iter; } - inline iterator_type& operator++() { ++_iter; return *this; } - inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } - inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); } - inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; } - inline iterator_type& operator--() { --_iter; return *this; } - inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } - inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); } - inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; } - inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } - inline bool operator==(iterator_type const &i) const { return _iter == i._iter; } - inline bool operator<(iterator_type const &i) const { return _iter < i._iter; } - inline bool operator>(iterator_type const &i) const { return _iter > i._iter; } - inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; } - inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; } - inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; } - - friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); } - friend class PackageContainer; - }; - class iterator : public PackageContainerInterface::const_iterator, - public std::iterator::iterator_category, typename Container::iterator> { - typedef typename Container::iterator container_iterator; - container_iterator _iter; - typedef iterator iterator_type; - public: - explicit iterator(container_iterator i) : _iter(i) {} - inline pkgCache::PkgIterator getPkg(void) const { return *_iter; } - inline pkgCache::PkgIterator operator*(void) const { return *_iter; } - operator container_iterator(void) const { return _iter; } - inline iterator_type& operator++() { ++_iter; return *this; } - inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } - inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); } - inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; } - inline iterator_type& operator--() { --_iter; return *this; } - inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } - inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); } - inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; } - inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } - inline bool operator==(iterator_type const &i) const { return _iter == i._iter; } - inline bool operator<(iterator_type const &i) const { return _iter < i._iter; } - inline bool operator>(iterator_type const &i) const { return _iter > i._iter; } - inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; } - inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; } - inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; } - - operator typename PackageContainer::const_iterator() { return typename PackageContainer::const_iterator(_iter); } - inline iterator& operator=(iterator_type const &i) { _iter = i._iter; return *this; } - inline iterator& operator=(container_iterator const &i) { _iter = i; return *this; } - - friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); } - friend class PackageContainer; - }; - /*}}}*/ + typedef Container_const_iterator const_iterator; + typedef Container_iterator iterator; + typedef Container_const_reverse_iterator const_reverse_iterator; + typedef Container_reverse_iterator reverse_iterator; - bool insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; _cont.insert(P); return true; } + bool insert(pkgCache::PkgIterator const &P) APT_OVERRIDE { if (P.end() == true) return false; _cont.insert(P); return true; } template void insert(PackageContainer const &pkgcont) { _cont.insert((typename Cont::const_iterator)pkgcont.begin(), (typename Cont::const_iterator)pkgcont.end()); } void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); } - bool empty() const { return _cont.empty(); } - void clear() { return _cont.clear(); } - size_t size() const { return _cont.size(); } + bool empty() const APT_OVERRIDE { return _cont.empty(); } + void clear() APT_OVERRIDE { return _cont.clear(); } + size_t size() const APT_OVERRIDE { return _cont.size(); } #if __cplusplus >= 201103L iterator erase( const_iterator pos ) { return iterator(_cont.erase(pos._iter)); } iterator erase( const_iterator first, const_iterator last ) { return iterator(_cont.erase(first._iter, last._iter)); } @@ -391,10 +409,18 @@ public: /*{{{*/ #endif const_iterator begin() const { return const_iterator(_cont.begin()); } const_iterator end() const { return const_iterator(_cont.end()); } + const_reverse_iterator rbegin() const { return const_reverse_iterator(_cont.rbegin()); } + const_reverse_iterator rend() const { return const_reverse_iterator(_cont.rend()); } +#if __cplusplus >= 201103L const_iterator cbegin() const { return const_iterator(_cont.cbegin()); } const_iterator cend() const { return const_iterator(_cont.cend()); } + const_reverse_iterator crbegin() const { return const_reverse_iterator(_cont.crbegin()); } + const_reverse_iterator crend() const { return const_reverse_iterator(_cont.crend()); } +#endif iterator begin() { return iterator(_cont.begin()); } iterator end() { return iterator(_cont.end()); } + reverse_iterator rbegin() { return reverse_iterator(_cont.rbegin()); } + reverse_iterator rend() { return reverse_iterator(_cont.rend()); } const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); } PackageContainer() : PackageContainerInterface(CacheSetHelper::UNKNOWN) {} @@ -546,7 +572,7 @@ APT_IGNORE_DEPRECATED_POP } /*}}}*/ }; /*}}}*/ -// specialisations for push_back containers: std::list & std::vector /*{{{*/ +// various specialisations for PackageContainer /*{{{*/ template<> template void PackageContainer >::insert(PackageContainer const &pkgcont) { for (typename PackageContainer::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p) _cont.push_back(*p); @@ -607,8 +633,6 @@ template<> inline PackageContainer >::iterator P return end(); } #endif - /*}}}*/ - template<> template inline bool PackageContainer >::sort(Compare Comp) { std::sort(_cont.begin(), _cont.end(), Comp); return true; @@ -623,6 +647,7 @@ template<> template inline bool PackageContainerHead().PackageCount; } + APT_PUBLIC bool empty() const APT_OVERRIDE { return false; } + APT_PUBLIC size_t size() const APT_OVERRIDE { return _cont->Head().PackageCount; } APT_PUBLIC const_iterator begin() const { return _cont->PkgBegin(); } APT_PUBLIC const_iterator end() const { return _cont->PkgEnd(); } @@ -653,11 +678,11 @@ public: APT_PUBLIC virtual ~PackageUniverse(); private: - bool insert(pkgCache::PkgIterator const &) { return true; } + bool insert(pkgCache::PkgIterator const &) APT_OVERRIDE { return true; } template void insert(PackageContainer const &) { } void insert(const_iterator, const_iterator) { } - void clear() { } + void clear() APT_OVERRIDE { } iterator erase( const_iterator pos ); iterator erase( const_iterator first, const_iterator last ); }; @@ -676,38 +701,40 @@ class VersionContainerInterface { /*{{{*/ Same as APT::PackageContainerInterface, just for Versions */ public: /** \brief smell like a pkgCache::VerIterator */ - class const_iterator { /*{{{*/ + class iterator_base { /*{{{*/ + protected: + virtual pkgCache::VerIterator getType() const = 0; public: - virtual pkgCache::VerIterator getVer() const = 0; - operator pkgCache::VerIterator(void) { return getVer(); } - - inline pkgCache *Cache() const { return getVer().Cache(); } - inline unsigned long Index() const {return getVer().Index();} - inline int CompareVer(const pkgCache::VerIterator &B) const { return getVer().CompareVer(B); } - inline const char *VerStr() const { return getVer().VerStr(); } - inline const char *Section() const { return getVer().Section(); } - inline const char *Arch() const { return getVer().Arch(); } - inline pkgCache::PkgIterator ParentPkg() const { return getVer().ParentPkg(); } - inline pkgCache::DescIterator DescriptionList() const { return getVer().DescriptionList(); } - inline pkgCache::DescIterator TranslatedDescription() const { return getVer().TranslatedDescription(); } - inline pkgCache::DepIterator DependsList() const { return getVer().DependsList(); } - inline pkgCache::PrvIterator ProvidesList() const { return getVer().ProvidesList(); } - inline pkgCache::VerFileIterator FileList() const { return getVer().FileList(); } - inline bool Downloadable() const { return getVer().Downloadable(); } - inline const char *PriorityType() const { return getVer().PriorityType(); } - inline std::string RelStr() const { return getVer().RelStr(); } - inline bool Automatic() const { return getVer().Automatic(); } - inline pkgCache::VerFileIterator NewestFile() const { return getVer().NewestFile(); } + operator pkgCache::VerIterator(void) { return getType(); } + + inline pkgCache *Cache() const { return getType().Cache(); } + inline unsigned long Index() const {return getType().Index();} + inline int CompareVer(const pkgCache::VerIterator &B) const { return getType().CompareVer(B); } + inline const char *VerStr() const { return getType().VerStr(); } + inline const char *Section() const { return getType().Section(); } + inline const char *Arch() const { return getType().Arch(); } + inline pkgCache::PkgIterator ParentPkg() const { return getType().ParentPkg(); } + inline pkgCache::DescIterator DescriptionList() const { return getType().DescriptionList(); } + inline pkgCache::DescIterator TranslatedDescription() const { return getType().TranslatedDescription(); } + inline pkgCache::DepIterator DependsList() const { return getType().DependsList(); } + inline pkgCache::PrvIterator ProvidesList() const { return getType().ProvidesList(); } + inline pkgCache::VerFileIterator FileList() const { return getType().FileList(); } + inline bool Downloadable() const { return getType().Downloadable(); } + inline const char *PriorityType() const { return getType().PriorityType(); } + inline std::string RelStr() const { return getType().RelStr(); } + inline bool Automatic() const { return getType().Automatic(); } + inline pkgCache::VerFileIterator NewestFile() const { return getType().NewestFile(); } // we have only valid iterators here inline bool end() const { return false; } - inline pkgCache::Version const * operator->() const { return &*getVer(); } + inline pkgCache::Version const * operator->() const { return &*getType(); } }; /*}}}*/ virtual bool insert(pkgCache::VerIterator const &V) = 0; virtual bool empty() const = 0; virtual void clear() = 0; + virtual size_t size() const = 0; /** \brief specifies which version(s) will be returned if non is given */ enum APT_DEPRECATED Version { @@ -824,77 +851,17 @@ template class VersionContainer : public VersionContainerInterf pkgCache. */ Container _cont; public: /*{{{*/ - /** \brief smell like a pkgCache::VerIterator */ - class const_iterator : public VersionContainerInterface::const_iterator,/*{{{*/ - public std::iterator::iterator_category, typename Container::const_iterator> { - typedef typename Container::const_iterator container_iterator; - container_iterator _iter; - typedef const_iterator iterator_type; - public: - explicit const_iterator(container_iterator i) : _iter(i) {} - inline pkgCache::VerIterator getVer(void) const { return *_iter; } - inline pkgCache::VerIterator operator*(void) const { return *_iter; } - operator container_iterator(void) const { return _iter; } - inline iterator_type& operator++() { ++_iter; return *this; } - inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } - inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); } - inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; } - inline iterator_type& operator--() { --_iter; return *this; } - inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } - inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); } - inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; } - inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } - inline bool operator==(iterator_type const &i) const { return _iter == i._iter; } - inline bool operator<(iterator_type const &i) const { return _iter < i._iter; } - inline bool operator>(iterator_type const &i) const { return _iter > i._iter; } - inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; } - inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; } - inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; } - - friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); } - friend class VersionContainer; - }; - class iterator : public VersionContainerInterface::const_iterator, - public std::iterator::iterator_category, typename Container::iterator> { - typedef typename Container::iterator container_iterator; - container_iterator _iter; - typedef iterator iterator_type; - public: - explicit iterator(container_iterator i) : _iter(i) {} - inline pkgCache::VerIterator getVer(void) const { return *_iter; } - inline pkgCache::VerIterator operator*(void) const { return *_iter; } - operator container_iterator(void) const { return _iter; } - inline iterator_type& operator++() { ++_iter; return *this; } - inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } - inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); } - inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; } - inline iterator_type& operator--() { --_iter; return *this; } - inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; } - inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); } - inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; } - inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; } - inline bool operator==(iterator_type const &i) const { return _iter == i._iter; } - inline bool operator<(iterator_type const &i) const { return _iter < i._iter; } - inline bool operator>(iterator_type const &i) const { return _iter > i._iter; } - inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; } - inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; } - inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; } - - operator typename VersionContainer::const_iterator() { return typename VersionContainer::const_iterator(_iter); } - inline iterator& operator=(iterator_type const &i) { _iter = i._iter; return *this; } - inline iterator& operator=(container_iterator const &i) { _iter = i; return *this; } - - friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); } - friend class VersionContainer; - }; - /*}}}*/ + typedef Container_const_iterator const_iterator; + typedef Container_iterator iterator; + typedef Container_const_reverse_iterator const_reverse_iterator; + typedef Container_reverse_iterator reverse_iterator; - bool insert(pkgCache::VerIterator const &V) { if (V.end() == true) return false; _cont.insert(V); return true; } + bool insert(pkgCache::VerIterator const &V) APT_OVERRIDE { if (V.end() == true) return false; _cont.insert(V); return true; } template void insert(VersionContainer const &vercont) { _cont.insert((typename Cont::const_iterator)vercont.begin(), (typename Cont::const_iterator)vercont.end()); } void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); } - bool empty() const { return _cont.empty(); } - void clear() { return _cont.clear(); } - size_t size() const { return _cont.size(); } + bool empty() const APT_OVERRIDE { return _cont.empty(); } + void clear() APT_OVERRIDE { return _cont.clear(); } + size_t size() const APT_OVERRIDE { return _cont.size(); } #if __cplusplus >= 201103L iterator erase( const_iterator pos ) { return iterator(_cont.erase(pos._iter)); } iterator erase( const_iterator first, const_iterator last ) { return iterator(_cont.erase(first._iter, last._iter)); } @@ -902,13 +869,20 @@ public: /*{{{*/ iterator erase( iterator pos ) { return iterator(_cont.erase(pos._iter)); } iterator erase( iterator first, iterator last ) { return iterator(_cont.erase(first._iter, last._iter)); } #endif - const_iterator begin() const { return const_iterator(_cont.begin()); } const_iterator end() const { return const_iterator(_cont.end()); } + const_reverse_iterator rbegin() const { return const_reverse_iterator(_cont.rbegin()); } + const_reverse_iterator rend() const { return const_reverse_iterator(_cont.rend()); } +#if __cplusplus >= 201103L const_iterator cbegin() const { return const_iterator(_cont.cbegin()); } const_iterator cend() const { return const_iterator(_cont.cend()); } + const_reverse_iterator crbegin() const { return const_reverse_iterator(_cont.crbegin()); } + const_reverse_iterator crend() const { return const_reverse_iterator(_cont.crend()); } +#endif iterator begin() { return iterator(_cont.begin()); } iterator end() { return iterator(_cont.end()); } + reverse_iterator rbegin() { return reverse_iterator(_cont.rbegin()); } + reverse_iterator rend() { return reverse_iterator(_cont.rend()); } const_iterator find(pkgCache::VerIterator const &V) const { return const_iterator(_cont.find(V)); } /** \brief sort all included versions with given comparer @@ -1074,7 +1048,7 @@ APT_IGNORE_DEPRECATED_POP } /*}}}*/ }; /*}}}*/ -// specialisations for push_back containers: std::list & std::vector /*{{{*/ +// various specialisations for VersionContainer /*{{{*/ template<> template void VersionContainer >::insert(VersionContainer const &vercont) { for (typename VersionContainer::const_iterator v = vercont.begin(); v != vercont.end(); ++v) _cont.push_back(*v); @@ -1135,8 +1109,6 @@ template<> inline VersionContainer >::iterator V return end(); } #endif - /*}}}*/ - template<> template inline bool VersionContainer >::sort(Compare Comp) { std::sort(_cont.begin(), _cont.end(), Comp); return true; @@ -1151,6 +1123,7 @@ template<> template inline bool VersionContainer > VersionSet; #if __cplusplus >= 201103L diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h index 2f9c6c269..367a6a75b 100644 --- a/apt-pkg/contrib/macros.h +++ b/apt-pkg/contrib/macros.h @@ -148,6 +148,12 @@ #define APT_IGNORE_DEPRECATED(XXX) XXX #endif +#if __cplusplus >= 201103L + #define APT_OVERRIDE override +#else + #define APT_OVERRIDE /* no c++11 standard */ +#endif + // These lines are extracted by the makefiles and the buildsystem // Increasing MAJOR or MINOR results in the need of recompiling all // reverse-dependencies of libapt-pkg against the new SONAME. -- cgit v1.2.3 From 3b3028467ceccca0b73a8f53051c0fa4de313111 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 9 Jul 2015 00:35:40 +0200 Subject: add c++11 override marker to overridden methods C++11 adds the 'override' specifier to mark that a method is overriding a base class method and error out if not. We hide it in the APT_OVERRIDE macro to ensure that we keep compiling in pre-c++11 standards. Reported-By: clang-modernize -add-override -override-macros Git-Dch: Ignore --- apt-inst/deb/debfile.h | 6 +- apt-inst/extract.h | 6 +- apt-pkg/acquire-item.cc | 4 +- apt-pkg/acquire-item.h | 140 +++++++++++++++--------------- apt-pkg/algorithms.h | 8 +- apt-pkg/cachefilter.h | 46 +++++----- apt-pkg/contrib/md5.h | 2 +- apt-pkg/contrib/progress.h | 5 +- apt-pkg/contrib/sha1.h | 2 +- apt-pkg/contrib/sha2.h | 4 +- apt-pkg/deb/debindexfile.cc | 10 +-- apt-pkg/deb/debindexfile.h | 56 ++++++------ apt-pkg/deb/deblistparser.h | 34 ++++---- apt-pkg/deb/debmetaindex.cc | 6 +- apt-pkg/deb/debmetaindex.h | 34 ++++---- apt-pkg/deb/debrecords.h | 32 +++---- apt-pkg/deb/debsrcrecords.h | 24 ++--- apt-pkg/deb/debsystem.h | 16 ++-- apt-pkg/deb/debversion.h | 4 +- apt-pkg/deb/dpkgpm.h | 12 +-- apt-pkg/depcache.h | 2 +- apt-pkg/edsp/edspindexfile.cc | 2 +- apt-pkg/edsp/edspindexfile.h | 2 +- apt-pkg/edsp/edsplistparser.h | 8 +- apt-pkg/edsp/edspsystem.h | 18 ++-- apt-pkg/indexcopy.h | 16 ++-- apt-pkg/indexfile.h | 8 +- apt-pkg/install-progress.h | 28 +++--- apt-pkg/policy.h | 6 +- apt-pkg/tagfile.h | 2 +- apt-private/acqprogress.h | 18 ++-- apt-private/private-cacheset.h | 16 ++-- apt-private/private-moo.h | 2 + cmdline/apt-cdrom.cc | 8 +- cmdline/apt-extracttemplates.h | 4 +- cmdline/apt-get.cc | 2 +- ftparchive/contents.h | 2 +- ftparchive/writer.h | 8 +- methods/cdrom.cc | 4 +- methods/copy.cc | 2 +- methods/file.cc | 2 +- methods/ftp.cc | 1 - methods/ftp.h | 6 +- methods/gpgv.cc | 4 +- methods/gzip.cc | 4 +- methods/http.h | 34 ++++---- methods/https.h | 34 ++++---- methods/mirror.h | 10 +-- methods/rred.cc | 4 +- methods/rsh.h | 4 +- methods/server.h | 4 +- test/interactive-helper/testdeb.cc | 2 +- test/libapt/acqprogress_test.cc | 4 +- test/libapt/indexcopytosourcelist_test.cc | 8 +- 54 files changed, 368 insertions(+), 362 deletions(-) diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h index 9d286716a..6ad9b7659 100644 --- a/apt-inst/deb/debfile.h +++ b/apt-inst/deb/debfile.h @@ -65,7 +65,7 @@ class debDebFile::ControlExtract : public pkgDirStream { public: - virtual bool DoItem(Item &Itm,int &Fd); + virtual bool DoItem(Item &Itm,int &Fd) APT_OVERRIDE; }; class debDebFile::MemControlExtract : public pkgDirStream @@ -80,10 +80,10 @@ class debDebFile::MemControlExtract : public pkgDirStream std::string Member; // Members from DirStream - virtual bool DoItem(Item &Itm,int &Fd); + virtual bool DoItem(Item &Itm,int &Fd) APT_OVERRIDE; virtual bool Process(Item &Itm,const unsigned char *Data, #if APT_PKG_ABI >= 413 - unsigned long long Size,unsigned long long Pos); + unsigned long long Size,unsigned long long Pos) APT_OVERRIDE; #else unsigned long Size,unsigned long Pos); #endif diff --git a/apt-inst/extract.h b/apt-inst/extract.h index 8ad9ac629..a62ff51bd 100644 --- a/apt-inst/extract.h +++ b/apt-inst/extract.h @@ -38,9 +38,9 @@ class pkgExtract : public pkgDirStream public: - virtual bool DoItem(Item &Itm,int &Fd); - virtual bool Fail(Item &Itm,int Fd); - virtual bool FinishedFile(Item &Itm,int Fd); + virtual bool DoItem(Item &Itm,int &Fd) APT_OVERRIDE; + virtual bool Fail(Item &Itm,int Fd) APT_OVERRIDE; + virtual bool FinishedFile(Item &Itm,int Fd) APT_OVERRIDE; bool Finished(); bool Aborted(); diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index b6466115e..864b93188 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -391,8 +391,8 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ { IndexTarget const Target; public: - virtual std::string DescURI() const {return Target.URI;}; - virtual HashStringList GetExpectedHashes() const {return HashStringList();}; + virtual std::string DescURI() const APT_OVERRIDE {return Target.URI;}; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE {return HashStringList();}; NoActionItem(pkgAcquire * const Owner, IndexTarget const &Target) : pkgAcquire::Item(Owner), Target(Target) diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 93d812248..2349d386c 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -349,7 +349,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ IndexTarget const Target; HashStringList GetExpectedHashesFor(std::string const &MetaKey) const; - bool QueueURI(pkgAcquire::ItemDesc &Item); + bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE; public: /** \brief storge name until a transaction is finished */ @@ -364,10 +364,10 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ }; virtual bool TransactionState(TransactionStates const state); - virtual std::string DescURI() const { return Target.URI; } - virtual HashStringList GetExpectedHashes() const; + virtual std::string DescURI() const APT_OVERRIDE { return Target.URI; } + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; virtual std::string GetMetaKey() const; - virtual bool HashesRequired() const; + virtual bool HashesRequired() const APT_OVERRIDE; pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); @@ -417,7 +417,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ /** \brief Queue the downloaded Signature for verification */ void QueueForSignatureVerify(pkgAcqTransactionItem * const I, std::string const &File, std::string const &Signature); - virtual std::string Custom600Headers() const; + virtual std::string Custom600Headers() const APT_OVERRIDE; /** \brief Called when authentication succeeded. * @@ -440,15 +440,15 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ */ bool VerifyVendor(std::string const &Message); - virtual bool TransactionState(TransactionStates const state); + virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE; public: // This refers more to the Transaction-Manager than the actual file bool IMSHit; - virtual bool QueueURI(pkgAcquire::ItemDesc &Item); - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + virtual bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; // transaction code void Add(pkgAcqTransactionItem * const I); @@ -466,7 +466,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ void TransactionStageRemoval(pkgAcqTransactionItem * const I, const std::string &FinalFile); /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, std::vector const &IndexTargets, @@ -494,13 +494,13 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase void Init(std::string const &URIDesc, std::string const &ShortDesc); public: - virtual std::string DescURI() const; + virtual std::string DescURI() const APT_OVERRIDE; // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual void Finished(); + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual void Finished() APT_OVERRIDE; /** \brief Create a new pkgAcqMetaIndex. */ pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, @@ -531,16 +531,16 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem protected: /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; public: - virtual bool HashesRequired() const { return false; } + virtual bool HashesRequired() const APT_OVERRIDE { return false; } // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; /** \brief Create a new pkgAcqMetaSig. */ pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, @@ -561,10 +561,10 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex metaIndex *MetaIndexParser; metaIndex *LastMetaIndexParser; - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; /** \brief Create a new pkgAcqMetaClearSig. */ pkgAcqMetaClearSig(pkgAcquire * const Owner, @@ -583,7 +583,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem public: /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); @@ -614,19 +614,19 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex std::string Description; /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; - virtual bool QueueURI(pkgAcquire::ItemDesc &Item); + virtual bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE; - virtual bool TransactionState(TransactionStates const state); + virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE; public: // Specialized action members - virtual void Failed(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string DescURI() const {return Target.URI + "Index";}; - virtual std::string Custom600Headers() const; - virtual std::string GetMetaKey() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Target.URI + "Index";}; + virtual std::string Custom600Headers() const APT_OVERRIDE; + virtual std::string GetMetaKey() const APT_OVERRIDE; /** \brief Parse the Index file for a set of Packages diffs. * @@ -724,13 +724,13 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex * This method will fall back to downloading the whole index file * outright; its arguments are ignored. */ - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return Target.URI + "Index";}; - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Target.URI + "Index";}; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; /** \brief Create an index merge-diff item. * @@ -836,14 +836,14 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex * This method will fall back to downloading the whole index file * outright; its arguments are ignored. */ - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return Target.URI + "IndexDiffs";}; - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Target.URI + "IndexDiffs";}; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; /** \brief Create an index diff item. * @@ -928,18 +928,18 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex void ReverifyAfterIMS(); /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; - virtual bool TransactionState(TransactionStates const state); + virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE; public: // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return Desc.URI;}; - virtual std::string GetMetaKey() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Desc.URI;}; + virtual std::string GetMetaKey() const APT_OVERRIDE; pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); @@ -1000,19 +1000,19 @@ class pkgAcqArchive : public pkgAcquire::Item bool QueueNext(); /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; public: - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string DescURI() const; - virtual std::string ShortDesc() const; - virtual void Finished(); - virtual bool IsTrusted() const; - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE; + virtual std::string ShortDesc() const APT_OVERRIDE; + virtual void Finished() APT_OVERRIDE; + virtual bool IsTrusted() const APT_OVERRIDE; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; /** \brief Create a new pkgAcqArchive. * @@ -1053,14 +1053,14 @@ class pkgAcqChangelog : public pkgAcquire::Item public: // we will never have hashes for changelogs. // If you need verified ones, download the deb and extract the changelog. - virtual HashStringList GetExpectedHashes() const { return HashStringList(); } - virtual bool HashesRequired() const { return false; } + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE { return HashStringList(); } + virtual bool HashesRequired() const APT_OVERRIDE { return false; } // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &CalcHashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string DescURI() const {return Desc.URI;}; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Desc.URI;}; /** returns the URI to the changelog of this version * @@ -1172,15 +1172,15 @@ class pkgAcqFile : public pkgAcquire::Item HashStringList const ExpectedHashes; public: - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &CalcHashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string DescURI() const {return Desc.URI;}; - virtual std::string Custom600Headers() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Desc.URI;}; + virtual std::string Custom600Headers() const APT_OVERRIDE; /** \brief Create a new pkgAcqFile object. * diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index d9cce672a..28057fa5c 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -62,7 +62,7 @@ class pkgSimulate : public pkgPackageManager /*{{{*/ pkgDepCache *Cache; public: - virtual VerIterator GetCandidateVer(PkgIterator const &Pkg) + virtual VerIterator GetCandidateVer(PkgIterator const &Pkg) APT_OVERRIDE { return (*Cache)[Pkg].CandidateVerIter(*Cache); } @@ -77,9 +77,9 @@ class pkgSimulate : public pkgPackageManager /*{{{*/ pkgDepCache::ActionGroup group; // The Actuall installation implementation - virtual bool Install(PkgIterator Pkg,std::string File); - virtual bool Configure(PkgIterator Pkg); - virtual bool Remove(PkgIterator Pkg,bool Purge); + virtual bool Install(PkgIterator Pkg,std::string File) APT_OVERRIDE; + virtual bool Configure(PkgIterator Pkg) APT_OVERRIDE; + virtual bool Remove(PkgIterator Pkg,bool Purge) APT_OVERRIDE; private: APT_HIDDEN void ShortBreaks(); diff --git a/apt-pkg/cachefilter.h b/apt-pkg/cachefilter.h index df9e9460a..2719154c1 100644 --- a/apt-pkg/cachefilter.h +++ b/apt-pkg/cachefilter.h @@ -30,33 +30,33 @@ public: class PackageMatcher : public Matcher { public: virtual bool operator() (pkgCache::PkgIterator const &Pkg) = 0; - virtual bool operator() (pkgCache::VerIterator const &Ver) { return (*this)(Ver.ParentPkg()); } - virtual bool operator() (pkgCache::GrpIterator const &/*Grp*/) { return false; } + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE { return (*this)(Ver.ParentPkg()); } + virtual bool operator() (pkgCache::GrpIterator const &/*Grp*/) APT_OVERRIDE { return false; } virtual ~PackageMatcher(); }; // Generica like True, False, NOT, AND, OR /*{{{*/ class TrueMatcher : public Matcher { public: - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; }; class FalseMatcher : public Matcher { public: - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; }; class NOTMatcher : public Matcher { Matcher * const matcher; public: explicit NOTMatcher(Matcher * const matcher); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; virtual ~NOTMatcher(); }; @@ -71,9 +71,9 @@ public: ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4); ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4, Matcher * const matcher5); ANDMatcher& AND(Matcher * const matcher); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; virtual ~ANDMatcher(); }; class ORMatcher : public Matcher { @@ -87,9 +87,9 @@ public: ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4); ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4, Matcher * const matcher5); ORMatcher& OR(Matcher * const matcher); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; virtual ~ORMatcher(); }; /*}}}*/ @@ -97,8 +97,8 @@ class PackageNameMatchesRegEx : public PackageMatcher { /*{{{*/ regex_t* pattern; public: explicit PackageNameMatchesRegEx(std::string const &Pattern); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; virtual ~PackageNameMatchesRegEx(); }; /*}}}*/ @@ -106,8 +106,8 @@ class PackageNameMatchesFnmatch : public PackageMatcher { /*{{{*/ const std::string Pattern; public: explicit PackageNameMatchesFnmatch(std::string const &Pattern); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; virtual ~PackageNameMatchesFnmatch() {}; }; /*}}}*/ @@ -133,7 +133,7 @@ public: */ PackageArchitectureMatchesSpecification(std::string const &pattern, bool const isPattern = true); bool operator() (char const * const &arch); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; virtual ~PackageArchitectureMatchesSpecification(); }; /*}}}*/ @@ -141,7 +141,7 @@ class PackageIsNewInstall : public PackageMatcher { /*{{{*/ pkgCacheFile * const Cache; public: explicit PackageIsNewInstall(pkgCacheFile * const Cache); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; virtual ~PackageIsNewInstall(); }; /*}}}*/ diff --git a/apt-pkg/contrib/md5.h b/apt-pkg/contrib/md5.h index f4992c223..a16ea4d2d 100644 --- a/apt-pkg/contrib/md5.h +++ b/apt-pkg/contrib/md5.h @@ -48,7 +48,7 @@ class MD5Summation : public SummationImplementation public: - bool Add(const unsigned char *inbuf, unsigned long long inlen); + bool Add(const unsigned char *inbuf, unsigned long long inlen) APT_OVERRIDE; using SummationImplementation::Add; MD5SumValue Result(); diff --git a/apt-pkg/contrib/progress.h b/apt-pkg/contrib/progress.h index f7fbc9ccf..427b1bd35 100644 --- a/apt-pkg/contrib/progress.h +++ b/apt-pkg/contrib/progress.h @@ -24,6 +24,7 @@ #include #include +#include #ifndef APT_8_CLEANER_HEADERS using std::string; @@ -74,12 +75,12 @@ class OpTextProgress : public OpProgress bool NoUpdate; bool NoDisplay; unsigned long LastLen; - virtual void Update(); + virtual void Update() APT_OVERRIDE; void Write(const char *S); public: - virtual void Done(); + virtual void Done() APT_OVERRIDE; OpTextProgress(bool NoUpdate = false) : NoUpdate(NoUpdate), NoDisplay(false), LastLen(0) {}; diff --git a/apt-pkg/contrib/sha1.h b/apt-pkg/contrib/sha1.h index 5770c315a..1c5cb5aa1 100644 --- a/apt-pkg/contrib/sha1.h +++ b/apt-pkg/contrib/sha1.h @@ -37,7 +37,7 @@ class SHA1Summation : public SummationImplementation bool Done; public: - bool Add(const unsigned char *inbuf, unsigned long long inlen); + bool Add(const unsigned char *inbuf, unsigned long long inlen) APT_OVERRIDE; using SummationImplementation::Add; SHA1SumValue Result(); diff --git a/apt-pkg/contrib/sha2.h b/apt-pkg/contrib/sha2.h index a25ad4d32..70e8384f2 100644 --- a/apt-pkg/contrib/sha2.h +++ b/apt-pkg/contrib/sha2.h @@ -45,7 +45,7 @@ class SHA256Summation : public SHA2SummationBase unsigned char Sum[32]; public: - bool Add(const unsigned char *inbuf, unsigned long long len) + bool Add(const unsigned char *inbuf, unsigned long long len) APT_OVERRIDE { if (Done) return false; @@ -78,7 +78,7 @@ class SHA512Summation : public SHA2SummationBase unsigned char Sum[64]; public: - bool Add(const unsigned char *inbuf, unsigned long long len) + bool Add(const unsigned char *inbuf, unsigned long long len) APT_OVERRIDE { if (Done) return false; diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index c5086b04b..972feba7f 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -482,7 +482,7 @@ class APT_HIDDEN debIFTypePkg : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -497,7 +497,7 @@ class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -506,7 +506,7 @@ class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE { return new debDebFileRecordParser(File.FileName()); }; @@ -515,7 +515,7 @@ class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type { public: - virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string DscFile) const + virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string DscFile) const APT_OVERRIDE { return new debDscRecordParser(DscFile, NULL); }; @@ -524,7 +524,7 @@ class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDebianSourceDir : public pkgIndexFile::Type { public: - virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string SourceDir) const + virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string SourceDir) const APT_OVERRIDE { return new debDscRecordParser(SourceDir + string("/debian/control"), NULL); }; diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 1de609a7b..71ca22e4d 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -38,14 +38,14 @@ class APT_HIDDEN debStatusIndex : public pkgIndexFile virtual const Type *GetType() const APT_CONST; // Interface for acquire - virtual std::string Describe(bool /*Short*/) const {return File;}; + virtual std::string Describe(bool /*Short*/) const APT_OVERRIDE {return File;}; // Interface for the Cache Generator - virtual bool Exists() const; - virtual bool HasPackages() const {return true;}; - virtual unsigned long Size() const; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; + virtual bool Exists() const APT_OVERRIDE; + virtual bool HasPackages() const APT_OVERRIDE {return true;}; + virtual unsigned long Size() const APT_OVERRIDE; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; debStatusIndex(std::string File); virtual ~debStatusIndex(); @@ -59,12 +59,12 @@ class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile virtual const Type *GetType() const APT_CONST; // Stuff for accessing files on remote items - virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const; + virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const APT_OVERRIDE; // Interface for the Cache Generator - virtual bool HasPackages() const {return true;}; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; + virtual bool HasPackages() const APT_OVERRIDE {return true;}; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; debPackagesIndex(IndexTarget const &Target, bool const Trusted); virtual ~debPackagesIndex(); @@ -78,9 +78,9 @@ class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile virtual const Type *GetType() const APT_CONST; // Interface for the Cache Generator - virtual bool HasPackages() const; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; + virtual bool HasPackages() const APT_OVERRIDE; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; debTranslationsIndex(IndexTarget const &Target); virtual ~debTranslationsIndex(); @@ -95,13 +95,13 @@ class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile // Stuff for accessing files on remote items virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, - pkgSrcRecords::File const &File) const; + pkgSrcRecords::File const &File) const APT_OVERRIDE; // Interface for the record parsers - virtual pkgSrcRecords::Parser *CreateSrcParser() const; + virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; // Interface for the Cache Generator - virtual bool HasPackages() const {return false;}; + virtual bool HasPackages() const APT_OVERRIDE {return false;}; debSourcesIndex(IndexTarget const &Target, bool const Trusted); virtual ~debSourcesIndex(); @@ -117,7 +117,7 @@ class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile public: virtual const Type *GetType() const APT_CONST; - virtual std::string Describe(bool /*Short*/) const { + virtual std::string Describe(bool /*Short*/) const APT_OVERRIDE { return DebFile; } @@ -130,16 +130,16 @@ class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile static bool GetContent(std::ostream &content, std::string const &debfile); // Interface for the Cache Generator - virtual bool Exists() const; - virtual bool HasPackages() const { + virtual bool Exists() const APT_OVERRIDE; + virtual bool HasPackages() const APT_OVERRIDE { return true; }; - virtual unsigned long Size() const; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; + virtual unsigned long Size() const APT_OVERRIDE; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; // Interface for acquire - virtual std::string ArchiveURI(std::string /*File*/) const; + virtual std::string ArchiveURI(std::string /*File*/) const APT_OVERRIDE; debDebPkgFileIndex(std::string DebFile); virtual ~debDebPkgFileIndex(); @@ -152,11 +152,11 @@ class APT_HIDDEN debDscFileIndex : public pkgIndexFile std::string DscFile; public: virtual const Type *GetType() const APT_CONST; - virtual pkgSrcRecords::Parser *CreateSrcParser() const; - virtual bool Exists() const; - virtual bool HasPackages() const {return false;}; - virtual unsigned long Size() const; - virtual std::string Describe(bool /*Short*/) const { + virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; + virtual bool Exists() const APT_OVERRIDE; + virtual bool HasPackages() const APT_OVERRIDE {return false;}; + virtual unsigned long Size() const APT_OVERRIDE; + virtual std::string Describe(bool /*Short*/) const APT_OVERRIDE { return DscFile; }; diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 3fd040bdd..4bc3c2341 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -62,24 +62,24 @@ class APT_HIDDEN debListParser : public pkgCacheGenerator::ListParser APT_PUBLIC static unsigned char GetPrio(std::string Str); // These all operate against the current section - virtual std::string Package(); - virtual std::string Architecture(); - virtual bool ArchitectureAll(); - virtual std::string Version(); - virtual bool NewVersion(pkgCache::VerIterator &Ver); - virtual std::string Description(std::string const &lang); - virtual std::vector AvailableDescriptionLanguages(); - virtual MD5SumValue Description_md5(); - virtual unsigned short VersionHash(); + virtual std::string Package() APT_OVERRIDE; + virtual std::string Architecture() APT_OVERRIDE; + virtual bool ArchitectureAll() APT_OVERRIDE; + virtual std::string Version() APT_OVERRIDE; + virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; + virtual std::string Description(std::string const &lang) APT_OVERRIDE; + virtual std::vector AvailableDescriptionLanguages() APT_OVERRIDE; + virtual MD5SumValue Description_md5() APT_OVERRIDE; + virtual unsigned short VersionHash() APT_OVERRIDE; #if APT_PKG_ABI >= 413 - virtual bool SameVersion(unsigned short const Hash, pkgCache::VerIterator const &Ver); + virtual bool SameVersion(unsigned short const Hash, pkgCache::VerIterator const &Ver) APT_OVERRIDE; #endif virtual bool UsePackage(pkgCache::PkgIterator &Pkg, - pkgCache::VerIterator &Ver); - virtual map_filesize_t Offset() {return iOffset;}; - virtual map_filesize_t Size() {return Section.size();}; + pkgCache::VerIterator &Ver) APT_OVERRIDE; + virtual map_filesize_t Offset() APT_OVERRIDE {return iOffset;}; + virtual map_filesize_t Size() APT_OVERRIDE {return Section.size();}; - virtual bool Step(); + virtual bool Step() APT_OVERRIDE; bool LoadReleaseInfo(pkgCache::RlsFileIterator &FileI,FileFd &File, std::string const §ion); @@ -111,15 +111,15 @@ class APT_HIDDEN debDebFileParser : public debListParser public: debDebFileParser(FileFd *File, std::string const &DebFile); virtual bool UsePackage(pkgCache::PkgIterator &Pkg, - pkgCache::VerIterator &Ver); + pkgCache::VerIterator &Ver) APT_OVERRIDE; }; class APT_HIDDEN debTranslationsParser : public debListParser { public: // a translation can never be a real package - virtual std::string Architecture() { return ""; } - virtual std::string Version() { return ""; } + virtual std::string Architecture() APT_OVERRIDE { return ""; } + virtual std::string Version() APT_OVERRIDE { return ""; } debTranslationsParser(FileFd *File, std::string const &Arch = "") : debListParser(File, Arch) {}; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 10ab0f844..46a7181fc 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -758,7 +758,7 @@ class APT_HIDDEN debSLTypeDeb : public debSLTypeDebian /*{{{*/ bool CreateItem(std::vector &List, std::string const &URI, std::string const &Dist, std::string const &Section, - std::map const &Options) const + std::map const &Options) const APT_OVERRIDE { return CreateItemInternal(List, URI, Dist, Section, false, Options); } @@ -774,7 +774,7 @@ class APT_HIDDEN debSLTypeDebSrc : public debSLTypeDebian /*{{{*/ bool CreateItem(std::vector &List, std::string const &URI, std::string const &Dist, std::string const &Section, - std::map const &Options) const + std::map const &Options) const APT_OVERRIDE { return CreateItemInternal(List, URI, Dist, Section, true, Options); } @@ -800,7 +800,7 @@ class APT_HIDDEN debSLTypeDebFile : public pkgSourceList::Type /*{{{*/ bool CreateItem(std::vector &List, std::string const &URI, std::string const &/*Dist*/, std::string const &/*Section*/, - std::map const &/*Options*/) const + std::map const &/*Options*/) const APT_OVERRIDE { metaIndex *mi = new debDebFileMetaIndex(URI); List.push_back(mi); diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index bf5b7c1ce..8c13237cb 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -39,18 +39,18 @@ class APT_HIDDEN debReleaseIndex : public metaIndex debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted); virtual ~debReleaseIndex(); - virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; - virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false); - virtual std::vector GetIndexTargets() const; + virtual std::string ArchiveURI(std::string const &File) const APT_OVERRIDE {return URI + File;}; + virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) APT_OVERRIDE; + virtual std::vector GetIndexTargets() const APT_OVERRIDE; - virtual std::string Describe() const; - virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; + virtual std::string Describe() const APT_OVERRIDE; + virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const APT_OVERRIDE; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; - virtual bool Load(std::string const &Filename, std::string * const ErrorText); - virtual metaIndex * UnloadedClone() const; + virtual bool Load(std::string const &Filename, std::string * const ErrorText) APT_OVERRIDE; + virtual metaIndex * UnloadedClone() const APT_OVERRIDE; - virtual std::vector *GetIndexFiles(); + virtual std::vector *GetIndexFiles() APT_OVERRIDE; bool SetTrusted(TriState const Trusted); bool SetCheckValidUntil(TriState const Trusted); @@ -58,7 +58,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex bool SetValidUntilMax(time_t const Valid); bool SetSignedBy(std::string const &SignedBy); - virtual bool IsTrusted() const; + virtual bool IsTrusted() const APT_OVERRIDE; void AddComponent(bool const isSrc, std::string const &Name, std::vector const &Targets, @@ -73,29 +73,29 @@ private: std::string DebFile; debDebPkgFileIndex *DebIndex; public: - virtual std::string ArchiveURI(std::string const& /*File*/) const { + virtual std::string ArchiveURI(std::string const& /*File*/) const APT_OVERRIDE { return DebFile; } - virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) { + virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) APT_OVERRIDE { return true; } - virtual std::vector GetIndexTargets() const { + virtual std::vector GetIndexTargets() const APT_OVERRIDE { return std::vector(); } - virtual std::vector *GetIndexFiles() { + virtual std::vector *GetIndexFiles() APT_OVERRIDE { return Indexes; } - virtual bool IsTrusted() const { + virtual bool IsTrusted() const APT_OVERRIDE { return true; } - virtual bool Load(std::string const &, std::string * const ErrorText) + virtual bool Load(std::string const &, std::string * const ErrorText) APT_OVERRIDE { LoadedSuccessfully = TRI_NO; if (ErrorText != NULL) strprintf(*ErrorText, "Unparseable metaindex as it represents the standalone deb file %s", DebFile.c_str()); return false; } - virtual metaIndex * UnloadedClone() const + virtual metaIndex * UnloadedClone() const APT_OVERRIDE { return NULL; } diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h index 4d0b713d4..7fc82a88d 100644 --- a/apt-pkg/deb/debrecords.h +++ b/apt-pkg/deb/debrecords.h @@ -33,23 +33,23 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser public: // These refer to the archive file for the Version - virtual std::string FileName(); - virtual std::string SourcePkg(); - virtual std::string SourceVer(); + virtual std::string FileName() APT_OVERRIDE; + virtual std::string SourcePkg() APT_OVERRIDE; + virtual std::string SourceVer() APT_OVERRIDE; - virtual HashStringList Hashes() const; + virtual HashStringList Hashes() const APT_OVERRIDE; // These are some general stats about the package - virtual std::string Maintainer(); - virtual std::string ShortDesc(std::string const &lang); - virtual std::string LongDesc(std::string const &lang); - virtual std::string Name(); - virtual std::string Homepage(); + virtual std::string Maintainer() APT_OVERRIDE; + virtual std::string ShortDesc(std::string const &lang) APT_OVERRIDE; + virtual std::string LongDesc(std::string const &lang) APT_OVERRIDE; + virtual std::string Name() APT_OVERRIDE; + virtual std::string Homepage() APT_OVERRIDE; // An arbitrary custom field - virtual std::string RecordField(const char *fieldName); + virtual std::string RecordField(const char *fieldName) APT_OVERRIDE; - virtual void GetRec(const char *&Start,const char *&Stop); + virtual void GetRec(const char *&Start,const char *&Stop) APT_OVERRIDE; debRecordParserBase(); virtual ~debRecordParserBase(); @@ -62,8 +62,8 @@ class APT_HIDDEN debRecordParser : public debRecordParserBase FileFd File; pkgTagFile Tags; - virtual bool Jump(pkgCache::VerFileIterator const &Ver); - virtual bool Jump(pkgCache::DescFileIterator const &Desc); + virtual bool Jump(pkgCache::VerFileIterator const &Ver) APT_OVERRIDE; + virtual bool Jump(pkgCache::DescFileIterator const &Desc) APT_OVERRIDE; public: debRecordParser(std::string FileName,pkgCache &Cache); @@ -80,11 +80,11 @@ class APT_HIDDEN debDebFileRecordParser : public debRecordParserBase APT_HIDDEN bool LoadContent(); protected: // single file files, so no jumping whatsoever - bool Jump(pkgCache::VerFileIterator const &); - bool Jump(pkgCache::DescFileIterator const &); + bool Jump(pkgCache::VerFileIterator const &) APT_OVERRIDE; + bool Jump(pkgCache::DescFileIterator const &) APT_OVERRIDE; public: - virtual std::string FileName(); + virtual std::string FileName() APT_OVERRIDE; debDebFileRecordParser(std::string FileName); virtual ~debDebFileRecordParser(); diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h index 64b07a1ec..89134af5f 100644 --- a/apt-pkg/deb/debsrcrecords.h +++ b/apt-pkg/deb/debsrcrecords.h @@ -36,24 +36,24 @@ class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser public: - virtual bool Restart() {return Jump(0);}; - virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);}; - virtual bool Jump(unsigned long const &Off) {iOffset = Off; return Tags.Jump(Sect,Off);}; + virtual bool Restart() APT_OVERRIDE {return Jump(0);}; + virtual bool Step() APT_OVERRIDE {iOffset = Tags.Offset(); return Tags.Step(Sect);}; + virtual bool Jump(unsigned long const &Off) APT_OVERRIDE {iOffset = Off; return Tags.Jump(Sect,Off);}; - virtual std::string Package() const {return Sect.FindS("Package");}; - virtual std::string Version() const {return Sect.FindS("Version");}; - virtual std::string Maintainer() const {return Sect.FindS("Maintainer");}; - virtual std::string Section() const {return Sect.FindS("Section");}; - virtual const char **Binaries(); - virtual bool BuildDepends(std::vector &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true); - virtual unsigned long Offset() {return iOffset;}; - virtual std::string AsStr() + virtual std::string Package() const APT_OVERRIDE {return Sect.FindS("Package");}; + virtual std::string Version() const APT_OVERRIDE {return Sect.FindS("Version");}; + virtual std::string Maintainer() const APT_OVERRIDE {return Sect.FindS("Maintainer");}; + virtual std::string Section() const APT_OVERRIDE {return Sect.FindS("Section");}; + virtual const char **Binaries() APT_OVERRIDE; + virtual bool BuildDepends(std::vector &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) APT_OVERRIDE; + virtual unsigned long Offset() APT_OVERRIDE {return iOffset;}; + virtual std::string AsStr() APT_OVERRIDE { const char *Start=0,*Stop=0; Sect.GetSection(Start,Stop); return std::string(Start,Stop); }; - virtual bool Files(std::vector &F); + virtual bool Files(std::vector &F) APT_OVERRIDE; bool Files2(std::vector &F); debSrcRecordParser(std::string const &File,pkgIndexFile const *Index); diff --git a/apt-pkg/deb/debsystem.h b/apt-pkg/deb/debsystem.h index e59bbebed..aed77520e 100644 --- a/apt-pkg/deb/debsystem.h +++ b/apt-pkg/deb/debsystem.h @@ -33,15 +33,15 @@ class debSystem : public pkgSystem public: - virtual bool Lock(); - virtual bool UnLock(bool NoErrors = false); - virtual pkgPackageManager *CreatePM(pkgDepCache *Cache) const; - virtual bool Initialize(Configuration &Cnf); - virtual bool ArchiveSupported(const char *Type); - virtual signed Score(Configuration const &Cnf); - virtual bool AddStatusFiles(std::vector &List); + virtual bool Lock() APT_OVERRIDE; + virtual bool UnLock(bool NoErrors = false) APT_OVERRIDE; + virtual pkgPackageManager *CreatePM(pkgDepCache *Cache) const APT_OVERRIDE; + virtual bool Initialize(Configuration &Cnf) APT_OVERRIDE; + virtual bool ArchiveSupported(const char *Type) APT_OVERRIDE; + virtual signed Score(Configuration const &Cnf) APT_OVERRIDE; + virtual bool AddStatusFiles(std::vector &List) APT_OVERRIDE; virtual bool FindIndex(pkgCache::PkgFileIterator File, - pkgIndexFile *&Found) const; + pkgIndexFile *&Found) const APT_OVERRIDE; debSystem(); virtual ~debSystem(); diff --git a/apt-pkg/deb/debversion.h b/apt-pkg/deb/debversion.h index 7befe6372..6d7eca7c1 100644 --- a/apt-pkg/deb/debversion.h +++ b/apt-pkg/deb/debversion.h @@ -27,11 +27,11 @@ class debVersioningSystem : public pkgVersioningSystem const char *B,const char *Bend) APT_PURE; virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) APT_PURE; virtual APT_PURE int DoCmpReleaseVer(const char *A,const char *Aend, - const char *B,const char *Bend) + const char *B,const char *Bend) APT_OVERRIDE { return DoCmpVersion(A,Aend,B,Bend); } - virtual std::string UpstreamVersion(const char *A); + virtual std::string UpstreamVersion(const char *A) APT_OVERRIDE; debVersioningSystem(); }; diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h index a1b36c6c0..82c1bef5d 100644 --- a/apt-pkg/deb/dpkgpm.h +++ b/apt-pkg/deb/dpkgpm.h @@ -120,14 +120,14 @@ class pkgDPkgPM : public pkgPackageManager void ProcessDpkgStatusLine(char *line); // The Actuall installation implementation - virtual bool Install(PkgIterator Pkg,std::string File); - virtual bool Configure(PkgIterator Pkg); - virtual bool Remove(PkgIterator Pkg,bool Purge = false); + virtual bool Install(PkgIterator Pkg,std::string File) APT_OVERRIDE; + virtual bool Configure(PkgIterator Pkg) APT_OVERRIDE; + virtual bool Remove(PkgIterator Pkg,bool Purge = false) APT_OVERRIDE; - virtual bool Go(APT::Progress::PackageManager *progress); - virtual bool Go(int StatusFd=-1); + virtual bool Go(APT::Progress::PackageManager *progress) APT_OVERRIDE; + virtual bool Go(int StatusFd=-1) APT_OVERRIDE; - virtual void Reset(); + virtual void Reset() APT_OVERRIDE; public: diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 40a2fcaab..2c3304ba8 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -204,7 +204,7 @@ class pkgDepCache : protected pkgCache::Namespace DefaultRootSetFunc() : Configuration::MatchAgainstConfig("APT::NeverAutoRemove") {}; virtual ~DefaultRootSetFunc() {}; - bool InRootSet(const pkgCache::PkgIterator &pkg) { return pkg.end() == false && Match(pkg.Name()); }; + bool InRootSet(const pkgCache::PkgIterator &pkg) APT_OVERRIDE { return pkg.end() == false && Match(pkg.Name()); }; }; struct StateCache diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index 3bffc27e9..649d94b5d 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -67,7 +67,7 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const class APT_HIDDEN edspIFType: public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator) const + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator) const APT_OVERRIDE { // we don't have a record parser for this type as the file is not presistent return NULL; diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h index 265a016c5..b2a510f14 100644 --- a/apt-pkg/edsp/edspindexfile.h +++ b/apt-pkg/edsp/edspindexfile.h @@ -27,7 +27,7 @@ class APT_HIDDEN edspIndex : public debStatusIndex virtual const Type *GetType() const APT_CONST; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; edspIndex(std::string File); virtual ~edspIndex(); diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index 98dde4bf5..2a09e8c47 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -29,11 +29,11 @@ class APT_HIDDEN edspListParser : public debListParser { void * const d; public: - virtual bool NewVersion(pkgCache::VerIterator &Ver); + virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; virtual std::string Description(); virtual std::string DescriptionLanguage(); - virtual MD5SumValue Description_md5(); - virtual unsigned short VersionHash(); + virtual MD5SumValue Description_md5() APT_OVERRIDE; + virtual unsigned short VersionHash() APT_OVERRIDE; bool LoadReleaseInfo(pkgCache::RlsFileIterator &FileI,FileFd &File, std::string const §ion); @@ -42,7 +42,7 @@ class APT_HIDDEN edspListParser : public debListParser virtual ~edspListParser(); protected: - virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver); + virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver) APT_OVERRIDE; }; diff --git a/apt-pkg/edsp/edspsystem.h b/apt-pkg/edsp/edspsystem.h index 156b02bb5..ec42bef75 100644 --- a/apt-pkg/edsp/edspsystem.h +++ b/apt-pkg/edsp/edspsystem.h @@ -16,6 +16,8 @@ #include +#include + class Configuration; class pkgDepCache; class pkgIndexFile; @@ -31,15 +33,15 @@ class APT_HIDDEN edspSystem : public pkgSystem public: - virtual bool Lock() APT_CONST; - virtual bool UnLock(bool NoErrors = false) APT_CONST; - virtual pkgPackageManager *CreatePM(pkgDepCache *Cache) const APT_CONST; - virtual bool Initialize(Configuration &Cnf); - virtual bool ArchiveSupported(const char *Type) APT_CONST; - virtual signed Score(Configuration const &Cnf); - virtual bool AddStatusFiles(std::vector &List); + virtual bool Lock() APT_OVERRIDE APT_CONST; + virtual bool UnLock(bool NoErrors = false) APT_OVERRIDE APT_CONST; + virtual pkgPackageManager *CreatePM(pkgDepCache *Cache) const APT_OVERRIDE APT_CONST; + virtual bool Initialize(Configuration &Cnf) APT_OVERRIDE; + virtual bool ArchiveSupported(const char *Type) APT_OVERRIDE APT_CONST; + virtual signed Score(Configuration const &Cnf) APT_OVERRIDE; + virtual bool AddStatusFiles(std::vector &List) APT_OVERRIDE; virtual bool FindIndex(pkgCache::PkgFileIterator File, - pkgIndexFile *&Found) const; + pkgIndexFile *&Found) const APT_OVERRIDE; edspSystem(); virtual ~edspSystem(); diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index 6eecad028..316672e1d 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -62,10 +62,10 @@ class PackageCopy : public IndexCopy /*{{{*/ void * const d; protected: - virtual bool GetFile(std::string &Filename,unsigned long long &Size); - virtual bool RewriteEntry(FileFd &Target, std::string const &File); - virtual const char *GetFileName() {return "Packages";}; - virtual const char *Type() {return "Package";}; + virtual bool GetFile(std::string &Filename,unsigned long long &Size) APT_OVERRIDE; + virtual bool RewriteEntry(FileFd &Target, std::string const &File) APT_OVERRIDE; + virtual const char *GetFileName() APT_OVERRIDE {return "Packages";}; + virtual const char *Type() APT_OVERRIDE {return "Package";}; public: PackageCopy(); @@ -77,10 +77,10 @@ class SourceCopy : public IndexCopy /*{{{*/ void * const d; protected: - virtual bool GetFile(std::string &Filename,unsigned long long &Size); - virtual bool RewriteEntry(FileFd &Target, std::string const &File); - virtual const char *GetFileName() {return "Sources";}; - virtual const char *Type() {return "Source";}; + virtual bool GetFile(std::string &Filename,unsigned long long &Size) APT_OVERRIDE; + virtual bool RewriteEntry(FileFd &Target, std::string const &File) APT_OVERRIDE; + virtual const char *GetFileName() APT_OVERRIDE {return "Sources";}; + virtual const char *Type() APT_OVERRIDE {return "Source";}; public: SourceCopy(); diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 44d39110d..5be7794bf 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -160,10 +160,10 @@ protected: std::string IndexFileName() const; public: - virtual std::string ArchiveURI(std::string File) const; - virtual std::string Describe(bool Short = false) const; - virtual bool Exists() const; - virtual unsigned long Size() const; + virtual std::string ArchiveURI(std::string File) const APT_OVERRIDE; + virtual std::string Describe(bool Short = false) const APT_OVERRIDE; + virtual bool Exists() const APT_OVERRIDE; + virtual unsigned long Size() const APT_OVERRIDE; pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted); virtual ~pkgIndexTargetFile(); diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h index 07fc15fd8..ee03ac217 100644 --- a/apt-pkg/install-progress.h +++ b/apt-pkg/install-progress.h @@ -72,21 +72,21 @@ namespace Progress { explicit PackageManagerProgressFd(int progress_fd); virtual ~PackageManagerProgressFd(); - virtual void StartDpkg(); - virtual void Stop(); + virtual void StartDpkg() APT_OVERRIDE; + virtual void Stop() APT_OVERRIDE; virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string HumanReadableAction); + std::string HumanReadableAction) APT_OVERRIDE; virtual void Error(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string ErrorMessage); + std::string ErrorMessage) APT_OVERRIDE; virtual void ConffilePrompt(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string ConfMessage); + std::string ConfMessage) APT_OVERRIDE; }; @@ -103,21 +103,21 @@ namespace Progress { explicit PackageManagerProgressDeb822Fd(int progress_fd); virtual ~PackageManagerProgressDeb822Fd(); - virtual void StartDpkg(); - virtual void Stop(); + virtual void StartDpkg() APT_OVERRIDE; + virtual void Stop() APT_OVERRIDE; virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string HumanReadableAction); + std::string HumanReadableAction) APT_OVERRIDE; virtual void Error(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string ErrorMessage); + std::string ErrorMessage) APT_OVERRIDE; virtual void ConffilePrompt(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string ConfMessage); + std::string ConfMessage) APT_OVERRIDE; }; class PackageManagerFancy : public PackageManager @@ -144,12 +144,12 @@ namespace Progress { public: PackageManagerFancy(); virtual ~PackageManagerFancy(); - virtual void Start(int child_pty=-1); - virtual void Stop(); + virtual void Start(int child_pty=-1) APT_OVERRIDE; + virtual void Stop() APT_OVERRIDE; virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string HumanReadableAction); + std::string HumanReadableAction) APT_OVERRIDE; // return a progress bar of the given size for the given progress // percent between 0.0 and 1.0 in the form "[####...]" @@ -163,7 +163,7 @@ namespace Progress { virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string HumanReadableAction); + std::string HumanReadableAction) APT_OVERRIDE; PackageManagerText(); virtual ~PackageManagerText(); diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index 58b062a7b..b3e1ec6b1 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -78,10 +78,10 @@ class pkgPolicy : public pkgDepCache::Policy pkgCache::VerIterator GetMatch(pkgCache::PkgIterator const &Pkg); // Things for the cache interface. - virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg); - virtual signed short GetPriority(pkgCache::PkgIterator const &Pkg); + virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual signed short GetPriority(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; virtual signed short GetPriority(pkgCache::VerIterator const &Pkg); - virtual signed short GetPriority(pkgCache::PkgFileIterator const &File); + virtual signed short GetPriority(pkgCache::PkgFileIterator const &File) APT_OVERRIDE; bool InitDefaults(); diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 81fff89f0..77a84c832 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -147,7 +147,7 @@ class pkgTagSection for being a bit slower to allow comments and new lines all over the place */ class pkgUserTagSection : public pkgTagSection { - virtual void TrimRecord(bool BeforeRecord, const char* &End); + virtual void TrimRecord(bool BeforeRecord, const char* &End) APT_OVERRIDE; }; class pkgTagFilePrivate; diff --git a/apt-private/acqprogress.h b/apt-private/acqprogress.h index cbb06fbec..6b6d555b1 100644 --- a/apt-private/acqprogress.h +++ b/apt-private/acqprogress.h @@ -28,15 +28,15 @@ class APT_PUBLIC AcqTextStatus : public pkgAcquireStatus public: - virtual bool MediaChange(std::string Media,std::string Drive); - virtual void IMSHit(pkgAcquire::ItemDesc &Itm); - virtual void Fetch(pkgAcquire::ItemDesc &Itm); - virtual void Done(pkgAcquire::ItemDesc &Itm); - virtual void Fail(pkgAcquire::ItemDesc &Itm); - virtual void Start(); - virtual void Stop(); - - bool Pulse(pkgAcquire *Owner); + virtual bool MediaChange(std::string Media,std::string Drive) APT_OVERRIDE; + virtual void IMSHit(pkgAcquire::ItemDesc &Itm) APT_OVERRIDE; + virtual void Fetch(pkgAcquire::ItemDesc &Itm) APT_OVERRIDE; + virtual void Done(pkgAcquire::ItemDesc &Itm) APT_OVERRIDE; + virtual void Fail(pkgAcquire::ItemDesc &Itm) APT_OVERRIDE; + virtual void Start() APT_OVERRIDE; + virtual void Stop() APT_OVERRIDE; + + bool Pulse(pkgAcquire *Owner) APT_OVERRIDE; AcqTextStatus(std::ostream &out, unsigned int &ScreenWidth,unsigned int const Quiet); }; diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h index 0eb22b788..518f179f3 100644 --- a/apt-private/private-cacheset.h +++ b/apt-private/private-cacheset.h @@ -81,13 +81,13 @@ class CacheSetHelperVirtuals: public APT::CacheSetHelper { public: APT::PackageSet virtualPkgs; - virtual pkgCache::VerIterator canNotGetVersion(enum CacheSetHelper::VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { + virtual pkgCache::VerIterator canNotGetVersion(enum CacheSetHelper::VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { if (select == NEWEST || select == CANDIDATE || select == ALL) virtualPkgs.insert(Pkg); return CacheSetHelper::canNotGetVersion(select, Cache, Pkg); } - virtual void canNotFindVersion(enum CacheSetHelper::VerSelector const select, APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { + virtual void canNotFindVersion(enum CacheSetHelper::VerSelector const select, APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { if (select == NEWEST || select == CANDIDATE || select == ALL) virtualPkgs.insert(Pkg); return CacheSetHelper::canNotFindVersion(select, vci, Cache, Pkg); @@ -113,23 +113,23 @@ public: explicitlyNamed = true; } - virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) { + virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE { ioprintf(out, _("Note, selecting '%s' for task '%s'\n"), Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } - virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) { + virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE { ioprintf(out, _("Note, selecting '%s' for glob '%s'\n"), Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } - virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) { + virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE { ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"), Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } virtual void showSelectedVersion(pkgCache::PkgIterator const &/*Pkg*/, pkgCache::VerIterator const Ver, - std::string const &ver, bool const /*verIsRel*/) { + std::string const &ver, bool const /*verIsRel*/) APT_OVERRIDE { if (ver == Ver.VerStr()) return; selectedByRelease.push_back(make_pair(Ver, ver)); @@ -191,7 +191,7 @@ public: return false; } - virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { + virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::CANDIDATE); if (verset.empty() == false) return *(verset.begin()); @@ -202,7 +202,7 @@ public: return pkgCache::VerIterator(Cache, 0); } - virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { + virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { if (Pkg->ProvidesList != 0) { APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::NEWEST); diff --git a/apt-private/private-moo.h b/apt-private/private-moo.h index b8e1cfed6..bc8b3e7dd 100644 --- a/apt-private/private-moo.h +++ b/apt-private/private-moo.h @@ -1,6 +1,8 @@ #ifndef APT_PRIVATE_MOO_H #define APT_PRIVATE_MOO_H +#include + class CommandLine; APT_PUBLIC bool DoMoo(CommandLine &CmdL); diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index d95c169cd..c0541d196 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -44,12 +44,12 @@ protected: OpTextProgress Progress; void Prompt(const char *Text); string PromptLine(const char *Text); - bool AskCdromName(string &name); + bool AskCdromName(string &name) APT_OVERRIDE; public: - virtual void Update(string text, int current); - virtual bool ChangeCdrom(); - virtual OpProgress* GetOpProgress(); + virtual void Update(string text, int current) APT_OVERRIDE; + virtual bool ChangeCdrom() APT_OVERRIDE; + virtual OpProgress* GetOpProgress() APT_OVERRIDE; }; void pkgCdromTextStatus::Prompt(const char *Text) diff --git a/cmdline/apt-extracttemplates.h b/cmdline/apt-extracttemplates.h index b129a2d51..91e385e70 100644 --- a/cmdline/apt-extracttemplates.h +++ b/cmdline/apt-extracttemplates.h @@ -26,9 +26,9 @@ class DebFile : public pkgDirStream public: explicit DebFile(const char *FileName); ~DebFile(); - bool DoItem(Item &I, int &fd); + bool DoItem(Item &I, int &fd) APT_OVERRIDE; bool Process(pkgDirStream::Item &I, const unsigned char *data, - unsigned long long size, unsigned long long pos); + unsigned long long size, unsigned long long pos) APT_OVERRIDE; bool Go(); bool ParseInfo(); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 10d4b3cc5..9232e1505 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -572,7 +572,7 @@ static bool DoClean(CommandLine &) class LogCleaner : public pkgArchiveCleaner { protected: - virtual void Erase(const char *File,string Pkg,string Ver,struct stat &St) + virtual void Erase(const char *File,string Pkg,string Ver,struct stat &St) APT_OVERRIDE { c1out << "Del " << Pkg << " " << Ver << " [" << SizeToStr(St.st_size) << "B]" << endl; diff --git a/ftparchive/contents.h b/ftparchive/contents.h index 953d0d54b..bc691d473 100644 --- a/ftparchive/contents.h +++ b/ftparchive/contents.h @@ -81,7 +81,7 @@ class ContentsExtract : public pkgDirStream bool Read(debDebFile &Deb); - virtual bool DoItem(Item &Itm,int &Fd); + virtual bool DoItem(Item &Itm,int &Fd) APT_OVERRIDE; void Reset() {CurSize = 0;}; bool TakeContents(const void *Data,unsigned long long Length); void Add(GenContents &Contents,std::string const &Package); diff --git a/ftparchive/writer.h b/ftparchive/writer.h index b9c1f672a..98012beee 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -120,7 +120,7 @@ class PackagesWriter : public FTWScanner inline bool ReadOverride(string const &File) {return Over.ReadOverride(File);}; inline bool ReadExtraOverride(string const &File) {return Over.ReadExtraOverride(File);}; - virtual bool DoPackage(string FileName); + virtual bool DoPackage(string FileName) APT_OVERRIDE; PackagesWriter(FileFd * const Output, TranslationWriter * const TransWriter, string const &DB, string const &Overrides, @@ -142,7 +142,7 @@ class ContentsWriter : public FTWScanner string Prefix; bool DoPackage(string FileName,string Package); - virtual bool DoPackage(string FileName) + virtual bool DoPackage(string FileName) APT_OVERRIDE {return DoPackage(FileName,string());}; bool ReadFromPkgs(string const &PkgFile,string const &PkgCompress); @@ -171,7 +171,7 @@ class SourcesWriter : public FTWScanner string DirStrip; struct CacheDB::Stats &Stats; - virtual bool DoPackage(string FileName); + virtual bool DoPackage(string FileName) APT_OVERRIDE; SourcesWriter(FileFd * const Output, string const &DB,string const &BOverrides,string const &SOverrides, string const &ExtOverrides=string()); @@ -182,7 +182,7 @@ class ReleaseWriter : public FTWScanner { public: ReleaseWriter(FileFd * const Output, string const &DB); - virtual bool DoPackage(string FileName); + virtual bool DoPackage(string FileName) APT_OVERRIDE; void Finish(); // General options diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 67265cfa3..d9ddecb6a 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -42,9 +42,9 @@ class CDROMMethod : public pkgAcqMethod bool IsCorrectCD(URI want, string MountPath, string& NewID); bool AutoDetectAndMount(const URI, string &NewID); - virtual bool Fetch(FetchItem *Itm); + virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; string GetID(string Name); - virtual void Exit(); + virtual void Exit() APT_OVERRIDE; public: diff --git a/methods/copy.cc b/methods/copy.cc index 4bdc15f75..0c9f322e6 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -27,7 +27,7 @@ class CopyMethod : public pkgAcqMethod { - virtual bool Fetch(FetchItem *Itm); + virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; void CalculateHashes(FetchItem const * const Itm, FetchResult &Res); public: diff --git a/methods/file.cc b/methods/file.cc index 5c76ec122..40e85bce5 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -30,7 +30,7 @@ class FileMethod : public pkgAcqMethod { - virtual bool Fetch(FetchItem *Itm); + virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; public: diff --git a/methods/ftp.cc b/methods/ftp.cc index 92d8573f1..5fee20f23 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -39,7 +39,6 @@ // Internet stuff #include -#include #include #include diff --git a/methods/ftp.h b/methods/ftp.h index 2efd28ec6..2c4e9f57a 100644 --- a/methods/ftp.h +++ b/methods/ftp.h @@ -10,8 +10,10 @@ #ifndef APT_FTP_H #define APT_FTP_H +#include #include +#include #include #include #include @@ -71,8 +73,8 @@ class FTPConn class FtpMethod : public pkgAcqMethod { - virtual bool Fetch(FetchItem *Itm); - virtual bool Configuration(std::string Message); + virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; + virtual bool Configuration(std::string Message) APT_OVERRIDE; FTPConn *Server; diff --git a/methods/gpgv.cc b/methods/gpgv.cc index d88a06789..490833d8c 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -46,8 +46,8 @@ class GPGVMethod : public pkgAcqMethod vector &NoPubKeySigners); protected: - virtual bool URIAcquire(std::string const &Message, FetchItem *Itm); - virtual bool Configuration(string Message); + virtual bool URIAcquire(std::string const &Message, FetchItem *Itm) APT_OVERRIDE; + virtual bool Configuration(string Message) APT_OVERRIDE; public: GPGVMethod() : pkgAcqMethod("1.0",SingleInstance | SendConfig) {}; diff --git a/methods/gzip.cc b/methods/gzip.cc index 65519633c..637aae124 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -32,8 +32,8 @@ const char *Prog; class GzipMethod : public pkgAcqMethod { - virtual bool Fetch(FetchItem *Itm); - virtual bool Configuration(std::string Message); + virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; + virtual bool Configuration(std::string Message) APT_OVERRIDE; public: diff --git a/methods/http.h b/methods/http.h index e73871931..da6139b02 100644 --- a/methods/http.h +++ b/methods/http.h @@ -99,23 +99,23 @@ struct HttpServerState: public ServerState int ServerFd; protected: - virtual bool ReadHeaderLines(std::string &Data); - virtual bool LoadNextResponse(bool const ToFile, FileFd * const File); - virtual bool WriteResponse(std::string const &Data); + virtual bool ReadHeaderLines(std::string &Data) APT_OVERRIDE; + virtual bool LoadNextResponse(bool const ToFile, FileFd * const File) APT_OVERRIDE; + virtual bool WriteResponse(std::string const &Data) APT_OVERRIDE; public: - virtual void Reset() { ServerState::Reset(); ServerFd = -1; }; + virtual void Reset() APT_OVERRIDE { ServerState::Reset(); ServerFd = -1; }; - virtual bool RunData(FileFd * const File); + virtual bool RunData(FileFd * const File) APT_OVERRIDE; - virtual bool Open(); - virtual bool IsOpen(); - virtual bool Close(); - virtual bool InitHashes(HashStringList const &ExpectedHashes); - virtual Hashes * GetHashes(); - virtual bool Die(FileFd &File); - virtual bool Flush(FileFd * const File); - virtual bool Go(bool ToFile, FileFd * const File); + virtual bool Open() APT_OVERRIDE; + virtual bool IsOpen() APT_OVERRIDE; + virtual bool Close() APT_OVERRIDE; + virtual bool InitHashes(HashStringList const &ExpectedHashes) APT_OVERRIDE; + virtual Hashes * GetHashes() APT_OVERRIDE; + virtual bool Die(FileFd &File) APT_OVERRIDE; + virtual bool Flush(FileFd * const File) APT_OVERRIDE; + virtual bool Go(bool ToFile, FileFd * const File) APT_OVERRIDE; HttpServerState(URI Srv, HttpMethod *Owner); virtual ~HttpServerState() {Close();}; @@ -124,12 +124,12 @@ struct HttpServerState: public ServerState class HttpMethod : public ServerMethod { public: - virtual void SendReq(FetchItem *Itm); + virtual void SendReq(FetchItem *Itm) APT_OVERRIDE; - virtual bool Configuration(std::string Message); + virtual bool Configuration(std::string Message) APT_OVERRIDE; - virtual ServerState * CreateServerState(URI uri); - virtual void RotateDNS(); + virtual ServerState * CreateServerState(URI uri) APT_OVERRIDE; + virtual void RotateDNS() APT_OVERRIDE; protected: std::string AutoDetectProxyCmd; diff --git a/methods/https.h b/methods/https.h index 57fc292ee..29b20b921 100644 --- a/methods/https.h +++ b/methods/https.h @@ -32,23 +32,23 @@ class HttpsServerState : public ServerState Hashes * Hash; protected: - virtual bool ReadHeaderLines(std::string &/*Data*/) { return false; } - virtual bool LoadNextResponse(bool const /*ToFile*/, FileFd * const /*File*/) { return false; } + virtual bool ReadHeaderLines(std::string &/*Data*/) APT_OVERRIDE { return false; } + virtual bool LoadNextResponse(bool const /*ToFile*/, FileFd * const /*File*/) APT_OVERRIDE { return false; } public: - virtual bool WriteResponse(std::string const &/*Data*/) { return false; } + virtual bool WriteResponse(std::string const &/*Data*/) APT_OVERRIDE { return false; } /** \brief Transfer the data from the socket */ - virtual bool RunData(FileFd * const /*File*/) { return false; } + virtual bool RunData(FileFd * const /*File*/) APT_OVERRIDE { return false; } - virtual bool Open() { return false; } - virtual bool IsOpen() { return false; } - virtual bool Close() { return false; } - virtual bool InitHashes(HashStringList const &ExpectedHashes); - virtual Hashes * GetHashes(); - virtual bool Die(FileFd &/*File*/) { return false; } - virtual bool Flush(FileFd * const /*File*/) { return false; } - virtual bool Go(bool /*ToFile*/, FileFd * const /*File*/) { return false; } + virtual bool Open() APT_OVERRIDE { return false; } + virtual bool IsOpen() APT_OVERRIDE { return false; } + virtual bool Close() APT_OVERRIDE { return false; } + virtual bool InitHashes(HashStringList const &ExpectedHashes) APT_OVERRIDE; + virtual Hashes * GetHashes() APT_OVERRIDE; + virtual bool Die(FileFd &/*File*/) APT_OVERRIDE { return false; } + virtual bool Flush(FileFd * const /*File*/) APT_OVERRIDE { return false; } + virtual bool Go(bool /*ToFile*/, FileFd * const /*File*/) APT_OVERRIDE { return false; } HttpsServerState(URI Srv, HttpsMethod *Owner); virtual ~HttpsServerState() {Close();}; @@ -59,7 +59,7 @@ class HttpsMethod : public ServerMethod // minimum speed in bytes/se that triggers download timeout handling static const int DL_MIN_SPEED = 10; - virtual bool Fetch(FetchItem *); + virtual bool Fetch(FetchItem *) APT_OVERRIDE; static size_t parse_header(void *buffer, size_t size, size_t nmemb, void *userp); static size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp); @@ -70,14 +70,14 @@ class HttpsMethod : public ServerMethod ServerState *Server; // Used by ServerMethods unused by https - virtual void SendReq(FetchItem *) { exit(42); } - virtual void RotateDNS() { exit(42); } + virtual void SendReq(FetchItem *) APT_OVERRIDE { exit(42); } + virtual void RotateDNS() APT_OVERRIDE { exit(42); } public: FileFd *File; - virtual bool Configuration(std::string Message); - virtual ServerState * CreateServerState(URI uri); + virtual bool Configuration(std::string Message) APT_OVERRIDE; + virtual ServerState * CreateServerState(URI uri) APT_OVERRIDE; using pkgAcqMethod::FetchResult; using pkgAcqMethod::FetchItem; diff --git a/methods/mirror.h b/methods/mirror.h index 6c0ce370e..425bea673 100644 --- a/methods/mirror.h +++ b/methods/mirror.h @@ -46,14 +46,14 @@ class MirrorMethod : public HttpMethod bool Clean(std::string dir); // we need to overwrite those to transform the url back - virtual void Fail(std::string Why, bool Transient = false); - virtual void URIStart(FetchResult &Res); - virtual void URIDone(FetchResult &Res,FetchResult *Alt = 0); - virtual bool Configuration(std::string Message); + virtual void Fail(std::string Why, bool Transient = false) APT_OVERRIDE; + virtual void URIStart(FetchResult &Res) APT_OVERRIDE; + virtual void URIDone(FetchResult &Res,FetchResult *Alt = 0) APT_OVERRIDE; + virtual bool Configuration(std::string Message) APT_OVERRIDE; public: MirrorMethod(); - virtual bool Fetch(FetchItem *Itm); + virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; }; diff --git a/methods/rred.cc b/methods/rred.cc index 54123ab9c..91b6dda22 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -558,7 +558,7 @@ class RredMethod : public pkgAcqMethod { } protected: - virtual bool URIAcquire(std::string const &Message, FetchItem *Itm) { + virtual bool URIAcquire(std::string const &Message, FetchItem *Itm) APT_OVERRIDE { Debug = _config->FindB("Debug::pkgAcquire::RRed", false); URI Get = Itm->Uri; std::string Path = Get.Host + Get.Path; // rred:/path - no host @@ -671,7 +671,7 @@ class RredMethod : public pkgAcqMethod { return true; } - bool Configuration(std::string Message) + bool Configuration(std::string Message) APT_OVERRIDE { if (pkgAcqMethod::Configuration(Message) == false) return false; diff --git a/methods/rsh.h b/methods/rsh.h index dd259e744..34492971c 100644 --- a/methods/rsh.h +++ b/methods/rsh.h @@ -56,8 +56,8 @@ class RSHConn class RSHMethod : public pkgAcqMethod { - virtual bool Fetch(FetchItem *Itm); - virtual bool Configuration(std::string Message); + virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; + virtual bool Configuration(std::string Message) APT_OVERRIDE; RSHConn *Server; diff --git a/methods/server.h b/methods/server.h index 8d7d33ee6..f9f6e9071 100644 --- a/methods/server.h +++ b/methods/server.h @@ -106,7 +106,7 @@ struct ServerState class ServerMethod : public pkgAcqMethod { protected: - virtual bool Fetch(FetchItem *); + virtual bool Fetch(FetchItem *) APT_OVERRIDE; ServerState *Server; std::string NextURI; @@ -146,7 +146,7 @@ class ServerMethod : public pkgAcqMethod static time_t FailTime; static APT_NORETURN void SigTerm(int); - virtual bool Configuration(std::string Message); + virtual bool Configuration(std::string Message) APT_OVERRIDE; virtual bool Flush() { return Server->Flush(File); }; int Loop(); diff --git a/test/interactive-helper/testdeb.cc b/test/interactive-helper/testdeb.cc index 6aae9f563..69e1ffe0b 100644 --- a/test/interactive-helper/testdeb.cc +++ b/test/interactive-helper/testdeb.cc @@ -13,7 +13,7 @@ class NullStream : public pkgDirStream { public: - virtual bool DoItem(Item &/*Itm*/, int &/*Fd*/) {return true;}; + virtual bool DoItem(Item &/*Itm*/, int &/*Fd*/) APT_OVERRIDE {return true;}; }; static bool Test(const char *File) diff --git a/test/libapt/acqprogress_test.cc b/test/libapt/acqprogress_test.cc index dc31423fc..50792528d 100644 --- a/test/libapt/acqprogress_test.cc +++ b/test/libapt/acqprogress_test.cc @@ -13,8 +13,8 @@ class TestItem: public pkgAcquire::Item public: TestItem(pkgAcquire * const Acq) : pkgAcquire::Item(Acq) {} - virtual std::string DescURI() const { return ""; } - virtual HashStringList GetExpectedHashes() const { return HashStringList(); } + virtual std::string DescURI() const APT_OVERRIDE { return ""; } + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE { return HashStringList(); } }; diff --git a/test/libapt/indexcopytosourcelist_test.cc b/test/libapt/indexcopytosourcelist_test.cc index 1b0427564..2d07dba15 100644 --- a/test/libapt/indexcopytosourcelist_test.cc +++ b/test/libapt/indexcopytosourcelist_test.cc @@ -15,10 +15,10 @@ class NoCopy : public IndexCopy { IndexCopy::ConvertToSourceList(CD, Path); return Path; } - bool GetFile(std::string &/*Filename*/, unsigned long long &/*Size*/) { return false; } - bool RewriteEntry(FileFd & /*Target*/, std::string const &/*File*/) { return false; } - const char *GetFileName() { return NULL; } - const char *Type() { return NULL; } + bool GetFile(std::string &/*Filename*/, unsigned long long &/*Size*/) APT_OVERRIDE { return false; } + bool RewriteEntry(FileFd & /*Target*/, std::string const &/*File*/) APT_OVERRIDE { return false; } + const char *GetFileName() APT_OVERRIDE { return NULL; } + const char *Type() APT_OVERRIDE { return NULL; } }; -- cgit v1.2.3 From 1196da2e7b620ed7d1aed717a85c4879945ea699 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 9 Jul 2015 12:01:29 +0200 Subject: skip .diff/Index acquire if Release file was a hit QuereURI already skips the aquire of the real file in such a case, but it can't detect pdiffs this way. Those already have a handling if the file wasn't changed in between two Release files, so we just add an other check for a Release file hit here, too. Git-Dch: Ignore --- apt-pkg/acquire-item.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 864b93188..38f753cbb 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -977,6 +977,12 @@ void pkgAcqMetaBase::QueueIndexes(bool const verify) /*{{{*/ continue; } } + else if (TransactionManager->IMSHit == true) + { + // we have the file already, no point in trying to acquire it again + new NoActionItem(Owner, *Target); + continue; + } } else trypdiff = false; // no file to patch -- cgit v1.2.3 From a4b8112b19763cbd2c12b81d55bc7d43a591d610 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 9 Jul 2015 12:21:20 +0200 Subject: handle site-changing redirects as mirror changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Redirectors like httpredir.debian.org orchestra the download from multiple (hopefully close) mirrors while having only a single central sources.list entry by using redirects. This has the effect that the progress report always shows the source it started with, not the mirror it ends up fetching from, which is especially problematic for error reporting as having a report for a "Hashsum mismatch" for the redirector URI is next to useless as nobody knows which URI it was really fetched from (regardless of it coming from a user or via the report script) from this output alone. You would need to enable debug output and hope for the same situation to arise again… We hence reuse the UsedMirror field of the mirror:// method and detect redirects which change the site and declare this new site as the UsedMirrror (and adapt the description). The disadvantage is that there is no obvious mapping anymore (it is relatively easy to guess through with some experience) from progress lines to sources.list lines, so error messages need to take care to use the Target description (rather than current Item description) if they want to refer to the sources.list entry. --- apt-pkg/acquire-item.cc | 4 +- apt-pkg/acquire-worker.cc | 48 ++++++++++++++-------- .../test-handle-redirect-as-used-mirror-change | 23 +++++++++++ 3 files changed, 56 insertions(+), 19 deletions(-) create mode 100755 test/integration/test-handle-redirect-as-used-mirror-change diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 38f753cbb..8a566fea0 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -457,7 +457,6 @@ void pkgAcquire::Item::Failed(string const &Message,pkgAcquire::MethodConfig con { if(ErrorText.empty()) ErrorText = LookupTag(Message,"Message"); - UsedMirror = LookupTag(Message,"UsedMirror"); if (QueueCounter <= 1) { /* This indicates that the file is not available right now but might @@ -516,11 +515,10 @@ void pkgAcquire::Item::Start(string const &/*Message*/, unsigned long long const } /*}}}*/ // Acquire::Item::Done - Item downloaded OK /*{{{*/ -void pkgAcquire::Item::Done(string const &Message, HashStringList const &Hashes, +void pkgAcquire::Item::Done(string const &/*Message*/, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const /*Cnf*/) { // We just downloaded something.. - UsedMirror = LookupTag(Message,"UsedMirror"); if (FileSize == 0) { unsigned long long const downloadedSize = Hashes.FileSize(); diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index c0f93f9ce..dc03a8870 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -204,19 +204,22 @@ bool pkgAcquire::Worker::RunMessages() return _error->Error("Invalid message from method %s: %s",Access.c_str(),Message.c_str()); string URI = LookupTag(Message,"URI"); - pkgAcquire::Queue::QItem *Itm = 0; + pkgAcquire::Queue::QItem *Itm = NULL; if (URI.empty() == false) Itm = OwnerQ->FindItem(URI,this); - // update used mirror - string UsedMirror = LookupTag(Message,"UsedMirror", ""); - if (!UsedMirror.empty() && - Itm && - Itm->Description.find(" ") != string::npos) + if (Itm != NULL) { - Itm->Description.replace(0, Itm->Description.find(" "), UsedMirror); - // FIXME: will we need this as well? - //Itm->ShortDesc = UsedMirror; + // update used mirror + string UsedMirror = LookupTag(Message,"UsedMirror", ""); + if (UsedMirror.empty() == false) + { + for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) + (*O)->UsedMirror = UsedMirror; + + if (Itm->Description.find(" ") != string::npos) + Itm->Description.replace(0, Itm->Description.find(" "), UsedMirror); + } } // Determine the message number and dispatch @@ -248,17 +251,14 @@ bool pkgAcquire::Worker::RunMessages() break; } - string NewURI = LookupTag(Message,"New-URI",URI.c_str()); + std::string const NewURI = LookupTag(Message,"New-URI",URI.c_str()); Itm->URI = NewURI; ItemDone(); // Change the status so that it can be dequeued for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) - { - pkgAcquire::Item *Owner = *O; - Owner->Status = pkgAcquire::Item::StatIdle; - } + (*O)->Status = pkgAcquire::Item::StatIdle; // Mark the item as done (taking care of all queues) // and then put it in the main queue again std::vector const ItmOwners = Itm->Owners; @@ -267,12 +267,28 @@ bool pkgAcquire::Worker::RunMessages() for (pkgAcquire::Queue::QItem::owner_iterator O = ItmOwners.begin(); O != ItmOwners.end(); ++O) { pkgAcquire::Item *Owner = *O; - pkgAcquire::ItemDesc desc = Owner->GetItemDesc(); + pkgAcquire::ItemDesc &desc = Owner->GetItemDesc(); + // if we change site, treat it as a mirror change + if (URI::SiteOnly(NewURI) != URI::SiteOnly(desc.URI)) + { + std::string const OldSite = desc.Description.substr(0, desc.Description.find(" ")); + if (likely(APT::String::Startswith(desc.URI, OldSite))) + { + std::string const OldExtra = desc.URI.substr(OldSite.length() + 1); + if (likely(APT::String::Endswith(NewURI, OldExtra))) + { + std::string const NewSite = NewURI.substr(0, NewURI.length() - OldExtra.length()); + Owner->UsedMirror = URI::ArchiveOnly(NewSite); + if (desc.Description.find(" ") != string::npos) + desc.Description.replace(0, desc.Description.find(" "), Owner->UsedMirror); + } + } + } desc.URI = NewURI; OwnerQ->Owner->Enqueue(desc); if (Log != 0) - Log->Done(Owner->GetItemDesc()); + Log->Done(desc); } break; } diff --git a/test/integration/test-handle-redirect-as-used-mirror-change b/test/integration/test-handle-redirect-as-used-mirror-change new file mode 100755 index 000000000..08a39a5e6 --- /dev/null +++ b/test/integration/test-handle-redirect-as-used-mirror-change @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' +configcompression '.' 'gz' + +buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable' + +setupaptarchive --no-update +changetowebserver -o 'aptwebserver::redirect::replace::/redirectme/=http://0.0.0.0:8080/' +rewritesourceslist 'http://localhost:8080/redirectme' + +testsuccessequal "Get:1 http://0.0.0.0:8080 unstable InRelease [$(stat -c %s aptarchive/dists/unstable/InRelease) B] +Get:2 http://0.0.0.0:8080 unstable/main Sources [$(stat -c %s aptarchive/dists/unstable/main/source/Sources.gz) B] +Get:3 http://0.0.0.0:8080 unstable/main amd64 Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-amd64/Packages.gz) B] +Get:4 http://0.0.0.0:8080 unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B] +Reading package lists..." aptget update + +testsuccessequal 'Hit:1 http://0.0.0.0:8080 unstable InRelease +Reading package lists...' aptget update -- cgit v1.2.3 From 0d5b9da9f597fecae9b912d37d4e58bc903bdd4f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 9 Jul 2015 21:10:53 +0200 Subject: disable locking even for root in --simulate Six years ago in 55a5a46c235a30bf024fb2301066553953701cc5 apt-get learned to disable locking if run as normal user and show a message. Helmut Grohne rightly suggests on IRC now that there isn't much point in getting the locks for root either as the output isn't in any way more authoritive than without locking given that after this call the lock is freed and any action can sneak in before we make the next call. So we exchange no benefit for the disavantage of blocking real calls. This can be especially confusing with the aliases --no-act and --just-print. We do not print the message we print for users through as the non-root users can be confronted with a lot more difference via unreadable files. --- apt-private/private-main.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apt-private/private-main.cc b/apt-private/private-main.cc index 668b1733a..3886c7df6 100644 --- a/apt-private/private-main.cc +++ b/apt-private/private-main.cc @@ -22,13 +22,15 @@ void InitSignals() void CheckSimulateMode(CommandLine &CmdL) { - // simulate user-friendly if apt-get has no root privileges - if (getuid() != 0 && _config->FindB("APT::Get::Simulate") == true && + // disable locking in simulation, but show the message only for users + // as root hasn't the same problems like unreadable files which can heavily + // distort the simulation. + if (_config->FindB("APT::Get::Simulate") == true && (CmdL.FileSize() == 0 || (strcmp(CmdL.FileList[0], "source") != 0 && strcmp(CmdL.FileList[0], "download") != 0 && strcmp(CmdL.FileList[0], "changelog") != 0))) { - if (_config->FindB("APT::Get::Show-User-Simulation-Note",true) == true) + if (getuid() != 0 && _config->FindB("APT::Get::Show-User-Simulation-Note",true) == true) std::cout << _("NOTE: This is only a simulation!\n" " apt-get needs root privileges for real execution.\n" " Keep also in mind that locking is deactivated,\n" -- cgit v1.2.3 From c2a4a8dded2dfb56dbcab9689b6cb4b96c9999b6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 10 Jul 2015 00:07:37 +0200 Subject: rename 'apt-get files' to 'apt-get indextargets' 'files' is a bit too generic as a name for a command usually only used programmatically (if at all) by developers, so instead of "wasting" this generic name for this we use "indextargets" which is actually the name of the datastructure the displayed data is stored in. Along with this rename the config options are renamed accordingly. --- apt-pkg/deb/debmetaindex.cc | 10 +++---- apt-pkg/init.cc | 34 +++++++++++----------- apt-private/private-cmndline.cc | 6 ++-- cmdline/apt-get.cc | 10 +++---- doc/acquire-additional-files.txt | 18 +++++++----- doc/apt-get.8.xml | 24 +++++++-------- doc/sources.list.5.xml | 2 +- .../test-acquire-same-repository-multiple-times | 2 +- test/integration/test-apt-acquire-additional-files | 26 ++++++++--------- .../integration/test-apt-get-update-unauth-warning | 2 +- .../test-sourceslist-lang-plusminus-options | 4 +-- 11 files changed, 70 insertions(+), 68 deletions(-) diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 46a7181fc..480317db3 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -128,12 +128,12 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI, { for (std::vector::const_iterator T = E->Targets.begin(); T != E->Targets.end(); ++T) { -#define APT_T_CONFIG(X) _config->Find(std::string("APT::Acquire::Targets::") + Type + "::" + *T + "::" + (X)) +#define APT_T_CONFIG(X) _config->Find(std::string("Acquire::IndexTargets::") + Type + "::" + *T + "::" + (X)) std::string const tplMetaKey = APT_T_CONFIG(flatArchive ? "flatMetaKey" : "MetaKey"); std::string const tplShortDesc = APT_T_CONFIG("ShortDescription"); - std::string const tplLongDesc = APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); - bool const IsOptional = _config->FindB(std::string("APT::Acquire::Targets::") + Type + "::" + *T + "::Optional", true); - bool const KeepCompressed = _config->FindB(std::string("APT::Acquire::Targets::") + Type + "::" + *T + "::KeepCompressed", GzipIndex); + std::string const tplLongDesc = "$(SITE) " + APT_T_CONFIG(flatArchive ? "flatDescription" : "Description"); + bool const IsOptional = _config->FindB(std::string("Acquire::IndexTargets::") + Type + "::" + *T + "::Optional", true); + bool const KeepCompressed = _config->FindB(std::string("Acquire::IndexTargets::") + Type + "::" + *T + "::KeepCompressed", GzipIndex); #undef APT_T_CONFIG if (tplMetaKey.empty()) continue; @@ -721,7 +721,7 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ Deb->AddComponent( IsSrc, Section, - parsePlusMinusOptions("target", Options, _config->FindVector(std::string("APT::Acquire::Targets::") + Name, "", true)), + parsePlusMinusOptions("target", Options, _config->FindVector(std::string("Acquire::IndexTargets::") + Name, "", true)), parsePlusMinusOptions("arch", Options, APT::Configuration::getArchitectures()), parsePlusMinusOptions("lang", Options, APT::Configuration::getLanguages(true)) ); diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 1fbb035f7..858bcec43 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -99,23 +99,23 @@ bool pkgInitConfig(Configuration &Cnf) // The default user we drop to in the methods Cnf.CndSet("APT::Sandbox::User", "_apt"); - Cnf.CndSet("APT::Acquire::Targets::deb::Packages::MetaKey", "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages"); - Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatMetaKey", "Packages"); - Cnf.CndSet("APT::Acquire::Targets::deb::Packages::ShortDescription", "Packages"); - Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Description", "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages"); - Cnf.CndSet("APT::Acquire::Targets::deb::Packages::flatDescription", "$(SITE) $(RELEASE) Packages"); - Cnf.CndSet("APT::Acquire::Targets::deb::Packages::Optional", false); - Cnf.CndSet("APT::Acquire::Targets::deb::Translations::MetaKey", "$(COMPONENT)/i18n/Translation-$(LANGUAGE)"); - Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatMetaKey", "$(LANGUAGE)"); - Cnf.CndSet("APT::Acquire::Targets::deb::Translations::ShortDescription", "Translation-$(LANGUAGE)"); - Cnf.CndSet("APT::Acquire::Targets::deb::Translations::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)"); - Cnf.CndSet("APT::Acquire::Targets::deb::Translations::flatDescription", "$(SITE) $(RELEASE) Translation-$(LANGUAGE)"); - Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::MetaKey", "$(COMPONENT)/source/Sources"); - Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatMetaKey", "Sources"); - Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::ShortDescription", "Sources"); - Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::Description", "$(SITE) $(RELEASE)/$(COMPONENT) Sources"); - Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::flatDescription", "$(SITE) $(RELEASE) Sources"); - Cnf.CndSet("APT::Acquire::Targets::deb-src::Sources::Optional", false); + Cnf.CndSet("Acquire::IndexTargets::deb::Packages::MetaKey", "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages"); + Cnf.CndSet("Acquire::IndexTargets::deb::Packages::flatMetaKey", "Packages"); + Cnf.CndSet("Acquire::IndexTargets::deb::Packages::ShortDescription", "Packages"); + Cnf.CndSet("Acquire::IndexTargets::deb::Packages::Description", "$(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages"); + Cnf.CndSet("Acquire::IndexTargets::deb::Packages::flatDescription", "$(RELEASE) Packages"); + Cnf.CndSet("Acquire::IndexTargets::deb::Packages::Optional", false); + Cnf.CndSet("Acquire::IndexTargets::deb::Translations::MetaKey", "$(COMPONENT)/i18n/Translation-$(LANGUAGE)"); + Cnf.CndSet("Acquire::IndexTargets::deb::Translations::flatMetaKey", "$(LANGUAGE)"); + Cnf.CndSet("Acquire::IndexTargets::deb::Translations::ShortDescription", "Translation-$(LANGUAGE)"); + Cnf.CndSet("Acquire::IndexTargets::deb::Translations::Description", "$(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)"); + Cnf.CndSet("Acquire::IndexTargets::deb::Translations::flatDescription", "$(RELEASE) Translation-$(LANGUAGE)"); + Cnf.CndSet("Acquire::IndexTargets::deb-src::Sources::MetaKey", "$(COMPONENT)/source/Sources"); + Cnf.CndSet("Acquire::IndexTargets::deb-src::Sources::flatMetaKey", "Sources"); + Cnf.CndSet("Acquire::IndexTargets::deb-src::Sources::ShortDescription", "Sources"); + Cnf.CndSet("Acquire::IndexTargets::deb-src::Sources::Description", "$(RELEASE)/$(COMPONENT) Sources"); + Cnf.CndSet("Acquire::IndexTargets::deb-src::Sources::flatDescription", "$(RELEASE) Sources"); + Cnf.CndSet("Acquire::IndexTargets::deb-src::Sources::Optional", false); Cnf.CndSet("Acquire::Changelogs::URI::Origin::Debian", "http://metadata.ftp-master.debian.org/changelogs/CHANGEPATH_changelog"); Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ubuntu", "http://changelogs.ubuntu.com/changelogs/pool/CHANGEPATH/changelog"); diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 11e88b1e7..71dceb559 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -163,10 +163,10 @@ static bool addArgumentsAPTGet(std::vector &Args, char const // once sbuild is fixed, this option can be removed addArg('f', "fix-broken", "APT::Get::Fix-Broken", 0); } - else if (CmdMatches("files")) + else if (CmdMatches("indextargets")) { - addArg(0,"format","APT::Get::Files::Format", CommandLine::HasArg); - addArg(0,"release-info","APT::Get::Files::ReleaseInfo", 0); + addArg(0,"format","APT::Get::IndexTargets::Format", CommandLine::HasArg); + addArg(0,"release-info","APT::Get::IndexTargets::ReleaseInfo", 0); } else if (CmdMatches("clean", "autoclean", "check", "download", "changelog") || CmdMatches("markauto", "unmarkauto")) // deprecated commands diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 9232e1505..a69f5418a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1468,7 +1468,7 @@ static bool DoChangelog(CommandLine &CmdL) return true; } /*}}}*/ -// DoFiles - Lists all IndexTargets /*{{{*/ +// DoIndexTargets - Lists all IndexTargets /*{{{*/ static std::string format_key(std::string key) { // deb822 is case-insensitive, but the human eye prefers candy @@ -1484,7 +1484,7 @@ static std::string format_key(std::string key) } return key; } -static bool DoFiles(CommandLine &CmdL) +static bool DoIndexTargets(CommandLine &CmdL) { pkgCacheFile CacheFile; pkgSourceList *SrcList = CacheFile.GetSourceList(); @@ -1492,8 +1492,8 @@ static bool DoFiles(CommandLine &CmdL) if (SrcList == NULL) return false; - std::string const Format = _config->Find("APT::Get::Files::Format"); - bool const ReleaseInfo = _config->FindB("APT::Get::Files::ReleaseInfo", true); + std::string const Format = _config->Find("APT::Get::IndexTargets::Format"); + bool const ReleaseInfo = _config->FindB("APT::Get::IndexTargets::ReleaseInfo", true); bool Filtered = CmdL.FileSize() > 1; for (pkgSourceList::const_iterator S = SrcList->begin(); S != SrcList->end(); ++S) { @@ -1687,7 +1687,7 @@ int main(int argc,const char *argv[]) /*{{{*/ {"source",&DoSource}, {"download",&DoDownload}, {"changelog",&DoChangelog}, - {"files",&DoFiles}, + {"indextargets",&DoIndexTargets}, {"moo",&DoMoo}, {"help",&ShowHelp}, {0,0}}; diff --git a/doc/acquire-additional-files.txt b/doc/acquire-additional-files.txt index f9a16318d..71ce7b0cb 100644 --- a/doc/acquire-additional-files.txt +++ b/doc/acquire-additional-files.txt @@ -26,7 +26,7 @@ they would be written in a configuration file the configuration instructing the Acquire system to download the Packages files would look like this (see also apt.conf(5) manpage for configuration file syntax): - APT::Acquire::Targets::deb::Packages { + Acquire::IndexTargets::deb::Packages { MetaKey "$(COMPONENT)/binary-$(ARCHITECTURE)/Packages"; ShortDescription "Packages"; Description "$(SITE) $(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages"; @@ -38,7 +38,7 @@ like this (see also apt.conf(5) manpage for configuration file syntax): }; All files which should be downloaded (nicknamed 'Targets') are mentioned -below the APT::Acquire::Targets scope. 'deb' is here the type of the +below the Acquire::IndexTargets scope. 'deb' is here the type of the sources.list entry the file should be acquired for. The only other supported value is hence 'deb-src'. Beware: You can't specify multiple types here and you can't download the same (evaluated) MetaKey from @@ -47,7 +47,7 @@ multiple types! After the type you can pick any valid and unique string which preferable refers to the file it downloads (In the example we picked 'Packages'). This string is used as identifier for the target class and accessible as -'Created-By' e.g. in the "apt-get files" output as detailed below. +'Created-By' e.g. in the "apt-get indextargets" output as detailed below. All targets have three main properties you can define: * MetaKey: The identifier of the file to be downloaded as used in the @@ -92,7 +92,7 @@ NO properties have to be set to enable this. The stanzas for Translation-* files as well as for Sources files would look like this: -APT::Acquire::Targets { +Acquire::IndexTargets { deb::Translations { MetaKey "$(COMPONENT)/i18n/Translation-$(LANGUAGE)"; ShortDescription "Translation-$(LANGUAGE)"; @@ -152,7 +152,7 @@ design so multiple applications can download and use the same file rather than each and every one of them potentially downloads and uses its own copy somewhere on disk. -"apt-get files" can be used to get the location as well as other +"apt-get indextargets" can be used to get the location as well as other information about all files downloaded (aka: you will see Packages, Sources and Translation-* files here as well). Provide a line of the default output format as parameter to filter out all entries which do @@ -161,12 +161,16 @@ own output style. The variables are what you see in the output, just all uppercase and wrapped in $(), as in the configuration file. To get all the filenames of all Translation-en files you can e.g. call: - apt-get files --format '$(FILENAME)' "Created-By: Translations" "Language: en" + apt-get indextargets --format '$(FILENAME)' "Created-By: Translations" "Language: en" + +The line-based filtering and the formating is rather crude and feature- +less by design, so it is recommend to use dedicated and more powerful +tools like 'grep-dctrl'. Accessing this information via libapt is done by reading the sources.lists (pkgSourceList), iterating over the metaIndex objects this creates and calling GetIndexTargets() on them. See the sourcecode of -"apt-get files" for a complete example. +"apt-get indextargets" for a complete example. Note that by default targets are not listed if they weren't downloaded. If you want to see all targets, you can use the --no-release-info, which diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index b0fe390df..81a9036c4 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -239,9 +239,9 @@ - + Displays by default a deb822 formatted listing of - information about all data files apt-get + information about all data files (aka index targets) apt-get update would download. Supports a option to modify the output format as well as accepts lines of the default output to filter the records @@ -327,17 +327,15 @@ - No action; perform a simulation of events that would occur but do not - actually change the system. - Configuration Item: APT::Get::Simulate. - - Simulated runs performed as a user will automatically deactivate locking - (Debug::NoLocking), and if the option - APT::Get::Show-User-Simulation-Note is set - (as it is by default) a notice will also be displayed indicating that - this is only a simulation. Runs performed as root do not trigger either - NoLocking or the notice - superusers should know what they are doing - without further warnings from apt-get. + No action; perform a simulation of events that would occur + based on the current system state but do not actually change the + system. Locking will be disabled () + so the system state could change while apt-get is + running. Simulations can also be executed by non-root users which might + not have read access to all apt configuration distorting the simulation. + A notice expressing this warning is also shown by default for non-root + users (). + Configuration Item: APT::Get::Simulate. Simulated runs print out a series of lines, each representing a dpkg operation: configure (Conf), remove (Remv) diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index 12a7773f5..3bc8a94ac 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -221,7 +221,7 @@ deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [. () is a multivalue option defining which download targets apt will try to acquire from this source. If not specified, the default set is defined by the - configuration scope. + configuration scope. diff --git a/test/integration/test-acquire-same-repository-multiple-times b/test/integration/test-acquire-same-repository-multiple-times index ad9cd6d7e..d3cb46c14 100755 --- a/test/integration/test-acquire-same-repository-multiple-times +++ b/test/integration/test-acquire-same-repository-multiple-times @@ -43,7 +43,7 @@ tworepos() { testsuccess --nomsg aptget update -o Debug::pkgAcquire::Worker=1 cp rootdir/tmp/testsuccess.output download.log #cat download.log - aptget files --format '$(FILENAME)' --no-release-info | sort > file.lst + aptget indextargets --format '$(FILENAME)' --no-release-info | sort > file.lst testequal "$(find $(readlink -f ./rootdir/var/lib/apt/lists) -name '*_dists_*' \( ! -name '*InRelease' \) -type f | sort)" cat file.lst testsuccess aptcache policy testequal "foo: diff --git a/test/integration/test-apt-acquire-additional-files b/test/integration/test-apt-acquire-additional-files index fecdf30bf..ee7908a2d 100755 --- a/test/integration/test-apt-acquire-additional-files +++ b/test/integration/test-apt-acquire-additional-files @@ -30,18 +30,18 @@ Reading package lists..." aptget update testempty find rootdir/var/lib/apt/lists -name '*Contents*' cat > rootdir/etc/apt/apt.conf.d/content-target.conf <> rootdir/etc/apt/apt.conf.d/content-target.conf +echo 'Acquire::IndexTargets::deb::Contents::KeepCompressed "true";' >> rootdir/etc/apt/apt.conf.d/content-target.conf testsuccessequal "Hit:1 http://localhost:8080 unstable InRelease Get:2 http://localhost:8080 unstable/main amd64 Contents [$(stat -c%s aptarchive/dists/unstable/main/Contents-amd64.gz) B] Reading package lists..." aptget update testequal 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' find rootdir/var/lib/apt/lists -name '*Contents*' -testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz)" aptget files --format '$(FILENAME)' 'Created-By: Contents' +testequal "$(readlink -f ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz)" aptget indextargets --format '$(FILENAME)' 'Created-By: Contents' testsuccess cmp 'rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz' 'aptarchive/dists/unstable/main/Contents-amd64.gz' rm ./rootdir/var/lib/apt/lists/localhost:8080_dists_unstable_main_Contents-amd64.gz -testempty aptget files --format '$(FILENAME)' 'Created-By: Contents' +testempty aptget indextargets --format '$(FILENAME)' 'Created-By: Contents' # and no automatic uncompress based on the name please, # only if we downloaded a compressed file, but target was uncompressed cat > rootdir/etc/apt/apt.conf.d/content-target.conf < gotlangs.list + aptget indextargets --no-release-info 'Created-By: Translations' "$@" --format '$(LANGUAGE)' | sort -u > gotlangs.list if [ -z "$LANGS" ]; then echo -n | tr ',' '\n' | sort | checkdiff - gotlangs.list && msgpass || msgfail else @@ -44,7 +44,7 @@ testlangs 'lang=de_DE' 'de_DE' echo 'deb [lang=none] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list testlangs 'lang=none' '' -testequal 'amd64' aptget files --no-release-info 'Created-By: Packages' --format '$(ARCHITECTURE)' +testequal 'amd64' aptget indextargets --no-release-info 'Created-By: Packages' --format '$(ARCHITECTURE)' echo 'deb [lang+=pt] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list testlangs 'lang+=pt' 'en,de,de_DE,pt' -- cgit v1.2.3 From b17d75804566ced55109b4b0498b7ed0faad389b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 11 Jul 2015 20:21:45 +0200 Subject: enforce GCC5 C++11 ABI and usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The library(s) make an API break anyhow, so lets ensure we use gcc5 for this break and enable c++11 as standard as gcc6 will use it as default and should provide some API parts for c++11 – beside that it can't hurt to use c++11 itself. We just have to keep our headers c++03 compatible to not enforce a standrd bump in our reverse dependencies. --- buildlib/environment.mak.in | 2 +- debian/control | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in index 8ea7a05ba..287205181 100644 --- a/buildlib/environment.mak.in +++ b/buildlib/environment.mak.in @@ -9,7 +9,7 @@ PACKAGE_MAIL = @PACKAGE_MAIL@ CC = @CC@ CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT -D_FORTIFY_SOURCE=2 CXX = @CXX@ -CXXFLAGS+= @CXXFLAGS@ -Wall -Wextra +CXXFLAGS+= @CXXFLAGS@ -std=c++11 -Wall -Wextra CXXFLAGS+= -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations CXXFLAGS+= -Wctor-dtor-privacy -Wdisabled-optimization -Winit-self -Wmissing-include-dirs -Wnoexcept -Wsign-promo -Wundef # suggests methods which already have such an attribute diff --git a/debian/control b/debian/control index 7e2db7373..37b9e215b 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,8 @@ Build-Depends: dpkg-dev (>= 1.15.8), debhelper (>= 8.1.3~), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.4~), zlib1g-dev, libbz2-dev, liblzma-dev, xsltproc, docbook-xsl, docbook-xml, po4a (>= 0.34-2), - autotools-dev, autoconf, automake, libgtest-dev + autotools-dev, autoconf, automake, libgtest-dev, + g++-5 (>= 5.1.1-20) Build-Depends-Indep: doxygen, w3m, graphviz Build-Conflicts: autoconf2.13, automake1.4 Vcs-Git: git://anonscm.debian.org/apt/apt.git -- cgit v1.2.3 From a0c19a217ca2ed38ae0ecb4b8d2d4f8c4e53289f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 12 Jul 2015 13:41:12 +0200 Subject: implement a more generic ShowList method apt-get is displaying various lists of package names, which until now it was building as a string before passing it to ShowList, which inserted linebreaks at fitting points and showed a title if needed, but it never really understood what it was working with. With the help of C++11 the new generic knows not only what it works with, but generates the list on the fly rather than asking for it and potentially discarding parts of the input (= the non-default verbose display). It also doubles as a test for how usable the CacheSets are with C++11. (Not all callers are adapted yet.) Git-Dch: Ignore --- apt-pkg/cacheset.h | 99 ++++++-- apt-private/private-cachefile.cc | 61 ++--- apt-private/private-cachefile.h | 59 +++-- apt-private/private-cacheset.h | 16 +- apt-private/private-install.cc | 69 +++--- apt-private/private-output.cc | 263 ++++++++++----------- apt-private/private-output.h | 67 +++++- po/apt-all.pot | 2 +- po/ar.po | 4 +- po/ast.po | 4 +- po/bg.po | 4 +- po/bs.po | 2 +- po/ca.po | 4 +- po/cs.po | 4 +- po/cy.po | 4 +- po/da.po | 4 +- po/de.po | 4 +- po/dz.po | 2 +- po/el.po | 4 +- po/es.po | 4 +- po/eu.po | 4 +- po/fi.po | 4 +- po/fr.po | 4 +- po/gl.po | 4 +- po/he.po | 4 +- po/hu.po | 4 +- po/it.po | 4 +- po/ja.po | 4 +- po/km.po | 4 +- po/ko.po | 4 +- po/ku.po | 2 +- po/lt.po | 4 +- po/mr.po | 2 +- po/nb.po | 4 +- po/ne.po | 4 +- po/nl.po | 4 +- po/nn.po | 4 +- po/pl.po | 4 +- po/pt.po | 4 +- po/pt_BR.po | 4 +- po/ro.po | 4 +- po/ru.po | 4 +- po/sk.po | 4 +- po/sl.po | 4 +- po/sv.po | 4 +- po/th.po | 4 +- po/tl.po | 4 +- po/tr.po | 4 +- po/uk.po | 4 +- po/vi.po | 4 +- po/zh_CN.po | 4 +- po/zh_TW.po | 4 +- test/integration/test-apt-get-autoremove | 26 ++ .../test-bug-596498-trusted-unsigned-repo | 9 + .../integration/test-bug-604222-new-and-autoremove | 26 ++ .../test-bug-613420-new-garbage-dependency | 16 ++ .../test-bug-675449-essential-are-protected | 14 ++ test/integration/test-kernel-helper-autoremove | 16 ++ 58 files changed, 570 insertions(+), 341 deletions(-) diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 03f3605a1..0b9b9441c 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -17,6 +17,7 @@ #include #endif #include +#include #include #include #include @@ -210,16 +211,15 @@ private: void * const d; }; /*}}}*/ // Iterator templates for our Containers /*{{{*/ -template class Container_iterator_base : +template class Container_iterator_base : public std::iterator::iterator_category, container_iterator>, public Interface::iterator_base { protected: container_iterator _iter; - inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *_iter; } public: explicit Container_iterator_base(container_iterator i) : _iter(i) {} - inline typename Container::value_type operator*(void) const { return *_iter; } + inline container_value operator*(void) const { return this->getType(); } operator container_iterator(void) const { return _iter; } inline iterator_type& operator++() { ++_iter; return static_cast(*this); } inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } @@ -241,48 +241,56 @@ public: friend Master; }; template class Container_const_iterator : - public Container_iterator_base, typename Container::const_iterator> + public Container_iterator_base, typename Container::const_iterator, typename Container::value_type> { typedef Container_const_iterator iterator_type; typedef typename Container::const_iterator container_iterator; public: explicit Container_const_iterator(container_iterator i) : - Container_iterator_base(i) {} + Container_iterator_base(i) {} + + inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *this->_iter; } }; template class Container_iterator : - public Container_iterator_base, typename Container::iterator> + public Container_iterator_base, typename Container::iterator, typename Container::value_type> { typedef Container_iterator iterator_type; typedef typename Container::iterator container_iterator; public: explicit Container_iterator(container_iterator i) : - Container_iterator_base(i) {} + Container_iterator_base(i) {} operator typename Master::const_iterator() { return typename Master::const_iterator(this->_iter); } inline iterator_type& operator=(iterator_type const &i) { this->_iter = i._iter; return static_cast(*this); } inline iterator_type& operator=(container_iterator const &i) { this->_iter = i; return static_cast(*this); } + + inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *this->_iter; } }; template class Container_const_reverse_iterator : - public Container_iterator_base, typename Container::const_reverse_iterator> + public Container_iterator_base, typename Container::const_reverse_iterator, typename Container::value_type> { typedef Container_const_reverse_iterator iterator_type; typedef typename Container::const_reverse_iterator container_iterator; public: explicit Container_const_reverse_iterator(container_iterator i) : - Container_iterator_base(i) {} + Container_iterator_base(i) {} + + inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *this->_iter; } }; template class Container_reverse_iterator : - public Container_iterator_base, typename Container::reverse_iterator> + public Container_iterator_base, typename Container::reverse_iterator, typename Container::value_type> { typedef Container_reverse_iterator iterator_type; typedef typename Container::reverse_iterator container_iterator; public: explicit Container_reverse_iterator(container_iterator i) : - Container_iterator_base(i) {} + Container_iterator_base(i) {} operator typename Master::const_iterator() { return typename Master::const_iterator(this->_iter); } inline iterator_type& operator=(iterator_type const &i) { this->_iter = i._iter; return static_cast(*this); } inline iterator_type& operator=(container_iterator const &i) { this->_iter = i; return static_cast(*this); } + + inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *this->_iter; } }; /*}}}*/ class PackageContainerInterface { /*{{{*/ @@ -583,6 +591,10 @@ template<> template void PackageContainer template void PackageContainer >::insert(PackageContainer const &pkgcont) { + for (typename PackageContainer::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p) + _cont.push_back(*p); +} template<> template void PackageContainer >::insert(PackageContainer const &pkgcont) { for (typename PackageContainer::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p) _cont.push_back(*p); @@ -603,6 +615,12 @@ template<> inline bool PackageContainer return true; } #endif +template<> inline bool PackageContainer >::insert(pkgCache::PkgIterator const &P) { + if (P.end() == true) + return false; + _cont.push_back(P); + return true; +} template<> inline bool PackageContainer >::insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; @@ -619,6 +637,10 @@ template<> inline void PackageContainer _cont.push_front(*p); } #endif +template<> inline void PackageContainer >::insert(const_iterator begin, const_iterator end) { + for (const_iterator p = begin; p != end; ++p) + _cont.push_back(*p); +} template<> inline void PackageContainer >::insert(const_iterator begin, const_iterator end) { for (const_iterator p = begin; p != end; ++p) _cont.push_back(*p); @@ -647,6 +669,10 @@ template<> template inline bool PackageContainer template inline bool PackageContainer >::sort(Compare Comp) { + std::sort(_cont.begin(), _cont.end(), Comp); + return true; +} /*}}}*/ // class PackageUniverse - pkgCache as PackageContainerInterface /*{{{*/ @@ -657,22 +683,35 @@ template<> template inline bool PackageContainer + { + protected: + inline virtual pkgCache::PkgIterator getType(void) const APT_OVERRIDE + { + return _iter; + } + public: + explicit const_iterator(pkgCache::PkgIterator i): + Container_iterator_base(i) {} + + }; + typedef const_iterator iterator; APT_PUBLIC bool empty() const APT_OVERRIDE { return false; } APT_PUBLIC size_t size() const APT_OVERRIDE { return _cont->Head().PackageCount; } - APT_PUBLIC const_iterator begin() const { return _cont->PkgBegin(); } - APT_PUBLIC const_iterator end() const { return _cont->PkgEnd(); } - APT_PUBLIC const_iterator cbegin() const { return _cont->PkgBegin(); } - APT_PUBLIC const_iterator cend() const { return _cont->PkgEnd(); } - APT_PUBLIC iterator begin() { return _cont->PkgBegin(); } - APT_PUBLIC iterator end() { return _cont->PkgEnd(); } + APT_PUBLIC const_iterator begin() const { return const_iterator(_cont->PkgBegin()); } + APT_PUBLIC const_iterator end() const { return const_iterator(_cont->PkgEnd()); } + APT_PUBLIC const_iterator cbegin() const { return const_iterator(_cont->PkgBegin()); } + APT_PUBLIC const_iterator cend() const { return const_iterator(_cont->PkgEnd()); } + APT_PUBLIC iterator begin() { return iterator(_cont->PkgBegin()); } + APT_PUBLIC iterator end() { return iterator(_cont->PkgEnd()); } + + APT_PUBLIC pkgCache * data() const { return _cont; } explicit APT_PUBLIC PackageUniverse(pkgCache * const Owner); APT_PUBLIC virtual ~PackageUniverse(); @@ -693,6 +732,7 @@ typedef PackageContainer > PackageUnor typedef PackageContainer > PackageForwardList; #endif typedef PackageContainer > PackageList; +typedef PackageContainer > PackageDeque; typedef PackageContainer > PackageVector; class VersionContainerInterface { /*{{{*/ @@ -1059,6 +1099,10 @@ template<> template void VersionContainer template void VersionContainer >::insert(VersionContainer const &vercont) { + for (typename VersionContainer::const_iterator v = vercont.begin(); v != vercont.end(); ++v) + _cont.push_back(*v); +} template<> template void VersionContainer >::insert(VersionContainer const &vercont) { for (typename VersionContainer::const_iterator v = vercont.begin(); v != vercont.end(); ++v) _cont.push_back(*v); @@ -1079,6 +1123,12 @@ template<> inline bool VersionContainer return true; } #endif +template<> inline bool VersionContainer >::insert(pkgCache::VerIterator const &V) { + if (V.end() == true) + return false; + _cont.push_back(V); + return true; +} template<> inline bool VersionContainer >::insert(pkgCache::VerIterator const &V) { if (V.end() == true) return false; @@ -1095,6 +1145,10 @@ template<> inline void VersionContainer _cont.push_front(*v); } #endif +template<> inline void VersionContainer >::insert(const_iterator begin, const_iterator end) { + for (const_iterator v = begin; v != end; ++v) + _cont.push_back(*v); +} template<> inline void VersionContainer >::insert(const_iterator begin, const_iterator end) { for (const_iterator v = begin; v != end; ++v) _cont.push_back(*v); @@ -1123,6 +1177,10 @@ template<> template inline bool VersionContainer template inline bool VersionContainer >::sort(Compare Comp) { + std::sort(_cont.begin(), _cont.end(), Comp); + return true; +} /*}}}*/ typedef VersionContainer > VersionSet; @@ -1131,6 +1189,7 @@ typedef VersionContainer > VersionUnor typedef VersionContainer > VersionForwardList; #endif typedef VersionContainer > VersionList; +typedef VersionContainer > VersionDeque; typedef VersionContainer > VersionVector; } #endif diff --git a/apt-private/private-cachefile.cc b/apt-private/private-cachefile.cc index 29e665245..2b2050684 100644 --- a/apt-private/private-cachefile.cc +++ b/apt-private/private-cachefile.cc @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include @@ -21,39 +21,40 @@ using namespace std; -// CacheFile::NameComp - QSort compare by name /*{{{*/ -// --------------------------------------------------------------------- -/* */ -pkgCache *CacheFile::SortCache = 0; -int CacheFile::NameComp(const void *a,const void *b) +static bool SortPackagesByName(pkgCache * const Owner, + map_pointer_t const A, map_pointer_t const B) { - if (*(pkgCache::Package **)a == 0 || *(pkgCache::Package **)b == 0) - return *(pkgCache::Package **)a - *(pkgCache::Package **)b; - - const pkgCache::Package &A = **(pkgCache::Package **)a; - const pkgCache::Package &B = **(pkgCache::Package **)b; - const pkgCache::Group * const GA = SortCache->GrpP + A.Group; - const pkgCache::Group * const GB = SortCache->GrpP + B.Group; - - return strcmp(SortCache->StrP + GA->Name,SortCache->StrP + GB->Name); + if (A == 0) + return false; + if (B == 0 || A == B) + return true; + pkgCache::Group const * const GA = Owner->GrpP + A; + pkgCache::Group const * const GB = Owner->GrpP + B; + return strcmp(Owner->StrP + GA->Name, Owner->StrP + GB->Name) <= 0; } - /*}}}*/ -// CacheFile::Sort - Sort by name /*{{{*/ -// --------------------------------------------------------------------- -/* */ -void CacheFile::Sort() +SortedPackageUniverse::SortedPackageUniverse(CacheFile &Cache) : + PackageUniverse{Cache}, List{Cache.UniverseList} { - delete [] List; - List = new pkgCache::Package *[Cache->Head().PackageCount]; - memset(List,0,sizeof(*List)*Cache->Head().PackageCount); - pkgCache::PkgIterator I = Cache->PkgBegin(); - for (;I.end() != true; ++I) - List[I->ID] = I; - - SortCache = *this; - qsort(List,Cache->Head().PackageCount,sizeof(*List),NameComp); } - /*}}}*/ +void SortedPackageUniverse::LazyInit() const +{ + if (List.empty() == false) + return; + pkgCache * const Owner = data(); + // In Multi-Arch systems Grps are easier to sort than Pkgs + std::vector GrpList; + List.reserve(Owner->Head().GroupCount); + for (pkgCache::GrpIterator I{Owner->GrpBegin()}; I.end() != true; ++I) + GrpList.emplace_back(I - Owner->GrpP); + std::stable_sort(GrpList.begin(), GrpList.end(), std::bind( &SortPackagesByName, Owner, std::placeholders::_1, std::placeholders::_2 )); + List.reserve(Owner->Head().PackageCount); + for (auto G : GrpList) + { + pkgCache::GrpIterator const Grp(*Owner, Owner->GrpP + G); + for (pkgCache::PkgIterator P = Grp.PackageList(); P.end() != true; P = Grp.NextPkg(P)) + List.emplace_back(P - Owner->PkgP); + } +} // CacheFile::CheckDeps - Open the cache file /*{{{*/ // --------------------------------------------------------------------- /* This routine generates the caches and then opens the dependency cache diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h index 1fddabfbd..4a68d9733 100644 --- a/apt-private/private-cachefile.h +++ b/apt-private/private-cachefile.h @@ -7,12 +7,13 @@ #include #include #include +#include + #include -// FIXME: we need to find a way to export this +// FIXME: we need to find a way to export this class APT_PUBLIC SourceList : public pkgSourceList { - public: // Add custom metaIndex (e.g. local files) void AddMetaIndex(metaIndex *mi) { @@ -22,17 +23,11 @@ class APT_PUBLIC SourceList : public pkgSourceList }; // class CacheFile - Cover class for some dependency cache functions /*{{{*/ -// --------------------------------------------------------------------- -/* */ class APT_PUBLIC CacheFile : public pkgCacheFile { - static pkgCache *SortCache; - APT_HIDDEN static int NameComp(const void *a,const void *b) APT_PURE; - public: - pkgCache::Package **List; - - void Sort(); + std::vector UniverseList; + bool CheckDeps(bool AllowBroken = false); bool BuildCaches(bool WithLock = true) { @@ -51,14 +46,10 @@ class APT_PUBLIC CacheFile : public pkgCacheFile return _error->Error(_("The list of sources could not be read.")); return true; } - bool Open(bool WithLock = true) + bool Open(bool WithLock = true) { OpTextProgress Prog(*_config); - if (pkgCacheFile::Open(&Prog,WithLock) == false) - return false; - Sort(); - - return true; + return pkgCacheFile::Open(&Prog,WithLock); }; bool OpenForInstall() { @@ -67,11 +58,39 @@ class APT_PUBLIC CacheFile : public pkgCacheFile else return Open(true); } - CacheFile() : List(0) {}; - ~CacheFile() { - delete[] List; - } }; /*}}}*/ +class APT_PUBLIC SortedPackageUniverse : public APT::PackageUniverse +{ + std::vector &List; + void LazyInit() const; + +public: + SortedPackageUniverse(CacheFile &Cache); + + class const_iterator : public APT::Container_iterator_base::const_iterator, pkgCache::PkgIterator> + { + pkgCache * const Cache; + protected: + inline virtual pkgCache::PkgIterator getType(void) const APT_OVERRIDE + { + if (*_iter == 0) return pkgCache::PkgIterator(*Cache); + return pkgCache::PkgIterator(*Cache, Cache->PkgP + *_iter); + } + public: + explicit const_iterator(pkgCache * const Owner, std::vector::const_iterator i): + Container_iterator_base::const_iterator, pkgCache::PkgIterator>(i), Cache(Owner) {} + + }; + typedef const_iterator iterator; + + APT_PUBLIC const_iterator begin() const { LazyInit(); return const_iterator(data(), List.begin()); } + APT_PUBLIC const_iterator end() const { LazyInit(); return const_iterator(data(), List.end()); } + APT_PUBLIC const_iterator cbegin() const { LazyInit(); return const_iterator(data(), List.begin()); } + APT_PUBLIC const_iterator cend() const { LazyInit(); return const_iterator(data(), List.end()); } + APT_PUBLIC iterator begin() { LazyInit(); return iterator(data(), List.begin()); } + APT_PUBLIC iterator end() { LazyInit(); return iterator(data(), List.end()); } +}; + #endif diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h index 518f179f3..7cafe4fdd 100644 --- a/apt-private/private-cacheset.h +++ b/apt-private/private-cacheset.h @@ -12,6 +12,8 @@ #include #include +#include + #include #include #include @@ -21,8 +23,6 @@ #include #include -#include "private-output.h" - #include class OpProgress; @@ -174,17 +174,19 @@ public: std::string VersionsList; SPtrArray Seen = new bool[Cache.GetPkgCache()->Head().PackageCount]; memset(Seen,0,Cache.GetPkgCache()->Head().PackageCount*sizeof(*Seen)); + APT::PackageList pkglist; for (pkgCache::DepIterator Dep = Pkg.RevDependsList(); Dep.end() == false; ++Dep) { if (Dep->Type != pkgCache::Dep::Replaces) continue; - if (Seen[Dep.ParentPkg()->ID] == true) + pkgCache::PkgIterator const DP = Dep.ParentPkg(); + if (Seen[DP->ID] == true) continue; - Seen[Dep.ParentPkg()->ID] = true; - List += Dep.ParentPkg().FullName(true) + " "; - //VersionsList += std::string(Dep.ParentPkg().CurVersion) + "\n"; ??? + Seen[DP->ID] = true; + pkglist.insert(DP); } - ShowList(c1out,_("However the following packages replace it:"),List,VersionsList); + ShowList(c1out, _("However the following packages replace it:"), pkglist, + &AlwaysTrue, &PrettyFullName, &EmptyString); } c1out << std::endl; } diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 3474d262a..cdca45755 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -374,11 +374,10 @@ static bool DoAutomaticRemove(CacheFile &Cache) unsigned long autoRemoveCount = 0; APT::PackageSet tooMuch; - APT::PackageList autoRemoveList; + SortedPackageUniverse Universe(Cache); // look over the cache to see what can be removed - for (unsigned J = 0; J < Cache->Head().PackageCount; ++J) + for (auto const &Pkg: Universe) { - pkgCache::PkgIterator Pkg(Cache,Cache.List[J]); if (Cache[Pkg].Garbage) { if(Pkg.CurrentVer() != 0 || Cache[Pkg].Install()) @@ -395,8 +394,6 @@ static bool DoAutomaticRemove(CacheFile &Cache) } else { - if (hideAutoRemove == false && Cache[Pkg].Delete() == false) - autoRemoveList.insert(Pkg); // if the package is a new install and already garbage we don't need to // install it in the first place, so nuke it instead of show it if (Cache[Pkg].Install() == true && Pkg.CurrentVer() == 0) @@ -456,18 +453,6 @@ static bool DoAutomaticRemove(CacheFile &Cache) } while (Changed == true); } - std::string autoremovelist, autoremoveversions; - if (smallList == false && autoRemoveCount != 0) - { - for (APT::PackageList::const_iterator Pkg = autoRemoveList.begin(); Pkg != autoRemoveList.end(); ++Pkg) - { - if (Cache[Pkg].Garbage == false) - continue; - autoremovelist += Pkg.FullName(true) + " "; - autoremoveversions += std::string(Cache[Pkg].CandVersion) + "\n"; - } - } - // Now see if we had destroyed anything (if we had done anything) if (Cache->BrokenCount() != 0) { @@ -482,12 +467,17 @@ static bool DoAutomaticRemove(CacheFile &Cache) } // if we don't remove them, we should show them! - if (doAutoRemove == false && (autoremovelist.empty() == false || autoRemoveCount != 0)) + if (doAutoRemove == false && autoRemoveCount != 0) { if (smallList == false) + { + SortedPackageUniverse Universe(Cache); ShowList(c1out, P_("The following package was automatically installed and is no longer required:", "The following packages were automatically installed and are no longer required:", - autoRemoveCount), autoremovelist, autoremoveversions); + autoRemoveCount), Universe, + [&Cache](pkgCache::PkgIterator const &Pkg) { return (*Cache)[Pkg].Garbage == true && (*Cache)[Pkg].Delete() == false; }, + &PrettyFullName, CandidateVersion(&Cache)); + } else ioprintf(c1out, P_("%lu package was automatically installed and is no longer required.\n", "%lu packages were automatically installed and are no longer required.\n", autoRemoveCount), autoRemoveCount); @@ -651,6 +641,18 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, // DoInstall - Install packages from the command line /*{{{*/ // --------------------------------------------------------------------- /* Install named packages */ +struct PkgIsExtraInstalled { + pkgCacheFile * const Cache; + APT::VersionSet const * const verset; + PkgIsExtraInstalled(pkgCacheFile * const Cache, APT::VersionSet const * const Container) : Cache(Cache), verset(Container) {} + bool operator() (pkgCache::PkgIterator const Pkg) + { + if ((*Cache)[Pkg].Install() == false) + return false; + pkgCache::VerIterator const Cand = (*Cache)[Pkg].CandidateVerIter(*Cache); + return verset->find(Cand) == verset->end(); + } +}; bool DoInstall(CommandLine &CmdL) { CacheFile Cache; @@ -689,35 +691,18 @@ bool DoInstall(CommandLine &CmdL) /* Print out a list of packages that are going to be installed extra to what the user asked */ + SortedPackageUniverse Universe(Cache); if (Cache->InstCount() != verset[MOD_INSTALL].size()) - { - std::string List; - std::string VersionsList; - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) - { - pkgCache::PkgIterator I(Cache,Cache.List[J]); - if ((*Cache)[I].Install() == false) - continue; - pkgCache::VerIterator Cand = Cache[I].CandidateVerIter(Cache); - - if (verset[MOD_INSTALL].find(Cand) != verset[MOD_INSTALL].end()) - continue; - - List += I.FullName(true) + " "; - VersionsList += std::string(Cache[I].CandVersion) + "\n"; - } - - ShowList(c1out,_("The following extra packages will be installed:"),List,VersionsList); - } + ShowList(c1out, _("The following extra packages will be installed:"), Universe, + PkgIsExtraInstalled(&Cache, &verset[MOD_INSTALL]), + &PrettyFullName, CandidateVersion(&Cache)); /* Print out a list of suggested and recommended packages */ { std::string SuggestsList, RecommendsList; std::string SuggestsVersions, RecommendsVersions; - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) + for (auto const &Pkg: Universe) { - pkgCache::PkgIterator Pkg(Cache,Cache.List[J]); - /* Just look at the ones we want to install */ if ((*Cache)[Pkg].Install() == false) continue; @@ -738,7 +723,6 @@ bool DoInstall(CommandLine &CmdL) for(;;) { /* Skip if package is installed already, or is about to be */ - std::string target = Start.TargetPkg().FullName(true) + " "; pkgCache::PkgIterator const TarPkg = Start.TargetPkg(); if (TarPkg->SelectedState == pkgCache::State::Install || TarPkg->SelectedState == pkgCache::State::Hold || @@ -749,6 +733,7 @@ bool DoInstall(CommandLine &CmdL) } /* Skip if we already saw it */ + std::string target = Start.TargetPkg().FullName(true) + " "; if (int(SuggestsList.find(target)) != -1 || int(RecommendsList.find(target)) != -1) { foundInstalledInOrGroup=true; diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc index 9944ab002..b77efff86 100644 --- a/apt-private/private-output.cc +++ b/apt-private/private-output.cc @@ -25,6 +25,8 @@ #include #include +#include + #include /*}}}*/ @@ -491,11 +493,9 @@ void ShowBroken(ostream &out, CacheFile &Cache, bool const Now) return; out << _("The following packages have unmet dependencies:") << endl; - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) - { - pkgCache::PkgIterator const I(Cache,Cache.List[J]); - ShowBrokenPackage(out, &Cache, I, Now); - } + SortedPackageUniverse Universe(Cache); + for (auto const &Pkg: Universe) + ShowBrokenPackage(out, &Cache, Pkg, Now); } void ShowBroken(ostream &out, pkgCacheFile &Cache, bool const Now) { @@ -503,98 +503,64 @@ void ShowBroken(ostream &out, pkgCacheFile &Cache, bool const Now) return; out << _("The following packages have unmet dependencies:") << endl; - for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg) + APT::PackageUniverse Universe(Cache); + for (auto const &Pkg: Universe) ShowBrokenPackage(out, &Cache, Pkg, Now); } /*}}}*/ // ShowNew - Show packages to newly install /*{{{*/ -// --------------------------------------------------------------------- -/* */ void ShowNew(ostream &out,CacheFile &Cache) { - /* Print out a list of packages that are going to be installed extra - to what the user asked */ - string List; - string VersionsList; - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) - { - pkgCache::PkgIterator I(Cache,Cache.List[J]); - if (Cache[I].NewInstall() == true) { - List += I.FullName(true) + " "; - VersionsList += string(Cache[I].CandVersion) + "\n"; - } - } - - ShowList(out,_("The following NEW packages will be installed:"),List,VersionsList); + SortedPackageUniverse Universe(Cache); + ShowList(out,_("The following NEW packages will be installed:"), Universe, + [&Cache](pkgCache::PkgIterator const &Pkg) { return Cache[Pkg].NewInstall(); }, + &PrettyFullName, + CandidateVersion(&Cache)); } /*}}}*/ // ShowDel - Show packages to delete /*{{{*/ -// --------------------------------------------------------------------- -/* */ void ShowDel(ostream &out,CacheFile &Cache) { - /* Print out a list of packages that are going to be removed extra - to what the user asked */ - string List; - string VersionsList; - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) - { - pkgCache::PkgIterator I(Cache,Cache.List[J]); - if (Cache[I].Delete() == true) - { - if ((Cache[I].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge) - List += I.FullName(true) + "* "; - else - List += I.FullName(true) + " "; - - VersionsList += string(Cache[I].CandVersion)+ "\n"; - } - } - - ShowList(out,_("The following packages will be REMOVED:"),List,VersionsList); + SortedPackageUniverse Universe(Cache); + ShowList(out,_("The following packages will be REMOVED:"), Universe, + [&Cache](pkgCache::PkgIterator const &Pkg) { return Cache[Pkg].Delete(); }, + [&Cache](pkgCache::PkgIterator const &Pkg) + { + std::string str = PrettyFullName(Pkg); + if (((*Cache)[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge) + str.append("*"); + return str; + }, + CandidateVersion(&Cache)); } /*}}}*/ // ShowKept - Show kept packages /*{{{*/ -// --------------------------------------------------------------------- -/* */ void ShowKept(ostream &out,CacheFile &Cache) { - string List; - string VersionsList; - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) - { - pkgCache::PkgIterator I(Cache,Cache.List[J]); - - // Not interesting - if (Cache[I].Upgrade() == true || Cache[I].Upgradable() == false || - I->CurrentVer == 0 || Cache[I].Delete() == true) - continue; - - List += I.FullName(true) + " "; - VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n"; - } - ShowList(out,_("The following packages have been kept back:"),List,VersionsList); + SortedPackageUniverse Universe(Cache); + ShowList(out,_("The following packages have been kept back:"), Universe, + [&Cache](pkgCache::PkgIterator const &Pkg) + { + return Cache[Pkg].Upgrade() == false && + Cache[Pkg].Upgradable() == true && + Pkg->CurrentVer != 0 && + Cache[Pkg].Delete() == false; + }, + &PrettyFullName, + CurrentToCandidateVersion(&Cache)); } /*}}}*/ // ShowUpgraded - Show upgraded packages /*{{{*/ -// --------------------------------------------------------------------- -/* */ void ShowUpgraded(ostream &out,CacheFile &Cache) { - string List; - string VersionsList; - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) - { - pkgCache::PkgIterator I(Cache,Cache.List[J]); - - // Not interesting - if (Cache[I].Upgrade() == false || Cache[I].NewInstall() == true) - continue; - - List += I.FullName(true) + " "; - VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n"; - } - ShowList(out,_("The following packages will be upgraded:"),List,VersionsList); + SortedPackageUniverse Universe(Cache); + ShowList(out,_("The following packages will be upgraded:"), Universe, + [&Cache](pkgCache::PkgIterator const &Pkg) + { + return Cache[Pkg].Upgrade() == true && Cache[Pkg].NewInstall() == false; + }, + &PrettyFullName, + CurrentToCandidateVersion(&Cache)); } /*}}}*/ // ShowDowngraded - Show downgraded packages /*{{{*/ @@ -602,74 +568,73 @@ void ShowUpgraded(ostream &out,CacheFile &Cache) /* */ bool ShowDowngraded(ostream &out,CacheFile &Cache) { - string List; - string VersionsList; - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) - { - pkgCache::PkgIterator I(Cache,Cache.List[J]); - - // Not interesting - if (Cache[I].Downgrade() == false || Cache[I].NewInstall() == true) - continue; - - List += I.FullName(true) + " "; - VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n"; - } - return ShowList(out,_("The following packages will be DOWNGRADED:"),List,VersionsList); + SortedPackageUniverse Universe(Cache); + return ShowList(out,_("The following packages will be DOWNGRADED:"), Universe, + [&Cache](pkgCache::PkgIterator const &Pkg) + { + return Cache[Pkg].Downgrade() == true && Cache[Pkg].NewInstall() == false; + }, + &PrettyFullName, + CurrentToCandidateVersion(&Cache)); } /*}}}*/ // ShowHold - Show held but changed packages /*{{{*/ -// --------------------------------------------------------------------- -/* */ bool ShowHold(ostream &out,CacheFile &Cache) { - string List; - string VersionsList; - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) - { - pkgCache::PkgIterator I(Cache,Cache.List[J]); - if (Cache[I].InstallVer != (pkgCache::Version *)I.CurrentVer() && - I->SelectedState == pkgCache::State::Hold) { - List += I.FullName(true) + " "; - VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n"; - } - } - - return ShowList(out,_("The following held packages will be changed:"),List,VersionsList); + SortedPackageUniverse Universe(Cache); + return ShowList(out,_("The following held packages will be changed:"), Universe, + [&Cache](pkgCache::PkgIterator const &Pkg) + { + return Pkg->SelectedState == pkgCache::State::Hold && + Cache[Pkg].InstallVer != (pkgCache::Version *)Pkg.CurrentVer(); + }, + &PrettyFullName, + CurrentToCandidateVersion(&Cache)); } /*}}}*/ // ShowEssential - Show an essential package warning /*{{{*/ // --------------------------------------------------------------------- /* This prints out a warning message that is not to be ignored. It shows - all essential packages and their dependents that are to be removed. + all essential packages and their dependents that are to be removed. It is insanely risky to remove the dependents of an essential package! */ +struct APT_HIDDEN PrettyFullNameWithDue { + std::map due; + PrettyFullNameWithDue() {} + std::string operator() (pkgCache::PkgIterator const &Pkg) + { + std::string const A = PrettyFullName(Pkg); + std::map::const_iterator d = due.find(Pkg->ID); + if (d == due.end()) + return A; + + std::string const B = PrettyFullName(d->second); + std::ostringstream outstr; + ioprintf(outstr, _("%s (due to %s)"), A.c_str(), B.c_str()); + return outstr.str(); + } +}; bool ShowEssential(ostream &out,CacheFile &Cache) { - string List; - string VersionsList; - bool *Added = new bool[Cache->Head().PackageCount]; - for (unsigned int I = 0; I != Cache->Head().PackageCount; I++) - Added[I] = false; - - for (unsigned J = 0; J < Cache->Head().PackageCount; J++) + std::vector Added(Cache->Head().PackageCount, false); + APT::PackageDeque pkglist; + PrettyFullNameWithDue withdue; + + SortedPackageUniverse Universe(Cache); + for (pkgCache::PkgIterator const &I: Universe) { - pkgCache::PkgIterator I(Cache,Cache.List[J]); if ((I->Flags & pkgCache::Flag::Essential) != pkgCache::Flag::Essential && (I->Flags & pkgCache::Flag::Important) != pkgCache::Flag::Important) continue; - + // The essential package is being removed - if (Cache[I].Delete() == true) + if (Cache[I].Delete() == false) + continue; + + if (Added[I->ID] == false) { - if (Added[I->ID] == false) - { - Added[I->ID] = true; - List += I.FullName(true) + " "; - //VersionsList += string(Cache[I].CurVersion) + "\n"; ??? - } + Added[I->ID] = true; + pkglist.insert(I); } - else - continue; if (I->CurrentVer == 0) continue; @@ -681,27 +646,23 @@ bool ShowEssential(ostream &out,CacheFile &Cache) if (D->Type != pkgCache::Dep::PreDepends && D->Type != pkgCache::Dep::Depends) continue; - + pkgCache::PkgIterator P = D.SmartTargetPkg(); if (Cache[P].Delete() == true) { if (Added[P->ID] == true) continue; Added[P->ID] = true; - - char S[300]; - snprintf(S,sizeof(S),_("%s (due to %s) "),P.FullName(true).c_str(),I.FullName(true).c_str()); - List += S; - //VersionsList += "\n"; ??? - } - } + + pkglist.insert(P); + withdue.due[P->ID] = I; + } + } } - - delete [] Added; return ShowList(out,_("WARNING: The following essential packages will be removed.\n" - "This should NOT be done unless you know exactly what you are doing!"),List,VersionsList); + "This should NOT be done unless you know exactly what you are doing!"), + pkglist, &AlwaysTrue, withdue, &EmptyString); } - /*}}}*/ // Stats - Show some statistics /*{{{*/ // --------------------------------------------------------------------- @@ -829,3 +790,33 @@ bool AnalPrompt(const char *Text) return false; } /*}}}*/ + +std::string PrettyFullName(pkgCache::PkgIterator const &Pkg) +{ + return Pkg.FullName(true); +} +std::string CandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg) +{ + return (*Cache)[Pkg].CandVersion; +} +std::function CandidateVersion(pkgCacheFile * const Cache) +{ + return std::bind(static_cast(&CandidateVersion), Cache, std::placeholders::_1); +} +std::string CurrentToCandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg) +{ + return std::string((*Cache)[Pkg].CurVersion) + " => " + (*Cache)[Pkg].CandVersion; +} +std::function CurrentToCandidateVersion(pkgCacheFile * const Cache) +{ + return std::bind(static_cast(&CurrentToCandidateVersion), Cache, std::placeholders::_1); +} +bool AlwaysTrue(pkgCache::PkgIterator const &) +{ + return true; +} +std::string EmptyString(pkgCache::PkgIterator const &) +{ + return std::string(); +} + diff --git a/apt-private/private-output.h b/apt-private/private-output.h index d5b57adec..b9151b245 100644 --- a/apt-private/private-output.h +++ b/apt-private/private-output.h @@ -1,9 +1,11 @@ #ifndef APT_PRIVATE_OUTPUT_H #define APT_PRIVATE_OUTPUT_H +#include #include #include +#include #include #include #include @@ -32,8 +34,63 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, APT_PUBLIC void ShowBroken(std::ostream &out, CacheFile &Cache, bool const Now); APT_PUBLIC void ShowBroken(std::ostream &out, pkgCacheFile &Cache, bool const Now); -APT_PUBLIC bool ShowList(std::ostream &out, std::string Title, std::string List, +template APT_PUBLIC bool ShowList(std::ostream &out, std::string const &Title, + Container const &cont, + std::function Predicate, + std::function PkgDisplay, + std::function VerboseDisplay) +{ + size_t const ScreenWidth = (::ScreenWidth > 3) ? ::ScreenWidth - 3 : 0; + int ScreenUsed = 0; + bool const ShowVersions = _config->FindB("APT::Get::Show-Versions", false); + bool printedTitle = false; + + for (auto const &Pkg: cont) + { + if (Predicate(Pkg) == false) + continue; + + if (printedTitle == false) + { + out << Title; + printedTitle = true; + } + + if (ShowVersions == true) + { + out << std::endl << " " << PkgDisplay(Pkg); + std::string const verbose = VerboseDisplay(Pkg); + if (verbose.empty() == false) + out << " (" << verbose << ")"; + } + else + { + std::string const PkgName = PkgDisplay(Pkg); + if (ScreenUsed == 0 || (ScreenUsed + PkgName.length()) >= ScreenWidth) + { + out << std::endl << " "; + ScreenUsed = 0; + } + else if (ScreenUsed != 0) + { + out << " "; + ++ScreenUsed; + } + out << PkgName; + ScreenUsed += PkgName.length(); + } + } + + if (printedTitle == true) + { + out << std::endl; + return false; + } + return true; +} +APT_DEPRECATED APT_PUBLIC bool ShowList(std::ostream &out, std::string Title, std::string List, std::string VersionsList); + void ShowNew(std::ostream &out,CacheFile &Cache); void ShowDel(std::ostream &out,CacheFile &Cache); void ShowKept(std::ostream &out,CacheFile &Cache); @@ -49,4 +106,12 @@ void Stats(std::ostream &out, pkgDepCache &Dep); bool YnPrompt(bool Default=true); bool AnalPrompt(const char *Text); +APT_PUBLIC std::string PrettyFullName(pkgCache::PkgIterator const &Pkg); +APT_PUBLIC std::string CandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); +APT_PUBLIC std::function CandidateVersion(pkgCacheFile * const Cache); +APT_PUBLIC std::string CurrentToCandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); +APT_PUBLIC std::function CurrentToCandidateVersion(pkgCacheFile * const Cache); +APT_PUBLIC std::string EmptyString(pkgCache::PkgIterator const &); +APT_PUBLIC bool AlwaysTrue(pkgCache::PkgIterator const &); + #endif diff --git a/po/apt-all.pot b/po/apt-all.pot index 73b033876..e2d09401b 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -1135,7 +1135,7 @@ msgstr "" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " +msgid "%s (due to %s)" msgstr "" #: apt-private/private-output.cc:696 diff --git a/po/ar.po b/po/ar.po index 3e71fef80..8c1622d91 100644 --- a/po/ar.po +++ b/po/ar.po @@ -1151,8 +1151,8 @@ msgstr "سيتم تغيير الحزم المبقاة التالية:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (بسبب %s) " +msgid "%s (due to %s)" +msgstr "%s (بسبب %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/ast.po b/po/ast.po index 1995c12f6..07888ebe2 100644 --- a/po/ast.po +++ b/po/ast.po @@ -1261,8 +1261,8 @@ msgstr "Van camudase los siguientes paquetes reteníos:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (por %s) " +msgid "%s (due to %s)" +msgstr "%s (por %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/bg.po b/po/bg.po index 7dff005e6..6dc47f5bb 100644 --- a/po/bg.po +++ b/po/bg.po @@ -1294,8 +1294,8 @@ msgstr "Следните задържани пакети ще бъдат про #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (поради %s) " +msgid "%s (due to %s)" +msgstr "%s (поради %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/bs.po b/po/bs.po index abb9a570a..e68cee981 100644 --- a/po/bs.po +++ b/po/bs.po @@ -1159,7 +1159,7 @@ msgstr "" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " +msgid "%s (due to %s)" msgstr "" #: apt-private/private-output.cc:696 diff --git a/po/ca.po b/po/ca.po index 065ad0ea7..3f111875d 100644 --- a/po/ca.po +++ b/po/ca.po @@ -1276,8 +1276,8 @@ msgstr "Es canviaran els paquets retinguts següents:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (per %s) " +msgid "%s (due to %s)" +msgstr "%s (per %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/cs.po b/po/cs.po index 3f6bcb4a7..4de2b7006 100644 --- a/po/cs.po +++ b/po/cs.po @@ -1301,8 +1301,8 @@ msgstr "Následující podržené balíky budou změněny:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (kvůli %s) " +msgid "%s (due to %s)" +msgstr "%s (kvůli %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/cy.po b/po/cy.po index b05bc7c59..db9ec0bbc 100644 --- a/po/cy.po +++ b/po/cy.po @@ -1288,8 +1288,8 @@ msgstr "Caiff y pecynnau wedi eu dal canlynol eu newid:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (oherwydd %s) " +msgid "%s (due to %s)" +msgstr "%s (oherwydd %s)" #: apt-private/private-output.cc:696 #, fuzzy diff --git a/po/da.po b/po/da.po index d6b8e07a1..f337879f6 100644 --- a/po/da.po +++ b/po/da.po @@ -1319,8 +1319,8 @@ msgstr "Følgende tilbageholdte pakker vil blive ændret:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (grundet %s) " +msgid "%s (due to %s)" +msgstr "%s (grundet %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/de.po b/po/de.po index d4ca0d5a0..0b363c8de 100644 --- a/po/de.po +++ b/po/de.po @@ -1364,8 +1364,8 @@ msgstr "Die folgenden zurückgehaltenen Pakete werden verändert:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (wegen %s) " +msgid "%s (due to %s)" +msgstr "%s (wegen %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/dz.po b/po/dz.po index a4c50d245..e27ea6a90 100644 --- a/po/dz.po +++ b/po/dz.po @@ -1256,7 +1256,7 @@ msgstr "འོག་གི་འཆང་ཡོད་པའི་ཐུམ་ས #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " +msgid "%s (due to %s)" msgstr "%s( %s་གིས་སྦེ)" #: apt-private/private-output.cc:696 diff --git a/po/el.po b/po/el.po index 98e1f31c9..b2370c6ad 100644 --- a/po/el.po +++ b/po/el.po @@ -1272,8 +1272,8 @@ msgstr "Τα ακόλουθα κρατημένα πακέτα θα αλλαχθ #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (λόγω του %s) " +msgid "%s (due to %s)" +msgstr "%s (λόγω του %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/es.po b/po/es.po index a2a9a71e9..c071ffb4a 100644 --- a/po/es.po +++ b/po/es.po @@ -1388,8 +1388,8 @@ msgstr "Se cambiarán los siguientes paquetes retenidos:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (por %s) " +msgid "%s (due to %s)" +msgstr "%s (por %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/eu.po b/po/eu.po index f1e90411a..528c6cc51 100644 --- a/po/eu.po +++ b/po/eu.po @@ -1257,8 +1257,8 @@ msgstr "Ondorengo pakete atxikiak aldatu egingo dira:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (arrazoia: %s) " +msgid "%s (due to %s)" +msgstr "%s (arrazoia: %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/fi.po b/po/fi.po index c40ed8e9e..5a5299255 100644 --- a/po/fi.po +++ b/po/fi.po @@ -1248,8 +1248,8 @@ msgstr "Seuraavat pysytetyt paketit muutetaan:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (syynä %s) " +msgid "%s (due to %s)" +msgstr "%s (syynä %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/fr.po b/po/fr.po index ecb752f5e..0a437907f 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1328,8 +1328,8 @@ msgstr "Les paquets retenus suivants seront changés :" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (en raison de %s) " +msgid "%s (due to %s)" +msgstr "%s (en raison de %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/gl.po b/po/gl.po index 2adaa302a..9ec10122b 100644 --- a/po/gl.po +++ b/po/gl.po @@ -1275,8 +1275,8 @@ msgstr "Vanse modificar os paquetes retidos seguintes:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (por mor de %s) " +msgid "%s (due to %s)" +msgstr "%s (por mor de %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/he.po b/po/he.po index ab7b50745..2c355f863 100644 --- a/po/he.po +++ b/po/he.po @@ -610,8 +610,8 @@ msgstr "החבילות המחוזקות הבאות ישונו:" #: cmdline/apt-get.cc:545 #, c-format -msgid "%s (due to %s) " -msgstr "%s (בגלל %s) " +msgid "%s (due to %s)" +msgstr "%s (בגלל %s)" #: cmdline/apt-get.cc:553 #, fuzzy diff --git a/po/hu.po b/po/hu.po index 635184c75..fcf53f727 100644 --- a/po/hu.po +++ b/po/hu.po @@ -1291,8 +1291,8 @@ msgstr "Az alábbi visszafogott csomagokat cserélem:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (%s miatt) " +msgid "%s (due to %s)" +msgstr "%s (%s miatt)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/it.po b/po/it.po index 178754c52..6d9793c55 100644 --- a/po/it.po +++ b/po/it.po @@ -1323,8 +1323,8 @@ msgstr "I seguenti pacchetti bloccati saranno cambiati:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (a causa di %s) " +msgid "%s (due to %s)" +msgstr "%s (a causa di %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/ja.po b/po/ja.po index f8f55f8aa..6e0e21418 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1324,8 +1324,8 @@ msgstr "以下の変更禁止パッケージは変更されます:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (%s のため) " +msgid "%s (due to %s)" +msgstr "%s (%s のため)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/km.po b/po/km.po index 8c72865f8..8ae605510 100644 --- a/po/km.po +++ b/po/km.po @@ -1242,8 +1242,8 @@ msgstr "កញ្ចប់​រង់ចាំ​ខាងក្រោម​ន #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (ដោយ​សារតែ​ %s) " +msgid "%s (due to %s)" +msgstr "%s (ដោយ​សារតែ​ %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/ko.po b/po/ko.po index 51cc27d61..e5b08fdec 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1250,8 +1250,8 @@ msgstr "고정되었던 다음 패키지를 바꿀 것입니다:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (%s때문에) " +msgid "%s (due to %s)" +msgstr "%s (%s때문에)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/ku.po b/po/ku.po index 540307937..3b2d6ed12 100644 --- a/po/ku.po +++ b/po/ku.po @@ -1162,7 +1162,7 @@ msgstr "" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " +msgid "%s (due to %s)" msgstr "%s (ji ber %s)" #: apt-private/private-output.cc:696 diff --git a/po/lt.po b/po/lt.po index 1f485b28d..6d0365183 100644 --- a/po/lt.po +++ b/po/lt.po @@ -1166,8 +1166,8 @@ msgstr "Bus pakeisti šie sulaikyti paketai:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (dėl %s) " +msgid "%s (due to %s)" +msgstr "%s (dėl %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/mr.po b/po/mr.po index 24e470cef..31bdb63c9 100644 --- a/po/mr.po +++ b/po/mr.po @@ -1240,7 +1240,7 @@ msgstr "पुढिल ठेवलेली पॅकेजेस बदलत #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " +msgid "%s (due to %s)" msgstr "%s (च्या मुळे %s)" #: apt-private/private-output.cc:696 diff --git a/po/nb.po b/po/nb.po index 433e33909..41563cecd 100644 --- a/po/nb.po +++ b/po/nb.po @@ -1258,8 +1258,8 @@ msgstr "Følgende pakker vil bli endret:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (pga. %s) " +msgid "%s (due to %s)" +msgstr "%s (pga. %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/ne.po b/po/ne.po index 4c6f2d098..b5fb2c6fc 100644 --- a/po/ne.po +++ b/po/ne.po @@ -1240,8 +1240,8 @@ msgstr "निम्न भइरहेको प्याकेजहरू प #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (%s कारणले) " +msgid "%s (due to %s)" +msgstr "%s (%s कारणले)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/nl.po b/po/nl.po index 5c774fe8d..2214ac65c 100644 --- a/po/nl.po +++ b/po/nl.po @@ -1337,8 +1337,8 @@ msgstr "De volgende vastgehouden pakketten zullen gewijzigd worden:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (vanwege %s) " +msgid "%s (due to %s)" +msgstr "%s (vanwege %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/nn.po b/po/nn.po index 0886c266a..5c8c39967 100644 --- a/po/nn.po +++ b/po/nn.po @@ -1251,8 +1251,8 @@ msgstr "Dei f #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (fordi %s) " +msgid "%s (due to %s)" +msgstr "%s (fordi %s)" #: apt-private/private-output.cc:696 #, fuzzy diff --git a/po/pl.po b/po/pl.po index 1851fa805..f248841c9 100644 --- a/po/pl.po +++ b/po/pl.po @@ -1302,8 +1302,8 @@ msgstr "Zostaną zmienione następujące zatrzymane pakiety:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (z powodu %s) " +msgid "%s (due to %s)" +msgstr "%s (z powodu %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/pt.po b/po/pt.po index 4f05ada82..0e106a7d1 100644 --- a/po/pt.po +++ b/po/pt.po @@ -1291,8 +1291,8 @@ msgstr "Os seguintes pacotes mantidos serão mudados:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (devido a %s) " +msgid "%s (due to %s)" +msgstr "%s (devido a %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 5e2abd988..c50792b79 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -1264,8 +1264,8 @@ msgstr "Os seguintes pacotes mantidos serão mudados:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (por causa de %s) " +msgid "%s (due to %s)" +msgstr "%s (por causa de %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/ro.po b/po/ro.po index 9b0a1494a..7b94bd3d8 100644 --- a/po/ro.po +++ b/po/ro.po @@ -1267,8 +1267,8 @@ msgstr "Următoarele pachete ținute vor fi schimbate:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (datorită %s) " +msgid "%s (due to %s)" +msgstr "%s (datorită %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/ru.po b/po/ru.po index 7d30cb696..5e52b9234 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1614,8 +1614,8 @@ msgstr "" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (вследствие %s) " +msgid "%s (due to %s)" +msgstr "%s (вследствие %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/sk.po b/po/sk.po index 631ddd826..0aeb167ea 100644 --- a/po/sk.po +++ b/po/sk.po @@ -1280,8 +1280,8 @@ msgstr "Nasledovné pridržané balíky sa zmenia:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (kvôli %s) " +msgid "%s (due to %s)" +msgstr "%s (kvôli %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/sl.po b/po/sl.po index 845fe3c5f..496919956 100644 --- a/po/sl.po +++ b/po/sl.po @@ -1277,8 +1277,8 @@ msgstr "Naslednji zadržani paketi bodo spremenjeni:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (zaradi %s) " +msgid "%s (due to %s)" +msgstr "%s (zaradi %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/sv.po b/po/sv.po index 52f65b598..bdf00ff65 100644 --- a/po/sv.po +++ b/po/sv.po @@ -1266,8 +1266,8 @@ msgstr "Följande tillbakahållna paket kommer att ändras:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (på grund av %s) " +msgid "%s (due to %s)" +msgstr "%s (på grund av %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/th.po b/po/th.po index 60a468ea4..c016205c5 100644 --- a/po/th.po +++ b/po/th.po @@ -1287,8 +1287,8 @@ msgstr "จะเปลี่ยนแปลงรายการคงรุ่ #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (เนื่องจาก %s) " +msgid "%s (due to %s)" +msgstr "%s (เนื่องจาก %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/tl.po b/po/tl.po index 970b0b387..be3371704 100644 --- a/po/tl.po +++ b/po/tl.po @@ -1258,8 +1258,8 @@ msgstr "Ang susunod na mga hinawakang mga pakete ay babaguhin:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (dahil sa %s) " +msgid "%s (due to %s)" +msgstr "%s (dahil sa %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/tr.po b/po/tr.po index 79945ebd3..8b8691a55 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1315,8 +1315,8 @@ msgstr "Aşağıdaki eski sürümlerinde tutulan paketler değiştirilecek:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (%s nedeniyle) " +msgid "%s (due to %s)" +msgstr "%s (%s nedeniyle)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/uk.po b/po/uk.po index 47976d39c..514403641 100644 --- a/po/uk.po +++ b/po/uk.po @@ -1298,8 +1298,8 @@ msgstr "Пакунки, які мали б залишитися без змін, #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (внаслідок %s) " +msgid "%s (due to %s)" +msgstr "%s (внаслідок %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/vi.po b/po/vi.po index 2edb52f22..73770ce74 100644 --- a/po/vi.po +++ b/po/vi.po @@ -1334,8 +1334,8 @@ msgstr "Những gói giữ lại sau đây sẽ bị THAY ĐỔI:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (bởi vì %s) " +msgid "%s (due to %s)" +msgstr "%s (bởi vì %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/zh_CN.po b/po/zh_CN.po index 6e9610ac9..1f92d6269 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1289,8 +1289,8 @@ msgstr "下列被要求保持版本不变的软件包将被改变:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s (是由于 %s) " +msgid "%s (due to %s)" +msgstr "%s (是由于 %s)" #: apt-private/private-output.cc:696 msgid "" diff --git a/po/zh_TW.po b/po/zh_TW.po index 201d9d675..f37e5e0ed 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -1236,8 +1236,8 @@ msgstr "下列被保留 (hold) 的套件將會被更改:" #: apt-private/private-output.cc:688 #, c-format -msgid "%s (due to %s) " -msgstr "%s(因為 %s)" +msgid "%s (due to %s)" +msgstr "%s(因為 %s" #: apt-private/private-output.cc:696 msgid "" diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index a0e4d3c24..454b47976 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -27,6 +27,19 @@ The following packages will be REMOVED: po-debconf 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Remv po-debconf [1.0.16]' aptget autoremove -s +testequal "Reading package lists... +Building dependency tree... +Reading state information... +The following package was automatically installed and is no longer required: + po-debconf +Use 'apt-get autoremove' to remove it. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s +testequal "Reading package lists... +Building dependency tree... +Reading state information... +1 package was automatically installed and is no longer required. +Use 'apt-get autoremove' to remove it. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small testdpkginstalled 'po-debconf' echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove @@ -63,6 +76,19 @@ The following packages will be REMOVED: 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. Remv debhelper [8.0.0] Remv po-debconf [1.0.16]' aptget autoremove -s +testequal "Reading package lists... +Building dependency tree... +Reading state information... +The following packages were automatically installed and are no longer required: + debhelper po-debconf +Use 'apt-get autoremove' to remove them. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s +testequal "Reading package lists... +Building dependency tree... +Reading state information... +2 packages were automatically installed and are no longer required. +Use 'apt-get autoremove' to remove them. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small testsuccess aptmark hold debhelper testsuccessequal 'Reading package lists... diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index c515837a3..94f280b81 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -37,6 +37,15 @@ WARNING: The following packages cannot be authenticated! Install these packages without verification? [y/N] N E: Some packages could not be authenticated" aptget install cool --assume-no -d +configarchitecture 'amd64' 'i386' +testequal "$(echo "$PKGTEXT" | sed 's#cool$#cool:i386#g') +WARNING: The following packages cannot be authenticated! + cool:i386 +Authentication warning overridden. +$DOWNLOG +Download complete and in download only mode" aptget install cool:i386 --assume-no -d --allow-unauthenticated +configarchitecture 'i386' + find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete sed -i -e 's#\(deb\(-src\)\?\) \[trusted=no\] #\1 #' $DEBFILE aptgetupdate diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index 52992680b..3b5fa20c4 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -23,6 +23,17 @@ The following NEW packages will be installed: Inst libavcodec52 (4:0.5.2-6 localhost [i386]) Conf libavcodec52 (4:0.5.2-6 localhost [i386])" aptget install libavcodec52 -s +testsuccessequal "Reading package lists... +Building dependency tree... +Reading state information... +1 package was automatically installed and is no longer required. +Use 'apt-get autoremove' to remove it. +The following NEW packages will be installed: + libavcodec52 +0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +Inst libavcodec52 (4:0.5.2-6 localhost [i386]) +Conf libavcodec52 (4:0.5.2-6 localhost [i386])" aptget install libavcodec52 -s -o APT::Get::HideAutoRemove=small + testfailureequal "Reading package lists... Building dependency tree... Reading state information... @@ -39,6 +50,21 @@ The following packages will be upgraded: Need to get 0 B/19.4 MB of archives. After this operation, 17.3 MB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation." aptget install dummy-archive --trivial-only +testequal "Reading package lists... +Building dependency tree... +Reading state information... +1 package was automatically installed and is no longer required. +Use 'apt-get autoremove' to remove it. +The following extra packages will be installed: + libavcodec52 libopenal-dev libvtk5.4 +The following NEW packages will be installed: + dummy-archive libavcodec52 libopenal-dev +The following packages will be upgraded: + libvtk5.4 +1 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/19.4 MB of archives. +After this operation, 17.3 MB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation." aptget install dummy-archive --trivial-only -o APT::Get::HideAutoRemove=small echo -n > rootdir/var/lib/dpkg/status rm rootdir/var/lib/apt/extended_states diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency index 5839f8798..18eab79c2 100755 --- a/test/integration/test-bug-613420-new-garbage-dependency +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -35,3 +35,19 @@ The following packages will be upgraded: 1 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. After this operation, 126 MB disk space will be freed. E: Trivial Only specified but this is not a trivial operation." aptget install libreoffice --trivial-only +testequal "Reading package lists... +Building dependency tree... +Reading state information... +2 packages were automatically installed and are no longer required. +Use 'apt-get autoremove' to remove them. +The following extra packages will be installed: + libreoffice-core libreoffice-officebean openoffice.org-officebean +The following packages will be REMOVED: + openoffice.org-core +The following NEW packages will be installed: + libreoffice libreoffice-core libreoffice-officebean +The following packages will be upgraded: + openoffice.org-officebean +1 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +After this operation, 126 MB disk space will be freed. +E: Trivial Only specified but this is not a trivial operation." aptget install libreoffice --trivial-only -o APT::Get::HideAutoRemove=small diff --git a/test/integration/test-bug-675449-essential-are-protected b/test/integration/test-bug-675449-essential-are-protected index f50507532..e62add938 100755 --- a/test/integration/test-bug-675449-essential-are-protected +++ b/test/integration/test-bug-675449-essential-are-protected @@ -87,3 +87,17 @@ Inst pkg-none-native [1] (2 unstable [amd64]) Conf pkg-none-native (2 unstable [amd64]) Inst pkg-none-new (2 unstable [amd64]) Conf pkg-none-new (2 unstable [amd64])' aptget dist-upgrade -s + +insertinstalledpackage 'foo' 'amd64' '1' 'Depends: libfoo +Essential: yes' +insertinstalledpackage 'libfoo' 'amd64' '1' +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + foo* libfoo* +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + foo libfoo (due to foo) +0 upgraded, 0 newly installed, 2 to remove and 4 not upgraded. +Purg foo [1] +Purg libfoo [1]' aptget purge libfoo -s diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove index c2fc37ee7..2b020ceca 100755 --- a/test/integration/test-kernel-helper-autoremove +++ b/test/integration/test-kernel-helper-autoremove @@ -58,6 +58,22 @@ testprotected() { testsuccessequal "Reading package lists... Building dependency tree... Reading state information... +The following packages were automatically installed and are no longer required: + linux-headers-1000000-1-generic (100.0.0-1) + linux-image-1.0.0-2-generic (1.0.0-2) + linux-image-100.0.0-1-generic (100.0.0-1) + $CURRENTKERNEL (1) +Use 'apt-get autoremove' to remove them. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV +testequal "Reading package lists... +Building dependency tree... +Reading state information... +4 packages were automatically installed and are no longer required. +Use 'apt-get autoremove' to remove them. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small +testequal "Reading package lists... +Building dependency tree... +Reading state information... The following packages will be REMOVED: linux-headers-1000000-1-generic (100.0.0-1) linux-image-1.0.0-2-generic (1.0.0-2) -- cgit v1.2.3 From 6cfadda161ce19e6c8076d0aa118f8f436805a6a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 12 Jul 2015 18:28:34 +0200 Subject: headers are for declarations only Housekeeping. This used to be embedded in apt-get directly, then moved to into our (then new) private lib and now header and code get a proper separation. Git-Dch: Ignore --- apt-private/private-cacheset.cc | 209 ++++++++++++++++++++++++++++++++- apt-private/private-cacheset.h | 249 ++++++---------------------------------- cmdline/apt-get.cc | 1 + 3 files changed, 243 insertions(+), 216 deletions(-) diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc index cb68024db..36d40117c 100644 --- a/apt-private/private-cacheset.cc +++ b/apt-private/private-cacheset.cc @@ -4,9 +4,11 @@ #include #include #include +#include #include #include #include +#include #include @@ -14,7 +16,7 @@ #include -bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile, +bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile, /*{{{*/ APT::VersionContainerInterface * const vci, OpProgress * const progress) { @@ -22,7 +24,6 @@ bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile, return GetLocalitySortedVersionSet(CacheFile, vci, null_matcher, progress); } - bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile, APT::VersionContainerInterface * const vci, Matcher &matcher, @@ -88,3 +89,207 @@ bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile, progress->Done(); return true; } + /*}}}*/ + +// CacheSetHelper saving virtual packages /*{{{*/ +pkgCache::VerIterator CacheSetHelperVirtuals::canNotGetVersion( + enum CacheSetHelper::VerSelector const select, + pkgCacheFile &Cache, + pkgCache::PkgIterator const &Pkg) +{ + if (select == NEWEST || select == CANDIDATE || select == ALL) + virtualPkgs.insert(Pkg); + return CacheSetHelper::canNotGetVersion(select, Cache, Pkg); +} +void CacheSetHelperVirtuals::canNotFindVersion( + enum CacheSetHelper::VerSelector const select, + APT::VersionContainerInterface * vci, + pkgCacheFile &Cache, + pkgCache::PkgIterator const &Pkg) +{ + if (select == NEWEST || select == CANDIDATE || select == ALL) + virtualPkgs.insert(Pkg); + return CacheSetHelper::canNotFindVersion(select, vci, Cache, Pkg); +} +CacheSetHelperVirtuals::CacheSetHelperVirtuals(bool const ShowErrors, GlobalError::MsgType const &ErrorType) : + CacheSetHelper{ShowErrors, ErrorType} +{} + /*}}}*/ + +// CacheSetHelperAPTGet - responsible for message telling from the CacheSets/*{{{*/ +CacheSetHelperAPTGet::CacheSetHelperAPTGet(std::ostream &out) : + APT::CacheSetHelper{true}, out{out} +{ + explicitlyNamed = true; +} +void CacheSetHelperAPTGet::showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) +{ + ioprintf(out, _("Note, selecting '%s' for task '%s'\n"), + Pkg.FullName(true).c_str(), pattern.c_str()); + explicitlyNamed = false; +} +void CacheSetHelperAPTGet::showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) +{ + ioprintf(out, _("Note, selecting '%s' for glob '%s'\n"), + Pkg.FullName(true).c_str(), pattern.c_str()); + explicitlyNamed = false; +} +void CacheSetHelperAPTGet::showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) +{ + ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"), + Pkg.FullName(true).c_str(), pattern.c_str()); + explicitlyNamed = false; +} +void CacheSetHelperAPTGet::showSelectedVersion(pkgCache::PkgIterator const &/*Pkg*/, pkgCache::VerIterator const Ver, + std::string const &ver, bool const /*verIsRel*/) +{ + if (ver == Ver.VerStr()) + return; + selectedByRelease.push_back(make_pair(Ver, ver)); +} +bool CacheSetHelperAPTGet::showVirtualPackageErrors(pkgCacheFile &Cache) +{ + if (virtualPkgs.empty() == true) + return true; + for (APT::PackageSet::const_iterator Pkg = virtualPkgs.begin(); + Pkg != virtualPkgs.end(); ++Pkg) { + if (Pkg->ProvidesList != 0) { + ioprintf(c1out,_("Package %s is a virtual package provided by:\n"), + Pkg.FullName(true).c_str()); + + pkgCache::PrvIterator I = Pkg.ProvidesList(); + unsigned short provider = 0; + for (; I.end() == false; ++I) { + pkgCache::PkgIterator Pkg = I.OwnerPkg(); + + if (Cache[Pkg].CandidateVerIter(Cache) == I.OwnerVer()) { + c1out << " " << Pkg.FullName(true) << " " << I.OwnerVer().VerStr(); + if (Cache[Pkg].Install() == true && Cache[Pkg].NewInstall() == false) + c1out << _(" [Installed]"); + c1out << std::endl; + ++provider; + } + } + // if we found no candidate which provide this package, show non-candidates + if (provider == 0) + for (I = Pkg.ProvidesList(); I.end() == false; ++I) + c1out << " " << I.OwnerPkg().FullName(true) << " " << I.OwnerVer().VerStr() + << _(" [Not candidate version]") << std::endl; + else + out << _("You should explicitly select one to install.") << std::endl; + } else { + ioprintf(c1out, + _("Package %s is not available, but is referred to by another package.\n" + "This may mean that the package is missing, has been obsoleted, or\n" + "is only available from another source\n"),Pkg.FullName(true).c_str()); + + std::string List; + std::string VersionsList; + std::vector Seen(Cache.GetPkgCache()->Head().PackageCount, false); + APT::PackageList pkglist; + for (pkgCache::DepIterator Dep = Pkg.RevDependsList(); + Dep.end() == false; ++Dep) { + if (Dep->Type != pkgCache::Dep::Replaces) + continue; + pkgCache::PkgIterator const DP = Dep.ParentPkg(); + if (Seen[DP->ID] == true) + continue; + Seen[DP->ID] = true; + pkglist.insert(DP); + } + ShowList(c1out, _("However the following packages replace it:"), pkglist, + &AlwaysTrue, &PrettyFullName, &EmptyString); + } + c1out << std::endl; + } + return false; +} +pkgCache::VerIterator CacheSetHelperAPTGet::canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) +{ + APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::CANDIDATE); + if (verset.empty() == false) + return *(verset.begin()); + else if (ShowError == true) { + _error->Error(_("Package '%s' has no installation candidate"),Pkg.FullName(true).c_str()); + virtualPkgs.insert(Pkg); + } + return pkgCache::VerIterator(Cache, 0); +} +pkgCache::VerIterator CacheSetHelperAPTGet::canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) +{ + if (Pkg->ProvidesList != 0) + { + APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::NEWEST); + if (verset.empty() == false) + return *(verset.begin()); + if (ShowError == true) + ioprintf(out, _("Virtual packages like '%s' can't be removed\n"), Pkg.FullName(true).c_str()); + } + else + { + pkgCache::GrpIterator Grp = Pkg.Group(); + pkgCache::PkgIterator P = Grp.PackageList(); + for (; P.end() != true; P = Grp.NextPkg(P)) + { + if (P == Pkg) + continue; + if (P->CurrentVer != 0) { + // TRANSLATORS: Note, this is not an interactive question + ioprintf(c1out,_("Package '%s' is not installed, so not removed. Did you mean '%s'?\n"), + Pkg.FullName(true).c_str(), P.FullName(true).c_str()); + break; + } + } + if (P.end() == true) + ioprintf(c1out,_("Package '%s' is not installed, so not removed\n"),Pkg.FullName(true).c_str()); + } + return pkgCache::VerIterator(Cache, 0); +} +APT::VersionSet CacheSetHelperAPTGet::tryVirtualPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg, + CacheSetHelper::VerSelector const select) +{ + /* This is a pure virtual package and there is a single available + candidate providing it. */ + if (unlikely(Cache[Pkg].CandidateVer != 0) || Pkg->ProvidesList == 0) + return APT::VersionSet(); + + pkgCache::PkgIterator Prov; + bool found_one = false; + for (pkgCache::PrvIterator P = Pkg.ProvidesList(); P; ++P) { + pkgCache::VerIterator const PVer = P.OwnerVer(); + pkgCache::PkgIterator const PPkg = PVer.ParentPkg(); + + /* Ignore versions that are not a candidate. */ + if (Cache[PPkg].CandidateVer != PVer) + continue; + + if (found_one == false) { + Prov = PPkg; + found_one = true; + } else if (PPkg != Prov) { + // same group, so it's a foreign package + if (PPkg->Group == Prov->Group) { + // do we already have the requested arch? + if (strcmp(Pkg.Arch(), Prov.Arch()) == 0 || + strcmp(Prov.Arch(), "all") == 0 || + unlikely(strcmp(PPkg.Arch(), Prov.Arch()) == 0)) // packages have only on candidate, but just to be sure + continue; + // see which architecture we prefer more and switch to it + std::vector archs = APT::Configuration::getArchitectures(); + if (std::find(archs.begin(), archs.end(), PPkg.Arch()) < std::find(archs.begin(), archs.end(), Prov.Arch())) + Prov = PPkg; + continue; + } + found_one = false; // we found at least two + break; + } + } + + if (found_one == true) { + ioprintf(out, _("Note, selecting '%s' instead of '%s'\n"), + Prov.FullName(true).c_str(), Pkg.FullName(true).c_str()); + return APT::VersionSet::FromPackage(Cache, Prov, select, *this); + } + return APT::VersionSet(); +} + /*}}}*/ diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h index 7cafe4fdd..892993e58 100644 --- a/apt-private/private-cacheset.h +++ b/apt-private/private-cacheset.h @@ -1,60 +1,48 @@ #ifndef APT_PRIVATE_CACHESET_H #define APT_PRIVATE_CACHESET_H -#include -#include #include -#include -#include -#include -#include -#include -#include #include #include -#include #include -#include #include -#include #include #include -#include #include class OpProgress; -struct VersionSortDescriptionLocality +struct APT_PUBLIC VersionSortDescriptionLocality /*{{{*/ { - bool operator () (const pkgCache::VerIterator &v_lhs, - const pkgCache::VerIterator &v_rhs) - { - pkgCache::DescFile const *A = NULL; - pkgCache::DescFile const *B = NULL; - if (v_lhs->DescriptionList != 0) - A = v_lhs.TranslatedDescription().FileList(); - if (v_rhs->DescriptionList != 0) - B = v_rhs.TranslatedDescription().FileList(); + bool operator () (const pkgCache::VerIterator &v_lhs, + const pkgCache::VerIterator &v_rhs) + { + pkgCache::DescFile const *A = nullptr; + pkgCache::DescFile const *B = nullptr; + if (v_lhs->DescriptionList != 0) + A = v_lhs.TranslatedDescription().FileList(); + if (v_rhs->DescriptionList != 0) + B = v_rhs.TranslatedDescription().FileList(); - if (A == 0 && B == 0) - return false; + if (A == nullptr && B == nullptr) + return false; - if (A == 0) - return true; + if (A == nullptr) + return true; - if (B == 0) - return false; + if (B == nullptr) + return false; - if (A->File == B->File) - return A->Offset < B->Offset; + if (A->File == B->File) + return A->Offset < B->Offset; - return A->File < B->File; - } + return A->File < B->File; + } }; - + /*}}}*/ // sorted by locality which makes iterating much faster typedef APT::VersionContainer< std::set > selectedByRelease; - CacheSetHelperAPTGet(std::ostream &out) : APT::CacheSetHelper(true), out(out) { - explicitlyNamed = true; - } + CacheSetHelperAPTGet(std::ostream &out); - virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE { - ioprintf(out, _("Note, selecting '%s' for task '%s'\n"), - Pkg.FullName(true).c_str(), pattern.c_str()); - explicitlyNamed = false; - } - virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE { - ioprintf(out, _("Note, selecting '%s' for glob '%s'\n"), - Pkg.FullName(true).c_str(), pattern.c_str()); - explicitlyNamed = false; - } - virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE { - ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"), - Pkg.FullName(true).c_str(), pattern.c_str()); - explicitlyNamed = false; - } + virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE; + virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE; + virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE; virtual void showSelectedVersion(pkgCache::PkgIterator const &/*Pkg*/, pkgCache::VerIterator const Ver, - std::string const &ver, bool const /*verIsRel*/) APT_OVERRIDE { - if (ver == Ver.VerStr()) - return; - selectedByRelease.push_back(make_pair(Ver, ver)); - } - - bool showVirtualPackageErrors(pkgCacheFile &Cache) { - if (virtualPkgs.empty() == true) - return true; - for (APT::PackageSet::const_iterator Pkg = virtualPkgs.begin(); - Pkg != virtualPkgs.end(); ++Pkg) { - if (Pkg->ProvidesList != 0) { - ioprintf(c1out,_("Package %s is a virtual package provided by:\n"), - Pkg.FullName(true).c_str()); - - pkgCache::PrvIterator I = Pkg.ProvidesList(); - unsigned short provider = 0; - for (; I.end() == false; ++I) { - pkgCache::PkgIterator Pkg = I.OwnerPkg(); + std::string const &ver, bool const /*verIsRel*/) APT_OVERRIDE; + bool showVirtualPackageErrors(pkgCacheFile &Cache); - if (Cache[Pkg].CandidateVerIter(Cache) == I.OwnerVer()) { - c1out << " " << Pkg.FullName(true) << " " << I.OwnerVer().VerStr(); - if (Cache[Pkg].Install() == true && Cache[Pkg].NewInstall() == false) - c1out << _(" [Installed]"); - c1out << std::endl; - ++provider; - } - } - // if we found no candidate which provide this package, show non-candidates - if (provider == 0) - for (I = Pkg.ProvidesList(); I.end() == false; ++I) - c1out << " " << I.OwnerPkg().FullName(true) << " " << I.OwnerVer().VerStr() - << _(" [Not candidate version]") << std::endl; - else - out << _("You should explicitly select one to install.") << std::endl; - } else { - ioprintf(c1out, - _("Package %s is not available, but is referred to by another package.\n" - "This may mean that the package is missing, has been obsoleted, or\n" - "is only available from another source\n"),Pkg.FullName(true).c_str()); - - std::string List; - std::string VersionsList; - SPtrArray Seen = new bool[Cache.GetPkgCache()->Head().PackageCount]; - memset(Seen,0,Cache.GetPkgCache()->Head().PackageCount*sizeof(*Seen)); - APT::PackageList pkglist; - for (pkgCache::DepIterator Dep = Pkg.RevDependsList(); - Dep.end() == false; ++Dep) { - if (Dep->Type != pkgCache::Dep::Replaces) - continue; - pkgCache::PkgIterator const DP = Dep.ParentPkg(); - if (Seen[DP->ID] == true) - continue; - Seen[DP->ID] = true; - pkglist.insert(DP); - } - ShowList(c1out, _("However the following packages replace it:"), pkglist, - &AlwaysTrue, &PrettyFullName, &EmptyString); - } - c1out << std::endl; - } - return false; - } - - virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { - APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::CANDIDATE); - if (verset.empty() == false) - return *(verset.begin()); - else if (ShowError == true) { - _error->Error(_("Package '%s' has no installation candidate"),Pkg.FullName(true).c_str()); - virtualPkgs.insert(Pkg); - } - return pkgCache::VerIterator(Cache, 0); - } - - virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { - if (Pkg->ProvidesList != 0) - { - APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::NEWEST); - if (verset.empty() == false) - return *(verset.begin()); - if (ShowError == true) - ioprintf(out, _("Virtual packages like '%s' can't be removed\n"), Pkg.FullName(true).c_str()); - } - else - { - pkgCache::GrpIterator Grp = Pkg.Group(); - pkgCache::PkgIterator P = Grp.PackageList(); - for (; P.end() != true; P = Grp.NextPkg(P)) - { - if (P == Pkg) - continue; - if (P->CurrentVer != 0) { - // TRANSLATORS: Note, this is not an interactive question - ioprintf(c1out,_("Package '%s' is not installed, so not removed. Did you mean '%s'?\n"), - Pkg.FullName(true).c_str(), P.FullName(true).c_str()); - break; - } - } - if (P.end() == true) - ioprintf(c1out,_("Package '%s' is not installed, so not removed\n"),Pkg.FullName(true).c_str()); - } - return pkgCache::VerIterator(Cache, 0); - } + virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; APT::VersionSet tryVirtualPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg, - CacheSetHelper::VerSelector const select) { - /* This is a pure virtual package and there is a single available - candidate providing it. */ - if (unlikely(Cache[Pkg].CandidateVer != 0) || Pkg->ProvidesList == 0) - return APT::VersionSet(); - - pkgCache::PkgIterator Prov; - bool found_one = false; - for (pkgCache::PrvIterator P = Pkg.ProvidesList(); P; ++P) { - pkgCache::VerIterator const PVer = P.OwnerVer(); - pkgCache::PkgIterator const PPkg = PVer.ParentPkg(); - - /* Ignore versions that are not a candidate. */ - if (Cache[PPkg].CandidateVer != PVer) - continue; - - if (found_one == false) { - Prov = PPkg; - found_one = true; - } else if (PPkg != Prov) { - // same group, so it's a foreign package - if (PPkg->Group == Prov->Group) { - // do we already have the requested arch? - if (strcmp(Pkg.Arch(), Prov.Arch()) == 0 || - strcmp(Prov.Arch(), "all") == 0 || - unlikely(strcmp(PPkg.Arch(), Prov.Arch()) == 0)) // packages have only on candidate, but just to be sure - continue; - // see which architecture we prefer more and switch to it - std::vector archs = APT::Configuration::getArchitectures(); - if (std::find(archs.begin(), archs.end(), PPkg.Arch()) < std::find(archs.begin(), archs.end(), Prov.Arch())) - Prov = PPkg; - continue; - } - found_one = false; // we found at least two - break; - } - } - - if (found_one == true) { - ioprintf(out, _("Note, selecting '%s' instead of '%s'\n"), - Prov.FullName(true).c_str(), Pkg.FullName(true).c_str()); - return APT::VersionSet::FromPackage(Cache, Prov, select, *this); - } - return APT::VersionSet(); - } + CacheSetHelper::VerSelector const select); inline bool allPkgNamedExplicitly() const { return explicitlyNamed; } - }; /*}}}*/ diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index a69f5418a..6fefbde47 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -56,6 +56,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 9112f77703c39d46e2e0471c48c8a5e1f93f4abf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 13 Jul 2015 03:36:59 +0200 Subject: show or-groups in not-installed recommends and suggests lists Further abstracting our new ShowList allows to use it for containers of strings as well giving us the option to implement an or-groups display for the recommends and suggests lists which is a nice trick given that it also helps with migrating the last remaining other cases of old ShowList. --- apt-pkg/cachefile.cc | 34 +++-- apt-pkg/cachefile.h | 27 ++-- apt-pkg/cacheset.cc | 110 ++++++++++++++ apt-pkg/cacheset.h | 6 +- apt-pkg/depcache.cc | 15 +- apt-private/private-cachefile.h | 14 +- apt-private/private-download.cc | 13 +- apt-private/private-download.h | 3 +- apt-private/private-install.cc | 135 +++++++++--------- apt-private/private-output.cc | 60 -------- apt-private/private-output.h | 24 ++-- cmdline/apt-get.cc | 8 +- .../test-apt-showlist-orgroup-in-recommends | 158 +++++++++++++++++++++ .../test-bug-470115-new-and-tighten-recommends | 2 + ...est-bug-549968-install-depends-of-not-installed | 2 + test/integration/test-handling-broken-orgroups | 2 +- test/integration/test-release-candidate-switching | 2 +- test/integration/test-releasefile-verification | 8 +- 18 files changed, 420 insertions(+), 203 deletions(-) create mode 100755 test/integration/test-apt-showlist-orgroup-in-recommends diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index 690776266..ed3c2dd0a 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -35,10 +35,13 @@ #include /*}}}*/ // CacheFile::CacheFile - Constructor /*{{{*/ -// --------------------------------------------------------------------- -/* */ -pkgCacheFile::pkgCacheFile() : d(NULL), Map(NULL), Cache(NULL), DCache(NULL), - SrcList(NULL), Policy(NULL) +pkgCacheFile::pkgCacheFile() : d(NULL), ExternOwner(false), Map(NULL), Cache(NULL), + DCache(NULL), SrcList(NULL), Policy(NULL) +{ +} +pkgCacheFile::pkgCacheFile(pkgDepCache * const Owner) : d(NULL), ExternOwner(true), + Map(&Owner->GetCache().GetMap()), Cache(&Owner->GetCache()), + DCache(Owner), SrcList(NULL), Policy(NULL) { } /*}}}*/ @@ -47,12 +50,16 @@ pkgCacheFile::pkgCacheFile() : d(NULL), Map(NULL), Cache(NULL), DCache(NULL), /* */ pkgCacheFile::~pkgCacheFile() { - delete DCache; + if (ExternOwner == false) + { + delete DCache; + delete Cache; + delete Map; + } delete Policy; delete SrcList; - delete Cache; - delete Map; - _system->UnLock(true); + if (ExternOwner == false) + _system->UnLock(true); } /*}}}*/ // CacheFile::BuildCaches - Open and build the cache files /*{{{*/ @@ -229,11 +236,16 @@ void pkgCacheFile::RemoveCaches() /* */ void pkgCacheFile::Close() { - delete DCache; + if (ExternOwner == false) + { + delete DCache; + delete Cache; + delete Map; + } + else + ExternOwner = false; delete Policy; - delete Cache; delete SrcList; - delete Map; _system->UnLock(true); Map = NULL; diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h index 83dd90d36..f4cadf5e6 100644 --- a/apt-pkg/cachefile.h +++ b/apt-pkg/cachefile.h @@ -38,9 +38,9 @@ class pkgCacheFile { /** \brief dpointer placeholder (for later in case we need it) */ void * const d; + bool ExternOwner; protected: - MMap *Map; pkgCache *Cache; pkgDepCache *DCache; @@ -50,18 +50,18 @@ class pkgCacheFile pkgPolicy *Policy; // We look pretty much exactly like a pointer to a dep cache - inline operator pkgCache &() {return *Cache;}; - inline operator pkgCache *() {return Cache;}; - inline operator pkgDepCache &() {return *DCache;}; - inline operator pkgDepCache *() {return DCache;}; - inline operator pkgPolicy &() {return *Policy;}; - inline operator pkgPolicy *() {return Policy;}; - inline operator pkgSourceList &() {return *SrcList;}; - inline operator pkgSourceList *() {return SrcList;}; - inline pkgDepCache *operator ->() {return DCache;}; - inline pkgDepCache &operator *() {return *DCache;}; - inline pkgDepCache::StateCache &operator [](pkgCache::PkgIterator const &I) {return (*DCache)[I];}; - inline unsigned char &operator [](pkgCache::DepIterator const &I) {return (*DCache)[I];}; + inline operator pkgCache &() const {return *Cache;}; + inline operator pkgCache *() const {return Cache;}; + inline operator pkgDepCache &() const {return *DCache;}; + inline operator pkgDepCache *() const {return DCache;}; + inline operator pkgPolicy &() const {return *Policy;}; + inline operator pkgPolicy *() const {return Policy;}; + inline operator pkgSourceList &() const {return *SrcList;}; + inline operator pkgSourceList *() const {return SrcList;}; + inline pkgDepCache *operator ->() const {return DCache;}; + inline pkgDepCache &operator *() const {return *DCache;}; + inline pkgDepCache::StateCache &operator [](pkgCache::PkgIterator const &I) const {return (*DCache)[I];}; + inline unsigned char &operator [](pkgCache::DepIterator const &I) const {return (*DCache)[I];}; bool BuildCaches(OpProgress *Progress = NULL,bool WithLock = true); APT_DEPRECATED bool BuildCaches(OpProgress &Progress,bool const &WithLock = true) { return BuildCaches(&Progress, WithLock); }; @@ -85,6 +85,7 @@ class pkgCacheFile inline bool IsSrcListBuilt() const { return (SrcList != NULL); }; pkgCacheFile(); + explicit pkgCacheFile(pkgDepCache * const Owner); virtual ~pkgCacheFile(); }; diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index a4e330a0a..f5cf52159 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -582,6 +582,116 @@ bool VersionContainerInterface::FromPackage(VersionContainerInterface * const vc return found; } /*}}}*/ +// FromDependency - versions satisfying a given dependency /*{{{*/ +bool VersionContainerInterface::FromDependency(VersionContainerInterface * const vci, + pkgCacheFile &Cache, + pkgCache::DepIterator const &D, + CacheSetHelper::VerSelector const selector, + CacheSetHelper &helper) +{ + bool found = false; + switch(selector) { + case CacheSetHelper::ALL: + { + pkgCache::PkgIterator const T = D.TargetPkg(); + for (pkgCache::VerIterator Ver = T.VersionList(); Ver.end() == false; ++Ver) + { + if (D.IsSatisfied(Ver) == true) + { + vci->insert(Ver); + found = true; + } + for (pkgCache::PrvIterator Prv = T.ProvidesList(); Prv.end() != true; ++Prv) + { + pkgCache::VerIterator const V = Prv.OwnerVer(); + if (unlikely(V.end() == true) || D.IsSatisfied(Prv) == false) + continue; + vci->insert(V); + found = true; + } + } + return found; + } + case CacheSetHelper::CANDANDINST: + { + found = FromDependency(vci, Cache, D, CacheSetHelper::CANDIDATE, helper); + found &= FromDependency(vci, Cache, D, CacheSetHelper::INSTALLED, helper); + return found; + } + case CacheSetHelper::CANDIDATE: + { + pkgCache::PkgIterator const T = D.TargetPkg(); + pkgCache::VerIterator const Cand = Cache[T].CandidateVerIter(Cache); + if (Cand.end() == false && D.IsSatisfied(Cand) == true) + { + vci->insert(Cand); + found = true; + } + for (pkgCache::PrvIterator Prv = T.ProvidesList(); Prv.end() != true; ++Prv) + { + pkgCache::VerIterator const V = Prv.OwnerVer(); + pkgCache::VerIterator const Cand = Cache[Prv.OwnerPkg()].CandidateVerIter(Cache); + if (Cand.end() == true || V != Cand || D.IsSatisfied(Prv) == false) + continue; + vci->insert(Cand); + found = true; + } + return found; + } + case CacheSetHelper::INSTALLED: + { + pkgCache::PkgIterator const T = D.TargetPkg(); + pkgCache::VerIterator const Cand = T.CurrentVer(); + if (Cand.end() == false && D.IsSatisfied(Cand) == true) + { + vci->insert(Cand); + found = true; + } + for (pkgCache::PrvIterator Prv = T.ProvidesList(); Prv.end() != true; ++Prv) + { + pkgCache::VerIterator const V = Prv.OwnerVer(); + pkgCache::VerIterator const Cand = Prv.OwnerPkg().CurrentVer(); + if (Cand.end() == true || V != Cand || D.IsSatisfied(Prv) == false) + continue; + vci->insert(Cand); + found = true; + } + return found; + } + case CacheSetHelper::CANDINST: + return FromDependency(vci, Cache, D, CacheSetHelper::CANDIDATE, helper) || + FromDependency(vci, Cache, D, CacheSetHelper::INSTALLED, helper); + case CacheSetHelper::INSTCAND: + return FromDependency(vci, Cache, D, CacheSetHelper::INSTALLED, helper) || + FromDependency(vci, Cache, D, CacheSetHelper::CANDIDATE, helper); + case CacheSetHelper::NEWEST: + { + pkgCache::PkgIterator const T = D.TargetPkg(); + pkgCache::VerIterator const Cand = T.VersionList(); + if (Cand.end() == false && D.IsSatisfied(Cand) == true) + { + vci->insert(Cand); + found = true; + } + for (pkgCache::PrvIterator Prv = T.ProvidesList(); Prv.end() != true; ++Prv) + { + pkgCache::VerIterator const V = Prv.OwnerVer(); + pkgCache::VerIterator const Cand = Prv.OwnerPkg().VersionList(); + if (Cand.end() == true || V != Cand || D.IsSatisfied(Prv) == false) + continue; + vci->insert(Cand); + found = true; + } + return found; + } + case CacheSetHelper::RELEASE: + case CacheSetHelper::VERSIONNUMBER: + // both make no sense here, so always false + return false; + } + return found; +} + /*}}}*/ // getCandidateVer - Returns the candidate version of the given package /*{{{*/ pkgCache::VerIterator VersionContainerInterface::getCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper) { diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 0b9b9441c..5455fe74b 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -1068,7 +1068,7 @@ APT_IGNORE_DEPRECATED_POP static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D, CacheSetHelper::VerSelector const selector) { CacheSetHelper helper; - return FromPackage(Cache, D, selector, helper); + return FromDependency(Cache, D, selector, helper); } APT_IGNORE_DEPRECATED_PUSH static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D, @@ -1080,11 +1080,11 @@ APT_IGNORE_DEPRECATED_PUSH static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D, Version const &selector) { CacheSetHelper helper; - return FromPackage(Cache, D, (CacheSetHelper::VerSelector)selector, helper); + return FromDependency(Cache, D, (CacheSetHelper::VerSelector)selector, helper); } APT_IGNORE_DEPRECATED_POP static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D) { - return FromPackage(Cache, D, CacheSetHelper::CANDIDATE); + return FromDependency(Cache, D, CacheSetHelper::CANDIDATE); } /*}}}*/ }; /*}}}*/ diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index d01c14223..0e972dbad 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -1189,18 +1190,8 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, fixing the problem for "positive" dependencies */ if (Start.IsNegative() == false && (DepState[Start->ID] & DepCVer) == DepCVer) { - APT::VersionList verlist; - pkgCache::VerIterator Cand = PkgState[Start.TargetPkg()->ID].CandidateVerIter(*this); - if (Cand.end() == false && Start.IsSatisfied(Cand) == true) - verlist.insert(Cand); - for (PrvIterator Prv = Start.TargetPkg().ProvidesList(); Prv.end() != true; ++Prv) - { - pkgCache::VerIterator V = Prv.OwnerVer(); - pkgCache::VerIterator Cand = PkgState[Prv.OwnerPkg()->ID].CandidateVerIter(*this); - if (Cand.end() == true || V != Cand || Start.IsSatisfied(Prv) == false) - continue; - verlist.insert(Cand); - } + pkgCacheFile CacheFile(this); + APT::VersionList verlist = APT::VersionList::FromDependency(CacheFile, Start, APT::CacheSetHelper::CANDIDATE); CompareProviders comp(Start); do { diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h index 4a68d9733..221852629 100644 --- a/apt-private/private-cachefile.h +++ b/apt-private/private-cachefile.h @@ -61,7 +61,7 @@ class APT_PUBLIC CacheFile : public pkgCacheFile }; /*}}}*/ -class APT_PUBLIC SortedPackageUniverse : public APT::PackageUniverse +class SortedPackageUniverse : public APT::PackageUniverse { std::vector &List; void LazyInit() const; @@ -85,12 +85,12 @@ public: }; typedef const_iterator iterator; - APT_PUBLIC const_iterator begin() const { LazyInit(); return const_iterator(data(), List.begin()); } - APT_PUBLIC const_iterator end() const { LazyInit(); return const_iterator(data(), List.end()); } - APT_PUBLIC const_iterator cbegin() const { LazyInit(); return const_iterator(data(), List.begin()); } - APT_PUBLIC const_iterator cend() const { LazyInit(); return const_iterator(data(), List.end()); } - APT_PUBLIC iterator begin() { LazyInit(); return iterator(data(), List.begin()); } - APT_PUBLIC iterator end() { LazyInit(); return iterator(data(), List.end()); } + const_iterator begin() const { LazyInit(); return const_iterator(data(), List.begin()); } + const_iterator end() const { LazyInit(); return const_iterator(data(), List.end()); } + const_iterator cbegin() const { LazyInit(); return const_iterator(data(), List.begin()); } + const_iterator cend() const { LazyInit(); return const_iterator(data(), List.end()); } + iterator begin() { LazyInit(); return iterator(data(), List.begin()); } + iterator end() { LazyInit(); return iterator(data(), List.end()); } }; #endif diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc index 37fae18e9..099146187 100644 --- a/apt-private/private-download.cc +++ b/apt-private/private-download.cc @@ -78,20 +78,23 @@ bool CheckDropPrivsMustBeDisabled(pkgAcquire &Fetcher) /*{{{*/ // CheckAuth - check if each download comes form a trusted source /*{{{*/ bool CheckAuth(pkgAcquire& Fetcher, bool const PromptUser) { - std::string UntrustedList; + std::vector UntrustedList; for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I < Fetcher.ItemsEnd(); ++I) if (!(*I)->IsTrusted()) - UntrustedList += std::string((*I)->ShortDesc()) + " "; + UntrustedList.push_back((*I)->ShortDesc()); - if (UntrustedList == "") + if (UntrustedList.empty()) return true; return AuthPrompt(UntrustedList, PromptUser); } -bool AuthPrompt(std::string const &UntrustedList, bool const PromptUser) +bool AuthPrompt(std::vector const &UntrustedList, bool const PromptUser) { - ShowList(c2out,_("WARNING: The following packages cannot be authenticated!"),UntrustedList,""); + ShowList(c2out,_("WARNING: The following packages cannot be authenticated!"), UntrustedList, + [](std::string const&) { return true; }, + [](std::string const&str) { return str; }, + [](std::string const&) { return ""; }); if (_config->FindB("APT::Get::AllowUnauthenticated",false) == true) { diff --git a/apt-private/private-download.h b/apt-private/private-download.h index 0a0ac6b95..0f3db5e7a 100644 --- a/apt-private/private-download.h +++ b/apt-private/private-download.h @@ -4,6 +4,7 @@ #include #include +#include class pkgAcquire; @@ -14,7 +15,7 @@ APT_PUBLIC bool CheckAuth(pkgAcquire& Fetcher, bool const PromptUser); // show a authentication warning prompt and return true if the system // should continue -APT_PUBLIC bool AuthPrompt(std::string const &UntrustedList, bool const PromptUser); +APT_PUBLIC bool AuthPrompt(std::vector const &UntrustedList, bool const PromptUser); APT_PUBLIC bool AcquireRun(pkgAcquire &Fetcher, int const PulseInterval, bool * const Failure, bool * const TransientNetworkFailure); diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index cdca45755..0b5e33ae5 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -330,19 +330,17 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) } std::set const disappearedPkgs = PM->GetDisappearedPackages(); - if (disappearedPkgs.empty() == true) - return true; - - std::string disappear; - for (std::set::const_iterator d = disappearedPkgs.begin(); - d != disappearedPkgs.end(); ++d) - disappear.append(*d).append(" "); - - ShowList(c1out, P_("The following package disappeared from your system as\n" - "all files have been overwritten by other packages:", - "The following packages disappeared from your system as\n" - "all files have been overwritten by other packages:", disappearedPkgs.size()), disappear, ""); - c0out << _("Note: This is done automatically and on purpose by dpkg.") << std::endl; + if (disappearedPkgs.empty() == false) + { + ShowList(c1out, P_("The following package disappeared from your system as\n" + "all files have been overwritten by other packages:", + "The following packages disappeared from your system as\n" + "all files have been overwritten by other packages:", disappearedPkgs.size()), disappearedPkgs, + [](std::string const &Pkg) { return Pkg.empty() == false; }, + [](std::string const &Pkg) { return Pkg; }, + [](std::string const &) { return std::string(); }); + c0out << _("Note: This is done automatically and on purpose by dpkg.") << std::endl; + } return true; } @@ -699,8 +697,7 @@ bool DoInstall(CommandLine &CmdL) /* Print out a list of suggested and recommended packages */ { - std::string SuggestsList, RecommendsList; - std::string SuggestsVersions, RecommendsVersions; + std::list Recommends, Suggests, SingleRecommends, SingleSuggests; for (auto const &Pkg: Universe) { /* Just look at the ones we want to install */ @@ -714,77 +711,79 @@ bool DoInstall(CommandLine &CmdL) pkgCache::DepIterator Start; pkgCache::DepIterator End; D.GlobOr(Start,End); // advances D + if (Start->Type != pkgCache::Dep::Recommends && Start->Type != pkgCache::Dep::Suggests) + continue; - // FIXME: we really should display a or-group as a or-group to the user - // the problem is that ShowList is incapable of doing this - std::string RecommendsOrList,RecommendsOrVersions; - std::string SuggestsOrList,SuggestsOrVersions; - bool foundInstalledInOrGroup = false; - for(;;) { - /* Skip if package is installed already, or is about to be */ - pkgCache::PkgIterator const TarPkg = Start.TargetPkg(); - if (TarPkg->SelectedState == pkgCache::State::Install || - TarPkg->SelectedState == pkgCache::State::Hold || - Cache[Start.TargetPkg()].Install()) - { - foundInstalledInOrGroup=true; - break; - } - - /* Skip if we already saw it */ - std::string target = Start.TargetPkg().FullName(true) + " "; - if (int(SuggestsList.find(target)) != -1 || int(RecommendsList.find(target)) != -1) + // Skip if we already saw this + std::string target; + for (pkgCache::DepIterator I = Start; I != D; ++I) { - foundInstalledInOrGroup=true; - break; + if (target.empty() == false) + target.append(" | "); + target.append(I.TargetPkg().FullName(true)); } + std::list &Type = Start->Type == pkgCache::Dep::Recommends ? SingleRecommends : SingleSuggests; + if (std::find(Type.begin(), Type.end(), target) != Type.end()) + continue; + Type.push_back(target); + } - // this is a dep on a virtual pkg, check if any package that provides it - // should be installed - if(Start.TargetPkg().ProvidesList() != 0) + std::list OrList; + bool foundInstalledInOrGroup = false; + for (pkgCache::DepIterator I = Start; I != D; ++I) + { { - pkgCache::PrvIterator I = Start.TargetPkg().ProvidesList(); - for (; I.end() == false; ++I) + // satisfying package is installed and not marked for deletion + APT::VersionList installed = APT::VersionList::FromDependency(Cache, I, APT::CacheSetHelper::INSTALLED); + if (std::find_if(installed.begin(), installed.end(), + [&Cache](pkgCache::VerIterator const &Ver) { return Cache[Ver.ParentPkg()].Delete() == false; }) != installed.end()) { - pkgCache::PkgIterator Pkg = I.OwnerPkg(); - if (Cache[Pkg].CandidateVerIter(Cache) == I.OwnerVer() && - Pkg.CurrentVer() != 0) - foundInstalledInOrGroup=true; + foundInstalledInOrGroup = true; + break; } } - if (Start->Type == pkgCache::Dep::Suggests) - { - SuggestsOrList += target; - SuggestsOrVersions += std::string(Cache[Start.TargetPkg()].CandVersion) + "\n"; - } - - if (Start->Type == pkgCache::Dep::Recommends) { - RecommendsOrList += target; - RecommendsOrVersions += std::string(Cache[Start.TargetPkg()].CandVersion) + "\n"; + // satisfying package is upgraded to/new install + APT::VersionList upgrades = APT::VersionList::FromDependency(Cache, I, APT::CacheSetHelper::CANDIDATE); + if (std::find_if(upgrades.begin(), upgrades.end(), + [&Cache](pkgCache::VerIterator const &Ver) { return Cache[Ver.ParentPkg()].Upgrade(); }) != upgrades.end()) + { + foundInstalledInOrGroup = true; + break; + } } - if (Start >= End) - break; - ++Start; + if (OrList.empty()) + OrList.push_back(I.TargetPkg().FullName(true)); + else + OrList.push_back("| " + I.TargetPkg().FullName(true)); } - + if(foundInstalledInOrGroup == false) { - RecommendsList += RecommendsOrList; - RecommendsVersions += RecommendsOrVersions; - SuggestsList += SuggestsOrList; - SuggestsVersions += SuggestsOrVersions; + std::list &Type = Start->Type == pkgCache::Dep::Recommends ? Recommends : Suggests; + std::move(OrList.begin(), OrList.end(), std::back_inserter(Type)); } - } } - - ShowList(c1out,_("Suggested packages:"),SuggestsList,SuggestsVersions); - ShowList(c1out,_("Recommended packages:"),RecommendsList,RecommendsVersions); - + auto always_true = [](std::string const&) { return true; }; + auto string_ident = [](std::string const&str) { return str; }; + auto verbose_show_candidate = + [&Cache](std::string str) + { + if (APT::String::Startswith(str, "| ")) + str.erase(0, 2); + pkgCache::PkgIterator const Pkg = Cache->FindPkg(str); + if (Pkg.end() == true) + return ""; + return (*Cache)[Pkg].CandVersion; + }; + ShowList(c1out,_("Suggested packages:"), Suggests, + always_true, string_ident, verbose_show_candidate); + ShowList(c1out,_("Recommended packages:"), Recommends, + always_true, string_ident, verbose_show_candidate); } // See if we need to prompt @@ -792,7 +791,7 @@ bool DoInstall(CommandLine &CmdL) if (Cache->InstCount() == verset[MOD_INSTALL].size() && Cache->DelCount() == 0) return InstallPackages(Cache,false,false); - return InstallPackages(Cache,false); + return InstallPackages(Cache,false); } /*}}}*/ diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc index b77efff86..b8e6dec02 100644 --- a/apt-private/private-output.cc +++ b/apt-private/private-output.cc @@ -300,66 +300,6 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/ out << output; } /*}}}*/ -// ShowList - Show a list /*{{{*/ -// --------------------------------------------------------------------- -/* This prints out a string of space separated words with a title and - a two space indent line wraped to the current screen width. */ -bool ShowList(ostream &out,string Title,string List,string VersionsList) -{ - if (List.empty() == true) - return true; - // trim trailing space - int NonSpace = List.find_last_not_of(' '); - if (NonSpace != -1) - { - List = List.erase(NonSpace + 1); - if (List.empty() == true) - return true; - } - - // Acount for the leading space - int ScreenWidth = ::ScreenWidth - 3; - - out << Title << endl; - string::size_type Start = 0; - string::size_type VersionsStart = 0; - while (Start < List.size()) - { - if(_config->FindB("APT::Get::Show-Versions",false) == true && - VersionsList.size() > 0) { - string::size_type End; - string::size_type VersionsEnd; - - End = List.find(' ',Start); - VersionsEnd = VersionsList.find('\n', VersionsStart); - - out << " " << string(List,Start,End - Start) << " (" << - string(VersionsList,VersionsStart,VersionsEnd - VersionsStart) << - ")" << endl; - - if (End == string::npos || End < Start) - End = Start + ScreenWidth; - - Start = End + 1; - VersionsStart = VersionsEnd + 1; - } else { - string::size_type End; - - if (Start + ScreenWidth >= List.size()) - End = List.size(); - else - End = List.rfind(' ',Start+ScreenWidth); - - if (End == string::npos || End < Start) - End = Start + ScreenWidth; - out << " " << string(List,Start,End - Start) << endl; - Start = End + 1; - } - } - - return false; -} - /*}}}*/ // ShowBroken - Debugging aide /*{{{*/ // --------------------------------------------------------------------- /* This prints out the names of all the packages that are broken along diff --git a/apt-private/private-output.h b/apt-private/private-output.h index b9151b245..4930fd981 100644 --- a/apt-private/private-output.h +++ b/apt-private/private-output.h @@ -34,11 +34,11 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, APT_PUBLIC void ShowBroken(std::ostream &out, CacheFile &Cache, bool const Now); APT_PUBLIC void ShowBroken(std::ostream &out, pkgCacheFile &Cache, bool const Now); -template APT_PUBLIC bool ShowList(std::ostream &out, std::string const &Title, +template APT_PUBLIC bool ShowList(std::ostream &out, std::string const &Title, Container const &cont, - std::function Predicate, - std::function PkgDisplay, - std::function VerboseDisplay) + PredicateC Predicate, + DisplayP PkgDisplay, + DisplayV VerboseDisplay) { size_t const ScreenWidth = (::ScreenWidth > 3) ? ::ScreenWidth - 3 : 0; int ScreenUsed = 0; @@ -88,8 +88,6 @@ template APT_PUBLIC bool ShowList(std::ostream &out, std::strin } return true; } -APT_DEPRECATED APT_PUBLIC bool ShowList(std::ostream &out, std::string Title, std::string List, - std::string VersionsList); void ShowNew(std::ostream &out,CacheFile &Cache); void ShowDel(std::ostream &out,CacheFile &Cache); @@ -106,12 +104,12 @@ void Stats(std::ostream &out, pkgDepCache &Dep); bool YnPrompt(bool Default=true); bool AnalPrompt(const char *Text); -APT_PUBLIC std::string PrettyFullName(pkgCache::PkgIterator const &Pkg); -APT_PUBLIC std::string CandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); -APT_PUBLIC std::function CandidateVersion(pkgCacheFile * const Cache); -APT_PUBLIC std::string CurrentToCandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); -APT_PUBLIC std::function CurrentToCandidateVersion(pkgCacheFile * const Cache); -APT_PUBLIC std::string EmptyString(pkgCache::PkgIterator const &); -APT_PUBLIC bool AlwaysTrue(pkgCache::PkgIterator const &); +std::string PrettyFullName(pkgCache::PkgIterator const &Pkg); +std::string CandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); +std::function CandidateVersion(pkgCacheFile * const Cache); +std::string CurrentToCandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); +std::function CurrentToCandidateVersion(pkgCacheFile * const Cache); +std::string EmptyString(pkgCache::PkgIterator const &); +bool AlwaysTrue(pkgCache::PkgIterator const &); #endif diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6fefbde47..ca9650998 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -742,7 +742,7 @@ static bool DoSource(CommandLine &CmdL) // Load the requestd sources into the fetcher unsigned J = 0; - std::string UntrustedList; + std::vector UntrustedList; for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++) { string Src; @@ -756,8 +756,8 @@ static bool DoSource(CommandLine &CmdL) } if (Last->Index().IsTrusted() == false) - UntrustedList += Src + " "; - + UntrustedList.push_back(Src); + string srec = Last->AsStr(); string::size_type pos = srec.find("\nVcs-"); while (pos != string::npos) @@ -884,7 +884,7 @@ static bool DoSource(CommandLine &CmdL) CheckDropPrivsMustBeDisabled(Fetcher); // check authentication status of the source as well - if (UntrustedList != "" && !AuthPrompt(UntrustedList, false)) + if (UntrustedList.empty() == false && AuthPrompt(UntrustedList, false) == false) return false; // Run it diff --git a/test/integration/test-apt-showlist-orgroup-in-recommends b/test/integration/test-apt-showlist-orgroup-in-recommends new file mode 100755 index 000000000..bce421ac4 --- /dev/null +++ b/test/integration/test-apt-showlist-orgroup-in-recommends @@ -0,0 +1,158 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'i386' + +# simple case +insertinstalledpackage 'aaa' 'all' '1' +insertinstalledpackage 'ddd' 'all' '1' +insertpackage 'unstable' 'aaa' 'all' '1' +insertpackage 'unstable' 'ddd' 'all' '1' +insertpackage 'unstable' 'yyy' 'all' '1' +insertpackage 'unstable' 'zzz' 'all' '1' +insertpackage 'unstable' 'simple' 'all' '1' 'Recommends: aaa, bbb +Suggests: ccc, ddd' +insertpackage 'unstable' 'orgroup' 'all' '1' 'Recommends: aaa | bbb +Suggests: ccc | ddd' +insertpackage 'unstable' 'orgroup2' 'all' '1' 'Recommends: xxx | yyy +Suggests: yyy | zzz' +insertpackage 'unstable' 'orgroup3' 'all' '1' 'Recommends: xxx | yyy +Suggests: yyy | zzz' +insertpackage 'unstable' 'orgroup4' 'all' '1' 'Recommends: xxx +Suggests: zzz' +insertpackage 'unstable' 'versionedor' 'all' '1' 'Recommends: aaa (>> 2) | bbb +Suggests: ccc | ddd (>> 2)' + +setupaptarchive + +testsuccessequal 'Reading package lists... +Building dependency tree... +Suggested packages: + ccc +Recommended packages: + bbb +The following NEW packages will be installed: + simple +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst simple (1 unstable [all]) +Conf simple (1 unstable [all])' aptget install simple -s --no-install-recommends +testsuccessequal 'Reading package lists... +Building dependency tree... +Suggested packages: + ccc +Recommended packages: + aaa bbb +The following packages will be REMOVED: + aaa +The following NEW packages will be installed: + simple +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv aaa [1] +Inst simple (1 unstable [all]) +Conf simple (1 unstable [all])' aptget install simple aaa- -s --no-install-recommends +testsuccessequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + orgroup +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst orgroup (1 unstable [all]) +Conf orgroup (1 unstable [all])' aptget install orgroup -s --no-install-recommends +testsuccessequal 'Reading package lists... +Building dependency tree... +Recommended packages: + aaa | bbb +The following packages will be REMOVED: + aaa +The following NEW packages will be installed: + orgroup +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv aaa [1] +Inst orgroup (1 unstable [all]) +Conf orgroup (1 unstable [all])' aptget install orgroup aaa- -s --no-install-recommends +testsuccessequal 'Reading package lists... +Building dependency tree... +Suggested packages: + yyy | zzz +Recommended packages: + xxx | yyy +The following NEW packages will be installed: + orgroup2 +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst orgroup2 (1 unstable [all]) +Conf orgroup2 (1 unstable [all])' aptget install orgroup2 -s --no-install-recommends +testsuccessequal 'Reading package lists... +Building dependency tree... +Suggested packages: + yyy | zzz +Recommended packages: + xxx | yyy +The following NEW packages will be installed: + orgroup2 orgroup3 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst orgroup2 (1 unstable [all]) +Inst orgroup3 (1 unstable [all]) +Conf orgroup2 (1 unstable [all]) +Conf orgroup3 (1 unstable [all])' aptget install orgroup2 orgroup3 -s --no-install-recommends +testsuccessequal 'Reading package lists... +Building dependency tree... +Suggested packages: + yyy | zzz zzz +Recommended packages: + xxx | yyy xxx +The following NEW packages will be installed: + orgroup2 orgroup4 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst orgroup2 (1 unstable [all]) +Inst orgroup4 (1 unstable [all]) +Conf orgroup2 (1 unstable [all]) +Conf orgroup4 (1 unstable [all])' aptget install orgroup2 orgroup4 -s --no-install-recommends +testsuccessequal 'Reading package lists... +Building dependency tree... +Suggested packages: + yyy (1) + | zzz (1) + zzz (1) +Recommended packages: + xxx + | yyy (1) + xxx +The following NEW packages will be installed: + orgroup2 (1) + orgroup4 (1) +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst orgroup2 (1 unstable [all]) +Inst orgroup4 (1 unstable [all]) +Conf orgroup2 (1 unstable [all]) +Conf orgroup4 (1 unstable [all])' aptget install orgroup2 orgroup4 -s -V --no-install-recommends +testsuccessequal 'Reading package lists... +Building dependency tree... +Suggested packages: + zzz (1) +Recommended packages: + xxx +The following NEW packages will be installed: + orgroup2 (1) + orgroup4 (1) + yyy (1) +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst orgroup2 (1 unstable [all]) +Inst orgroup4 (1 unstable [all]) +Inst yyy (1 unstable [all]) +Conf orgroup2 (1 unstable [all]) +Conf orgroup4 (1 unstable [all]) +Conf yyy (1 unstable [all])' aptget install orgroup2 orgroup4 yyy -s -V --no-install-recommends +testsuccessequal 'Reading package lists... +Building dependency tree... +Suggested packages: + ccc | ddd +Recommended packages: + aaa | bbb +The following NEW packages will be installed: + versionedor +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst versionedor (1 unstable [all]) +Conf versionedor (1 unstable [all])' aptget install versionedor -s --no-install-recommends diff --git a/test/integration/test-bug-470115-new-and-tighten-recommends b/test/integration/test-bug-470115-new-and-tighten-recommends index 0970e2f23..80f699ef3 100755 --- a/test/integration/test-bug-470115-new-and-tighten-recommends +++ b/test/integration/test-bug-470115-new-and-tighten-recommends @@ -165,6 +165,8 @@ Conf upgrade-over-new (2 unstable [all])' aptget install upgrade-over-new -s # the user doesn't seem to need it so avoid upgrading it testsuccessequal 'Reading package lists... Building dependency tree... +Recommended packages: + cool The following packages will be upgraded: now-satisfiable 1 upgraded, 0 newly installed, 0 to remove and 12 not upgraded. diff --git a/test/integration/test-bug-549968-install-depends-of-not-installed b/test/integration/test-bug-549968-install-depends-of-not-installed index 3ff4807de..1d969fea2 100755 --- a/test/integration/test-bug-549968-install-depends-of-not-installed +++ b/test/integration/test-bug-549968-install-depends-of-not-installed @@ -19,6 +19,8 @@ Building dependency tree... MarkInstall coolstuff [ i386 ] < none -> 1.0 > ( other ) FU=1 Ignore MarkInstall of extracoolstuff [ i386 ] < none -> 1.0 > ( other ) as its mode (Keep) is protected Package 'extracoolstuff' is not installed, so not removed +Recommended packages: + extracoolstuff The following NEW packages will be installed: coolstuff 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. diff --git a/test/integration/test-handling-broken-orgroups b/test/integration/test-handling-broken-orgroups index 149f05fa9..15964a270 100755 --- a/test/integration/test-handling-broken-orgroups +++ b/test/integration/test-handling-broken-orgroups @@ -63,7 +63,7 @@ E: Unable to correct problems, you have held broken packages.' aptget install co testsuccessequal 'Reading package lists... Building dependency tree... Recommended packages: - cool2 stuff2 + cool2 | stuff2 The following NEW packages will be installed: coolstuff-brokenrec 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching index a1a6a6142..510a8e078 100755 --- a/test/integration/test-release-candidate-switching +++ b/test/integration/test-release-candidate-switching @@ -370,7 +370,7 @@ The following extra packages will be installed: Recommended packages: amarok-utils (2.3.1-1+sid) phonon-backend-xine (4.6.0really4.4.2-1+sid) - phonon-backend () + | phonon-backend libmtp8 (0.3.1+sid) libc6 (2.11.2-7+sid) The following NEW packages will be installed: diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index 759242514..06701c623 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -36,7 +36,7 @@ installaptold() { testsuccessequal 'Reading package lists... Building dependency tree... Suggested packages: - aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt + aptitude | synaptic | wajig dpkg-dev apt-doc bzip2 lzma python-apt The following NEW packages will be installed: apt 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. @@ -49,7 +49,7 @@ installaptnew() { testsuccessequal 'Reading package lists... Building dependency tree... Suggested packages: - aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt + aptitude | synaptic | wajig dpkg-dev apt-doc bzip2 lzma python-apt The following NEW packages will be installed: apt 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. @@ -62,7 +62,7 @@ failaptold() { testfailureequal 'Reading package lists... Building dependency tree... Suggested packages: - aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt + aptitude | synaptic | wajig dpkg-dev apt-doc bzip2 lzma python-apt The following NEW packages will be installed: apt 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. @@ -76,7 +76,7 @@ failaptnew() { testfailureequal 'Reading package lists... Building dependency tree... Suggested packages: - aptitude synaptic wajig dpkg-dev apt-doc bzip2 lzma python-apt + aptitude | synaptic | wajig dpkg-dev apt-doc bzip2 lzma python-apt The following NEW packages will be installed: apt 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -- cgit v1.2.3 From 3707fd4faab3f2e2521263070b68fd0afaae2900 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 13 Jul 2015 23:10:53 +0200 Subject: avoid virtual in the iterators With a bit of trickery and the Curiously recurring template pattern we can free us from our use of virtual in the iterators were it is unneeded bloat as we never deal with pointers to iterators and similar such. Git-Dch: Ignore --- apt-pkg/cacheiterators.h | 90 ++++++++++++++++++----------------------- apt-pkg/cacheset.cc | 3 +- apt-pkg/cacheset.h | 63 +++++++++++++---------------- apt-pkg/pkgcache.cc | 8 ++-- apt-private/private-cachefile.h | 5 +-- 5 files changed, 77 insertions(+), 92 deletions(-) diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index d7614374e..06deef950 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -43,10 +43,6 @@ need to have for doing some walk-over-the-cache magic */ template class pkgCache::Iterator : public std::iterator { - protected: - Str *S; - pkgCache *Owner; - /** \brief Returns the Pointer for this struct in the owner * The implementation of this method should be pretty short * as it will only return the Pointer into the mmap stored @@ -55,12 +51,14 @@ template class pkgCache::Iterator : * basic methods from the actual structure. * \return Pointer to the first structure of this type */ - virtual Str* OwnerPointer() const = 0; + Str* OwnerPointer() const { return static_cast(this)->OwnerPointer(); } + + protected: + Str *S; + pkgCache *Owner; public: // Iteration - virtual void operator ++(int) = 0; - virtual void operator ++() = 0; // Should be {operator ++(0);} inline bool end() const {return Owner == 0 || S == OwnerPointer();} // Comparison @@ -99,20 +97,19 @@ template class pkgCache::Iterator : class pkgCache::GrpIterator: public Iterator { long HashIndex; - protected: + public: inline Group* OwnerPointer() const { return (Owner != 0) ? Owner->GrpP : 0; } - public: // This constructor is the 'begin' constructor, never use it. explicit inline GrpIterator(pkgCache &Owner) : Iterator(Owner), HashIndex(-1) { S = OwnerPointer(); - operator ++(0); + operator++(); } - virtual void operator ++(int); - virtual void operator ++() {operator ++(0);} + GrpIterator& operator++(); + inline GrpIterator operator++(int) { GrpIterator const tmp(*this); operator++(); return tmp; } inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;} inline PkgIterator PackageList() const; @@ -140,20 +137,19 @@ class pkgCache::GrpIterator: public Iterator { class pkgCache::PkgIterator: public Iterator { long HashIndex; - protected: + public: inline Package* OwnerPointer() const { return (Owner != 0) ? Owner->PkgP : 0; } - public: // This constructor is the 'begin' constructor, never use it. explicit inline PkgIterator(pkgCache &Owner) : Iterator(Owner), HashIndex(-1) { S = OwnerPointer(); - operator ++(0); + operator++(); } - virtual void operator ++(int); - virtual void operator ++() {operator ++(0);} + PkgIterator& operator++(); + inline PkgIterator operator++(int) { PkgIterator const tmp(*this); operator++(); return tmp; } enum OkState {NeedsNothing,NeedsUnpack,NeedsConfigure}; @@ -193,15 +189,14 @@ class pkgCache::PkgIterator: public Iterator { /*}}}*/ // Version Iterator /*{{{*/ class pkgCache::VerIterator : public Iterator { - protected: + public: inline Version* OwnerPointer() const { return (Owner != 0) ? Owner->VerP : 0; } - public: // Iteration - void operator ++(int) {if (S != Owner->VerP) S = Owner->VerP + S->NextVer;} - inline void operator ++() {operator ++(0);} + inline VerIterator& operator++() {if (S != Owner->VerP) S = Owner->VerP + S->NextVer; return *this;} + inline VerIterator operator++(int) { VerIterator const tmp(*this); operator++(); return tmp; } // Comparison int CompareVer(const VerIterator &B) const; @@ -253,15 +248,14 @@ class pkgCache::VerIterator : public Iterator { /*}}}*/ // Description Iterator /*{{{*/ class pkgCache::DescIterator : public Iterator { - protected: + public: inline Description* OwnerPointer() const { return (Owner != 0) ? Owner->DescP : 0; } - public: // Iteration - void operator ++(int) {if (S != Owner->DescP) S = Owner->DescP + S->NextDesc;} - inline void operator ++() {operator ++(0);} + inline DescIterator& operator++() {if (S != Owner->DescP) S = Owner->DescP + S->NextDesc; return *this;} + inline DescIterator operator++(int) { DescIterator const tmp(*this); operator++(); return tmp; } // Comparison int CompareDesc(const DescIterator &B) const; @@ -282,16 +276,15 @@ class pkgCache::DescIterator : public Iterator { class pkgCache::DepIterator : public Iterator { enum {DepVer, DepRev} Type; - protected: + public: inline Dependency* OwnerPointer() const { return (Owner != 0) ? Owner->DepP : 0; } - public: // Iteration - void operator ++(int) {if (S != Owner->DepP) S = Owner->DepP + - (Type == DepVer ? S->NextDepends : S->NextRevDepends);} - inline void operator ++() {operator ++(0);} + inline DepIterator& operator++() {if (S != Owner->DepP) S = Owner->DepP + + (Type == DepVer ? S->NextDepends : S->NextRevDepends); return *this;} + inline DepIterator operator++(int) { DepIterator const tmp(*this); operator++(); return tmp; } // Accessors inline const char *TargetVer() const {return S->Version == 0?0:Owner->StrP + S->Version;} @@ -333,16 +326,15 @@ class pkgCache::DepIterator : public Iterator { class pkgCache::PrvIterator : public Iterator { enum {PrvVer, PrvPkg} Type; - protected: + public: inline Provides* OwnerPointer() const { return (Owner != 0) ? Owner->ProvideP : 0; } - public: // Iteration - void operator ++(int) {if (S != Owner->ProvideP) S = Owner->ProvideP + - (Type == PrvVer?S->NextPkgProv:S->NextProvides);} - inline void operator ++() {operator ++(0);} + inline PrvIterator& operator ++() {if (S != Owner->ProvideP) S = Owner->ProvideP + + (Type == PrvVer?S->NextPkgProv:S->NextProvides); return *this;} + inline PrvIterator operator++(int) { PrvIterator const tmp(*this); operator++(); return tmp; } // Accessors inline const char *Name() const {return ParentPkg().Name();} @@ -368,15 +360,14 @@ class pkgCache::PrvIterator : public Iterator { /*}}}*/ // Release file /*{{{*/ class pkgCache::RlsFileIterator : public Iterator { - protected: + public: inline ReleaseFile* OwnerPointer() const { return (Owner != 0) ? Owner->RlsFileP : 0; } - public: // Iteration - void operator ++(int) {if (S != Owner->RlsFileP) S = Owner->RlsFileP + S->NextFile;} - inline void operator ++() {operator ++(0);} + inline RlsFileIterator& operator++() {if (S != Owner->RlsFileP) S = Owner->RlsFileP + S->NextFile;return *this;} + inline RlsFileIterator operator++(int) { RlsFileIterator const tmp(*this); operator++(); return tmp; } // Accessors inline const char *FileName() const {return S->FileName == 0?0:Owner->StrP + S->FileName;} @@ -399,15 +390,14 @@ class pkgCache::RlsFileIterator : public Iterator /*}}}*/ // Package file /*{{{*/ class pkgCache::PkgFileIterator : public Iterator { - protected: + public: inline PackageFile* OwnerPointer() const { return (Owner != 0) ? Owner->PkgFileP : 0; } - public: // Iteration - void operator ++(int) {if (S != Owner->PkgFileP) S = Owner->PkgFileP + S->NextFile;} - inline void operator ++() {operator ++(0);} + inline PkgFileIterator& operator++() {if (S != Owner->PkgFileP) S = Owner->PkgFileP + S->NextFile; return *this;} + inline PkgFileIterator operator++(int) { PkgFileIterator const tmp(*this); operator++(); return tmp; } // Accessors inline const char *FileName() const {return S->FileName == 0?0:Owner->StrP + S->FileName;} @@ -435,15 +425,14 @@ class pkgCache::PkgFileIterator : public Iterator /*}}}*/ // Version File /*{{{*/ class pkgCache::VerFileIterator : public pkgCache::Iterator { - protected: + public: inline VerFile* OwnerPointer() const { return (Owner != 0) ? Owner->VerFileP : 0; } - public: // Iteration - void operator ++(int) {if (S != Owner->VerFileP) S = Owner->VerFileP + S->NextFile;} - inline void operator ++() {operator ++(0);} + inline VerFileIterator& operator++() {if (S != Owner->VerFileP) S = Owner->VerFileP + S->NextFile; return *this;} + inline VerFileIterator operator++(int) { VerFileIterator const tmp(*this); operator++(); return tmp; } // Accessors inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);} @@ -454,15 +443,14 @@ class pkgCache::VerFileIterator : public pkgCache::Iterator { - protected: + public: inline DescFile* OwnerPointer() const { return (Owner != 0) ? Owner->DescFileP : 0; } - public: // Iteration - void operator ++(int) {if (S != Owner->DescFileP) S = Owner->DescFileP + S->NextFile;} - inline void operator ++() {operator ++(0);} + inline DescFileIterator& operator++() {if (S != Owner->DescFileP) S = Owner->DescFileP + S->NextFile; return *this;} + inline DescFileIterator operator++(int) { DescFileIterator const tmp(*this); operator++(); return tmp; } // Accessors inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);} diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index f5cf52159..af607a197 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -935,7 +935,8 @@ PackageContainerInterface& PackageContainerInterface::operator=(PackageContainer } PackageContainerInterface::~PackageContainerInterface() {} -PackageUniverse::PackageUniverse(pkgCache * const Owner) : _cont(Owner), d(NULL) { } +PackageUniverse::PackageUniverse(pkgCache * const Owner) : _cont(Owner), d(NULL) {} +PackageUniverse::PackageUniverse(pkgCacheFile * const Owner) : _cont(Owner->GetPkgCache()), d(NULL) {} PackageUniverse::~PackageUniverse() {} VersionContainerInterface::VersionContainerInterface() : d(NULL) {} diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 5455fe74b..95df55dcc 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -213,13 +213,13 @@ private: // Iterator templates for our Containers /*{{{*/ template class Container_iterator_base : public std::iterator::iterator_category, container_iterator>, - public Interface::iterator_base + public Interface::template iterator_base { protected: container_iterator _iter; public: explicit Container_iterator_base(container_iterator i) : _iter(i) {} - inline container_value operator*(void) const { return this->getType(); } + inline container_value operator*(void) const { return static_cast(this)->getType(); }; operator container_iterator(void) const { return _iter; } inline iterator_type& operator++() { ++_iter; return static_cast(*this); } inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; } @@ -249,7 +249,7 @@ public: explicit Container_const_iterator(container_iterator i) : Container_iterator_base(i) {} - inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *this->_iter; } + inline typename Container::value_type getType(void) const { return *this->_iter; } }; template class Container_iterator : public Container_iterator_base, typename Container::iterator, typename Container::value_type> @@ -264,7 +264,7 @@ public: inline iterator_type& operator=(iterator_type const &i) { this->_iter = i._iter; return static_cast(*this); } inline iterator_type& operator=(container_iterator const &i) { this->_iter = i; return static_cast(*this); } - inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *this->_iter; } + inline typename Container::value_type getType(void) const { return *this->_iter; } }; template class Container_const_reverse_iterator : public Container_iterator_base, typename Container::const_reverse_iterator, typename Container::value_type> @@ -275,7 +275,7 @@ public: explicit Container_const_reverse_iterator(container_iterator i) : Container_iterator_base(i) {} - inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *this->_iter; } + inline typename Container::value_type getType(void) const { return *this->_iter; } }; template class Container_reverse_iterator : public Container_iterator_base, typename Container::reverse_iterator, typename Container::value_type> @@ -290,7 +290,7 @@ public: inline iterator_type& operator=(iterator_type const &i) { this->_iter = i._iter; return static_cast(*this); } inline iterator_type& operator=(container_iterator const &i) { this->_iter = i; return static_cast(*this); } - inline virtual typename Container::value_type getType(void) const APT_OVERRIDE { return *this->_iter; } + inline typename Container::value_type getType(void) const { return *this->_iter; } }; /*}}}*/ class PackageContainerInterface { /*{{{*/ @@ -304,9 +304,8 @@ class PackageContainerInterface { /*{{{*/ * This class mostly protects use from the need to write all implementation * of the methods working on containers in the template */ public: - class iterator_base { /*{{{*/ - protected: - virtual pkgCache::PkgIterator getType() const = 0; + template class iterator_base { /*{{{*/ + pkgCache::PkgIterator getType() const { return static_cast(this)->getType(); }; public: operator pkgCache::PkgIterator(void) const { return getType(); } @@ -689,41 +688,38 @@ class APT_PUBLIC PackageUniverse : public PackageContainerInterface { public: class const_iterator : public APT::Container_iterator_base { - protected: - inline virtual pkgCache::PkgIterator getType(void) const APT_OVERRIDE - { - return _iter; - } public: explicit const_iterator(pkgCache::PkgIterator i): Container_iterator_base(i) {} + inline pkgCache::PkgIterator getType(void) const { return _iter; } }; typedef const_iterator iterator; - APT_PUBLIC bool empty() const APT_OVERRIDE { return false; } - APT_PUBLIC size_t size() const APT_OVERRIDE { return _cont->Head().PackageCount; } + bool empty() const APT_OVERRIDE { return false; } + size_t size() const APT_OVERRIDE { return _cont->Head().PackageCount; } - APT_PUBLIC const_iterator begin() const { return const_iterator(_cont->PkgBegin()); } - APT_PUBLIC const_iterator end() const { return const_iterator(_cont->PkgEnd()); } - APT_PUBLIC const_iterator cbegin() const { return const_iterator(_cont->PkgBegin()); } - APT_PUBLIC const_iterator cend() const { return const_iterator(_cont->PkgEnd()); } - APT_PUBLIC iterator begin() { return iterator(_cont->PkgBegin()); } - APT_PUBLIC iterator end() { return iterator(_cont->PkgEnd()); } + const_iterator begin() const { return const_iterator(_cont->PkgBegin()); } + const_iterator end() const { return const_iterator(_cont->PkgEnd()); } + const_iterator cbegin() const { return const_iterator(_cont->PkgBegin()); } + const_iterator cend() const { return const_iterator(_cont->PkgEnd()); } + iterator begin() { return iterator(_cont->PkgBegin()); } + iterator end() { return iterator(_cont->PkgEnd()); } - APT_PUBLIC pkgCache * data() const { return _cont; } + pkgCache * data() const { return _cont; } - explicit APT_PUBLIC PackageUniverse(pkgCache * const Owner); - APT_PUBLIC virtual ~PackageUniverse(); + explicit PackageUniverse(pkgCache * const Owner); + explicit PackageUniverse(pkgCacheFile * const Owner); + virtual ~PackageUniverse(); private: - bool insert(pkgCache::PkgIterator const &) APT_OVERRIDE { return true; } - template void insert(PackageContainer const &) { } - void insert(const_iterator, const_iterator) { } + APT_HIDDEN bool insert(pkgCache::PkgIterator const &) APT_OVERRIDE { return true; } + template APT_HIDDEN void insert(PackageContainer const &) { } + APT_HIDDEN void insert(const_iterator, const_iterator) { } - void clear() APT_OVERRIDE { } - iterator erase( const_iterator pos ); - iterator erase( const_iterator first, const_iterator last ); + APT_HIDDEN void clear() APT_OVERRIDE { } + APT_HIDDEN iterator erase( const_iterator pos ); + APT_HIDDEN iterator erase( const_iterator first, const_iterator last ); }; /*}}}*/ typedef PackageContainer > PackageSet; @@ -741,9 +737,8 @@ class VersionContainerInterface { /*{{{*/ Same as APT::PackageContainerInterface, just for Versions */ public: /** \brief smell like a pkgCache::VerIterator */ - class iterator_base { /*{{{*/ - protected: - virtual pkgCache::VerIterator getType() const = 0; + template class iterator_base { /*{{{*/ + pkgCache::VerIterator getType() const { return static_cast(this)->getType(); }; public: operator pkgCache::VerIterator(void) { return getType(); } diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index ae04bc699..aebbffe8b 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -411,7 +411,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::NextPkg(pkgCache::PkgIterator const // GrpIterator::operator ++ - Postfix incr /*{{{*/ // --------------------------------------------------------------------- /* This will advance to the next logical group in the hash table. */ -void pkgCache::GrpIterator::operator ++(int) +pkgCache::GrpIterator& pkgCache::GrpIterator::operator++() { // Follow the current links if (S != Owner->GrpP) @@ -423,12 +423,13 @@ void pkgCache::GrpIterator::operator ++(int) HashIndex++; S = Owner->GrpP + Owner->HeaderP->GrpHashTableP()[HashIndex]; } + return *this; } /*}}}*/ // PkgIterator::operator ++ - Postfix incr /*{{{*/ // --------------------------------------------------------------------- /* This will advance to the next logical package in the hash table. */ -void pkgCache::PkgIterator::operator ++(int) +pkgCache::PkgIterator& pkgCache::PkgIterator::operator ++() { // Follow the current links if (S != Owner->PkgP) @@ -440,6 +441,7 @@ void pkgCache::PkgIterator::operator ++(int) HashIndex++; S = Owner->PkgP + Owner->HeaderP->PkgHashTableP()[HashIndex]; } + return *this; } /*}}}*/ // PkgIterator::State - Check the State of the package /*{{{*/ @@ -685,7 +687,7 @@ void pkgCache::DepIterator::GlobOr(DepIterator &Start,DepIterator &End) for (bool LastOR = true; end() == false && LastOR == true;) { LastOR = (S->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or; - (*this)++; + ++(*this); if (LastOR == true) End = (*this); } diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h index 221852629..ed9342db0 100644 --- a/apt-private/private-cachefile.h +++ b/apt-private/private-cachefile.h @@ -72,13 +72,12 @@ public: class const_iterator : public APT::Container_iterator_base::const_iterator, pkgCache::PkgIterator> { pkgCache * const Cache; - protected: - inline virtual pkgCache::PkgIterator getType(void) const APT_OVERRIDE + public: + inline pkgCache::PkgIterator getType(void) const { if (*_iter == 0) return pkgCache::PkgIterator(*Cache); return pkgCache::PkgIterator(*Cache, Cache->PkgP + *_iter); } - public: explicit const_iterator(pkgCache * const Owner, std::vector::const_iterator i): Container_iterator_base::const_iterator, pkgCache::PkgIterator>(i), Cache(Owner) {} -- cgit v1.2.3 From fd23676e809b7fa87ae138cc22d2c683d212950e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 13 Jul 2015 12:47:05 +0200 Subject: bunch of micro-optimizations for depcache DepCache functions are called a lot, so if we can squeeze some drops out of them for free we should do so. Takes also the opportunity to remove some whitespace errors from these functions. Git-Dch: Ignore --- apt-pkg/deb/deblistparser.cc | 11 +- apt-pkg/deb/debversion.cc | 47 +++--- apt-pkg/depcache.cc | 170 ++++++++++----------- apt-pkg/depcache.h | 28 ++-- apt-pkg/pkgcache.cc | 21 ++- test/integration/test-apt-cache | 24 +-- .../test-apt-showlist-orgroup-in-recommends | 2 +- 7 files changed, 149 insertions(+), 154 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 4e49e1c78..7c21bd8b3 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -209,23 +209,22 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) Ver->Priority = pkgCache::State::Extra; } - if (ParseDepends(Ver,"Depends",pkgCache::Dep::Depends) == false) - return false; if (ParseDepends(Ver,"Pre-Depends",pkgCache::Dep::PreDepends) == false) return false; - if (ParseDepends(Ver,"Suggests",pkgCache::Dep::Suggests) == false) - return false; - if (ParseDepends(Ver,"Recommends",pkgCache::Dep::Recommends) == false) + if (ParseDepends(Ver,"Depends",pkgCache::Dep::Depends) == false) return false; if (ParseDepends(Ver,"Conflicts",pkgCache::Dep::Conflicts) == false) return false; if (ParseDepends(Ver,"Breaks",pkgCache::Dep::DpkgBreaks) == false) return false; + if (ParseDepends(Ver,"Recommends",pkgCache::Dep::Recommends) == false) + return false; + if (ParseDepends(Ver,"Suggests",pkgCache::Dep::Suggests) == false) + return false; if (ParseDepends(Ver,"Replaces",pkgCache::Dep::Replaces) == false) return false; if (ParseDepends(Ver,"Enhances",pkgCache::Dep::Enhances) == false) return false; - // Obsolete. if (ParseDepends(Ver,"Optional",pkgCache::Dep::Suggests) == false) return false; diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc index a5eacb7f5..043025912 100644 --- a/apt-pkg/deb/debversion.cc +++ b/apt-pkg/deb/debversion.cc @@ -34,29 +34,26 @@ debVersioningSystem::debVersioningSystem() // debVS::CmpFragment - Compare versions /*{{{*/ // --------------------------------------------------------------------- -/* This compares a fragment of the version. This is a slightly adapted - version of what dpkg uses. */ -#define order(x) ((x) == '~' ? -1 \ - : isdigit((x)) ? 0 \ - : !(x) ? 0 \ - : isalpha((x)) ? (x) \ - : (x) + 256) -int debVersioningSystem::CmpFragment(const char *A,const char *AEnd, - const char *B,const char *BEnd) +/* This compares a fragment of the version. This is a slightly adapted + version of what dpkg uses in dpkg/lib/dpkg/version.c. + In particular, the a | b = NULL check is removed as we check this in the + caller, we use an explicit end for a | b strings and we check ~ explicit. */ +static int order(char c) { - if (A >= AEnd && B >= BEnd) + if (isdigit(c)) return 0; - if (A >= AEnd) - { - if (*B == '~') return 1; + else if (isalpha(c)) + return c; + else if (c == '~') return -1; - } - if (B >= BEnd) - { - if (*A == '~') return -1; - return 1; - } - + else if (c) + return c + 256; + else + return 0; +} +int debVersioningSystem::CmpFragment(const char *A,const char *AEnd, + const char *B,const char *BEnd) +{ /* Iterate over the whole string What this does is to split the whole string into groups of numeric and non numeric portions. For instance: @@ -77,19 +74,19 @@ int debVersioningSystem::CmpFragment(const char *A,const char *AEnd, int rc = order(*rhs); if (vc != rc) return vc - rc; - lhs++; rhs++; + ++lhs; ++rhs; } while (*lhs == '0') - lhs++; + ++lhs; while (*rhs == '0') - rhs++; + ++rhs; while (isdigit(*lhs) && isdigit(*rhs)) { if (!first_diff) first_diff = *lhs - *rhs; - lhs++; - rhs++; + ++lhs; + ++rhs; } if (isdigit(*lhs)) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 0e972dbad..6271a024a 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -95,7 +95,7 @@ pkgDepCache::ActionGroup::~ActionGroup() // DepCache::pkgDepCache - Constructors /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgDepCache::pkgDepCache(pkgCache *pCache,Policy *Plcy) : +pkgDepCache::pkgDepCache(pkgCache * const pCache,Policy * const Plcy) : group_level(0), Cache(pCache), PkgState(0), DepState(0), iUsrSize(0), iDownloadSize(0), iInstCount(0), iDelCount(0), iKeepCount(0), iBrokenCount(0), iPolicyBrokenCount(0), iBadCount(0), d(NULL) @@ -121,7 +121,7 @@ pkgDepCache::~pkgDepCache() // DepCache::Init - Generate the initial extra structures. /*{{{*/ // --------------------------------------------------------------------- /* This allocats the extension buffers and initializes them. */ -bool pkgDepCache::Init(OpProgress *Prog) +bool pkgDepCache::Init(OpProgress * const Prog) { // Suppress mark updates during this operation (just in case) and // run a mark operation when Init terminates. @@ -132,7 +132,7 @@ bool pkgDepCache::Init(OpProgress *Prog) PkgState = new StateCache[Head().PackageCount]; DepState = new unsigned char[Head().DependsCount]; memset(PkgState,0,sizeof(*PkgState)*Head().PackageCount); - memset(DepState,0,sizeof(*DepState)*Head().DependsCount); + memset(DepState,0,sizeof(*DepState)*Head().DependsCount); if (Prog != 0) { @@ -140,7 +140,7 @@ bool pkgDepCache::Init(OpProgress *Prog) _("Building dependency tree")); Prog->SubProgress(Head().PackageCount,_("Candidate versions")); } - + /* Set the current state of everything. In this state all of the packages are kept exactly as is. See AllUpgrade */ int Done = 0; @@ -148,7 +148,7 @@ bool pkgDepCache::Init(OpProgress *Prog) { if (Prog != 0 && Done%20 == 0) Prog->Progress(Done); - + // Find the proper cache slot StateCache &State = PkgState[I->ID]; State.iFlags = 0; @@ -157,28 +157,27 @@ bool pkgDepCache::Init(OpProgress *Prog) State.CandidateVer = GetCandidateVer(I); State.InstallVer = I.CurrentVer(); State.Mode = ModeKeep; - + State.Update(I,*this); - } - + } + if (Prog != 0) { - Prog->OverallProgress(Head().PackageCount,2*Head().PackageCount, Head().PackageCount, _("Building dependency tree")); Prog->SubProgress(Head().PackageCount,_("Dependency generation")); } - + Update(Prog); if(Prog != 0) Prog->Done(); return true; -} +} /*}}}*/ -bool pkgDepCache::readStateFile(OpProgress *Prog) /*{{{*/ +bool pkgDepCache::readStateFile(OpProgress * const Prog) /*{{{*/ { FileFd state_file; string const state = _config->FindFile("Dir::State::extended_states"); @@ -186,7 +185,7 @@ bool pkgDepCache::readStateFile(OpProgress *Prog) /*{{{*/ state_file.Open(state, FileFd::ReadOnly); off_t const file_size = state_file.Size(); if(Prog != NULL) - Prog->OverallProgress(0, file_size, 1, + Prog->OverallProgress(0, file_size, 1, _("Reading state information")); pkgTagFile tagfile(&state_file); @@ -230,7 +229,7 @@ bool pkgDepCache::readStateFile(OpProgress *Prog) /*{{{*/ return true; } /*}}}*/ -bool pkgDepCache::writeStateFile(OpProgress * /*prog*/, bool InstalledOnly) /*{{{*/ +bool pkgDepCache::writeStateFile(OpProgress * const /*prog*/, bool const InstalledOnly) /*{{{*/ { bool const debug_autoremove = _config->FindB("Debug::pkgAutoRemove",false); @@ -340,7 +339,7 @@ bool pkgDepCache::writeStateFile(OpProgress * /*prog*/, bool InstalledOnly) /*{{ then walks along the package provides list and checks if each provides will be installed then checks the provides against the dep. Res will be set to the package which was used to satisfy the dep. */ -bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res) +bool pkgDepCache::CheckDep(DepIterator const &Dep,int const Type,PkgIterator &Res) { Res = Dep.TargetPkg(); @@ -351,22 +350,26 @@ bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res) { PkgIterator Pkg = Dep.TargetPkg(); // Check the base package - if (Type == NowVersion && Pkg->CurrentVer != 0) - if (Dep.IsSatisfied(Pkg.CurrentVer()) == true) + if (Type == NowVersion) + { + if (Pkg->CurrentVer != 0 && Dep.IsSatisfied(Pkg.CurrentVer()) == true) return true; - - if (Type == InstallVersion && PkgState[Pkg->ID].InstallVer != 0) - if (Dep.IsSatisfied(PkgState[Pkg->ID].InstVerIter(*this)) == true) + } + else if (Type == InstallVersion) + { + if (PkgState[Pkg->ID].InstallVer != 0 && + Dep.IsSatisfied(PkgState[Pkg->ID].InstVerIter(*this)) == true) return true; - - if (Type == CandidateVersion && PkgState[Pkg->ID].CandidateVer != 0) - if (Dep.IsSatisfied(PkgState[Pkg->ID].CandidateVerIter(*this)) == true) + } + else if (Type == CandidateVersion) + if (PkgState[Pkg->ID].CandidateVer != 0 && + Dep.IsSatisfied(PkgState[Pkg->ID].CandidateVerIter(*this)) == true) return true; } - + if (Dep->Type == Dep::Obsoletes) return false; - + // Check the providing packages PrvIterator P = Dep.TargetPkg().ProvidesList(); for (; P.end() != true; ++P) @@ -380,21 +383,19 @@ bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res) if (P.OwnerPkg().CurrentVer() != P.OwnerVer()) continue; } - - if (Type == InstallVersion) + else if (Type == InstallVersion) { StateCache &State = PkgState[P.OwnerPkg()->ID]; if (State.InstallVer != (Version *)P.OwnerVer()) continue; } - - if (Type == CandidateVersion) + else if (Type == CandidateVersion) { StateCache &State = PkgState[P.OwnerPkg()->ID]; if (State.CandidateVer != (Version *)P.OwnerVer()) continue; } - + // Compare the versions. if (Dep.IsSatisfied(P) == true) { @@ -402,7 +403,7 @@ bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res) return true; } } - + return false; } /*}}}*/ @@ -484,47 +485,46 @@ void pkgDepCache::AddStates(const PkgIterator &Pkg, bool const Invert) { signed char const Add = (Invert == false) ? 1 : -1; StateCache &State = PkgState[Pkg->ID]; - + // The Package is broken (either minimal dep or policy dep) if ((State.DepState & DepInstMin) != DepInstMin) iBrokenCount += Add; if ((State.DepState & DepInstPolicy) != DepInstPolicy) iPolicyBrokenCount += Add; - + // Bad state if (Pkg.State() != PkgIterator::NeedsNothing) iBadCount += Add; - + // Not installed if (Pkg->CurrentVer == 0) { if (State.Mode == ModeDelete && (State.iFlags & Purge) == Purge && Pkg.Purge() == false) iDelCount += Add; - + if (State.Mode == ModeInstall) iInstCount += Add; return; } - + // Installed, no upgrade if (State.Status == 0) - { + { if (State.Mode == ModeDelete) iDelCount += Add; else if ((State.iFlags & ReInstall) == ReInstall) iInstCount += Add; - return; } - + // Alll 3 are possible if (State.Mode == ModeDelete) - iDelCount += Add; - if (State.Mode == ModeKeep) + iDelCount += Add; + else if (State.Mode == ModeKeep) iKeepCount += Add; - if (State.Mode == ModeInstall) + else if (State.Mode == ModeInstall) iInstCount += Add; } /*}}}*/ @@ -535,7 +535,6 @@ void pkgDepCache::AddStates(const PkgIterator &Pkg, bool const Invert) void pkgDepCache::BuildGroupOrs(VerIterator const &V) { unsigned char Group = 0; - for (DepIterator D = V.DependsList(); D.end() != true; ++D) { // Build the dependency state. @@ -545,18 +544,18 @@ void pkgDepCache::BuildGroupOrs(VerIterator const &V) right sense for a conflicts group */ if (D.IsNegative() == true) State = ~State; - + // Add to the group if we are within an or.. State &= 0x7; Group |= State; State |= Group << 3; if ((D->CompareOp & Dep::Or) != Dep::Or) Group = 0; - + // Invert for Conflicts if (D.IsNegative() == true) State = ~State; - } + } } /*}}}*/ // DepCache::VersionState - Perform a pass over a dependency list /*{{{*/ @@ -565,34 +564,31 @@ void pkgDepCache::BuildGroupOrs(VerIterator const &V) state of the list, filtering it through both a Min check and a Policy check. The return result will have SetMin/SetPolicy low if a check fails. It uses the DepState cache for it's computations. */ -unsigned char pkgDepCache::VersionState(DepIterator D,unsigned char Check, - unsigned char SetMin, - unsigned char SetPolicy) +unsigned char pkgDepCache::VersionState(DepIterator D, unsigned char const Check, + unsigned char const SetMin, + unsigned char const SetPolicy) const { unsigned char Dep = 0xFF; - while (D.end() != true) { - // Compute a single dependency element (glob or) - DepIterator Start = D; - unsigned char State = 0; - for (bool LastOR = true; D.end() == false && LastOR == true; ++D) - { - State |= DepState[D->ID]; - LastOR = (D->CompareOp & Dep::Or) == Dep::Or; - } - + // the last or-dependency has the state of all previous or'ed + DepIterator Start, End; + D.GlobOr(Start, End); + // ignore if we are called with Dep{Install,…} or DepG{Install,…} + // the later would be more correct, but the first is what we get + unsigned char const State = DepState[End->ID] | (DepState[End->ID] >> 3); + // Minimum deps that must be satisfied to have a working package if (Start.IsCritical() == true) + { if ((State & Check) != Check) - Dep &= ~SetMin; - + return Dep &= ~(SetMin | SetPolicy); + } // Policy deps that must be satisfied to install the package - if (IsImportantDep(Start) == true && + else if (IsImportantDep(Start) == true && (State & Check) != Check) Dep &= ~SetPolicy; } - return Dep; } /*}}}*/ @@ -601,17 +597,17 @@ unsigned char pkgDepCache::VersionState(DepIterator D,unsigned char Check, /* This is the main dependency computation bit. It computes the 3 main results for a dependencys, Now, Install and Candidate. Callers must invert the result if dealing with conflicts. */ -unsigned char pkgDepCache::DependencyState(DepIterator &D) +unsigned char pkgDepCache::DependencyState(DepIterator const &D) { unsigned char State = 0; - + if (CheckDep(D,NowVersion) == true) State |= DepNow; if (CheckDep(D,InstallVersion) == true) State |= DepInstall; if (CheckDep(D,CandidateVersion) == true) State |= DepCVer; - + return State; } /*}}}*/ @@ -620,7 +616,7 @@ unsigned char pkgDepCache::DependencyState(DepIterator &D) /* This determines the combined dependency representation of a package for its two states now and install. This is done by using the pre-generated dependency information. */ -void pkgDepCache::UpdateVerState(PkgIterator Pkg) +void pkgDepCache::UpdateVerState(PkgIterator const &Pkg) { // Empty deps are always true StateCache &State = PkgState[Pkg->ID]; @@ -654,7 +650,7 @@ void pkgDepCache::UpdateVerState(PkgIterator Pkg) // --------------------------------------------------------------------- /* This will figure out the state of all the packages and all the dependencies based on the current policy. */ -void pkgDepCache::Update(OpProgress *Prog) +void pkgDepCache::Update(OpProgress * const Prog) { iUsrSize = 0; iDownloadSize = 0; @@ -1655,10 +1651,10 @@ const char *pkgDepCache::StateCache::StripEpoch(const char *Ver) return 0; // Strip any epoch - for (const char *I = Ver; *I != 0; I++) - if (*I == ':') - return I + 1; - return Ver; + char const * const I = strchr(Ver, ':'); + if (I == nullptr) + return Ver; + return I + 1; } /*}}}*/ // Policy::GetCandidateVer - Returns the Candidate install version /*{{{*/ @@ -1701,17 +1697,17 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator const &Pk // Policy::IsImportantDep - True if the dependency is important /*{{{*/ // --------------------------------------------------------------------- /* */ -bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep) +bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep) const { if(Dep.IsCritical()) return true; - else if(Dep->Type == pkgCache::Dep::Recommends) + else if(Dep->Type == pkgCache::Dep::Recommends) { if (InstallRecommends) return true; // we suport a special mode to only install-recommends for certain // sections - // FIXME: this is a meant as a temporarly solution until the + // FIXME: this is a meant as a temporarly solution until the // recommends are cleaned up const char *sec = Dep.ParentVer().Section(); if (sec && ConfigValueInSubTree("APT::Install-Recommends-Sections", sec)) @@ -1757,24 +1753,22 @@ bool pkgDepCache::MarkRequired(InRootSetFunc &userFunc) if (_config->Find("APT::Solver", "internal") != "internal") return true; - bool follow_recommends; - bool follow_suggests; - bool debug_autoremove = _config->FindB("Debug::pkgAutoRemove",false); + bool const debug_autoremove = _config->FindB("Debug::pkgAutoRemove",false); // init the states - for(PkgIterator p = PkgBegin(); !p.end(); ++p) + map_id_t const PackagesCount = Head().PackageCount; + for(map_id_t i = 0; i < PackagesCount; ++i) { - PkgState[p->ID].Marked = false; - PkgState[p->ID].Garbage = false; - - // debug output - if(debug_autoremove && PkgState[p->ID].Flags & Flag::Auto) - std::clog << "AutoDep: " << p.FullName() << std::endl; + PkgState[i].Marked = false; + PkgState[i].Garbage = false; } + if (debug_autoremove) + for(PkgIterator p = PkgBegin(); !p.end(); ++p) + if(PkgState[p->ID].Flags & Flag::Auto) + std::clog << "AutoDep: " << p.FullName() << std::endl; - // init vars - follow_recommends = MarkFollowsRecommends(); - follow_suggests = MarkFollowsSuggests(); + bool const follow_recommends = MarkFollowsRecommends(); + bool const follow_suggests = MarkFollowsSuggests(); // do the mark part, this is the core bit of the algorithm for(PkgIterator p = PkgBegin(); !p.end(); ++p) diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 2c3304ba8..aa281f695 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -267,7 +267,7 @@ class pkgDepCache : protected pkgCache::Namespace // Helper functions void BuildGroupOrs(VerIterator const &V); - void UpdateVerState(PkgIterator Pkg); + void UpdateVerState(PkgIterator const &Pkg); // User Policy control class Policy @@ -279,7 +279,7 @@ class pkgDepCache : protected pkgCache::Namespace } virtual VerIterator GetCandidateVer(PkgIterator const &Pkg); - virtual bool IsImportantDep(DepIterator const &Dep); + virtual bool IsImportantDep(DepIterator const &Dep) const; virtual signed short GetPriority(PkgIterator const &Pkg); virtual signed short GetPriority(PkgFileIterator const &File); @@ -323,18 +323,18 @@ class pkgDepCache : protected pkgCache::Namespace Policy *LocalPolicy; // Check for a matching provides - bool CheckDep(DepIterator Dep,int Type,PkgIterator &Res); - inline bool CheckDep(DepIterator Dep,int Type) + bool CheckDep(DepIterator const &Dep,int const Type,PkgIterator &Res); + inline bool CheckDep(DepIterator const &Dep,int const Type) { PkgIterator Res(*this,0); return CheckDep(Dep,Type,Res); } // Computes state information for deps and versions (w/o storing) - unsigned char DependencyState(DepIterator &D); - unsigned char VersionState(DepIterator D,unsigned char Check, - unsigned char SetMin, - unsigned char SetPolicy); + unsigned char DependencyState(DepIterator const &D); + unsigned char VersionState(DepIterator D,unsigned char const Check, + unsigned char const SetMin, + unsigned char const SetPolicy) const; // Recalculates various portions of the cache, call after changing something void Update(DepIterator Dep); // Mostly internal @@ -362,7 +362,7 @@ class pkgDepCache : protected pkgCache::Namespace // Policy implementation inline VerIterator GetCandidateVer(PkgIterator const &Pkg) {return LocalPolicy->GetCandidateVer(Pkg);}; - inline bool IsImportantDep(DepIterator Dep) {return LocalPolicy->IsImportantDep(Dep);}; + inline bool IsImportantDep(DepIterator Dep) const {return LocalPolicy->IsImportantDep(Dep);}; inline Policy &GetPolicy() {return *LocalPolicy;}; // Accessors @@ -471,8 +471,8 @@ class pkgDepCache : protected pkgCache::Namespace unsigned long Depth = 0, bool FromUser = true); // read persistent states - bool readStateFile(OpProgress *prog); - bool writeStateFile(OpProgress *prog, bool InstalledOnly=true); + bool readStateFile(OpProgress * const prog); + bool writeStateFile(OpProgress * const prog, bool const InstalledOnly=true); // Size queries inline signed long long UsrSize() {return iUsrSize;}; @@ -484,11 +484,11 @@ class pkgDepCache : protected pkgCache::Namespace inline unsigned long PolicyBrokenCount() {return iPolicyBrokenCount;}; inline unsigned long BadCount() {return iBadCount;}; - bool Init(OpProgress *Prog); + bool Init(OpProgress * const Prog); // Generate all state information - void Update(OpProgress *Prog = 0); + void Update(OpProgress * const Prog = 0); - pkgDepCache(pkgCache *Cache,Policy *Plcy = 0); + pkgDepCache(pkgCache * const Cache,Policy * const Plcy = 0); virtual ~pkgDepCache(); protected: diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index aebbffe8b..897f1ee2a 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -697,29 +697,34 @@ void pkgCache::DepIterator::GlobOr(DepIterator &Start,DepIterator &End) // --------------------------------------------------------------------- /* Deps like self-conflicts should be ignored as well as implicit conflicts on virtual packages. */ -bool pkgCache::DepIterator::IsIgnorable(PkgIterator const &/*Pkg*/) const +bool pkgCache::DepIterator::IsIgnorable(PkgIterator const &PT) const { if (IsNegative() == false) return false; - pkgCache::PkgIterator PP = ParentPkg(); - pkgCache::PkgIterator PT = TargetPkg(); + pkgCache::PkgIterator const PP = ParentPkg(); if (PP->Group != PT->Group) return false; // self-conflict if (PP == PT) return true; - pkgCache::VerIterator PV = ParentVer(); + pkgCache::VerIterator const PV = ParentVer(); // ignore group-conflict on a M-A:same package - but not our implicit dependencies // so that we can have M-A:same packages conflicting with their own real name if ((PV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same) { // Replaces: ${self}:other ( << ${binary:Version}) - if (S->Type == pkgCache::Dep::Replaces && S->CompareOp == pkgCache::Dep::Less && strcmp(PV.VerStr(), TargetVer()) == 0) - return false; + if (S->Type == pkgCache::Dep::Replaces) + { + if (S->CompareOp == pkgCache::Dep::Less && strcmp(PV.VerStr(), TargetVer()) == 0) + return false; + } // Breaks: ${self}:other (!= ${binary:Version}) - if (S->Type == pkgCache::Dep::DpkgBreaks && S->CompareOp == pkgCache::Dep::NotEquals && strcmp(PV.VerStr(), TargetVer()) == 0) - return false; + else if (S->Type == pkgCache::Dep::DpkgBreaks) + { + if (S->CompareOp == pkgCache::Dep::NotEquals && strcmp(PV.VerStr(), TargetVer()) == 0) + return false; + } return true; } diff --git a/test/integration/test-apt-cache b/test/integration/test-apt-cache index 97dc0f939..7da2ab71f 100755 --- a/test/integration/test-apt-cache +++ b/test/integration/test-apt-cache @@ -56,21 +56,21 @@ testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive uns testsuccessequal 'foo Depends: bar - |Recommends: - Recommends: Conflicts: - Conflicts: ' aptcache depends foo + Conflicts: + |Recommends: + Recommends: ' aptcache depends foo testsuccessequal 'foo Depends: bar - Recommends: Conflicts: - Conflicts: ' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 + Conflicts: + Recommends: ' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 testsuccessequal 'foo Depends: bar - |Recommends: (>= 2) - Recommends: (<< 5) Conflicts: - Conflicts: ' aptcache depends foo -o APT::Cache::ShowVersion=1 + Conflicts: + |Recommends: (>= 2) + Recommends: (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 testsuccessequal 'foo Depends: bar Conflicts: @@ -82,20 +82,20 @@ testsuccessequal 'foo Conflicts: ' aptcache depends foo --important --no-depends --conflicts testsuccessequal 'foo Depends: bar - |Recommends: - Recommends: Conflicts: Conflicts: + |Recommends: + Recommends: bar Depends: bar Breaks: foo Breaks: Replaces: foo Replaces: - - + + ' aptcache depends foo --recurse testsuccessequal 'foo Depends: bar diff --git a/test/integration/test-apt-showlist-orgroup-in-recommends b/test/integration/test-apt-showlist-orgroup-in-recommends index bce421ac4..929f7feb9 100755 --- a/test/integration/test-apt-showlist-orgroup-in-recommends +++ b/test/integration/test-apt-showlist-orgroup-in-recommends @@ -13,7 +13,7 @@ insertinstalledpackage 'ddd' 'all' '1' insertpackage 'unstable' 'aaa' 'all' '1' insertpackage 'unstable' 'ddd' 'all' '1' insertpackage 'unstable' 'yyy' 'all' '1' -insertpackage 'unstable' 'zzz' 'all' '1' +insertpackage 'unstable' 'zzz' 'all' '1:1' insertpackage 'unstable' 'simple' 'all' '1' 'Recommends: aaa, bbb Suggests: ccc, ddd' insertpackage 'unstable' 'orgroup' 'all' '1' 'Recommends: aaa | bbb -- cgit v1.2.3 From 71c9e95b223517b5f51c4627f6ad4cce8af0d901 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 13 Jul 2015 16:28:21 +0200 Subject: split-up Dependency struct Having dependency data separated from the link between version/package and the dependency allows use to work on sharing the depdency data a bit as it turns out that many dependencies are in fact duplicates. How many are duplicates various heavily with the sources configured, but for a single Debian release the ballpark is 2 duplicates for each dependency already (e.g. libc6 counts 18410 dependencies, but only 45 unique). Add more releases and the duplicates count only rises to get ~6 for 3 releases. For each architecture a user has configured which given the shear number of dependencies amounts to MBs of duplication. We can cut down on this number, but pay a heavy price for it: In my many releases(3) + architectures(3) test we have a 10% (~ 0.5 sec) increase in cache creationtime, but also 10% less cachesize (~ 10 MB). Further work is needed to rip the whole benefits from this through, so this is just the start. Git-Dch: Ignore --- apt-pkg/cacheiterators.h | 43 +++++++++++++++++++------ apt-pkg/depcache.cc | 11 +++---- apt-pkg/pkgcache.cc | 56 ++++++++++++++++++++------------ apt-pkg/pkgcache.h | 27 ++++++++++------ apt-pkg/pkgcachegen.cc | 83 ++++++++++++++++++++++++++++++++++++++++-------- cmdline/apt-cache.cc | 9 +++--- 6 files changed, 167 insertions(+), 62 deletions(-) diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 06deef950..82c5d082b 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -275,6 +275,7 @@ class pkgCache::DescIterator : public Iterator { // Dependency iterator /*{{{*/ class pkgCache::DepIterator : public Iterator { enum {DepVer, DepRev} Type; + DependencyData * S2; public: inline Dependency* OwnerPointer() const { @@ -282,13 +283,12 @@ class pkgCache::DepIterator : public Iterator { } // Iteration - inline DepIterator& operator++() {if (S != Owner->DepP) S = Owner->DepP + - (Type == DepVer ? S->NextDepends : S->NextRevDepends); return *this;} + DepIterator& operator++(); inline DepIterator operator++(int) { DepIterator const tmp(*this); operator++(); return tmp; } // Accessors - inline const char *TargetVer() const {return S->Version == 0?0:Owner->StrP + S->Version;} - inline PkgIterator TargetPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->Package);} + inline const char *TargetVer() const {return S2->Version == 0?0:Owner->StrP + S2->Version;} + inline PkgIterator TargetPkg() const {return PkgIterator(*Owner,Owner->PkgP + S2->Package);} inline PkgIterator SmartTargetPkg() const {PkgIterator R(*Owner,0);SmartTargetPkg(R);return R;} inline VerIterator ParentVer() const {return VerIterator(*Owner,Owner->VerP + S->ParentVer);} inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->ParentVer].ParentPkg);} @@ -303,23 +303,48 @@ class pkgCache::DepIterator : public Iterator { void GlobOr(DepIterator &Start,DepIterator &End); Version **AllTargets() const; bool SmartTargetPkg(PkgIterator &Result) const; - inline const char *CompType() const {return Owner->CompType(S->CompareOp);} - inline const char *DepType() const {return Owner->DepType(S->Type);} + inline const char *CompType() const {return Owner->CompType(S2->CompareOp);} + inline const char *DepType() const {return Owner->DepType(S2->Type);} + + // overrides because we are special + struct DependencyProxy + { + map_stringitem_t &Version; + map_pointer_t &Package; + should_be_map_id_t &ID; + unsigned char &Type; + unsigned char &CompareOp; + map_pointer_t &ParentVer; + map_pointer_t &DependencyData; + map_pointer_t &NextRevDepends; + map_pointer_t &NextDepends; + DependencyProxy const * operator->() const { return this; } + DependencyProxy * operator->() { return this; } + }; + inline DependencyProxy operator->() const {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends };} + inline DependencyProxy operator->() {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends };} + void ReMap(void const * const oldMap, void const * const newMap) + { + Iterator::ReMap(oldMap, newMap); + if (Owner == 0 || S == 0 || S2 == 0) + return; + S2 += (DependencyData const * const)(newMap) - (DependencyData const * const)(oldMap); + } //Nice printable representation friend std::ostream& operator <<(std::ostream& out, DepIterator D); inline DepIterator(pkgCache &Owner, Dependency *Trg, Version* = 0) : - Iterator(Owner, Trg), Type(DepVer) { + Iterator(Owner, Trg), Type(DepVer), S2(Trg == 0 ? Owner.DepDataP : (Owner.DepDataP + Trg->DependencyData)) { if (S == 0) S = Owner.DepP; } inline DepIterator(pkgCache &Owner, Dependency *Trg, Package*) : - Iterator(Owner, Trg), Type(DepRev) { + Iterator(Owner, Trg), Type(DepRev), S2(Trg == 0 ? Owner.DepDataP : (Owner.DepDataP + Trg->DependencyData)) { if (S == 0) S = Owner.DepP; } - inline DepIterator() : Iterator(), Type(DepVer) {} + inline DepIterator() : Iterator(), Type(DepVer), S2(0) {} }; /*}}}*/ // Provides iterator /*{{{*/ diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 6271a024a..7b1448c73 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -348,22 +348,21 @@ bool pkgDepCache::CheckDep(DepIterator const &Dep,int const Type,PkgIterator &Re bug. Conflicts may never self match */ if (Dep.IsIgnorable(Res) == false) { - PkgIterator Pkg = Dep.TargetPkg(); // Check the base package if (Type == NowVersion) { - if (Pkg->CurrentVer != 0 && Dep.IsSatisfied(Pkg.CurrentVer()) == true) + if (Res->CurrentVer != 0 && Dep.IsSatisfied(Res.CurrentVer()) == true) return true; } else if (Type == InstallVersion) { - if (PkgState[Pkg->ID].InstallVer != 0 && - Dep.IsSatisfied(PkgState[Pkg->ID].InstVerIter(*this)) == true) + if (PkgState[Res->ID].InstallVer != 0 && + Dep.IsSatisfied(PkgState[Res->ID].InstVerIter(*this)) == true) return true; } else if (Type == CandidateVersion) - if (PkgState[Pkg->ID].CandidateVer != 0 && - Dep.IsSatisfied(PkgState[Pkg->ID].CandidateVerIter(*this)) == true) + if (PkgState[Res->ID].CandidateVer != 0 && + Dep.IsSatisfied(PkgState[Res->ID].CandidateVerIter(*this)) == true) return true; } diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 897f1ee2a..8cd716c6e 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -66,6 +66,7 @@ pkgCache::Header::Header() VersionSz = sizeof(pkgCache::Version); DescriptionSz = sizeof(pkgCache::Description); DependencySz = sizeof(pkgCache::Dependency); + DependencyDataSz = sizeof(pkgCache::DependencyData); ProvidesSz = sizeof(pkgCache::Provides); VerFileSz = sizeof(pkgCache::VerFile); DescFileSz = sizeof(pkgCache::DescFile); @@ -75,6 +76,7 @@ pkgCache::Header::Header() VersionCount = 0; DescriptionCount = 0; DependsCount = 0; + DependsDataCount = 0; ReleaseFileCount = 0; PackageFileCount = 0; VerFileCount = 0; @@ -110,6 +112,7 @@ bool pkgCache::Header::CheckSizes(Header &Against) const VersionSz == Against.VersionSz && DescriptionSz == Against.DescriptionSz && DependencySz == Against.DependencySz && + DependencyDataSz == Against.DependencyDataSz && VerFileSz == Against.VerFileSz && DescFileSz == Against.DescFileSz && ProvidesSz == Against.ProvidesSz) @@ -150,6 +153,7 @@ bool pkgCache::ReMap(bool const &Errorchecks) DescP = (Description *)Map.Data(); ProvideP = (Provides *)Map.Data(); DepP = (Dependency *)Map.Data(); + DepDataP = (DependencyData *)Map.Data(); StrP = (char *)Map.Data(); if (Errorchecks == false) @@ -408,7 +412,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::NextPkg(pkgCache::PkgIterator const return PkgIterator(*Owner, Owner->PkgP + LastPkg->NextPackage); } /*}}}*/ -// GrpIterator::operator ++ - Postfix incr /*{{{*/ +// GrpIterator::operator++ - Prefix incr /*{{{*/ // --------------------------------------------------------------------- /* This will advance to the next logical group in the hash table. */ pkgCache::GrpIterator& pkgCache::GrpIterator::operator++() @@ -420,16 +424,16 @@ pkgCache::GrpIterator& pkgCache::GrpIterator::operator++() // Follow the hash table while (S == Owner->GrpP && (HashIndex+1) < (signed)Owner->HeaderP->GetHashTableSize()) { - HashIndex++; + ++HashIndex; S = Owner->GrpP + Owner->HeaderP->GrpHashTableP()[HashIndex]; } return *this; } /*}}}*/ -// PkgIterator::operator ++ - Postfix incr /*{{{*/ +// PkgIterator::operator++ - Prefix incr /*{{{*/ // --------------------------------------------------------------------- /* This will advance to the next logical package in the hash table. */ -pkgCache::PkgIterator& pkgCache::PkgIterator::operator ++() +pkgCache::PkgIterator& pkgCache::PkgIterator::operator++() { // Follow the current links if (S != Owner->PkgP) @@ -438,12 +442,24 @@ pkgCache::PkgIterator& pkgCache::PkgIterator::operator ++() // Follow the hash table while (S == Owner->PkgP && (HashIndex+1) < (signed)Owner->HeaderP->GetHashTableSize()) { - HashIndex++; + ++HashIndex; S = Owner->PkgP + Owner->HeaderP->PkgHashTableP()[HashIndex]; } return *this; } /*}}}*/ +pkgCache::DepIterator& pkgCache::DepIterator::operator++() /*{{{*/ +{ + if (S == Owner->DepP) + return *this; + S = Owner->DepP + (Type == DepVer ? S->NextDepends : S->NextRevDepends); + if (S == Owner->DepP) + S2 = Owner->DepDataP; + else + S2 = Owner->DepDataP + S->DependencyData; + return *this; +} + /*}}}*/ // PkgIterator::State - Check the State of the package /*{{{*/ // --------------------------------------------------------------------- /* By this we mean if it is either cleanly installed or cleanly removed. */ @@ -543,8 +559,8 @@ std::string pkgCache::PkgIterator::FullName(bool const &Pretty) const bool pkgCache::DepIterator::IsCritical() const { if (IsNegative() == true || - S->Type == pkgCache::Dep::Depends || - S->Type == pkgCache::Dep::PreDepends) + S2->Type == pkgCache::Dep::Depends || + S2->Type == pkgCache::Dep::PreDepends) return true; return false; } @@ -555,9 +571,9 @@ bool pkgCache::DepIterator::IsCritical() const are negative like Conflicts which can and should be handled differently */ bool pkgCache::DepIterator::IsNegative() const { - return S->Type == Dep::DpkgBreaks || - S->Type == Dep::Conflicts || - S->Type == Dep::Obsoletes; + return S2->Type == Dep::DpkgBreaks || + S2->Type == Dep::Conflicts || + S2->Type == Dep::Obsoletes; } /*}}}*/ // DepIterator::SmartTargetPkg - Resolve dep target pointers w/provides /*{{{*/ @@ -686,7 +702,7 @@ void pkgCache::DepIterator::GlobOr(DepIterator &Start,DepIterator &End) End = *this; for (bool LastOR = true; end() == false && LastOR == true;) { - LastOR = (S->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or; + LastOR = (S2->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or; ++(*this); if (LastOR == true) End = (*this); @@ -714,15 +730,15 @@ bool pkgCache::DepIterator::IsIgnorable(PkgIterator const &PT) const if ((PV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same) { // Replaces: ${self}:other ( << ${binary:Version}) - if (S->Type == pkgCache::Dep::Replaces) + if (S2->Type == pkgCache::Dep::Replaces) { - if (S->CompareOp == pkgCache::Dep::Less && strcmp(PV.VerStr(), TargetVer()) == 0) + if (S2->CompareOp == pkgCache::Dep::Less && strcmp(PV.VerStr(), TargetVer()) == 0) return false; } // Breaks: ${self}:other (!= ${binary:Version}) - else if (S->Type == pkgCache::Dep::DpkgBreaks) + else if (S2->Type == pkgCache::Dep::DpkgBreaks) { - if (S->CompareOp == pkgCache::Dep::NotEquals && strcmp(PV.VerStr(), TargetVer()) == 0) + if (S2->CompareOp == pkgCache::Dep::NotEquals && strcmp(PV.VerStr(), TargetVer()) == 0) return false; } return true; @@ -755,9 +771,9 @@ bool pkgCache::DepIterator::IsIgnorable(PrvIterator const &Prv) const bool pkgCache::DepIterator::IsMultiArchImplicit() const { if (ParentPkg()->Arch != TargetPkg()->Arch && - (S->Type == pkgCache::Dep::Replaces || - S->Type == pkgCache::Dep::DpkgBreaks || - S->Type == pkgCache::Dep::Conflicts)) + (S2->Type == pkgCache::Dep::Replaces || + S2->Type == pkgCache::Dep::DpkgBreaks || + S2->Type == pkgCache::Dep::Conflicts)) return true; return false; } @@ -765,11 +781,11 @@ bool pkgCache::DepIterator::IsMultiArchImplicit() const // DepIterator::IsSatisfied - check if a version satisfied the dependency /*{{{*/ bool pkgCache::DepIterator::IsSatisfied(VerIterator const &Ver) const { - return Owner->VS->CheckDep(Ver.VerStr(),S->CompareOp,TargetVer()); + return Owner->VS->CheckDep(Ver.VerStr(),S2->CompareOp,TargetVer()); } bool pkgCache::DepIterator::IsSatisfied(PrvIterator const &Prv) const { - return Owner->VS->CheckDep(Prv.ProvideVersion(),S->CompareOp,TargetVer()); + return Owner->VS->CheckDep(Prv.ProvideVersion(),S2->CompareOp,TargetVer()); } /*}}}*/ // ostream operator to handle string representation of a dependecy /*{{{*/ diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 0042eac96..41709eae8 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -139,6 +139,7 @@ class pkgCache /*{{{*/ struct Description; struct Provides; struct Dependency; + struct DependencyData; struct StringItem; struct VerFile; struct DescFile; @@ -226,6 +227,7 @@ class pkgCache /*{{{*/ Description *DescP; Provides *ProvideP; Dependency *DepP; + DependencyData *DepDataP; APT_DEPRECATED StringItem *StringItemP; char *StrP; @@ -310,6 +312,7 @@ struct pkgCache::Header unsigned short VersionSz; unsigned short DescriptionSz; unsigned short DependencySz; + unsigned short DependencyDataSz; unsigned short ProvidesSz; unsigned short VerFileSz; unsigned short DescFileSz; @@ -324,6 +327,7 @@ struct pkgCache::Header map_id_t VersionCount; map_id_t DescriptionCount; map_id_t DependsCount; + map_id_t DependsDataCount; map_fileid_t ReleaseFileCount; map_fileid_t PackageFileCount; map_fileid_t VerFileCount; @@ -711,7 +715,7 @@ struct pkgCache::Description The base of the linked list is pkgCache::Version::DependsList. All forms of dependencies are recorded here including Depends, Recommends, Suggests, Enhances, Conflicts, Replaces and Breaks. */ -struct pkgCache::Dependency +struct pkgCache::DependencyData { /** \brief string of the version the dependency is applied against */ map_stringitem_t Version; @@ -720,21 +724,26 @@ struct pkgCache::Dependency The generator will - if the package does not already exist - create a blank (no version records) package. */ map_pointer_t Package; // Package - /** \brief next dependency of this version */ - map_pointer_t NextDepends; // Dependency - /** \brief next reverse dependency of this package */ - map_pointer_t NextRevDepends; // Dependency - /** \brief version of the package which has the reverse depends */ - map_pointer_t ParentVer; // Version - /** \brief unique sequel ID */ - should_be_map_id_t ID; /** \brief Dependency type - Depends, Recommends, Conflicts, etc */ unsigned char Type; /** \brief comparison operator specified on the depends line If the high bit is set then it is a logical OR with the previous record. */ unsigned char CompareOp; +}; +struct pkgCache::Dependency +{ + map_pointer_t DependencyData; // DependencyData + /** \brief version of the package which has the depends */ + map_pointer_t ParentVer; // Version + /** \brief next reverse dependency of this package */ + map_pointer_t NextRevDepends; // Dependency + /** \brief next dependency of this version */ + map_pointer_t NextDepends; // Dependency + + /** \brief unique sequel ID */ + should_be_map_id_t ID; }; /*}}}*/ // Provides structure /*{{{*/ diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 0eba5795f..d5b282007 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -950,19 +950,75 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, if (unlikely(Dependency == 0)) return false; - // Fill it in - pkgCache::DepIterator Dep(Cache,Cache.DepP + Dependency); - Dynamic DynDep(Dep); - Dep->ParentVer = Ver.Index(); - Dep->Type = Type; - Dep->CompareOp = Op; - Dep->Version = Version; - Dep->ID = Cache.HeaderP->DependsCount++; + bool isDuplicate = false; + map_pointer_t DependencyData = 0; + map_pointer_t * PkgRevDepends = &Pkg->RevDepends; + map_pointer_t previous_id = 0; - // Link it to the package - Dep->Package = Pkg.Index(); - Dep->NextRevDepends = Pkg->RevDepends; - Pkg->RevDepends = Dep.Index(); + while (*PkgRevDepends != 0) + { + pkgCache::Dependency * const L = Cache.DepP + *PkgRevDepends; + PkgRevDepends = &L->NextRevDepends; + if (L->DependencyData == previous_id) + break; + previous_id = L->DependencyData; + pkgCache::DependencyData const * const D = Cache.DepDataP + previous_id; + if (D->Type == Type && D->CompareOp == Op && D->Version == Version) + { + DependencyData = previous_id; + isDuplicate = true; + break; + } + } + + if (isDuplicate == false) + { + void const * const oldMap2 = Map.Data(); + DependencyData = AllocateInMap(sizeof(pkgCache::DependencyData)); + if (unlikely(DependencyData == 0)) + return false; + if (oldMap2 != Map.Data()) + PkgRevDepends += (map_pointer_t const * const) Map.Data() - (map_pointer_t const * const) oldMap2; + } + + pkgCache::Dependency * Link = Cache.DepP + Dependency; + Link->ParentVer = Ver.Index(); + Link->DependencyData = DependencyData; + Link->ID = Cache.HeaderP->DependsCount++; + + pkgCache::DepIterator Dep(Cache, Link); + Dynamic DynDep(Dep); + if (isDuplicate == false) + { + Dep->Type = Type; + Dep->CompareOp = Op; + Dep->Version = Version; + Dep->Package = Pkg.Index(); + ++Cache.HeaderP->DependsDataCount; + Link->NextRevDepends = Pkg->RevDepends; + Pkg->RevDepends = Dependency; + } + else + { + // dependency data is already fine, we just set the reverse link + // and in such a way that the loop above can finish fast, so we keep + // non-duplicates at the front and for the duplicates we: + // a) move to the end of the list, b) insert before another own duplicate + // or c) find two duplicates behind each other. + map_pointer_t const own_id = Link->DependencyData; + while (*PkgRevDepends != 0) + { + pkgCache::Dependency * const L = Cache.DepP + *PkgRevDepends; + PkgRevDepends = &L->NextRevDepends; + if (L->DependencyData == own_id || L->DependencyData == previous_id) + { + Link->NextRevDepends = L->NextRevDepends; + break; + } + previous_id = L->DependencyData; + } + *PkgRevDepends = Dependency; + } // Do we know where to link the Dependency to? if (OldDepLast == NULL) @@ -974,9 +1030,8 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, OldDepLast += (map_pointer_t const * const) Map.Data() - (map_pointer_t const * const) oldMap; Dep->NextDepends = *OldDepLast; - *OldDepLast = Dep.Index(); + *OldDepLast = Dependency; OldDepLast = &Dep->NextDepends; - return true; } /*}}}*/ diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 9c884433c..cfa789fd9 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -364,14 +364,14 @@ static bool Stats(CommandLine &) cout << _(" Single virtual packages: ") << DVirt << endl; cout << _(" Mixed virtual packages: ") << NVirt << endl; cout << _(" Missing: ") << Missing << endl; - + cout << _("Total distinct versions: ") << Cache->Head().VersionCount << " (" << SizeToStr(Cache->Head().VersionCount*Cache->Head().VersionSz) << ')' << endl; cout << _("Total distinct descriptions: ") << Cache->Head().DescriptionCount << " (" << SizeToStr(Cache->Head().DescriptionCount*Cache->Head().DescriptionSz) << ')' << endl; - cout << _("Total dependencies: ") << Cache->Head().DependsCount << " (" << - SizeToStr(Cache->Head().DependsCount*Cache->Head().DependencySz) << ')' << endl; - + cout << _("Total dependencies: ") << Cache->Head().DependsCount << "/" << Cache->Head().DependsDataCount << " (" << + SizeToStr((Cache->Head().DependsCount*Cache->Head().DependencySz) + + (Cache->Head().DependsDataCount*Cache->Head().DependencyDataSz)) << ')' << endl; cout << _("Total ver/file relations: ") << Cache->Head().VerFileCount << " (" << SizeToStr(Cache->Head().VerFileCount*Cache->Head().VerFileSz) << ')' << endl; cout << _("Total Desc/File relations: ") << Cache->Head().DescFileCount << " (" << @@ -450,6 +450,7 @@ static bool Stats(CommandLine &) APT_CACHESIZE(VersionCount, VersionSz) + APT_CACHESIZE(DescriptionCount, DescriptionSz) + APT_CACHESIZE(DependsCount, DependencySz) + + APT_CACHESIZE(DependsDataCount, DependencyDataSz) + APT_CACHESIZE(ReleaseFileCount, ReleaseFileSz) + APT_CACHESIZE(PackageFileCount, PackageFileSz) + APT_CACHESIZE(VerFileCount, VerFileSz) + -- cgit v1.2.3 From b291aa59ee63983204d8aeb166c388b1f97edce7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 14 Jul 2015 13:41:11 +0200 Subject: link DependencyData structs together Cache generation needs a way of quickly iterating over the unique potion of the dependencies to be able to share them. By linking them together we can reduce the speed penality (~ 80%) with only a small reduction in saved size (~ 20%). Git-Dch: Ignore --- apt-pkg/cacheiterators.h | 5 +-- apt-pkg/pkgcache.h | 4 ++- apt-pkg/pkgcachegen.cc | 77 ++++++++++++++++++++--------------------- test/integration/test-apt-cache | 8 ++--- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 82c5d082b..4173326ca 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -318,11 +318,12 @@ class pkgCache::DepIterator : public Iterator { map_pointer_t &DependencyData; map_pointer_t &NextRevDepends; map_pointer_t &NextDepends; + map_pointer_t &NextData; DependencyProxy const * operator->() const { return this; } DependencyProxy * operator->() { return this; } }; - inline DependencyProxy operator->() const {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends };} - inline DependencyProxy operator->() {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends };} + inline DependencyProxy operator->() const {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };} + inline DependencyProxy operator->() {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };} void ReMap(void const * const oldMap, void const * const newMap) { Iterator::ReMap(oldMap, newMap); diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 41709eae8..b3a2e3184 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -366,7 +366,7 @@ struct pkgCache::Header the same number of pools as there are structure types. The generator stores this information so future additions can make use of any unused pool blocks. */ - DynamicMMap::Pool Pools[9]; + DynamicMMap::Pool Pools[12]; /** \brief hash tables providing rapid group/package name lookup @@ -731,6 +731,8 @@ struct pkgCache::DependencyData If the high bit is set then it is a logical OR with the previous record. */ unsigned char CompareOp; + + map_pointer_t NextData; }; struct pkgCache::Dependency { diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index d5b282007..a82483d15 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -952,33 +952,30 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, bool isDuplicate = false; map_pointer_t DependencyData = 0; - map_pointer_t * PkgRevDepends = &Pkg->RevDepends; - map_pointer_t previous_id = 0; - - while (*PkgRevDepends != 0) + map_pointer_t PreviousData = 0; + if (Pkg->RevDepends != 0) { - pkgCache::Dependency * const L = Cache.DepP + *PkgRevDepends; - PkgRevDepends = &L->NextRevDepends; - if (L->DependencyData == previous_id) - break; - previous_id = L->DependencyData; - pkgCache::DependencyData const * const D = Cache.DepDataP + previous_id; - if (D->Type == Type && D->CompareOp == Op && D->Version == Version) - { - DependencyData = previous_id; - isDuplicate = true; - break; - } + pkgCache::Dependency const * const L = Cache.DepP + Pkg->RevDepends; + DependencyData = L->DependencyData; + do { + pkgCache::DependencyData const * const D = Cache.DepDataP + DependencyData; + if (Version > D->Version) + break; + if (D->Version == Version && D->Type == Type && D->CompareOp == Op) + { + isDuplicate = true; + break; + } + PreviousData = DependencyData; + DependencyData = D->NextData; + } while (DependencyData != 0); } if (isDuplicate == false) { - void const * const oldMap2 = Map.Data(); DependencyData = AllocateInMap(sizeof(pkgCache::DependencyData)); if (unlikely(DependencyData == 0)) return false; - if (oldMap2 != Map.Data()) - PkgRevDepends += (map_pointer_t const * const) Map.Data() - (map_pointer_t const * const) oldMap2; } pkgCache::Dependency * Link = Cache.DepP + Dependency; @@ -987,7 +984,6 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, Link->ID = Cache.HeaderP->DependsCount++; pkgCache::DepIterator Dep(Cache, Link); - Dynamic DynDep(Dep); if (isDuplicate == false) { Dep->Type = Type; @@ -995,31 +991,32 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, Dep->Version = Version; Dep->Package = Pkg.Index(); ++Cache.HeaderP->DependsDataCount; - Link->NextRevDepends = Pkg->RevDepends; - Pkg->RevDepends = Dependency; + if (PreviousData != 0) + { + pkgCache::DependencyData * const D = Cache.DepDataP + PreviousData; + Dep->NextData = D->NextData; + D->NextData = DependencyData; + } + else if (Pkg->RevDepends != 0) + { + pkgCache::Dependency const * const D = Cache.DepP + Pkg->RevDepends; + Dep->NextData = D->DependencyData; + } + } + + if (isDuplicate == true || PreviousData != 0) + { + pkgCache::Dependency * const L = Cache.DepP + Pkg->RevDepends; + Link->NextRevDepends = L->NextRevDepends; + L->NextRevDepends = Dependency; } else { - // dependency data is already fine, we just set the reverse link - // and in such a way that the loop above can finish fast, so we keep - // non-duplicates at the front and for the duplicates we: - // a) move to the end of the list, b) insert before another own duplicate - // or c) find two duplicates behind each other. - map_pointer_t const own_id = Link->DependencyData; - while (*PkgRevDepends != 0) - { - pkgCache::Dependency * const L = Cache.DepP + *PkgRevDepends; - PkgRevDepends = &L->NextRevDepends; - if (L->DependencyData == own_id || L->DependencyData == previous_id) - { - Link->NextRevDepends = L->NextRevDepends; - break; - } - previous_id = L->DependencyData; - } - *PkgRevDepends = Dependency; + Link->NextRevDepends = Pkg->RevDepends; + Pkg->RevDepends = Dependency; } + // Do we know where to link the Dependency to? if (OldDepLast == NULL) { diff --git a/test/integration/test-apt-cache b/test/integration/test-apt-cache index 7da2ab71f..a22b08c20 100755 --- a/test/integration/test-apt-cache +++ b/test/integration/test-apt-cache @@ -113,12 +113,12 @@ Reverse Depends: bar' aptcache rdepends foo testsuccessequal 'foo Reverse Depends: - Replaces: bar - Breaks: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 + Breaks: bar + Replaces: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 testsuccessequal 'foo Reverse Depends: - Replaces: bar (<< 1) - Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 + Breaks: bar (<< 1) + Replaces: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 testsuccessequal 'foo Reverse Depends: Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks -- cgit v1.2.3 From 4dc77823d360158d6870a5710cc8c17064f1308f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 15 Jul 2015 13:21:21 +0200 Subject: remove the compatibility markers for 4.13 abi We aren't and we will not be really compatible again with the previous stable abi, so lets drop these markers (which never made it into a released version) for good as they have outlived their intend already. Git-Dch: Ignore --- apt-inst/contrib/arfile.h | 4 --- apt-inst/contrib/extracttar.cc | 5 --- apt-inst/contrib/extracttar.h | 8 ----- apt-inst/deb/debfile.cc | 8 ----- apt-inst/deb/debfile.h | 8 ----- apt-inst/dirstream.h | 12 +------ apt-pkg/algorithms.cc | 14 -------- apt-pkg/algorithms.h | 10 ------ apt-pkg/cacheiterators.h | 4 +-- apt-pkg/contrib/configuration.cc | 6 ---- apt-pkg/deb/deblistparser.cc | 5 --- apt-pkg/deb/deblistparser.h | 2 -- apt-pkg/deb/dpkgpm.cc | 9 ----- apt-pkg/edsp.cc | 7 ---- apt-pkg/packagemanager.cc | 24 ------------- apt-pkg/packagemanager.h | 10 ------ apt-pkg/pkgcache.cc | 3 -- apt-pkg/pkgcache.h | 74 ++++++++-------------------------------- apt-pkg/pkgrecords.h | 7 ---- apt-pkg/tagfile.cc | 28 --------------- apt-pkg/tagfile.h | 16 --------- apt-pkg/upgrade.cc | 6 ---- apt-pkg/upgrade.h | 5 --- apt-private/private-install.cc | 10 ------ cmdline/apt-cache.cc | 4 +-- cmdline/apt-get.cc | 33 ------------------ 26 files changed, 18 insertions(+), 304 deletions(-) diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h index f53356847..297303a9d 100644 --- a/apt-inst/contrib/arfile.h +++ b/apt-inst/contrib/arfile.h @@ -62,11 +62,7 @@ struct ARArchive::Member unsigned long long Size; // Location of the data. -#if APT_PKG_ABI >= 413 unsigned long long Start; -#else - unsigned long Start; -#endif Member *Next; Member() : Start(0), Next(0) {}; diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index be0b69d96..2c86d0d01 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -60,13 +60,8 @@ struct ExtractTar::TarHeader // ExtractTar::ExtractTar - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -#if APT_PKG_ABI >= 413 ExtractTar::ExtractTar(FileFd &Fd,unsigned long long Max,string DecompressionProgram) : File(Fd), MaxInSize(Max), DecompressProg(DecompressionProgram) -#else -ExtractTar::ExtractTar(FileFd &Fd,unsigned long Max,string DecompressionProgram) - : File(Fd), MaxInSize(Max), DecompressProg(DecompressionProgram) -#endif { GZPid = -1; Eof = false; diff --git a/apt-inst/contrib/extracttar.h b/apt-inst/contrib/extracttar.h index 57be956bd..22bb69e66 100644 --- a/apt-inst/contrib/extracttar.h +++ b/apt-inst/contrib/extracttar.h @@ -40,11 +40,7 @@ class ExtractTar GNU_LongLink = 'K',GNU_LongName = 'L'}; FileFd &File; -#if APT_PKG_ABI >= 413 unsigned long long MaxInSize; -#else - unsigned long MaxInSize; -#endif int GZPid; FileFd InFd; bool Eof; @@ -58,11 +54,7 @@ class ExtractTar bool Go(pkgDirStream &Stream); -#if APT_PKG_ABI >= 413 ExtractTar(FileFd &Fd,unsigned long long Max,std::string DecompressionProgram); -#else - ExtractTar(FileFd &Fd,unsigned long Max,std::string DecompressionProgram); -#endif virtual ~ExtractTar(); }; diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index a8bf754e4..4853a13c7 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -203,11 +203,7 @@ bool debDebFile::MemControlExtract::DoItem(Item &Itm,int &Fd) /* Just memcopy the block from the tar extractor and put it in the right place in the pre-allocated memory block. */ bool debDebFile::MemControlExtract::Process(Item &/*Itm*/,const unsigned char *Data, -#if APT_PKG_ABI >= 413 unsigned long long Size,unsigned long long Pos) -#else - unsigned long Size,unsigned long Pos) -#endif { memcpy(Control + Pos, Data,Size); return true; @@ -236,11 +232,7 @@ bool debDebFile::MemControlExtract::Read(debDebFile &Deb) // --------------------------------------------------------------------- /* The given memory block is loaded into the parser and parsed as a control record. */ -#if APT_PKG_ABI >= 413 bool debDebFile::MemControlExtract::TakeControl(const void *Data,unsigned long long Size) -#else -bool debDebFile::MemControlExtract::TakeControl(const void *Data,unsigned long Size) -#endif { delete [] Control; Control = new char[Size+2]; diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h index 6ad9b7659..02ebaae2e 100644 --- a/apt-inst/deb/debfile.h +++ b/apt-inst/deb/debfile.h @@ -82,19 +82,11 @@ class debDebFile::MemControlExtract : public pkgDirStream // Members from DirStream virtual bool DoItem(Item &Itm,int &Fd) APT_OVERRIDE; virtual bool Process(Item &Itm,const unsigned char *Data, -#if APT_PKG_ABI >= 413 unsigned long long Size,unsigned long long Pos) APT_OVERRIDE; -#else - unsigned long Size,unsigned long Pos); -#endif // Helpers bool Read(debDebFile &Deb); -#if APT_PKG_ABI >= 413 bool TakeControl(const void *Data,unsigned long long Size); -#else - bool TakeControl(const void *Data,unsigned long Size); -#endif MemControlExtract() : IsControl(false), Control(0), Length(0), Member("control") {}; MemControlExtract(std::string Member) : IsControl(false), Control(0), Length(0), Member(Member) {}; diff --git a/apt-inst/dirstream.h b/apt-inst/dirstream.h index 53ac24ba5..dac965db7 100644 --- a/apt-inst/dirstream.h +++ b/apt-inst/dirstream.h @@ -38,15 +38,10 @@ class pkgDirStream Directory, FIFO} Type; char *Name; char *LinkTarget; -#if APT_PKG_ABI >= 413 - unsigned long long Size; -#endif unsigned long Mode; unsigned long UID; unsigned long GID; -#if APT_PKG_ABI < 413 - unsigned long Size; -#endif + unsigned long long Size; unsigned long MTime; unsigned long Major; unsigned long Minor; @@ -55,13 +50,8 @@ class pkgDirStream virtual bool DoItem(Item &Itm,int &Fd); virtual bool Fail(Item &Itm,int Fd); virtual bool FinishedFile(Item &Itm,int Fd); -#if APT_PKG_ABI >= 413 virtual bool Process(Item &/*Itm*/,const unsigned char * /*Data*/, unsigned long long /*Size*/,unsigned long long /*Pos*/) {return true;}; -#else - virtual bool Process(Item &/*Itm*/,const unsigned char * /*Data*/, - unsigned long /*Size*/,unsigned long /*Pos*/) {return true;}; -#endif virtual ~pkgDirStream() {}; }; diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index db765febe..747b73e05 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -638,14 +638,6 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg) } /*}}}*/ // ProblemResolver::Resolve - calls a resolver to fix the situation /*{{{*/ -// --------------------------------------------------------------------- -/* */ -#if APT_PKG_ABI < 413 -bool pkgProblemResolver::Resolve(bool BrokenFix) -{ - return Resolve(BrokenFix, NULL); -} -#endif bool pkgProblemResolver::Resolve(bool BrokenFix, OpProgress * const Progress) { std::string const solver = _config->Find("APT::Solver", "internal"); @@ -1144,12 +1136,6 @@ bool pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator I) /* This is the work horse of the soft upgrade routine. It is very gental in that it does not install or remove any packages. It is assumed that the system was non-broken previously. */ -#if APT_PKG_ABI < 413 -bool pkgProblemResolver::ResolveByKeep() -{ - return ResolveByKeep(NULL); -} -#endif bool pkgProblemResolver::ResolveByKeep(OpProgress * const Progress) { std::string const solver = _config->Find("APT::Solver", "internal"); diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index 28057fa5c..aad261b63 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -138,20 +138,10 @@ class pkgProblemResolver /*{{{*/ inline void Clear(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] &= ~(Protected | ToRemove);}; // Try to intelligently resolve problems by installing and removing packages -#if APT_PKG_ABI >= 413 bool Resolve(bool BrokenFix = false, OpProgress * const Progress = NULL); -#else - bool Resolve(bool BrokenFix = false); - bool Resolve(bool BrokenFix, OpProgress * const Progress); -#endif // Try to resolve problems only by using keep -#if APT_PKG_ABI >= 413 bool ResolveByKeep(OpProgress * const Progress = NULL); -#else - bool ResolveByKeep(); - bool ResolveByKeep(OpProgress * const Progress); -#endif APT_DEPRECATED void InstallProtect(); diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 4173326ca..7e6adb92f 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -211,14 +211,12 @@ class pkgCache::VerIterator : public Iterator { // Accessors inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;} inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;} -#if APT_PKG_ABI >= 413 /** \brief source package name this version comes from Always contains the name, even if it is the same as the binary name */ inline const char *SourcePkgName() const {return Owner->StrP + S->SourcePkgName;} /** \brief source version this version comes from Always contains the version string, even if it is the same as the binary version */ inline const char *SourceVerStr() const {return Owner->StrP + S->SourceVerStr;} -#endif inline const char *Arch() const { if ((S->MultiArch & pkgCache::Version::All) == pkgCache::Version::All) return "all"; @@ -311,7 +309,7 @@ class pkgCache::DepIterator : public Iterator { { map_stringitem_t &Version; map_pointer_t &Package; - should_be_map_id_t &ID; + map_id_t &ID; unsigned char &Type; unsigned char &CompareOp; map_pointer_t &ParentVer; diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 2500ab631..203de158b 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -253,12 +253,6 @@ string Configuration::FindDir(const char *Name,const char *Default) const // Configuration::FindVector - Find a vector of values /*{{{*/ // --------------------------------------------------------------------- /* Returns a vector of config values under the given item */ -#if APT_PKG_ABI < 413 -vector Configuration::FindVector(const char *Name) const -{ - return FindVector(Name, ""); -} -#endif vector Configuration::FindVector(const char *Name, std::string const &Default, bool const Keys) const { vector Vec; diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 7c21bd8b3..e57a3524f 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -141,7 +141,6 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) map_stringitem_t const idx = StoreString(pkgCacheGenerator::SECTION, Start, Stop - Start); Ver->Section = idx; } -#if APT_PKG_ABI >= 413 // Parse the source package name pkgCache::GrpIterator const G = Ver.ParentPkg().Group(); Ver->SourcePkgName = G->Name; @@ -193,7 +192,6 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) } } } -#endif Ver->MultiArch = ParseMultiArch(true); // Archive Size @@ -962,7 +960,6 @@ unsigned char debListParser::GetPrio(string Str) return Out; } /*}}}*/ -#if APT_PKG_ABI >= 413 bool debListParser::SameVersion(unsigned short const Hash, /*{{{*/ pkgCache::VerIterator const &Ver) { @@ -982,8 +979,6 @@ bool debListParser::SameVersion(unsigned short const Hash, /*{{{*/ return true; } /*}}}*/ -#endif - debDebFileParser::debDebFileParser(FileFd *File, std::string const &DebFile) : debListParser(File, ""), DebFile(DebFile) diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 4bc3c2341..3884aafb9 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -71,9 +71,7 @@ class APT_HIDDEN debListParser : public pkgCacheGenerator::ListParser virtual std::vector AvailableDescriptionLanguages() APT_OVERRIDE; virtual MD5SumValue Description_md5() APT_OVERRIDE; virtual unsigned short VersionHash() APT_OVERRIDE; -#if APT_PKG_ABI >= 413 virtual bool SameVersion(unsigned short const Hash, pkgCache::VerIterator const &Ver) APT_OVERRIDE; -#endif virtual bool UsePackage(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver) APT_OVERRIDE; virtual map_filesize_t Offset() APT_OVERRIDE {return iOffset;}; diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 3594a6efe..c578cc338 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1846,16 +1846,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg) time_t now = time(NULL); fprintf(report, "Date: %s" , ctime(&now)); fprintf(report, "Package: %s %s\n", pkgname.c_str(), pkgver.c_str()); -#if APT_PKG_ABI >= 413 fprintf(report, "SourcePackage: %s\n", Ver.SourcePkgName()); -#else - pkgRecords Recs(Cache); - pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList()); - std::string srcpkgname = Parse.SourcePkg(); - if(srcpkgname.empty()) - srcpkgname = pkgname; - fprintf(report, "SourcePackage: %s\n", srcpkgname.c_str()); -#endif fprintf(report, "ErrorMessage:\n %s\n", errormsg); // ensure that the log is flushed diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 25d53747c..5c53581fe 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -51,14 +51,7 @@ static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::Pkg pkgCache::VerIterator const &Ver) { fprintf(output, "Package: %s\n", Pkg.Name()); -#if APT_PKG_ABI >= 413 fprintf(output, "Source: %s\n", Ver.SourcePkgName()); -#else - pkgRecords Recs(Cache); - pkgRecords::Parser &rec = Recs.Lookup(Ver.FileList()); - string srcpkg = rec.SourcePkg().empty() ? Pkg.Name() : rec.SourcePkg(); - fprintf(output, "Source: %s\n", srcpkg.c_str()); -#endif fprintf(output, "Architecture: %s\n", Ver.Arch()); fprintf(output, "Version: %s\n", Ver.VerStr()); if (Pkg.CurrentVer() == Ver) diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 016f4474c..78142ab13 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -1085,7 +1085,6 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall() // PM::DoInstallPostFork - compat /*{{{*/ // --------------------------------------------------------------------- /*}}}*/ -#if APT_PKG_ABI >= 413 pkgPackageManager::OrderResult pkgPackageManager::DoInstallPostFork(int statusFd) { @@ -1107,22 +1106,10 @@ pkgPackageManager::DoInstallPostFork(APT::Progress::PackageManager *progress) return Res; } -#else -pkgPackageManager::OrderResult -pkgPackageManager::DoInstallPostFork(int statusFd) -{ - bool goResult = Go(statusFd); - if(goResult == false) - return Failed; - - return Res; -} -#endif /*}}}*/ // PM::DoInstall - Does the installation /*{{{*/ // --------------------------------------------------------------------- /* compat */ -#if APT_PKG_ABI >= 413 pkgPackageManager::OrderResult pkgPackageManager::DoInstall(int statusFd) { @@ -1132,21 +1119,11 @@ pkgPackageManager::DoInstall(int statusFd) delete progress; return res; } -#else -pkgPackageManager::OrderResult pkgPackageManager::DoInstall(int statusFd) -{ - if(DoInstallPreFork() == Failed) - return Failed; - - return DoInstallPostFork(statusFd); -} -#endif /*}}}*/ // PM::DoInstall - Does the installation /*{{{*/ // --------------------------------------------------------------------- /* This uses the filenames in FileNames and the information in the DepCache to perform the installation of packages.*/ -#if APT_PKG_ABI >= 413 pkgPackageManager::OrderResult pkgPackageManager::DoInstall(APT::Progress::PackageManager *progress) { @@ -1155,5 +1132,4 @@ pkgPackageManager::DoInstall(APT::Progress::PackageManager *progress) return DoInstallPostFork(progress); } -#endif /*}}}*/ diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index febab26dd..8de6ab3ad 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -95,9 +95,7 @@ class pkgPackageManager : protected pkgCache::Namespace virtual bool Install(PkgIterator /*Pkg*/,std::string /*File*/) {return false;}; virtual bool Configure(PkgIterator /*Pkg*/) {return false;}; virtual bool Remove(PkgIterator /*Pkg*/,bool /*Purge*/=false) {return false;}; -#if APT_PKG_ABI >= 413 virtual bool Go(APT::Progress::PackageManager * /*progress*/) {return true;}; -#endif virtual bool Go(int /*statusFd*/=-1) {return true;}; virtual void Reset() {}; @@ -112,13 +110,9 @@ class pkgPackageManager : protected pkgCache::Namespace pkgRecords *Recs); // Do the installation -#if APT_PKG_ABI >= 413 OrderResult DoInstall(APT::Progress::PackageManager *progress); // compat APT_DEPRECATED OrderResult DoInstall(int statusFd=-1); -#else - OrderResult DoInstall(int statusFd=-1); -#endif // stuff that needs to be done before the fork() of a library that // uses apt @@ -126,14 +120,10 @@ class pkgPackageManager : protected pkgCache::Namespace Res = OrderInstall(); return Res; }; -#if APT_PKG_ABI >= 413 // stuff that needs to be done after the fork OrderResult DoInstallPostFork(APT::Progress::PackageManager *progress); // compat APT_DEPRECATED OrderResult DoInstallPostFork(int statusFd=-1); -#else - OrderResult DoInstallPostFork(int statusFd=-1); -#endif // ? bool FixMissing(); diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 8cd716c6e..2348cca2d 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -87,9 +87,6 @@ pkgCache::Header::Header() FileList = 0; RlsFileList = 0; -#if APT_PKG_ABI < 413 - APT_IGNORE_DEPRECATED(StringList = 0;) -#endif VerSysName = 0; Architecture = 0; SetArchitectures(0); diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index b3a2e3184..3fa815c15 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -85,45 +85,18 @@ using std::string; #endif -#if APT_PKG_ABI >= 413 +// size of (potentially big) files like debs or the install size of them +typedef uint64_t map_filesize_t; // storing file sizes of indexes, which are way below 4 GB for now -typedef uint32_t map_filesize_t; -typedef map_filesize_t should_be_map_filesize_t; -#else -typedef unsigned long map_filesize_t; -typedef unsigned int should_be_map_filesize_t; -#endif -#if APT_PKG_ABI >= 413 +typedef uint32_t map_filesize_small_t; // each package/group/dependency gets an id typedef uint32_t map_id_t; -typedef map_id_t should_be_map_id_t; -#else -typedef unsigned long map_id_t; -typedef unsigned int should_be_map_id_t; -#endif -#if APT_PKG_ABI >= 413 // some files get an id, too, but in far less absolute numbers typedef uint16_t map_fileid_t; -typedef map_fileid_t should_be_map_fileid_t; -#else -typedef unsigned long map_fileid_t; -typedef unsigned int should_be_map_fileid_t; -#endif -#if APT_PKG_ABI >= 413 // relative pointer from cache start typedef uint32_t map_pointer_t; -#else -typedef unsigned int map_pointer_t; -#endif // same as the previous, but documented to be to a string item typedef map_pointer_t map_stringitem_t; -#if APT_PKG_ABI >= 413 -typedef uint64_t should_be_uint64_t; -typedef uint64_t should_be_uint64_small_t; -#else -typedef unsigned long long should_be_uint64_t; -typedef unsigned long should_be_uint64_small_t; -#endif class pkgVersioningSystem; class pkgCache /*{{{*/ @@ -342,17 +315,12 @@ struct pkgCache::Header /** \brief index of the first ReleaseFile structure */ map_pointer_t RlsFileList; -#if APT_PKG_ABI < 413 - APT_DEPRECATED map_pointer_t StringList; -#endif /** \brief String representing the version system used */ map_pointer_t VerSysName; /** \brief native architecture the cache was built against */ map_pointer_t Architecture; -#if APT_PKG_ABI >= 413 /** \brief all architectures the cache was built against */ map_pointer_t Architectures; -#endif /** \brief The maximum size of a raw entry from the original Package file */ map_filesize_t MaxVerFileSize; /** \brief The maximum size of a raw entry from the original Translation file */ @@ -378,26 +346,16 @@ struct pkgCache::Header In the PkgHashTable is it possible that multiple packages have the same name - these packages are stored as a sequence in the list. The size of both tables is the same. */ -#if APT_PKG_ABI >= 413 unsigned int HashTableSize; unsigned int GetHashTableSize() const { return HashTableSize; } void SetHashTableSize(unsigned int const sz) { HashTableSize = sz; } map_pointer_t GetArchitectures() const { return Architectures; } void SetArchitectures(map_pointer_t const idx) { Architectures = idx; } -#else - // BEWARE: these tables are pretty much empty and just here for abi compat - map_ptrloc PkgHashTable[2*1048]; - map_ptrloc GrpHashTable[2*1048]; - unsigned int GetHashTableSize() const { return PkgHashTable[0]; } - void SetHashTableSize(unsigned int const sz) { PkgHashTable[0] = sz; } - map_pointer_t GetArchitectures() const { return PkgHashTable[1]; } - void SetArchitectures(map_pointer_t const idx) { PkgHashTable[1] = idx; } -#endif map_pointer_t * PkgHashTableP() const { return (map_pointer_t*) (this + 1); } map_pointer_t * GrpHashTableP() const { return PkgHashTableP() + GetHashTableSize(); } /** \brief Size of the complete cache file */ - should_be_uint64_small_t CacheFileSize; + map_filesize_small_t CacheFileSize; bool CheckSizes(Header &Against) const APT_PURE; Header(); @@ -423,7 +381,7 @@ struct pkgCache::Group /** \brief Link to the next Group */ map_pointer_t Next; // Group /** \brief unique sequel ID */ - should_be_map_id_t ID; + map_id_t ID; }; /*}}}*/ @@ -495,7 +453,7 @@ struct pkgCache::Package This allows clients to create an array of size PackageCount and use it to store state information for the package map. For instance the status file emitter uses this to track which packages have been emitted already. */ - should_be_map_id_t ID; + map_id_t ID; /** \brief some useful indicators of the package's state */ unsigned long Flags; }; @@ -537,7 +495,7 @@ struct pkgCache::ReleaseFile /** \brief Link to the next ReleaseFile in the Cache */ map_pointer_t NextFile; /** \brief unique sequel ID */ - should_be_map_fileid_t ID; + map_fileid_t ID; }; /*}}}*/ // Package File structure /*{{{*/ @@ -576,7 +534,7 @@ struct pkgCache::PackageFile /** \brief Link to the next PackageFile in the Cache */ map_pointer_t NextFile; // PackageFile /** \brief unique sequel ID */ - should_be_map_fileid_t ID; + map_fileid_t ID; }; /*}}}*/ // VerFile structure /*{{{*/ @@ -591,7 +549,7 @@ struct pkgCache::VerFile /** \brief next step in the linked list */ map_pointer_t NextFile; // PkgVerFile /** \brief position in the package file */ - should_be_map_filesize_t Offset; // File offset + map_filesize_t Offset; // File offset /** @TODO document pkgCache::VerFile::Size */ map_filesize_t Size; }; @@ -605,7 +563,7 @@ struct pkgCache::DescFile /** \brief next step in the linked list */ map_pointer_t NextFile; // PkgVerFile /** \brief position in the file */ - should_be_map_filesize_t Offset; // File offset + map_filesize_t Offset; // File offset /** @TODO document pkgCache::DescFile::Size */ map_filesize_t Size; }; @@ -622,14 +580,12 @@ struct pkgCache::Version map_stringitem_t VerStr; /** \brief section this version is filled in */ map_stringitem_t Section; -#if APT_PKG_ABI >= 413 /** \brief source package name this version comes from Always contains the name, even if it is the same as the binary name */ map_stringitem_t SourcePkgName; /** \brief source version this version comes from Always contains the version string, even if it is the same as the binary version */ map_stringitem_t SourceVerStr; -#endif /** \brief Multi-Arch capabilities of a package version */ enum VerMultiArch { None = 0, /*!< is the default and doesn't trigger special behaviour */ @@ -668,16 +624,16 @@ struct pkgCache::Version /** \brief archive size for this version For Debian this is the size of the .deb file. */ - should_be_uint64_t Size; // These are the .deb size + map_filesize_t Size; // These are the .deb size /** \brief uncompressed size for this version */ - should_be_uint64_t InstalledSize; + map_filesize_t InstalledSize; /** \brief characteristic value representing this version No two packages in existence should have the same VerStr and Hash with different contents. */ unsigned short Hash; /** \brief unique sequel ID */ - should_be_map_id_t ID; + map_id_t ID; /** \brief parsed priority value */ unsigned char Priority; }; @@ -705,7 +661,7 @@ struct pkgCache::Description map_pointer_t ParentPkg; // Package /** \brief unique sequel ID */ - should_be_map_id_t ID; + map_id_t ID; }; /*}}}*/ // Dependency structure /*{{{*/ @@ -745,7 +701,7 @@ struct pkgCache::Dependency map_pointer_t NextDepends; // Dependency /** \brief unique sequel ID */ - should_be_map_id_t ID; + map_id_t ID; }; /*}}}*/ // Provides structure /*{{{*/ diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h index 9e10409e4..0ed731f1f 100644 --- a/apt-pkg/pkgrecords.h +++ b/apt-pkg/pkgrecords.h @@ -68,17 +68,10 @@ class pkgRecords::Parser /*{{{*/ * choose the hash to be used. */ virtual HashStringList Hashes() const { return HashStringList(); }; -#if APT_PKG_ABI >= 413 APT_DEPRECATED std::string MD5Hash() const { return GetHashFromHashes("MD5Sum"); }; APT_DEPRECATED std::string SHA1Hash() const { return GetHashFromHashes("SHA1"); }; APT_DEPRECATED std::string SHA256Hash() const { return GetHashFromHashes("SHA256"); }; APT_DEPRECATED std::string SHA512Hash() const { return GetHashFromHashes("SHA512"); }; -#else - APT_DEPRECATED std::string MD5Hash() { return GetHashFromHashes("MD5Sum"); }; - APT_DEPRECATED std::string SHA1Hash() { return GetHashFromHashes("SHA1"); }; - APT_DEPRECATED std::string SHA256Hash() { return GetHashFromHashes("SHA256"); }; - APT_DEPRECATED std::string SHA512Hash() { return GetHashFromHashes("SHA512"); }; -#endif // These are some general stats about the package virtual std::string Maintainer() {return std::string();}; diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index cc63b213f..213a413cb 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -305,21 +305,11 @@ APT_IGNORE_DEPRECATED_PUSH pkgTagSection::pkgTagSection() : Section(0), d(new pkgTagSectionPrivate()), Stop(0) { -#if APT_PKG_ABI < 413 - TagCount = 0; - memset(&Indexes, 0, sizeof(Indexes)); -#endif memset(&AlphaIndexes, 0, sizeof(AlphaIndexes)); } APT_IGNORE_DEPRECATED_POP /*}}}*/ // TagSection::Scan - Scan for the end of the header information /*{{{*/ -#if APT_PKG_ABI < 413 -bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength) -{ - return Scan(Start, MaxLength, true); -} -#endif bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const Restart) { Section = Start; @@ -345,11 +335,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R } d->Tags.reserve(0x100); } -#if APT_PKG_ABI >= 413 unsigned int TagCount = d->Tags.size(); -#else - APT_IGNORE_DEPRECATED(TagCount = d->Tags.size();) -#endif if (Stop == 0) return false; @@ -376,10 +362,6 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R lastTagData.NextInBucket = AlphaIndexes[lastTagHash]; APT_IGNORE_DEPRECATED_PUSH AlphaIndexes[lastTagHash] = TagCount; -#if APT_PKG_ABI < 413 - if (d->Tags.size() < sizeof(Indexes)/sizeof(Indexes[0])) - Indexes[d->Tags.size()] = lastTagData.StartTag; -#endif APT_IGNORE_DEPRECATED_POP d->Tags.push_back(lastTagData); } @@ -423,16 +405,10 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R if (AlphaIndexes[lastTagHash] != 0) lastTagData.NextInBucket = AlphaIndexes[lastTagHash]; APT_IGNORE_DEPRECATED(AlphaIndexes[lastTagHash] = TagCount;) -#if APT_PKG_ABI < 413 - APT_IGNORE_DEPRECATED(Indexes[d->Tags.size()] = lastTagData.StartTag;) -#endif d->Tags.push_back(lastTagData); } pkgTagSectionPrivate::TagData const td(Stop - Section); -#if APT_PKG_ABI < 413 - APT_IGNORE_DEPRECATED(Indexes[d->Tags.size()] = td.StartTag;) -#endif d->Tags.push_back(td); TrimRecord(false,End); return true; @@ -463,11 +439,7 @@ void pkgTagSection::Trim() } /*}}}*/ // TagSection::Exists - return True if a tag exists /*{{{*/ -#if APT_PKG_ABI >= 413 bool pkgTagSection::Exists(const char* const Tag) const -#else -bool pkgTagSection::Exists(const char* const Tag) -#endif { unsigned int tmp; return Find(Tag, tmp); diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 77a84c832..847a799f4 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -37,14 +37,7 @@ class pkgTagSectionPrivate; class pkgTagSection { const char *Section; - // We have a limit of 256 tags per section with the old abi -#if APT_PKG_ABI < 413 - APT_DEPRECATED unsigned int Indexes[256]; -#endif unsigned int AlphaIndexes[0x100]; -#if APT_PKG_ABI < 413 - APT_DEPRECATED unsigned int TagCount; -#endif pkgTagSectionPrivate * const d; @@ -84,12 +77,7 @@ class pkgTagSection * @return \b true if section end was found, \b false otherwise. * Beware that internal state will be inconsistent if \b false is returned! */ -#if APT_PKG_ABI >= 413 APT_MUSTCHECK bool Scan(const char *Start, unsigned long MaxLength, bool const Restart = true); -#else - APT_MUSTCHECK bool Scan(const char *Start, unsigned long MaxLength, bool const Restart); - APT_MUSTCHECK bool Scan(const char *Start, unsigned long MaxLength); -#endif inline unsigned long size() const {return Stop - Section;}; void Trim(); @@ -101,11 +89,7 @@ class pkgTagSection * times, but only the last occurrence is available via Find methods. */ unsigned int Count() const; -#if APT_PKG_ABI >= 413 bool Exists(const char* const Tag) const; -#else - bool Exists(const char* const Tag); -#endif void Get(const char *&Start,const char *&Stop,unsigned int I) const; diff --git a/apt-pkg/upgrade.cc b/apt-pkg/upgrade.cc index 6c8721da8..e7f2aae40 100644 --- a/apt-pkg/upgrade.cc +++ b/apt-pkg/upgrade.cc @@ -288,12 +288,6 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache) } /*}}}*/ // APT::Upgrade::Upgrade - Upgrade using a specific strategy /*{{{*/ -#if APT_PKG_ABI < 413 -bool APT::Upgrade::Upgrade(pkgDepCache &Cache, int mode) -{ - return Upgrade(Cache, mode, NULL); -} -#endif bool APT::Upgrade::Upgrade(pkgDepCache &Cache, int mode, OpProgress * const Progress) { APT_IGNORE_DEPRECATED_PUSH diff --git a/apt-pkg/upgrade.h b/apt-pkg/upgrade.h index 18b6aac7b..6cad64fd9 100644 --- a/apt-pkg/upgrade.h +++ b/apt-pkg/upgrade.h @@ -24,12 +24,7 @@ namespace APT { FORBID_INSTALL_NEW_PACKAGES = 2, ALLOW_EVERYTHING = 0 }; -#if APT_PKG_ABI >= 413 bool Upgrade(pkgDepCache &Cache, int UpgradeMode, OpProgress * const Progress = NULL); -#else - bool Upgrade(pkgDepCache &Cache, int UpgradeMode); - bool Upgrade(pkgDepCache &Cache, int UpgradeMode, OpProgress * const Progress); -#endif } } diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 0b5e33ae5..116e01038 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -94,14 +94,9 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) { pkgSimulate PM(Cache); -#if APT_PKG_ABI >= 413 APT::Progress::PackageManager *progress = APT::Progress::PackageManagerProgressFactory(); pkgPackageManager::OrderResult Res = PM.DoInstall(progress); delete progress; -#else - int status_fd = _config->FindI("APT::Status-Fd",-1); - pkgPackageManager::OrderResult Res = PM.DoInstall(status_fd); -#endif if (Res == pkgPackageManager::Failed) return false; @@ -307,14 +302,9 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) _system->UnLock(); -#if APT_PKG_ABI >= 413 APT::Progress::PackageManager *progress = APT::Progress::PackageManagerProgressFactory(); pkgPackageManager::OrderResult Res = PM->DoInstall(progress); delete progress; -#else - int status_fd = _config->FindI("APT::Status-Fd", -1); - pkgPackageManager::OrderResult Res = PM->DoInstall(status_fd); -#endif if (Res == pkgPackageManager::Failed || _error->PendingError() == true) return false; diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index cfa789fd9..2fc721f69 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -392,10 +392,8 @@ static bool Stats(CommandLine &) stritems.insert(V->VerStr); if (V->Section != 0) stritems.insert(V->Section); -#if APT_PKG_ABI >= 413 stritems.insert(V->SourcePkgName); stritems.insert(V->SourceVerStr); -#endif for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; ++D) { if (D->Version != 0) @@ -430,10 +428,10 @@ static bool Stats(CommandLine &) stritems.insert(F->Component); stritems.insert(F->IndexType); } + unsigned long Size = 0; for (std::set::const_iterator i = stritems.begin(); i != stritems.end(); ++i) Size += strlen(Cache->StrP + *i) + 1; - cout << _("Total globbed strings: ") << stritems.size() << " (" << SizeToStr(Size) << ')' << endl; stritems.clear(); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ca9650998..d515a0f4f 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -162,11 +162,7 @@ static pkgCache::RlsFileIterator GetReleaseFileForSourceRecord(CacheFile &CacheF // FindSrc - Find a source record /*{{{*/ // --------------------------------------------------------------------- /* */ -#if APT_PKG_ABI >= 413 static pkgSrcRecords::Parser *FindSrc(const char *Name, -#else -static pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, -#endif pkgSrcRecords &SrcRecs,string &Src, CacheFile &CacheFile) { @@ -276,19 +272,8 @@ static pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, { // the Version we have is possibly fuzzy or includes binUploads, // so we use the Version of the SourcePkg (empty if same as package) -#if APT_PKG_ABI >= 413 Src = Ver.SourcePkgName(); VerTag = Ver.SourceVerStr(); -#else - pkgRecords::Parser &Parse = Recs.Lookup(VF); - Src = Parse.SourcePkg(); - // no SourcePkg name, so it is the "binary" name - if (Src.empty() == true) - Src = TmpSrc; - VerTag = Parse.SourceVer(); - if (VerTag.empty() == true) - VerTag = Ver.VerStr(); -#endif break; } } @@ -319,17 +304,10 @@ static pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, pkgCache::VerIterator Ver = Cache->GetCandidateVer(Pkg); if (Ver.end() == false) { -#if APT_PKG_ABI >= 413 if (strcmp(Ver.SourcePkgName(),Ver.ParentPkg().Name()) != 0) Src = Ver.SourcePkgName(); if (VerTag.empty() == true && strcmp(Ver.SourceVerStr(),Ver.VerStr()) != 0) VerTag = Ver.SourceVerStr(); -#else - pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList()); - Src = Parse.SourcePkg(); - if (VerTag.empty() == true) - VerTag = Parse.SourceVer(); -#endif } } } @@ -716,9 +694,6 @@ static bool DoSource(CommandLine &CmdL) pkgSourceList *List = Cache.GetSourceList(); // Create the text record parsers -#if APT_PKG_ABI < 413 - pkgRecords Recs(Cache); -#endif pkgSrcRecords SrcRecs(*List); if (_error->PendingError() == true) return false; @@ -746,11 +721,7 @@ static bool DoSource(CommandLine &CmdL) for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++) { string Src; -#if APT_PKG_ABI >= 413 pkgSrcRecords::Parser *Last = FindSrc(*I,SrcRecs,Src,Cache); -#else - pkgSrcRecords::Parser *Last = FindSrc(*I,Recs,SrcRecs,Src,Cache); -#endif if (Last == 0) { return _error->Error(_("Unable to find a source package for %s"),Src.c_str()); } @@ -1056,11 +1027,7 @@ static bool DoBuildDep(CommandLine &CmdL) LastOwner = Last = Type->CreateSrcPkgParser(*I); } else { // normal case, search the cache for the source file -#if APT_PKG_ABI >= 413 Last = FindSrc(*I,SrcRecs,Src,Cache); -#else - Last = FindSrc(*I,Recs,SrcRecs,Src,Cache); -#endif } if (Last == 0) -- cgit v1.2.3 From dfe66c72ffc010e019e96b35154e1ad4ab506a6e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 15 Jul 2015 14:36:16 +0200 Subject: use a smaller type for flags storage in the cache We store very few flags in the cache, so keeping storage space for 8 is enough for all of them and still leaves a few unused bits remaining for future extensions without wasting bytes for nothing. Git-Dch: Ignore --- apt-pkg/pkgcache.cc | 42 ++++++++++++++++++++------------------- apt-pkg/pkgcache.h | 57 ++++++++++++++++++++++++++++------------------------- apt-pkg/tagfile.cc | 28 ++++++++++++++++++++++++++ apt-pkg/tagfile.h | 4 ++++ 4 files changed, 84 insertions(+), 47 deletions(-) diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 2348cca2d..5034ee38a 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -50,27 +50,29 @@ using std::string; /* Simply initialize the header */ pkgCache::Header::Header() { - Signature = 0x98FE76DC; - +#define APT_HEADER_SET(X,Y) X = Y; static_assert(std::numeric_limits::max() > Y, "Size violation detected in pkgCache::Header") + APT_HEADER_SET(Signature, 0x98FE76DC); + /* Whenever the structures change the major version should be bumped, whenever the generator changes the minor version should be bumped. */ - MajorVersion = 10; - MinorVersion = 0; - Dirty = false; - - HeaderSz = sizeof(pkgCache::Header); - GroupSz = sizeof(pkgCache::Group); - PackageSz = sizeof(pkgCache::Package); - ReleaseFileSz = sizeof(pkgCache::ReleaseFile); - PackageFileSz = sizeof(pkgCache::PackageFile); - VersionSz = sizeof(pkgCache::Version); - DescriptionSz = sizeof(pkgCache::Description); - DependencySz = sizeof(pkgCache::Dependency); - DependencyDataSz = sizeof(pkgCache::DependencyData); - ProvidesSz = sizeof(pkgCache::Provides); - VerFileSz = sizeof(pkgCache::VerFile); - DescFileSz = sizeof(pkgCache::DescFile); - + APT_HEADER_SET(MajorVersion, 10); + APT_HEADER_SET(MinorVersion, 0); + APT_HEADER_SET(Dirty, false); + + APT_HEADER_SET(HeaderSz, sizeof(pkgCache::Header)); + APT_HEADER_SET(GroupSz, sizeof(pkgCache::Group)); + APT_HEADER_SET(PackageSz, sizeof(pkgCache::Package)); + APT_HEADER_SET(ReleaseFileSz, sizeof(pkgCache::ReleaseFile)); + APT_HEADER_SET(PackageFileSz, sizeof(pkgCache::PackageFile)); + APT_HEADER_SET(VersionSz, sizeof(pkgCache::Version)); + APT_HEADER_SET(DescriptionSz, sizeof(pkgCache::Description)); + APT_HEADER_SET(DependencySz, sizeof(pkgCache::Dependency)); + APT_HEADER_SET(DependencyDataSz, sizeof(pkgCache::DependencyData)); + APT_HEADER_SET(ProvidesSz, sizeof(pkgCache::Provides)); + APT_HEADER_SET(VerFileSz, sizeof(pkgCache::VerFile)); + APT_HEADER_SET(DescFileSz, sizeof(pkgCache::DescFile)); +#undef APT_HEADER_SET + GroupCount = 0; PackageCount = 0; VersionCount = 0; @@ -84,7 +86,7 @@ pkgCache::Header::Header() ProvidesCount = 0; MaxVerFileSize = 0; MaxDescFileSize = 0; - + FileList = 0; RlsFileList = 0; VerSysName = 0; diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 3fa815c15..fba692982 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -97,6 +97,9 @@ typedef uint16_t map_fileid_t; typedef uint32_t map_pointer_t; // same as the previous, but documented to be to a string item typedef map_pointer_t map_stringitem_t; +// we have only a small amount of flags for each item +typedef uint8_t map_flags_t; +typedef uint8_t map_number_t; class pkgVersioningSystem; class pkgCache /*{{{*/ @@ -259,10 +262,10 @@ struct pkgCache::Header This must contain the hex value 0x98FE76DC which is designed to verify that the system loading the image has the same byte order and byte size as the system saving the image */ - unsigned long Signature; + uint32_t Signature; /** These contain the version of the cache file */ - short MajorVersion; - short MinorVersion; + map_number_t MajorVersion; + map_number_t MinorVersion; /** \brief indicates if the cache should be erased Dirty is true if the cache file was opened for reading, the client @@ -277,18 +280,18 @@ struct pkgCache::Header If any of the size values do not exactly match what the client expects then the client should refuse the load the file. */ - unsigned short HeaderSz; - unsigned short GroupSz; - unsigned short PackageSz; - unsigned short ReleaseFileSz; - unsigned short PackageFileSz; - unsigned short VersionSz; - unsigned short DescriptionSz; - unsigned short DependencySz; - unsigned short DependencyDataSz; - unsigned short ProvidesSz; - unsigned short VerFileSz; - unsigned short DescFileSz; + uint16_t HeaderSz; + map_number_t GroupSz; + map_number_t PackageSz; + map_number_t ReleaseFileSz; + map_number_t PackageFileSz; + map_number_t VersionSz; + map_number_t DescriptionSz; + map_number_t DependencySz; + map_number_t DependencyDataSz; + map_number_t ProvidesSz; + map_number_t VerFileSz; + map_number_t DescFileSz; /** \brief Structure counts @@ -346,8 +349,8 @@ struct pkgCache::Header In the PkgHashTable is it possible that multiple packages have the same name - these packages are stored as a sequence in the list. The size of both tables is the same. */ - unsigned int HashTableSize; - unsigned int GetHashTableSize() const { return HashTableSize; } + uint32_t HashTableSize; + uint32_t GetHashTableSize() const { return HashTableSize; } void SetHashTableSize(unsigned int const sz) { HashTableSize = sz; } map_pointer_t GetArchitectures() const { return Architectures; } void SetArchitectures(map_pointer_t const idx) { Architectures = idx; } @@ -437,15 +440,15 @@ struct pkgCache::Package // Install/Remove/Purge etc /** \brief state that the user wishes the package to be in */ - unsigned char SelectedState; // What + map_number_t SelectedState; // What /** \brief installation state of the package This should be "ok" but in case the installation failed it will be different. */ - unsigned char InstState; // Flags + map_number_t InstState; // Flags /** \brief indicates if the package is installed */ - unsigned char CurrentState; // State + map_number_t CurrentState; // State /** \brief unique sequel ID @@ -455,7 +458,7 @@ struct pkgCache::Package this to track which packages have been emitted already. */ map_id_t ID; /** \brief some useful indicators of the package's state */ - unsigned long Flags; + map_flags_t Flags; }; /*}}}*/ // Release File structure /*{{{*/ @@ -489,7 +492,7 @@ struct pkgCache::ReleaseFile time_t mtime; /** @TODO document PackageFile::Flags */ - unsigned long Flags; + map_flags_t Flags; // Linked list /** \brief Link to the next ReleaseFile in the Cache */ @@ -528,7 +531,7 @@ struct pkgCache::PackageFile time_t mtime; /** @TODO document PackageFile::Flags */ - unsigned long Flags; + map_flags_t Flags; // Linked list /** \brief Link to the next PackageFile in the Cache */ @@ -599,7 +602,7 @@ struct pkgCache::Version Flags used are defined in pkgCache::Version::VerMultiArch */ - unsigned char MultiArch; + map_number_t MultiArch; /** \brief references all the PackageFile's that this version came from @@ -635,7 +638,7 @@ struct pkgCache::Version /** \brief unique sequel ID */ map_id_t ID; /** \brief parsed priority value */ - unsigned char Priority; + map_number_t Priority; }; /*}}}*/ // Description structure /*{{{*/ @@ -682,11 +685,11 @@ struct pkgCache::DependencyData map_pointer_t Package; // Package /** \brief Dependency type - Depends, Recommends, Conflicts, etc */ - unsigned char Type; + map_number_t Type; /** \brief comparison operator specified on the depends line If the high bit is set then it is a logical OR with the previous record. */ - unsigned char CompareOp; + map_flags_t CompareOp; map_pointer_t NextData; }; diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 213a413cb..253b1b7a3 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -579,6 +579,34 @@ bool pkgTagSection::FindB(const char *Tag, bool const &Default) const // TagSection::FindFlag - Locate a yes/no type flag /*{{{*/ // --------------------------------------------------------------------- /* The bits marked in Flag are masked on/off in Flags */ +bool pkgTagSection::FindFlag(const char * const Tag, uint8_t &Flags, + uint8_t const Flag) const +{ + const char *Start; + const char *Stop; + if (Find(Tag,Start,Stop) == false) + return true; + return FindFlag(Flags, Flag, Start, Stop); +} +bool pkgTagSection::FindFlag(uint8_t &Flags, uint8_t const Flag, + char const* const Start, char const* const Stop) +{ + switch (StringToBool(string(Start, Stop))) + { + case 0: + Flags &= ~Flag; + return true; + + case 1: + Flags |= Flag; + return true; + + default: + _error->Warning("Unknown flag value: %s",string(Start,Stop).c_str()); + return true; + } + return true; +} bool pkgTagSection::FindFlag(const char *Tag,unsigned long &Flags, unsigned long Flag) const { diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 847a799f4..19c07595e 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -56,6 +56,10 @@ class pkgTagSection signed int FindI(const char *Tag,signed long Default = 0) const; bool FindB(const char *Tag, bool const &Default = false) const; unsigned long long FindULL(const char *Tag, unsigned long long const &Default = 0) const; + bool FindFlag(const char * const Tag,uint8_t &Flags, + uint8_t const Flag) const; + bool static FindFlag(uint8_t &Flags, uint8_t const Flag, + const char* const Start, const char* const Stop); bool FindFlag(const char *Tag,unsigned long &Flags, unsigned long Flag) const; bool static FindFlag(unsigned long &Flags, unsigned long Flag, -- cgit v1.2.3 From 8c7af4d4c95d0423fbd0f3baa979792504f4f45f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jul 2015 11:15:25 +0200 Subject: hide implicit deps in apt-cache again by default Before MultiArch implicits weren't a thing, so they were hidden by default by definition. Adding them for MultiArch solved many problems, but having no reliable way of detecting which dependency (and provides) is implicit or not causes problems everytime we want to output dependencies without confusing our observers with unneeded implementation details. The really notworthy point here is actually that we keep now a better record of how a dependency came to be so that we can later reason about it more easily, but that is hidden so deep down in the library internals that change is more the problems it solves than the change itself. --- apt-pkg/cacheiterators.h | 18 ++++- apt-pkg/deb/deblistparser.cc | 8 +-- apt-pkg/edsp.cc | 8 +-- apt-pkg/pkgcache.cc | 61 +++++------------ apt-pkg/pkgcache.h | 16 +++-- apt-pkg/pkgcachegen.cc | 32 ++++----- apt-pkg/pkgcachegen.h | 15 +++-- apt-private/private-cmndline.cc | 1 + cmdline/apt-cache.cc | 11 ++- doc/apt-cache.8.xml | 15 ++++- test/integration/test-apt-cache | 78 ++++++++++++++++++++-- .../test-ordering-ignore-not-matching-breaks | 56 ---------------- 12 files changed, 169 insertions(+), 150 deletions(-) delete mode 100755 test/integration/test-ordering-ignore-not-matching-breaks diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 7e6adb92f..1063d6f9e 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -295,7 +295,16 @@ class pkgCache::DepIterator : public Iterator { bool IsNegative() const APT_PURE; bool IsIgnorable(PrvIterator const &Prv) const APT_PURE; bool IsIgnorable(PkgIterator const &Pkg) const APT_PURE; - bool IsMultiArchImplicit() const APT_PURE; + /* MultiArch can be translated to SingleArch for an resolver and we did so, + by adding dependencies to help the resolver understand the problem, but + sometimes it is needed to identify these to ignore them… */ + inline bool IsMultiArchImplicit() const APT_PURE { + return (S2->CompareOp & pkgCache::Dep::MultiArchImplicit) == pkgCache::Dep::MultiArchImplicit; + } + /* This covers additionally negative dependencies, which aren't arch-specific, + but change architecture nontheless as a Conflicts: foo does applies for all archs */ + bool IsImplicit() const APT_PURE; + bool IsSatisfied(VerIterator const &Ver) const APT_PURE; bool IsSatisfied(PrvIterator const &Prv) const APT_PURE; void GlobOr(DepIterator &Start,DepIterator &End); @@ -367,7 +376,12 @@ class pkgCache::PrvIterator : public Iterator { inline VerIterator OwnerVer() const {return VerIterator(*Owner,Owner->VerP + S->Version);} inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->Version].ParentPkg);} - bool IsMultiArchImplicit() const APT_PURE; + /* MultiArch can be translated to SingleArch for an resolver and we did so, + by adding provides to help the resolver understand the problem, but + sometimes it is needed to identify these to ignore them… */ + bool IsMultiArchImplicit() const APT_PURE + { return (S->Flags & pkgCache::Flag::MultiArchImplicit) == pkgCache::Flag::MultiArchImplicit; } + inline PrvIterator() : Iterator(), Type(PrvVer) {} inline PrvIterator(pkgCache &Owner, Provides *Trg, Version*) : diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index e57a3524f..df0879641 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -812,7 +812,7 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, // … but this is probably the best thing to do. if (Arch == "native") Arch = _config->Find("APT::Architecture"); - if (NewDepends(Ver,Package,Arch,Version,Op,Type) == false) + if (NewDepends(Ver,Package,Arch,Version,Op | pkgCache::Dep::ArchSpecific,Type) == false) return false; } else @@ -858,13 +858,13 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) } else if (archfound != string::npos) { string OtherArch = Package.substr(archfound+1, string::npos); Package = Package.substr(0, archfound); - if (NewProvides(Ver, Package, OtherArch, Version) == false) + if (NewProvides(Ver, Package, OtherArch, Version, pkgCache::Flag::ArchSpecific) == false) return false; } else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) { if (NewProvidesAllArch(Ver, Package, Version) == false) return false; } else { - if (NewProvides(Ver, Package, Arch, Version) == false) + if (NewProvides(Ver, Package, Arch, Version, 0) == false) return false; } @@ -890,7 +890,7 @@ bool debListParser::NewProvidesAllArch(pkgCache::VerIterator &Ver, string const for (std::vector::const_iterator a = Architectures.begin(); a != Architectures.end(); ++a) { - if (NewProvides(Ver, Package, *a, Version) == false) + if (NewProvides(Ver, Package, *a, Version, pkgCache::Flag::MultiArchImplicit) == false) return false; } return true; diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 5c53581fe..34b0b0cc7 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -102,11 +102,11 @@ static void WriteScenarioDependency( FILE* output, pkgCache::VerIterator const & bool orGroup = false; for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep) { - if (Dep.IsMultiArchImplicit() == true) + if (Dep.IsImplicit() == true) continue; if (orGroup == false) dependencies[Dep->Type].append(", "); - dependencies[Dep->Type].append(Dep.TargetPkg().Name()); + dependencies[Dep->Type].append(Dep.TargetPkg().FullName((Dep->CompareOp & pkgCache::Dep::ArchSpecific) != pkgCache::Dep::ArchSpecific)); if (Dep->Version != 0) dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")"); if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or) @@ -140,7 +140,7 @@ static void WriteScenarioLimitedDependency(FILE* output, bool orGroup = false; for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep) { - if (Dep.IsMultiArchImplicit() == true) + if (Dep.IsImplicit() == true) continue; if (orGroup == false) { @@ -156,7 +156,7 @@ static void WriteScenarioLimitedDependency(FILE* output, orGroup = false; continue; } - dependencies[Dep->Type].append(Dep.TargetPkg().Name()); + dependencies[Dep->Type].append(Dep.TargetPkg().FullName((Dep->CompareOp & pkgCache::Dep::ArchSpecific) != pkgCache::Dep::ArchSpecific)); if (Dep->Version != 0) dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")"); if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or) diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 5034ee38a..e8c95738e 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -727,21 +727,7 @@ bool pkgCache::DepIterator::IsIgnorable(PkgIterator const &PT) const // ignore group-conflict on a M-A:same package - but not our implicit dependencies // so that we can have M-A:same packages conflicting with their own real name if ((PV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same) - { - // Replaces: ${self}:other ( << ${binary:Version}) - if (S2->Type == pkgCache::Dep::Replaces) - { - if (S2->CompareOp == pkgCache::Dep::Less && strcmp(PV.VerStr(), TargetVer()) == 0) - return false; - } - // Breaks: ${self}:other (!= ${binary:Version}) - else if (S2->Type == pkgCache::Dep::DpkgBreaks) - { - if (S2->CompareOp == pkgCache::Dep::NotEquals && strcmp(PV.VerStr(), TargetVer()) == 0) - return false; - } - return true; - } + return IsMultiArchImplicit() == false; return false; } @@ -756,27 +742,12 @@ bool pkgCache::DepIterator::IsIgnorable(PrvIterator const &Prv) const if (Prv.OwnerPkg()->Group == Pkg->Group) return true; // Implicit group-conflicts should not be applied on providers of other groups - if (Pkg->Group == TargetPkg()->Group && Prv.OwnerPkg()->Group != Pkg->Group) + if (IsMultiArchImplicit() && Prv.OwnerPkg()->Group != Pkg->Group) return true; return false; } /*}}}*/ -// DepIterator::IsMultiArchImplicit - added by the cache generation /*{{{*/ -// --------------------------------------------------------------------- -/* MultiArch can be translated to SingleArch for an resolver and we did so, - by adding dependencies to help the resolver understand the problem, but - sometimes it is needed to identify these to ignore them… */ -bool pkgCache::DepIterator::IsMultiArchImplicit() const -{ - if (ParentPkg()->Arch != TargetPkg()->Arch && - (S2->Type == pkgCache::Dep::Replaces || - S2->Type == pkgCache::Dep::DpkgBreaks || - S2->Type == pkgCache::Dep::Conflicts)) - return true; - return false; -} - /*}}}*/ // DepIterator::IsSatisfied - check if a version satisfied the dependency /*{{{*/ bool pkgCache::DepIterator::IsSatisfied(VerIterator const &Ver) const { @@ -787,6 +758,20 @@ bool pkgCache::DepIterator::IsSatisfied(PrvIterator const &Prv) const return Owner->VS->CheckDep(Prv.ProvideVersion(),S2->CompareOp,TargetVer()); } /*}}}*/ +// DepIterator::IsImplicit - added by the cache generation /*{{{*/ +bool pkgCache::DepIterator::IsImplicit() const +{ + if (IsMultiArchImplicit() == true) + return true; + if (IsNegative() || S2->Type == pkgCache::Dep::Replaces) + { + if ((S2->CompareOp & pkgCache::Dep::ArchSpecific) != pkgCache::Dep::ArchSpecific && + strcmp(ParentPkg().Arch(), TargetPkg().Arch()) != 0) + return true; + } + return false; +} + /*}}}*/ // ostream operator to handle string representation of a dependecy /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -1067,19 +1052,5 @@ pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const } /*}}}*/ -// PrvIterator::IsMultiArchImplicit - added by the cache generation /*{{{*/ -// --------------------------------------------------------------------- -/* MultiArch can be translated to SingleArch for an resolver and we did so, - by adding provides to help the resolver understand the problem, but - sometimes it is needed to identify these to ignore them… */ -bool pkgCache::PrvIterator::IsMultiArchImplicit() const -{ - pkgCache::PkgIterator const Owner = OwnerPkg(); - pkgCache::PkgIterator const Parent = ParentPkg(); - if (strcmp(Owner.Arch(), Parent.Arch()) != 0 || Owner.Group()->Name == Parent.Group()->Name) - return true; - return false; -} - /*}}}*/ pkgCache::~pkgCache() {} diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index fba692982..8a726085e 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -149,8 +149,12 @@ class pkgCache /*{{{*/ The lower 4 bits are used to indicate what operator is being specified and the upper 4 bits are flags. OR indicates that the next package is or'd with the current package. */ - enum DepCompareOp {Or=0x10,NoOp=0,LessEq=0x1,GreaterEq=0x2,Less=0x3, - Greater=0x4,Equals=0x5,NotEquals=0x6}; + enum DepCompareOp {NoOp=0,LessEq=0x1,GreaterEq=0x2,Less=0x3, + Greater=0x4,Equals=0x5,NotEquals=0x6, + Or=0x10, /*!< or'ed with the next dependency */ + MultiArchImplicit=0x20, /*!< generated internally, not spelled out in the index */ + ArchSpecific=0x40 /*!< was decorated with an explicit architecture in index */ + }; }; struct State @@ -178,6 +182,10 @@ class pkgCache /*{{{*/ NotAutomatic=(1<<0), /*!< archive has a default pin of 1 */ ButAutomaticUpgrades=(1<<1), /*!< (together with the previous) archive has a default pin of 100 */ }; + enum ProvidesFlags { + MultiArchImplicit=pkgCache::Dep::MultiArchImplicit, /*!< generated internally, not spelled out in the index */ + ArchSpecific=pkgCache::Dep::ArchSpecific /*!< was decorated with an explicit architecture in index */ + }; }; protected: @@ -725,9 +733,9 @@ struct pkgCache::Provides /** \brief version in the provides line (if any) This version allows dependencies to depend on specific versions of a - Provides, as well as allowing Provides to override existing packages. - This is experimental. Note that Debian doesn't allow versioned provides */ + Provides, as well as allowing Provides to override existing packages. */ map_stringitem_t ProvideVersion; + map_flags_t Flags; /** \brief next provides (based of package) */ map_pointer_t NextProvides; // Provides /** \brief next provides (based of version) */ diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index a82483d15..9acb2563a 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -709,16 +709,16 @@ bool pkgCacheGenerator::AddImplicitDepends(pkgCache::GrpIterator &G, { // Replaces: ${self}:other ( << ${binary:Version}) NewDepends(D, V, VerStrIdx, - pkgCache::Dep::Less, pkgCache::Dep::Replaces, + pkgCache::Dep::Less | pkgCache::Dep::MultiArchImplicit, pkgCache::Dep::Replaces, OldDepLast); // Breaks: ${self}:other (!= ${binary:Version}) NewDepends(D, V, VerStrIdx, - pkgCache::Dep::NotEquals, pkgCache::Dep::DpkgBreaks, + pkgCache::Dep::NotEquals | pkgCache::Dep::MultiArchImplicit, pkgCache::Dep::DpkgBreaks, OldDepLast); } else { // Conflicts: ${self}:other NewDepends(D, V, 0, - pkgCache::Dep::NoOp, pkgCache::Dep::Conflicts, + pkgCache::Dep::NoOp | pkgCache::Dep::MultiArchImplicit, pkgCache::Dep::Conflicts, OldDepLast); } } @@ -737,16 +737,16 @@ bool pkgCacheGenerator::AddImplicitDepends(pkgCache::VerIterator &V, map_stringitem_t const VerStrIdx = V->VerStr; // Replaces: ${self}:other ( << ${binary:Version}) NewDepends(D, V, VerStrIdx, - pkgCache::Dep::Less, pkgCache::Dep::Replaces, + pkgCache::Dep::Less | pkgCache::Dep::MultiArchImplicit, pkgCache::Dep::Replaces, OldDepLast); // Breaks: ${self}:other (!= ${binary:Version}) NewDepends(D, V, VerStrIdx, - pkgCache::Dep::NotEquals, pkgCache::Dep::DpkgBreaks, + pkgCache::Dep::NotEquals | pkgCache::Dep::MultiArchImplicit, pkgCache::Dep::DpkgBreaks, OldDepLast); } else { // Conflicts: ${self}:other NewDepends(D, V, 0, - pkgCache::Dep::NoOp, pkgCache::Dep::Conflicts, + pkgCache::Dep::NoOp | pkgCache::Dep::MultiArchImplicit, pkgCache::Dep::Conflicts, OldDepLast); } return true; @@ -913,8 +913,8 @@ map_pointer_t pkgCacheGenerator::NewDescription(pkgCache::DescIterator &Desc, bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver, string const &Version, - unsigned int const &Op, - unsigned int const &Type, + uint8_t const Op, + uint8_t const Type, map_stringitem_t* &OldDepLast) { map_stringitem_t index = 0; @@ -940,8 +940,8 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver, map_pointer_t const Version, - unsigned int const &Op, - unsigned int const &Type, + uint8_t const Op, + uint8_t const Type, map_pointer_t* &OldDepLast) { void const * const oldMap = Map.Data(); @@ -1040,8 +1040,8 @@ bool pkgCacheGenerator::ListParser::NewDepends(pkgCache::VerIterator &Ver, const string &PackageName, const string &Arch, const string &Version, - unsigned int Op, - unsigned int Type) + uint8_t const Op, + uint8_t const Type) { pkgCache::GrpIterator Grp; Dynamic DynGrp(Grp); @@ -1073,12 +1073,11 @@ bool pkgCacheGenerator::ListParser::NewDepends(pkgCache::VerIterator &Ver, } /*}}}*/ // ListParser::NewProvides - Create a Provides element /*{{{*/ -// --------------------------------------------------------------------- -/* */ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver, - const string &PkgName, + const string &PkgName, const string &PkgArch, - const string &Version) + const string &Version, + uint8_t const Flags) { pkgCache &Cache = Owner->Cache; @@ -1097,6 +1096,7 @@ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver, pkgCache::PrvIterator Prv(Cache,Cache.ProvideP + Provides,Cache.PkgP); Dynamic DynPrv(Prv); Prv->Version = Ver.Index(); + Prv->Flags = Flags; Prv->NextPkgProv = Ver->ProvidesList; Ver->ProvidesList = Prv.Index(); if (Version.empty() == false) { diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index c56b5abae..c5527ff30 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -82,11 +82,11 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ bool NewFileVer(pkgCache::VerIterator &Ver,ListParser &List); bool NewFileDesc(pkgCache::DescIterator &Desc,ListParser &List); bool NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver, - std::string const &Version, unsigned int const &Op, - unsigned int const &Type, map_pointer_t* &OldDepLast); + std::string const &Version, uint8_t const Op, + uint8_t const Type, map_pointer_t* &OldDepLast); bool NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver, - map_pointer_t const Version, unsigned int const &Op, - unsigned int const &Type, map_pointer_t* &OldDepLast); + map_pointer_t const Version, uint8_t const Op, + uint8_t const Type, map_pointer_t* &OldDepLast); map_pointer_t NewVersion(pkgCache::VerIterator &Ver,const std::string &VerStr,map_pointer_t const Next) APT_DEPRECATED { return NewVersion(Ver, VerStr, 0, 0, Next); } map_pointer_t NewVersion(pkgCache::VerIterator &Ver,const std::string &VerStr, @@ -162,10 +162,11 @@ class APT_HIDDEN pkgCacheGenerator::ListParser inline map_stringitem_t WriteString(const std::string &S) {return Owner->WriteStringInMap(S);}; inline map_stringitem_t WriteString(const char *S,unsigned int Size) {return Owner->WriteStringInMap(S,Size);}; bool NewDepends(pkgCache::VerIterator &Ver,const std::string &Package, const std::string &Arch, - const std::string &Version,unsigned int Op, - unsigned int Type); + const std::string &Version,uint8_t const Op, + uint8_t const Type); bool NewProvides(pkgCache::VerIterator &Ver,const std::string &PkgName, - const std::string &PkgArch, const std::string &Version); + const std::string &PkgArch, const std::string &Version, + uint8_t const Flags); public: diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 71dceb559..cfdc13259 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -51,6 +51,7 @@ static bool addArgumentsAPTCache(std::vector &Args, char cons addArg(0, "conflicts", "APT::Cache::ShowConflicts", 0); addArg(0, "enhances", "APT::Cache::ShowEnhances", 0); addArg(0, "recurse", "APT::Cache::RecurseDepends", 0); + addArg(0, "implicit", "APT::Cache::ShowImplicit", 0); } else if (CmdMatches("search")) { diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 2fc721f69..1eb891e8e 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -689,6 +689,7 @@ static bool ShowDepends(CommandLine &CmdL, bool const RevDepends) bool const ShowBreaks = _config->FindB("APT::Cache::ShowBreaks", Important == false); bool const ShowEnhances = _config->FindB("APT::Cache::ShowEnhances", Important == false); bool const ShowOnlyFirstOr = _config->FindB("APT::Cache::ShowOnlyFirstOr", false); + bool const ShowImplicit = _config->FindB("APT::Cache::ShowImplicit", false); while (verset.empty() != true) { @@ -709,12 +710,16 @@ static bool ShowDepends(CommandLine &CmdL, bool const RevDepends) case pkgCache::Dep::Depends: if (!ShowDepends) continue; break; case pkgCache::Dep::Recommends: if (!ShowRecommends) continue; break; case pkgCache::Dep::Suggests: if (!ShowSuggests) continue; break; - case pkgCache::Dep::Replaces: if (!ShowReplaces) continue; break; case pkgCache::Dep::Conflicts: if (!ShowConflicts) continue; break; + case pkgCache::Dep::Replaces: if (!ShowReplaces) continue; break; + case pkgCache::Dep::Conflicts: if (!ShowConflicts) continue; break; case pkgCache::Dep::DpkgBreaks: if (!ShowBreaks) continue; break; case pkgCache::Dep::Enhances: if (!ShowEnhances) continue; break; } + if (ShowImplicit == false && D.IsImplicit()) + continue; pkgCache::PkgIterator Trg = RevDepends ? D.ParentPkg() : D.TargetPkg(); + bool const showNoArch = RevDepends || (D->CompareOp & pkgCache::Dep::ArchSpecific) != pkgCache::Dep::ArchSpecific; if((Installed && Trg->CurrentVer != 0) || !Installed) { @@ -728,9 +733,9 @@ static bool ShowDepends(CommandLine &CmdL, bool const RevDepends) if (ShowDepType == true) cout << D.DepType() << ": "; if (Trg->VersionList == 0) - cout << "<" << Trg.FullName(true) << ">"; + cout << "<" << Trg.FullName(showNoArch) << ">"; else - cout << Trg.FullName(true); + cout << Trg.FullName(showNoArch); if (ShowVersion == true && D->Version != 0) cout << " (" << pkgCache::CompTypeDeb(D->CompareOp) << ' ' << D.TargetVer() << ')'; cout << std::endl; diff --git a/doc/apt-cache.8.xml b/doc/apt-cache.8.xml index a9f6c8da2..e20f66770 100644 --- a/doc/apt-cache.8.xml +++ b/doc/apt-cache.8.xml @@ -281,12 +281,23 @@ Reverse Provides: - Per default the depends and - rdepends print all dependencies. This can be tweaked with + Per default the depends and + rdepends print all dependencies. This can be tweaked with these flags which will omit the specified dependency type. Configuration Item: APT::Cache::ShowDependencyType e.g. APT::Cache::ShowRecommends. + + + Per default depends and rdepends + print only dependencies explicitly expressed in the metadata. With this flag + it will also show dependencies implicitely added based on the encountered data. + A Conflicts: foo e.g. expresses implicitely that this package + also conflicts with the package foo from any other architecture. + Configuration Item: APT::Cache::ShowImplicit. + + + Print full package records when searching. Configuration Item: APT::Cache::ShowFull. diff --git a/test/integration/test-apt-cache b/test/integration/test-apt-cache index a22b08c20..a8ddfd889 100755 --- a/test/integration/test-apt-cache +++ b/test/integration/test-apt-cache @@ -16,6 +16,9 @@ Recommends: cool (>= 2) | cooler (<< 5)' "$DESCR" insertpackage 'unstable' 'bar' 'all' '1' 'Depends: bar Breaks: foo (<< 1) Replaces: foo (<< 1)' "$DESCR" +insertpackage 'unstable' 'specific' 'all' '1' 'Depends: bar:i386, specific:amd64 +Breaks: foo:amd64 (<< 1) +Replaces: foo:i386 (<< 1)' "$DESCR" setupaptarchive @@ -44,6 +47,7 @@ testsuccess test -s dump.output testsuccessequal 'dpkg bar +specific fancy foo' aptcache pkgnames testsuccessequal 'bar' aptcache pkgnames bar @@ -57,29 +61,60 @@ testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive uns testsuccessequal 'foo Depends: bar Conflicts: - Conflicts: |Recommends: Recommends: ' aptcache depends foo testsuccessequal 'foo Depends: bar Conflicts: Conflicts: + |Recommends: + Recommends: ' aptcache depends foo --implicit +testsuccessequal 'foo + Depends: bar + Conflicts: Recommends: ' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 testsuccessequal 'foo Depends: bar Conflicts: Conflicts: + Recommends: ' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 --implicit +testsuccessequal 'foo + Depends: bar + Conflicts: |Recommends: (>= 2) Recommends: (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 testsuccessequal 'foo Depends: bar Conflicts: - Conflicts: ' aptcache depends foo --no-recommends + Conflicts: + |Recommends: (>= 2) + Recommends: (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 --implicit testsuccessequal 'foo - Depends: bar' aptcache depends foo --important + Depends: bar + Conflicts: ' aptcache depends foo --no-recommends +testsuccessequal 'foo + Depends: bar + Conflicts: + Conflicts: ' aptcache depends foo --no-recommends --implicit +testsuccessequal 'foo + Depends: bar' aptcache depends foo --important --implicit testsuccessequal 'foo + Conflicts: ' aptcache depends foo --important --no-depends --conflicts +testsuccessequal 'foo + Conflicts: + Conflicts: ' aptcache depends foo --important --no-depends --conflicts --implicit +testsuccessequal 'foo + Depends: bar Conflicts: - Conflicts: ' aptcache depends foo --important --no-depends --conflicts + |Recommends: + Recommends: +bar + Depends: bar + Breaks: foo + Replaces: foo + + +' aptcache depends foo --recurse testsuccessequal 'foo Depends: bar Conflicts: @@ -96,29 +131,58 @@ bar -' aptcache depends foo --recurse +' aptcache depends foo --recurse --implicit +testsuccessequal 'foo + Depends: bar +bar + Depends: bar + Replaces: foo' aptcache depends foo --recurse --important --replaces testsuccessequal 'foo Depends: bar bar Depends: bar Replaces: foo Replaces: -' aptcache depends foo --recurse --important --replaces +' aptcache depends foo --recurse --important --replaces --implicit +testsuccessequal 'bar + Depends: bar + Breaks: foo + Replaces: foo' aptcache depends bar +testsuccessequal 'bar + Depends: bar + Breaks: foo + Breaks: + Replaces: foo + Replaces: ' aptcache depends bar --implicit +testsuccessequal 'specific + Depends: + Depends: specific:amd64 + Breaks: foo:amd64 + Replaces: ' aptcache depends specific +testsuccessequal 'specific + Depends: + Depends: specific:amd64 + Breaks: foo:amd64 + Replaces: ' aptcache depends specific --implicit ## rdpends testsuccessequal 'foo Reverse Depends: bar + specific bar' aptcache rdepends foo testsuccessequal 'foo Reverse Depends: Breaks: bar + Breaks: specific Replaces: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 testsuccessequal 'foo Reverse Depends: Breaks: bar (<< 1) + Breaks: specific (<< 1) Replaces: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 testsuccessequal 'foo Reverse Depends: - Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks + Breaks: bar (<< 1) + Breaks: specific (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks diff --git a/test/integration/test-ordering-ignore-not-matching-breaks b/test/integration/test-ordering-ignore-not-matching-breaks deleted file mode 100755 index 7c1365bdd..000000000 --- a/test/integration/test-ordering-ignore-not-matching-breaks +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -set -e - -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework -setupenvironment -configarchitecture 'amd64' 'i386' - -insertpackage 'unstable-mp' 'crda' 'i386,amd64' '1.1.1-1ubuntu4mp' 'Provides: wireless-crda -Multi-Arch: foreign' -insertpackage 'unstable-m' 'crda' 'i386,amd64' '1.1.1-1ubuntu4m' 'Multi-Arch: foreign' -insertpackage 'unstable-p' 'crda' 'i386,amd64' '1.1.1-1ubuntu4p' 'Provides: wireless-crda' -insertpackage 'unstable' 'wireless-crda' 'i386,amd64' '1.16' - - -insertinstalledpackage 'wireless-crda' 'amd64' '1.14' - -setupaptarchive - -testsuccessequal 'Reading package lists... -Building dependency tree... -The following NEW packages will be installed: - crda -0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. -Inst crda (1.1.1-1ubuntu4m unstable-m [amd64]) -Conf crda (1.1.1-1ubuntu4m unstable-m [amd64])' aptget install crda -s -t unstable-m - -testsuccessequal 'Reading package lists... -Building dependency tree... -The following NEW packages will be installed: - crda -0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. -Inst crda (1.1.1-1ubuntu4p unstable-p [amd64]) -Conf crda (1.1.1-1ubuntu4p unstable-p [amd64])' aptget install crda -s -t unstable-p - -testsuccessequal 'Reading package lists... -Building dependency tree... -The following NEW packages will be installed: - crda -0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. -Inst crda (1.1.1-1ubuntu4mp unstable-mp [amd64]) -Conf crda (1.1.1-1ubuntu4mp unstable-mp [amd64])' aptget install crda -s -t unstable-mp - -rm rootdir/var/lib/dpkg/status -insertinstalledpackage 'crda' 'amd64' '1.1.1-1ubuntu4mp' 'Provides: wireless-crda -Conflicts: wireless-crda (<< 1.15) -Replaces: wireless-crda ( << 1.15) -Multi-arch: foreign' - -testsuccessequal 'Reading package lists... -Building dependency tree... -The following NEW packages will be installed: - wireless-crda -0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. -Inst wireless-crda (1.16 unstable [amd64]) -Conf wireless-crda (1.16 unstable [amd64])' aptget install wireless-crda -s -t unstable -- cgit v1.2.3 From ecc138f858fab61e0b888d3d13854d1422c3432b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 16 Jul 2015 19:41:45 +0200 Subject: just-in-time creation for (implicit) Provides Expecting the worst is easy to code, but has its disadvantages e.g. by creating package structures which otherwise would have never existed. By creating the provides instead at the time a package structure is added we are well prepared for the introduction of partial architectures, massive amounts of M-A:foreign (and :allowed) and co as far as provides are concerned at least. We have something relatively similar for dependencies already. Many tests are added for both M-A states and the code cleaned to properly support implicit provides for foreign architectures and architectures we 'just' happen to parse. Git-Dch: Ignore --- apt-pkg/deb/deblistparser.cc | 20 +- apt-pkg/deb/deblistparser.h | 1 - apt-pkg/pkgcachegen.cc | 123 ++++++++--- apt-pkg/pkgcachegen.h | 4 + cmdline/apt-cache.cc | 4 +- .../test-bug-723586-any-stripped-in-single-arch | 2 +- .../test-bug-758153-versioned-provides-support | 84 +++++++ test/integration/test-multiarch-allowed | 246 +++++++++++++++++++++ test/integration/test-multiarch-foreign | 33 +++ 9 files changed, 466 insertions(+), 51 deletions(-) create mode 100755 test/integration/test-multiarch-allowed diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index df0879641..87aa99c6e 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -861,7 +861,7 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) if (NewProvides(Ver, Package, OtherArch, Version, pkgCache::Flag::ArchSpecific) == false) return false; } else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) { - if (NewProvidesAllArch(Ver, Package, Version) == false) + if (NewProvidesAllArch(Ver, Package, Version, 0) == false) return false; } else { if (NewProvides(Ver, Package, Arch, Version, 0) == false) @@ -876,26 +876,14 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed) { string const Package = string(Ver.ParentPkg().Name()).append(":").append("any"); - return NewProvidesAllArch(Ver, Package, Ver.VerStr()); + return NewProvidesAllArch(Ver, Package, Ver.VerStr(), pkgCache::Flag::MultiArchImplicit); } else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) - return NewProvidesAllArch(Ver, Ver.ParentPkg().Name(), Ver.VerStr()); + return NewProvidesAllArch(Ver, Ver.ParentPkg().Name(), Ver.VerStr(), pkgCache::Flag::MultiArchImplicit); return true; } /*}}}*/ -// ListParser::NewProvides - add provides for all architectures /*{{{*/ -bool debListParser::NewProvidesAllArch(pkgCache::VerIterator &Ver, string const &Package, - string const &Version) { - for (std::vector::const_iterator a = Architectures.begin(); - a != Architectures.end(); ++a) - { - if (NewProvides(Ver, Package, *a, Version, pkgCache::Flag::MultiArchImplicit) == false) - return false; - } - return true; -} - /*}}}*/ // ListParser::GrabWord - Matches a word and returns /*{{{*/ // --------------------------------------------------------------------- /* Looks for a word in a list of words - for ParseStatus */ @@ -991,7 +979,7 @@ bool debDebFileParser::UsePackage(pkgCache::PkgIterator &Pkg, bool res = debListParser::UsePackage(Pkg, Ver); // we use the full file path as a provides so that the file is found // by its name - if(NewProvidesAllArch(Ver, DebFile, Ver.VerStr()) == false) + if(NewProvidesAllArch(Ver, DebFile, Ver.VerStr(), 0) == false) return false; return res; } diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 3884aafb9..30e52718d 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -53,7 +53,6 @@ class APT_HIDDEN debListParser : public pkgCacheGenerator::ListParser bool ParseDepends(pkgCache::VerIterator &Ver,const char *Tag, unsigned int Type); bool ParseProvides(pkgCache::VerIterator &Ver); - bool NewProvidesAllArch(pkgCache::VerIterator &Ver, std::string const &Package, std::string const &Version); static bool GrabWord(std::string Word,WordList *List,unsigned char &Out); APT_HIDDEN unsigned char ParseMultiArch(bool const showErrors); diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 9acb2563a..c04320555 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -648,6 +648,16 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg,const string &Name return false; Pkg = pkgCache::PkgIterator(Cache,Cache.PkgP + Package); + // Set the name, arch and the ID + APT_IGNORE_DEPRECATED(Pkg->Name = Grp->Name;) + Pkg->Group = Grp.Index(); + // all is mapped to the native architecture + map_stringitem_t const idxArch = (Arch == "all") ? Cache.HeaderP->Architecture : StoreString(MIXED, Arch); + if (unlikely(idxArch == 0)) + return false; + Pkg->Arch = idxArch; + Pkg->ID = Cache.HeaderP->PackageCount++; + // Insert the package into our package list if (Grp->FirstPackage == 0) // the group is new { @@ -662,23 +672,36 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg,const string &Name } else // Group the Packages together { + // but first get implicit provides done + if (APT::Configuration::checkArchitecture(Pkg.Arch()) == true) + { + pkgCache::PkgIterator const M = Grp.FindPreferredPkg(false); // native or any foreign pkg will do + if (M.end() == false) + for (pkgCache::PrvIterator Prv = M.ProvidesList(); Prv.end() == false; ++Prv) + { + if ((Prv->Flags & pkgCache::Flag::ArchSpecific) != 0) + continue; + pkgCache::VerIterator Ver = Prv.OwnerVer(); + if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed || + ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign && + (Prv->Flags & pkgCache::Flag::MultiArchImplicit) == 0)) + if (NewProvides(Ver, Pkg, Prv->ProvideVersion, Prv->Flags) == false) + return false; + } + + for (pkgCache::PkgIterator P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P)) + for (pkgCache::VerIterator Ver = P.VersionList(); Ver.end() == false; ++Ver) + if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) + if (NewProvides(Ver, Pkg, Ver->VerStr, pkgCache::Flag::MultiArchImplicit) == false) + return false; + } + // this package is the new last package pkgCache::PkgIterator LastPkg(Cache, Cache.PkgP + Grp->LastPackage); Pkg->NextPackage = LastPkg->NextPackage; LastPkg->NextPackage = Package; } Grp->LastPackage = Package; - - // Set the name, arch and the ID - APT_IGNORE_DEPRECATED(Pkg->Name = Grp->Name;) - Pkg->Group = Grp.Index(); - // all is mapped to the native architecture - map_stringitem_t const idxArch = (Arch == "all") ? Cache.HeaderP->Architecture : StoreString(MIXED, Arch); - if (unlikely(idxArch == 0)) - return false; - Pkg->Arch = idxArch; - Pkg->ID = Cache.HeaderP->PackageCount++; - return true; } /*}}}*/ @@ -1079,44 +1102,82 @@ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver, const string &Version, uint8_t const Flags) { - pkgCache &Cache = Owner->Cache; + pkgCache const &Cache = Owner->Cache; // We do not add self referencing provides if (Ver.ParentPkg().Name() == PkgName && (PkgArch == Ver.ParentPkg().Arch() || (PkgArch == "all" && strcmp((Cache.StrP + Cache.HeaderP->Architecture), Ver.ParentPkg().Arch()) == 0))) return true; - + + // Locate the target package + pkgCache::PkgIterator Pkg; + Dynamic DynPkg(Pkg); + if (unlikely(Owner->NewPackage(Pkg,PkgName, PkgArch) == false)) + return false; + + map_stringitem_t idxProvideVersion = 0; + if (Version.empty() == false) { + idxProvideVersion = StoreString(VERSIONNUMBER, Version); + if (unlikely(idxProvideVersion == 0)) + return false; + } + return Owner->NewProvides(Ver, Pkg, idxProvideVersion, Flags); +} +bool pkgCacheGenerator::NewProvides(pkgCache::VerIterator &Ver, + pkgCache::PkgIterator &Pkg, + map_pointer_t const ProvideVersion, + uint8_t const Flags) +{ // Get a structure - map_pointer_t const Provides = Owner->AllocateInMap(sizeof(pkgCache::Provides)); + map_pointer_t const Provides = AllocateInMap(sizeof(pkgCache::Provides)); if (unlikely(Provides == 0)) return false; - Cache.HeaderP->ProvidesCount++; - + ++Cache.HeaderP->ProvidesCount; + // Fill it in pkgCache::PrvIterator Prv(Cache,Cache.ProvideP + Provides,Cache.PkgP); - Dynamic DynPrv(Prv); Prv->Version = Ver.Index(); + Prv->ProvideVersion = ProvideVersion; Prv->Flags = Flags; Prv->NextPkgProv = Ver->ProvidesList; Ver->ProvidesList = Prv.Index(); - if (Version.empty() == false) { - map_stringitem_t const idxProvideVersion = WriteString(Version); - Prv->ProvideVersion = idxProvideVersion; - if (unlikely(idxProvideVersion == 0)) - return false; - } - - // Locate the target package - pkgCache::PkgIterator Pkg; - Dynamic DynPkg(Pkg); - if (unlikely(Owner->NewPackage(Pkg,PkgName, PkgArch) == false)) - return false; - + // Link it to the package Prv->ParentPkg = Pkg.Index(); Prv->NextProvides = Pkg->ProvidesList; Pkg->ProvidesList = Prv.Index(); - + return true; +} + /*}}}*/ +// ListParser::NewProvidesAllArch - add provides for all architectures /*{{{*/ +bool pkgCacheGenerator::ListParser::NewProvidesAllArch(pkgCache::VerIterator &Ver, string const &Package, + string const &Version, uint8_t const Flags) { + pkgCache &Cache = Owner->Cache; + pkgCache::GrpIterator const Grp = Cache.FindGrp(Package); + if (Grp.end() == true) + return NewProvides(Ver, Package, Cache.NativeArch(), Version, Flags); + else + { + map_stringitem_t idxProvideVersion = 0; + if (Version.empty() == false) { + idxProvideVersion = StoreString(VERSIONNUMBER, Version); + if (unlikely(idxProvideVersion == 0)) + return false; + } + + bool const isImplicit = (Flags & pkgCache::Flag::MultiArchImplicit) == pkgCache::Flag::MultiArchImplicit; + bool const isArchSpecific = (Flags & pkgCache::Flag::ArchSpecific) == pkgCache::Flag::ArchSpecific; + pkgCache::PkgIterator const OwnerPkg = Ver.ParentPkg(); + for (pkgCache::PkgIterator Pkg = Grp.PackageList(); Pkg.end() == false; Pkg = Grp.NextPkg(Pkg)) + { + if (isImplicit && OwnerPkg == Pkg) + continue; + if (isArchSpecific == false && APT::Configuration::checkArchitecture(OwnerPkg.Arch()) == false) + continue; + if (Owner->NewProvides(Ver, Pkg, idxProvideVersion, Flags) == false) + return false; + } + } return true; } /*}}}*/ diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index c5527ff30..34dc6fead 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -93,6 +93,8 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ map_pointer_t const ParentPkg, unsigned short const Hash, map_pointer_t const Next); map_pointer_t NewDescription(pkgCache::DescIterator &Desc,const std::string &Lang,const MD5SumValue &md5sum,map_stringitem_t const idxmd5str); + bool NewProvides(pkgCache::VerIterator &Ver, pkgCache::PkgIterator &Pkg, + map_stringitem_t const ProvidesVersion, uint8_t const Flags); public: @@ -167,6 +169,8 @@ class APT_HIDDEN pkgCacheGenerator::ListParser bool NewProvides(pkgCache::VerIterator &Ver,const std::string &PkgName, const std::string &PkgArch, const std::string &Version, uint8_t const Flags); + bool NewProvidesAllArch(pkgCache::VerIterator &Ver, std::string const &Package, + std::string const &Version, uint8_t const Flags); public: diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 1eb891e8e..e61914298 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -253,12 +253,12 @@ static bool DumpPackage(CommandLine &CmdL) { cout << Cur.VerStr() << " - "; for (pkgCache::PrvIterator Prv = Cur.ProvidesList(); Prv.end() != true; ++Prv) - cout << Prv.ParentPkg().FullName(true) << " "; + cout << Prv.ParentPkg().FullName(true) << " (= " << (Prv->ProvideVersion == 0 ? "" : Prv.ProvideVersion()) << ") "; cout << endl; } cout << "Reverse Provides: " << endl; for (pkgCache::PrvIterator Prv = Pkg.ProvidesList(); Prv.end() != true; ++Prv) - cout << Prv.OwnerPkg().FullName(true) << " " << Prv.OwnerVer().VerStr() << endl; + cout << Prv.OwnerPkg().FullName(true) << " " << Prv.OwnerVer().VerStr() << " (= " << (Prv->ProvideVersion == 0 ? "" : Prv.ProvideVersion()) << ")"<< endl; } return true; diff --git a/test/integration/test-bug-723586-any-stripped-in-single-arch b/test/integration/test-bug-723586-any-stripped-in-single-arch index 0cf3362cf..8a835a6db 100755 --- a/test/integration/test-bug-723586-any-stripped-in-single-arch +++ b/test/integration/test-bug-723586-any-stripped-in-single-arch @@ -50,5 +50,5 @@ configarchitecture 'amd64' 'armhf' rm rootdir/var/cache/apt/*.bin testsuccessequal "$INSTALLLOG" aptget install python3-gnupg -s -testsuccessequal "$(sed 's#3.3.2-16 - python3#3.3.2-16 - python3:any:armhf python3#' showpkg.log)" aptcache showpkg python3 +testsuccessequal "$(cat showpkg.log)" aptcache showpkg python3 testfailureequal "$FAILLOG" aptget install python-mips -s diff --git a/test/integration/test-bug-758153-versioned-provides-support b/test/integration/test-bug-758153-versioned-provides-support index 30bc921c3..bf42f57fd 100755 --- a/test/integration/test-bug-758153-versioned-provides-support +++ b/test/integration/test-bug-758153-versioned-provides-support @@ -30,6 +30,18 @@ insertpackage 'unstable' 'baz' 'i386,amd64' '1' 'Depends: bar' insertpackage 'experimental' 'baz' 'i386,amd64' '2' 'Depends: bar:i386' insertpackage 'experimental' 'baz-broken' 'i386' '2' 'Depends: bar:amd64' +insertpackage 'unstable' 'next' 'amd64' '1' 'Multi-Arch: foreign +Provides: next (= 2)' +insertpackage 'unstable' 'needsrealnext' 'amd64,i386' '2' 'Depends: next (>= 2)' + +insertpackage 'unstable' 'virtualnext2' 'amd64' '1' 'Multi-Arch: foreign +Provides: next2 (= 2)' +insertpackage 'unstable' 'needsnext2' 'amd64,i386' '2' 'Depends: next2 (>= 2)' + +insertpackage 'unstable' 'virtualnext3' 'amd64' '1' 'Multi-Arch: no +Provides: next3 (= 2)' +insertpackage 'unstable' 'needsnext3' 'amd64,i386' '2' 'Depends: next3 (>= 2)' + setupaptarchive testsuccessequal 'Reading package lists... @@ -204,3 +216,75 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: baz-broken:i386 : Depends: bar but it is not installable E: Unable to correct problems, you have held broken packages.' aptget install baz-broken -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + next +The following NEW packages will be installed: + needsrealnext next +0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. +Inst next (1 unstable [amd64]) +Inst needsrealnext (2 unstable [amd64]) +Conf next (1 unstable [amd64]) +Conf needsrealnext (2 unstable [amd64])' aptget install needsrealnext -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + next +The following NEW packages will be installed: + needsrealnext:i386 next +0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. +Inst next (1 unstable [amd64]) +Inst needsrealnext:i386 (2 unstable [i386]) +Conf next (1 unstable [amd64]) +Conf needsrealnext:i386 (2 unstable [i386])' aptget install needsrealnext:i386 -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + virtualnext2 +The following NEW packages will be installed: + needsnext2 virtualnext2 +0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. +Inst virtualnext2 (1 unstable [amd64]) +Inst needsnext2 (2 unstable [amd64]) +Conf virtualnext2 (1 unstable [amd64]) +Conf needsnext2 (2 unstable [amd64])' aptget install needsnext2 -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + virtualnext2 +The following NEW packages will be installed: + needsnext2:i386 virtualnext2 +0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. +Inst virtualnext2 (1 unstable [amd64]) +Inst needsnext2:i386 (2 unstable [i386]) +Conf virtualnext2 (1 unstable [amd64]) +Conf needsnext2:i386 (2 unstable [i386])' aptget install needsnext2:i386 -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + virtualnext3 +The following NEW packages will be installed: + needsnext3 virtualnext3 +0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. +Inst virtualnext3 (1 unstable [amd64]) +Inst needsnext3 (2 unstable [amd64]) +Conf virtualnext3 (1 unstable [amd64]) +Conf needsnext3 (2 unstable [amd64])' aptget install needsnext3 -s + +testfailureequal 'Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + needsnext3:i386 : Depends: next3:i386 (>= 2) but it is not installable +E: Unable to correct problems, you have held broken packages.' aptget install needsnext3:i386 -s diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed new file mode 100755 index 000000000..a643cd2dc --- /dev/null +++ b/test/integration/test-multiarch-allowed @@ -0,0 +1,246 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertpackage 'unstable' 'foo' 'amd64,i386' '1' 'Multi-Arch: allowed' +insertpackage 'unstable' 'needsfoo' 'amd64,i386' '1' 'Depends: foo' +insertpackage 'unstable' 'needsfooany' 'amd64,i386' '1' 'Depends: foo:any' +insertpackage 'unstable' 'needsfoover1' 'amd64,i386' '1' 'Depends: foo:any (>= 1)' +insertpackage 'unstable' 'needsfoover2' 'amd64,i386' '1' 'Depends: foo:any (>= 2)' +insertpackage 'unstable' 'hatesfoo' 'amd64' '1' 'Conflicts: foo' +insertpackage 'unstable' 'hatesfooany' 'amd64' '1' 'Conflicts: foo:any' # this makes no sense… +insertpackage 'unstable' 'hatesfoonative' 'amd64' '1' 'Conflicts: foo:amd64' + +insertpackage 'unstable' 'coolfoo' 'amd64' '1' 'Multi-Arch:allowed +Provides: coolbar' +insertpackage 'unstable' 'coolfoover' 'amd64' '1' 'Multi-Arch:allowed +Provides: coolbar (= 2)' +insertpackage 'unstable' 'needscoolfoo' 'amd64' '1' 'Depends: coolfoo, coolbar' +insertpackage 'unstable' 'needscoolfooany' 'amd64' '1' 'Depends: coolfoo:any, coolbar:any' +insertpackage 'unstable' 'needscoolfoover0' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar' +insertpackage 'unstable' 'needscoolfoover1' 'amd64' '1' 'Depends: coolfoo:any (>= 1), coolbar (>= 1)' +insertpackage 'unstable' 'needscoolfoover2' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 1)' +insertpackage 'unstable' 'needscoolfoover3' 'amd64' '1' 'Depends: coolfoo:any (>= 2), coolbar (>= 3)' + +setupaptarchive + +BADPREFIX='Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: +' + +solveableinsinglearch0() { + testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + foo needsfoo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [amd64]) +Inst needsfoo (1 unstable [amd64]) +Conf foo (1 unstable [amd64]) +Conf needsfoo (1 unstable [amd64])' aptget install needsfoo -s +} +solveableinsinglearch0 +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo:i386 +The following NEW packages will be installed: + foo:i386 needsfoo:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:i386 (1 unstable [i386]) +Inst needsfoo:i386 (1 unstable [i386]) +Conf foo:i386 (1 unstable [i386]) +Conf needsfoo:i386 (1 unstable [i386])' aptget install needsfoo:i386 -s +testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needsfoo:i386 : Depends: foo:i386 but it is not going to be installed +E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s +testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needsfoo : Depends: foo but it is not going to be installed +E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s + +solveableinsinglearch1() { + testsuccessequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + foo $1 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [amd64]) +Inst $1 (1 unstable [amd64]) +Conf foo (1 unstable [amd64]) +Conf $1 (1 unstable [amd64])" aptget install $1 -s +} + +testneedsfooallgood() { + solveableinsinglearch1 $1 + testsuccessequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + foo $1:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1 unstable [amd64]) +Inst $1:i386 (1 unstable [i386]) +Conf foo (1 unstable [amd64]) +Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 -s + testsuccessequal "Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo:i386 $1:i386 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:i386 (1 unstable [i386]) +Inst $1:i386 (1 unstable [i386]) +Conf foo:i386 (1 unstable [i386]) +Conf $1:i386 (1 unstable [i386])" aptget install $1:i386 foo:i386 -s + testsuccessequal "Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo:i386 $1 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:i386 (1 unstable [i386]) +Inst $1 (1 unstable [amd64]) +Conf foo:i386 (1 unstable [i386]) +Conf $1 (1 unstable [amd64])" aptget install $1 foo:i386 -s +} +testneedsfooallgood 'needsfooany' +testneedsfooallgood 'needsfoover1' + +NEEDSFOO2NATIVE="$BADPREFIX +The following packages have unmet dependencies: + needsfoover2 : Depends: foo:any (>= 2) +E: Unable to correct problems, you have held broken packages." +NEEDSFOO2FOREIGN="$BADPREFIX +The following packages have unmet dependencies: + needsfoover2:i386 : Depends: foo:any:i386 (>= 2) +E: Unable to correct problems, you have held broken packages." +testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s +testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 -s +testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 foo:i386 -s +testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 foo:i386 -s + +solveableinsinglearch2() { + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfoo : Conflicts: foo but 1 is to be installed +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfooany : Conflicts: foo:any +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfooany -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfoonative : Conflicts: foo but 1 is to be installed +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s +} +solveableinsinglearch2 +testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfoo : Conflicts: foo:i386 but 1 is to be installed +E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s +testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hatesfooany : Conflicts: foo:any +E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s +testsuccessequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo:i386 hatesfoonative +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo:i386 (1 unstable [i386]) +Inst hatesfoonative (1 unstable [amd64]) +Conf foo:i386 (1 unstable [i386]) +Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s + +solveableinsinglearch3() { + testsuccessequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + coolfoo +The following NEW packages will be installed: + coolfoo needscoolfoo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst coolfoo (1 unstable [amd64]) +Inst needscoolfoo (1 unstable [amd64]) +Conf coolfoo (1 unstable [amd64]) +Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s + testsuccessequal "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + coolfoo +The following NEW packages will be installed: + coolfoo coolfoover needscoolfoo +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst coolfoo (1 unstable [amd64]) +Inst coolfoover (1 unstable [amd64]) +Inst needscoolfoo (1 unstable [amd64]) +Conf coolfoo (1 unstable [amd64]) +Conf coolfoover (1 unstable [amd64]) +Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo coolfoover -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needscoolfooany : Depends: coolbar:any but it is not installable +E: Unable to correct problems, you have held broken packages." aptget install needscoolfooany -s + testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + coolfoo +The following NEW packages will be installed: + coolfoo needscoolfoover0 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst coolfoo (1 unstable [amd64]) +Inst needscoolfoover0 (1 unstable [amd64]) +Conf coolfoo (1 unstable [amd64]) +Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s + testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + coolfoo coolfoover +The following NEW packages will be installed: + coolfoo coolfoover needscoolfoover1 +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Inst coolfoo (1 unstable [amd64]) +Inst coolfoover (1 unstable [amd64]) +Inst needscoolfoover1 (1 unstable [amd64]) +Conf coolfoo (1 unstable [amd64]) +Conf coolfoover (1 unstable [amd64]) +Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needscoolfoover2 : Depends: coolfoo:any (>= 2) +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + needscoolfoover3 : Depends: coolfoo:any (>= 2) + Depends: coolbar (>= 3) +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s +} +solveableinsinglearch3 + +msgmsg 'switch to single architecture' +configarchitecture 'amd64' + +solveableinsinglearch0 +testfailureequal 'Reading package lists... +Building dependency tree... +E: Unable to locate package needsfoo' aptget install needsfoo:i386 -s + +solveableinsinglearch1 'needsfooany' +solveableinsinglearch1 'needsfoover1' +testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s +solveableinsinglearch2 +solveableinsinglearch3 diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign index 7870126f5..a266e35ed 100755 --- a/test/integration/test-multiarch-foreign +++ b/test/integration/test-multiarch-foreign @@ -9,11 +9,17 @@ configarchitecture 'amd64' 'i386' 'armel' insertpackage 'unstable' 'cool-foo' 'amd64,i386' '1.0' 'Depends: foo' insertpackage 'unstable' 'cool-foo-x64' 'amd64' '1.0' 'Depends: foo:amd64' insertpackage 'unstable' 'cool-foo-x32' 'amd64' '1.0' 'Depends: foo:i386' +insertpackage 'unstable' 'hates-foo' 'amd64,i386' '1.0' 'Conflicts: foo' +insertpackage 'unstable' 'hates-foo-x64' 'amd64' '1.0' 'Conflicts: foo:amd64' +insertpackage 'unstable' 'hates-foo-x32' 'amd64' '1.0' 'Conflicts: foo:i386' insertpackage 'unstable' 'foo' 'amd64,i386,armel' '1.0' 'Multi-Arch: foreign' insertpackage 'unstable' 'cool-bar' 'amd64,i386' '1.0' 'Depends: bar-provider' insertpackage 'unstable' 'cool-bar-x64' 'amd64' '1.0' 'Depends: bar-provider:amd64' insertpackage 'unstable' 'cool-bar-x32' 'amd64' '1.0' 'Depends: bar-provider:i386' +insertpackage 'unstable' 'hates-bar' 'amd64,i386' '1.0' 'Conflicts: bar-provider' +insertpackage 'unstable' 'hates-bar-x64' 'amd64' '1.0' 'Conflicts: bar-provider:amd64' +insertpackage 'unstable' 'hates-bar-x32' 'amd64' '1.0' 'Conflicts: bar-provider:i386' insertpackage 'unstable' 'bar' 'amd64,i386,armel' '1.0' 'Provides: bar-provider Multi-Arch: foreign' @@ -163,6 +169,33 @@ Conf foo (1.0 unstable [amd64]) Conf cool-foo-x64 (1.0 unstable [amd64])' aptget install cool-foo-x64 -s } +hatersgonnahate() { + BADPREFIX='Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: +' + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hates-foo : Conflicts: foo + Conflicts: foo:i386 + Conflicts: foo:armel +E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hates-foo-x64 : Conflicts: foo +E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo-x64 -s + testfailureequal "$BADPREFIX +The following packages have unmet dependencies: + hates-foo-x32 : Conflicts: foo:i386 +E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo-x32 -s +} +hatersgonnahate 'foo' +hatersgonnahate 'foo:i386' + #FIXME: do not work in single-arch as i386 isn't known at cache generation time testsuccessequal 'Reading package lists... Building dependency tree... -- cgit v1.2.3 From bb0f6a34c4cebea7884de828c011dc85765ff820 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 17 Jul 2015 10:53:01 +0200 Subject: just-in-time creation for (explicit) negative deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we deal with provides in a more dynamic fashion the last remaining problem is explicit dependencies like 'Conflicts: foo' which have to apply to all architectures, but creating them all at the same time requires us to know all architectures ending up in the cache which isn't needed to be the same set as all foreign architectures. The effect is visible already now through as this prevents the creation of a bunch of virtual packages for arch:all packages and as such also many dependencies, just not very visible if you don't look at the stats… Git-Dch Ignore --- apt-pkg/deb/deblistparser.cc | 30 +----- apt-pkg/pkgcachegen.cc | 112 +++++++++++++-------- apt-pkg/pkgcachegen.h | 5 +- test/integration/test-apt-cache | 15 +-- .../test-bug-590041-prefer-non-virtual-packages | 2 +- test/integration/test-multiarch-allowed | 7 +- 6 files changed, 83 insertions(+), 88 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 87aa99c6e..1154016a9 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -790,43 +790,23 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, return _error->Error("Problem parsing dependency %s",Tag); size_t const found = Package.rfind(':'); - // If negative is unspecific it needs to apply on all architectures - if (MultiArchEnabled == true && found == string::npos && - (Type == pkgCache::Dep::Conflicts || - Type == pkgCache::Dep::DpkgBreaks || - Type == pkgCache::Dep::Replaces)) + if (found == string::npos || strcmp(Package.c_str() + found, ":any") == 0) { - for (std::vector::const_iterator a = Architectures.begin(); - a != Architectures.end(); ++a) - if (NewDepends(Ver,Package,*a,Version,Op,Type) == false) - return false; - if (NewDepends(Ver,Package,"none",Version,Op,Type) == false) + if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false) return false; } - else if (found != string::npos && - strcmp(Package.c_str() + found, ":any") != 0) + else { string Arch = Package.substr(found+1, string::npos); Package = Package.substr(0, found); // Such dependencies are not supposed to be accepted … - // … but this is probably the best thing to do. + // … but this is probably the best thing to do anyway if (Arch == "native") Arch = _config->Find("APT::Architecture"); if (NewDepends(Ver,Package,Arch,Version,Op | pkgCache::Dep::ArchSpecific,Type) == false) return false; } - else - { - if (NewDepends(Ver,Package,pkgArch,Version,Op,Type) == false) - return false; - if ((Type == pkgCache::Dep::Conflicts || - Type == pkgCache::Dep::DpkgBreaks || - Type == pkgCache::Dep::Replaces) && - NewDepends(Ver, Package, - (pkgArch != "none") ? "none" : _config->Find("APT::Architecture"), - Version,Op,Type) == false) - return false; - } + if (Start == Stop) break; } diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index c04320555..26a5e60a6 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -695,6 +695,23 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg,const string &Name if (NewProvides(Ver, Pkg, Ver->VerStr, pkgCache::Flag::MultiArchImplicit) == false) return false; } + // and negative dependencies, don't forget negative dependencies + { + pkgCache::PkgIterator const M = Grp.FindPreferredPkg(false); + if (M.end() == false) + for (pkgCache::DepIterator Dep = M.RevDependsList(); Dep.end() == false; ++Dep) + { + if ((Dep->CompareOp & (pkgCache::Dep::ArchSpecific | pkgCache::Dep::MultiArchImplicit)) != 0) + continue; + if (Dep->Type != pkgCache::Dep::DpkgBreaks && Dep->Type != pkgCache::Dep::Conflicts && + Dep->Type != pkgCache::Dep::Replaces) + continue; + pkgCache::VerIterator Ver = Dep.ParentVer(); + map_pointer_t * unused = NULL; + if (NewDepends(Pkg, Ver, Dep->Version, Dep->CompareOp, Dep->Type, unused) == false) + return false; + } + } // this package is the new last package pkgCache::PkgIterator LastPkg(Cache, Cache.PkgP + Grp->LastPackage); @@ -933,33 +950,6 @@ map_pointer_t pkgCacheGenerator::NewDescription(pkgCache::DescIterator &Desc, // --------------------------------------------------------------------- /* This creates a dependency element in the tree. It is linked to the version and to the package that it is pointing to. */ -bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, - pkgCache::VerIterator &Ver, - string const &Version, - uint8_t const Op, - uint8_t const Type, - map_stringitem_t* &OldDepLast) -{ - map_stringitem_t index = 0; - if (Version.empty() == false) - { - int const CmpOp = Op & 0x0F; - // =-deps are used (79:1) for lockstep on same-source packages (e.g. data-packages) - if (CmpOp == pkgCache::Dep::Equals && strcmp(Version.c_str(), Ver.VerStr()) == 0) - index = Ver->VerStr; - - if (index == 0) - { - void const * const oldMap = Map.Data(); - index = StoreString(VERSIONNUMBER, Version); - if (unlikely(index == 0)) - return false; - if (OldDepLast != 0 && oldMap != Map.Data()) - OldDepLast += (map_pointer_t const * const) Map.Data() - (map_pointer_t const * const) oldMap; - } - } - return NewDepends(Pkg, Ver, index, Op, Type, OldDepLast); -} bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver, map_pointer_t const Version, @@ -1071,28 +1061,64 @@ bool pkgCacheGenerator::ListParser::NewDepends(pkgCache::VerIterator &Ver, if (unlikely(Owner->NewGroup(Grp, PackageName) == false)) return false; - // Locate the target package - pkgCache::PkgIterator Pkg = Grp.FindPkg(Arch); - // we don't create 'none' packages and their dependencies if we can avoid it … - if (Pkg.end() == true && Arch == "none" && strcmp(Ver.ParentPkg().Arch(), "none") != 0) - return true; - Dynamic DynPkg(Pkg); - if (Pkg.end() == true) { - if (unlikely(Owner->NewPackage(Pkg, PackageName, Arch) == false)) - return false; - } - // Is it a file dependency? if (unlikely(PackageName[0] == '/')) FoundFileDeps = true; - /* Caching the old end point speeds up generation substantially */ - if (OldDepVer != Ver) { - OldDepLast = NULL; - OldDepVer = Ver; + map_stringitem_t idxVersion = 0; + if (Version.empty() == false) + { + int const CmpOp = Op & 0x0F; + // =-deps are used (79:1) for lockstep on same-source packages (e.g. data-packages) + if (CmpOp == pkgCache::Dep::Equals && strcmp(Version.c_str(), Ver.VerStr()) == 0) + idxVersion = Ver->VerStr; + + if (idxVersion == 0) + { + idxVersion = StoreString(VERSIONNUMBER, Version); + if (unlikely(idxVersion == 0)) + return false; + } + } + + bool const isNegative = (Type == pkgCache::Dep::DpkgBreaks || + Type == pkgCache::Dep::Conflicts || + Type == pkgCache::Dep::Replaces); + + pkgCache::PkgIterator Pkg; + Dynamic DynPkg(Pkg); + if (isNegative == false || (Op & pkgCache::Dep::ArchSpecific) == pkgCache::Dep::ArchSpecific || Grp->FirstPackage == 0) + { + // Locate the target package + Pkg = Grp.FindPkg(Arch); + if (Pkg.end() == true) { + if (unlikely(Owner->NewPackage(Pkg, PackageName, Arch) == false)) + return false; + } + + /* Caching the old end point speeds up generation substantially */ + if (OldDepVer != Ver) { + OldDepLast = NULL; + OldDepVer = Ver; + } + + return Owner->NewDepends(Pkg, Ver, idxVersion, Op, Type, OldDepLast); } + else + { + /* Caching the old end point speeds up generation substantially */ + if (OldDepVer != Ver) { + OldDepLast = NULL; + OldDepVer = Ver; + } - return Owner->NewDepends(Pkg, Ver, Version, Op, Type, OldDepLast); + for (Pkg = Grp.PackageList(); Pkg.end() == false; Pkg = Grp.NextPkg(Pkg)) + { + if (Owner->NewDepends(Pkg, Ver, idxVersion, Op, Type, OldDepLast) == false) + return false; + } + } + return true; } /*}}}*/ // ListParser::NewProvides - Create a Provides element /*{{{*/ diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 34dc6fead..0d0fb893f 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -76,14 +76,11 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ // Flag file dependencies bool FoundFileDeps; - + bool NewGroup(pkgCache::GrpIterator &Grp,const std::string &Name); bool NewPackage(pkgCache::PkgIterator &Pkg,const std::string &Name, const std::string &Arch); bool NewFileVer(pkgCache::VerIterator &Ver,ListParser &List); bool NewFileDesc(pkgCache::DescIterator &Desc,ListParser &List); - bool NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver, - std::string const &Version, uint8_t const Op, - uint8_t const Type, map_pointer_t* &OldDepLast); bool NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver, map_pointer_t const Version, uint8_t const Op, uint8_t const Type, map_pointer_t* &OldDepLast); diff --git a/test/integration/test-apt-cache b/test/integration/test-apt-cache index a8ddfd889..1d90eed5c 100755 --- a/test/integration/test-apt-cache +++ b/test/integration/test-apt-cache @@ -66,7 +66,6 @@ testsuccessequal 'foo testsuccessequal 'foo Depends: bar Conflicts: - Conflicts: |Recommends: Recommends: ' aptcache depends foo --implicit testsuccessequal 'foo @@ -76,7 +75,6 @@ testsuccessequal 'foo testsuccessequal 'foo Depends: bar Conflicts: - Conflicts: Recommends: ' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 --implicit testsuccessequal 'foo Depends: bar @@ -86,7 +84,6 @@ testsuccessequal 'foo testsuccessequal 'foo Depends: bar Conflicts: - Conflicts: |Recommends: (>= 2) Recommends: (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 --implicit testsuccessequal 'foo @@ -94,15 +91,13 @@ testsuccessequal 'foo Conflicts: ' aptcache depends foo --no-recommends testsuccessequal 'foo Depends: bar - Conflicts: - Conflicts: ' aptcache depends foo --no-recommends --implicit + Conflicts: ' aptcache depends foo --no-recommends --implicit testsuccessequal 'foo Depends: bar' aptcache depends foo --important --implicit testsuccessequal 'foo Conflicts: ' aptcache depends foo --important --no-depends --conflicts testsuccessequal 'foo - Conflicts: - Conflicts: ' aptcache depends foo --important --no-depends --conflicts --implicit + Conflicts: ' aptcache depends foo --important --no-depends --conflicts --implicit testsuccessequal 'foo Depends: bar Conflicts: @@ -118,17 +113,15 @@ bar testsuccessequal 'foo Depends: bar Conflicts: - Conflicts: |Recommends: Recommends: bar Depends: bar Breaks: foo - Breaks: Replaces: foo + Breaks: Replaces: - ' aptcache depends foo --recurse --implicit @@ -151,8 +144,8 @@ testsuccessequal 'bar testsuccessequal 'bar Depends: bar Breaks: foo - Breaks: Replaces: foo + Breaks: Replaces: ' aptcache depends bar --implicit testsuccessequal 'specific Depends: diff --git a/test/integration/test-bug-590041-prefer-non-virtual-packages b/test/integration/test-bug-590041-prefer-non-virtual-packages index 3bd7d436e..4e2a5142c 100755 --- a/test/integration/test-bug-590041-prefer-non-virtual-packages +++ b/test/integration/test-bug-590041-prefer-non-virtual-packages @@ -45,7 +45,7 @@ EOF setupaptarchive -testshowvirtual libc6:i386 +testnopackage libc6:i386 testsuccessequal "$pkglibc6" aptcache show libc6:armel testsuccessequal "$pkglibc6" aptcache show libc6 testsuccessequal "$pkglibdb1" aptcache show libdb1:i386 diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed index a643cd2dc..2c791ca19 100755 --- a/test/integration/test-multiarch-allowed +++ b/test/integration/test-multiarch-allowed @@ -138,10 +138,8 @@ solveableinsinglearch2() { The following packages have unmet dependencies: hatesfoo : Conflicts: foo but 1 is to be installed E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s - testfailureequal "$BADPREFIX -The following packages have unmet dependencies: - hatesfooany : Conflicts: foo:any -E: Unable to correct problems, you have held broken packages." aptget install foo hatesfooany -s + # the message differs slightly between single and multiarch + testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install foo hatesfooany -s testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfoonative : Conflicts: foo but 1 is to be installed @@ -155,6 +153,7 @@ E: Unable to correct problems, you have held broken packages." aptget install fo testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfooany : Conflicts: foo:any + Conflicts: foo:any:i386 E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s testsuccessequal 'Reading package lists... Building dependency tree... -- cgit v1.2.3 From 5465192b9aeb1ccea778950ccf2d1b7b32f2cd91 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 18 Jul 2015 18:03:54 +0200 Subject: add volatile sources support in libapt-pkg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sources are usually defined in sources.list (and co) and are pretty stable, but once in a while a frontend might want to add an additional "source" like a local .deb file to install this package (No support for 'real' sources being added this way as this is a multistep process). We had a hack in place to allow apt-get and apt to pull this of for a short while now, but other frontends are either left in the cold by this and/or the code for it looks dirty with FIXMEs plastering it and has on top of this also some problems (like including these 'volatile' sources in the srcpkgcache.bin file). So the biggest part in this commit is actually the rewrite of the cache generation as it is now potentially a three step process. The biggest problem with adding support now through is that this makes a bunch of previously mostly unusable by externs and therefore hidden classes public, so a bit of further tuneing on this now public API is in order… --- apt-pkg/deb/debindexfile.cc | 27 +- apt-pkg/deb/debindexfile.h | 18 +- apt-pkg/deb/deblistparser.cc | 2 +- apt-pkg/deb/debmetaindex.cc | 29 --- apt-pkg/deb/debmetaindex.h | 39 --- apt-pkg/edsp/edspsystem.cc | 3 +- apt-pkg/pkgcachegen.cc | 401 ++++++++++++++---------------- apt-pkg/pkgcachegen.h | 1 - apt-pkg/pkgsystem.h | 5 +- apt-pkg/sourcelist.cc | 28 ++- apt-pkg/sourcelist.h | 19 ++ apt-private/private-cachefile.h | 21 -- apt-private/private-install.cc | 21 +- test/integration/framework | 12 +- test/integration/test-apt-get-install-deb | 45 +++- 15 files changed, 309 insertions(+), 362 deletions(-) diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 972feba7f..e67233e5f 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -339,18 +339,16 @@ APT_CONST bool debStatusIndex::Exists() const } /*}}}*/ -// debDebPkgFile - Single .deb file /*{{{*/ -debDebPkgFileIndex::debDebPkgFileIndex(std::string DebFile) +// debDebPkgFileIndex - Single .deb file /*{{{*/ +debDebPkgFileIndex::debDebPkgFileIndex(std::string const &DebFile) : pkgIndexFile(true), d(NULL), DebFile(DebFile) { DebFileFullPath = flAbsPath(DebFile); } - std::string debDebPkgFileIndex::ArchiveURI(std::string /*File*/) const { return "file:" + DebFileFullPath; } - bool debDebPkgFileIndex::Exists() const { return FileExists(DebFile); @@ -403,6 +401,8 @@ bool debDebPkgFileIndex::Merge(pkgCacheGenerator& Gen, OpProgress* Prog) const if (GetContent(content, DebFile) == false) return false; std::string const contentstr = content.str(); + if (contentstr.empty()) + return true; DebControl->Write(contentstr.c_str(), contentstr.length()); // rewind for the listparser DebControl->Seek(0); @@ -431,7 +431,7 @@ pkgCache::PkgFileIterator debDebPkgFileIndex::FindInCache(pkgCache &Cache) const return File; } - + return File; } unsigned long debDebPkgFileIndex::Size() const @@ -443,12 +443,11 @@ unsigned long debDebPkgFileIndex::Size() const } /*}}}*/ -// debDscFileIndex stuff -debDscFileIndex::debDscFileIndex(std::string &DscFile) +// debDscFileIndex - a .dsc file /*{{{*/ +debDscFileIndex::debDscFileIndex(std::string const &DscFile) : pkgIndexFile(true), d(NULL), DscFile(DscFile) { } - bool debDscFileIndex::Exists() const { return FileExists(DscFile); @@ -461,8 +460,6 @@ unsigned long debDscFileIndex::Size() const return buf.st_size; return 0; } - -// DscFileIndex::CreateSrcParser - Get a parser for the .dsc file /*{{{*/ pkgSrcRecords::Parser *debDscFileIndex::CreateSrcParser() const { if (!FileExists(DscFile)) @@ -471,18 +468,17 @@ pkgSrcRecords::Parser *debDscFileIndex::CreateSrcParser() const return new debDscRecordParser(DscFile,this); } /*}}}*/ + // Index File types for Debian /*{{{*/ class APT_HIDDEN debIFTypeSrc : public pkgIndexFile::Type { public: - debIFTypeSrc() {Label = "Debian Source Index";}; }; class APT_HIDDEN debIFTypePkg : public pkgIndexFile::Type { public: - - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -496,8 +492,7 @@ class APT_HIDDEN debIFTypeTrans : public debIFTypePkg class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type { public: - - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -506,7 +501,7 @@ class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE { return new debDebFileRecordParser(File.FileName()); }; diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 71ca22e4d..4a818121a 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -27,7 +27,7 @@ class pkgAcquire; class pkgCacheGenerator; -class APT_HIDDEN debStatusIndex : public pkgIndexFile +class debStatusIndex : public pkgIndexFile { void * const d; protected: @@ -51,7 +51,7 @@ class APT_HIDDEN debStatusIndex : public pkgIndexFile virtual ~debStatusIndex(); }; -class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile +class debPackagesIndex : public pkgIndexTargetFile { void * const d; public: @@ -70,7 +70,7 @@ class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile virtual ~debPackagesIndex(); }; -class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile +class debTranslationsIndex : public pkgIndexTargetFile { void * const d; public: @@ -86,7 +86,7 @@ class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile virtual ~debTranslationsIndex(); }; -class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile +class debSourcesIndex : public pkgIndexTargetFile { void * const d; public: @@ -107,7 +107,7 @@ class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile virtual ~debSourcesIndex(); }; -class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile +class debDebPkgFileIndex : public pkgIndexFile { private: void * const d; @@ -141,11 +141,11 @@ class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile // Interface for acquire virtual std::string ArchiveURI(std::string /*File*/) const APT_OVERRIDE; - debDebPkgFileIndex(std::string DebFile); + debDebPkgFileIndex(std::string const &DebFile); virtual ~debDebPkgFileIndex(); }; -class APT_HIDDEN debDscFileIndex : public pkgIndexFile +class debDscFileIndex : public pkgIndexFile { private: void * const d; @@ -160,11 +160,11 @@ class APT_HIDDEN debDscFileIndex : public pkgIndexFile return DscFile; }; - debDscFileIndex(std::string &DscFile); + debDscFileIndex(std::string const &DscFile); virtual ~debDscFileIndex(); }; -class APT_HIDDEN debDebianSourceDirIndex : public debDscFileIndex +class debDebianSourceDirIndex : public debDscFileIndex { public: virtual const Type *GetType() const APT_CONST; diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 1154016a9..b7988d499 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -959,7 +959,7 @@ bool debDebFileParser::UsePackage(pkgCache::PkgIterator &Pkg, bool res = debListParser::UsePackage(Pkg, Ver); // we use the full file path as a provides so that the file is found // by its name - if(NewProvidesAllArch(Ver, DebFile, Ver.VerStr(), 0) == false) + if(NewProvides(Ver, DebFile, Pkg.Cache()->NativeArch(), Ver.VerStr(), 0) == false) return false; return res; } diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 480317db3..123c91648 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -785,34 +785,5 @@ class APT_HIDDEN debSLTypeDebSrc : public debSLTypeDebian /*{{{*/ }; /*}}}*/ -debDebFileMetaIndex::debDebFileMetaIndex(std::string const &DebFile) /*{{{*/ - : metaIndex(DebFile, "local-uri", "deb-dist"), d(NULL), DebFile(DebFile) -{ - DebIndex = new debDebPkgFileIndex(DebFile); - Indexes = new std::vector(); - Indexes->push_back(DebIndex); -} -debDebFileMetaIndex::~debDebFileMetaIndex() {} - /*}}}*/ -class APT_HIDDEN debSLTypeDebFile : public pkgSourceList::Type /*{{{*/ -{ - public: - - bool CreateItem(std::vector &List, std::string const &URI, - std::string const &/*Dist*/, std::string const &/*Section*/, - std::map const &/*Options*/) const APT_OVERRIDE - { - metaIndex *mi = new debDebFileMetaIndex(URI); - List.push_back(mi); - return true; - } - - debSLTypeDebFile() : Type("deb-file", "Debian local deb file") - { - } -}; - /*}}}*/ - APT_HIDDEN debSLTypeDeb _apt_DebType; APT_HIDDEN debSLTypeDebSrc _apt_DebSrcType; -APT_HIDDEN debSLTypeDebFile _apt_DebFileType; diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 8c13237cb..e93959a21 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -17,7 +17,6 @@ class pkgAcquire; class pkgIndexFile; -class debDebPkgFileIndex; class IndexTarget; class pkgCacheGenerator; class OpProgress; @@ -66,42 +65,4 @@ class APT_HIDDEN debReleaseIndex : public metaIndex std::vector Languages); }; -class APT_HIDDEN debDebFileMetaIndex : public metaIndex -{ -private: - void * const d; - std::string DebFile; - debDebPkgFileIndex *DebIndex; -public: - virtual std::string ArchiveURI(std::string const& /*File*/) const APT_OVERRIDE { - return DebFile; - } - virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) APT_OVERRIDE { - return true; - } - virtual std::vector GetIndexTargets() const APT_OVERRIDE { - return std::vector(); - } - virtual std::vector *GetIndexFiles() APT_OVERRIDE { - return Indexes; - } - virtual bool IsTrusted() const APT_OVERRIDE { - return true; - } - virtual bool Load(std::string const &, std::string * const ErrorText) APT_OVERRIDE - { - LoadedSuccessfully = TRI_NO; - if (ErrorText != NULL) - strprintf(*ErrorText, "Unparseable metaindex as it represents the standalone deb file %s", DebFile.c_str()); - return false; - } - virtual metaIndex * UnloadedClone() const APT_OVERRIDE - { - return NULL; - } - debDebFileMetaIndex(std::string const &DebFile); - virtual ~debDebFileMetaIndex(); - -}; - #endif diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc index 4fb34b896..f65fcc0d2 100644 --- a/apt-pkg/edsp/edspsystem.cc +++ b/apt-pkg/edsp/edspsystem.cc @@ -91,8 +91,7 @@ signed edspSystem::Score(Configuration const &Cnf) return -1000; } /*}}}*/ -// System::AddStatusFiles - Register the status files /*{{{*/ -bool edspSystem::AddStatusFiles(std::vector &List) +bool edspSystem::AddStatusFiles(std::vector &List) /*{{{*/ { if (StatusFile == 0) { diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 26a5e60a6..9529f42dc 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -36,6 +36,8 @@ #include #include #include +#include +#include #include #include @@ -1332,10 +1334,10 @@ map_stringitem_t pkgCacheGenerator::StoreString(enum StringType const type, cons /* 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(const string &CacheFile, +static bool CheckValidity(const string &CacheFile, pkgSourceList &List, - FileIterator Start, - FileIterator End, + FileIterator const Start, + FileIterator const End, MMap **OutMap = 0) { bool const Debug = _config->FindB("Debug::pkgCacheGen", false); @@ -1343,7 +1345,7 @@ static bool CheckValidity(const string &CacheFile, if (CacheFile.empty() == true || FileExists(CacheFile) == false) { if (Debug == true) - std::clog << "CacheFile doesn't exist" << std::endl; + std::clog << "CacheFile " << CacheFile << " doesn't exist" << std::endl; return false; } @@ -1361,7 +1363,7 @@ static bool CheckValidity(const string &CacheFile, if (_error->PendingError() == true || Map->Size() == 0) { if (Debug == true) - std::clog << "Errors are pending or Map is empty()" << std::endl; + std::clog << "Errors are pending or Map is empty() for " << CacheFile << std::endl; _error->Discard(); return false; } @@ -1385,10 +1387,9 @@ static bool CheckValidity(const string &CacheFile, if (Debug == true) std::clog << "with ID " << RlsFile->ID << " is valid" << std::endl; - std::vector *Indexes = (*i)->GetIndexFiles(); - for (std::vector::const_iterator j = Indexes->begin(); j != Indexes->end(); ++j) - if ((*j)->HasPackages()) - Files.push_back (*j); + std::vector const * const Indexes = (*i)->GetIndexFiles(); + std::copy_if(Indexes->begin(), Indexes->end(), std::back_inserter(Files), + [](pkgIndexFile const * const I) { return I->HasPackages(); }); } for (unsigned I = 0; I != Cache.HeaderP->ReleaseFileCount; ++I) if (RlsVisited[I] == false) @@ -1398,8 +1399,7 @@ static bool CheckValidity(const string &CacheFile, return false; } - for (; Start != End; ++Start) - Files.push_back(*Start); + std::copy(Start, End, std::back_inserter(Files)); /* Now we check every index file, see if it is in the cache, verify the IMS data and check that it is on the disk too.. */ @@ -1482,16 +1482,41 @@ static map_filesize_t ComputeSize(pkgSourceList const * const List, FileIterator } /*}}}*/ // BuildCache - Merge the list of index files into the cache /*{{{*/ -// --------------------------------------------------------------------- -/* */ static bool BuildCache(pkgCacheGenerator &Gen, - OpProgress *Progress, + OpProgress * const Progress, map_filesize_t &CurrentSize,map_filesize_t TotalSize, pkgSourceList const * const List, - FileIterator Start, FileIterator End) + FileIterator const Start, FileIterator const End) { std::vector Files; bool const HasFileDeps = Gen.HasFileDeps(); + bool mergeFailure = false; + + auto const indexFileMerge = [&](pkgIndexFile * const I) { + if (HasFileDeps) + Files.push_back(I); + + if (I->HasPackages() == false || mergeFailure) + return; + + if (I->Exists() == false) + return; + + if (I->FindInCache(Gen.GetCache()).end() == false) + { + _error->Warning("Duplicate sources.list entry %s", + I->Describe().c_str()); + return; + } + + map_filesize_t const Size = I->Size(); + if (Progress != NULL) + Progress->OverallProgress(CurrentSize, TotalSize, Size, _("Reading package lists")); + CurrentSize += Size; + + if (I->Merge(Gen,Progress) == false) + mergeFailure = true; + }; if (List != NULL) { @@ -1508,63 +1533,20 @@ static bool BuildCache(pkgCacheGenerator &Gen, return false; std::vector *Indexes = (*i)->GetIndexFiles(); - for (std::vector::const_iterator I = Indexes->begin(); I != Indexes->end(); ++I) - { - if (HasFileDeps) - Files.push_back(*I); - - if ((*I)->HasPackages() == false) - continue; - - if ((*I)->Exists() == false) - continue; - - if ((*I)->FindInCache(Gen.GetCache()).end() == false) - { - _error->Warning("Duplicate sources.list entry %s", - (*I)->Describe().c_str()); - continue; - } - - map_filesize_t Size = (*I)->Size(); - if (Progress != NULL) - Progress->OverallProgress(CurrentSize,TotalSize,Size,_("Reading package lists")); - CurrentSize += Size; - - if ((*I)->Merge(Gen,Progress) == false) - return false; - } + if (Indexes != NULL) + std::for_each(Indexes->begin(), Indexes->end(), indexFileMerge); + if (mergeFailure) + return false; } } - Gen.SelectReleaseFile("", ""); - FileIterator I; - for (I = Start; I != End; ++I) + if (Start != End) { - if (HasFileDeps) - Files.push_back(*I); - - if ((*I)->HasPackages() == false) - continue; - - if ((*I)->Exists() == false) - continue; - - if ((*I)->FindInCache(Gen.GetCache()).end() == false) - { - _error->Warning("Duplicate sources.list entry %s", - (*I)->Describe().c_str()); - continue; - } - - map_filesize_t Size = (*I)->Size(); - if (Progress != NULL) - Progress->OverallProgress(CurrentSize,TotalSize,Size,_("Reading package lists")); - CurrentSize += Size; - - if ((*I)->Merge(Gen,Progress) == false) + Gen.SelectReleaseFile("", ""); + std::for_each(Start, End, indexFileMerge); + if (mergeFailure) return false; - } + } if (HasFileDeps == true) { @@ -1582,12 +1564,20 @@ static bool BuildCache(pkgCacheGenerator &Gen, return false; } } - + return true; } /*}}}*/ -// CacheGenerator::CreateDynamicMMap - load an mmap with configuration options /*{{{*/ -DynamicMMap* pkgCacheGenerator::CreateDynamicMMap(FileFd *CacheF, unsigned long Flags) { +// CacheGenerator::MakeStatusCache - Construct the status cache /*{{{*/ +// --------------------------------------------------------------------- +/* This makes sure that the status cache (the cache that has all + index files from the sources list and all local ones) is ready + to be mmaped. If OutMap is not zero then a MMap object representing + the cache will be stored there. This is pretty much mandetory if you + are using AllowMem. AllowMem lets the function be run as non-root + where it builds the cache 'fast' into a memory buffer. */ +static DynamicMMap* CreateDynamicMMap(FileFd * const CacheF, unsigned long Flags) +{ map_filesize_t const MapStart = _config->FindI("APT::Cache-Start", 24*1024*1024); map_filesize_t const MapGrow = _config->FindI("APT::Cache-Grow", 1*1024*1024); map_filesize_t const MapLimit = _config->FindI("APT::Cache-Limit", 0); @@ -1599,15 +1589,42 @@ DynamicMMap* pkgCacheGenerator::CreateDynamicMMap(FileFd *CacheF, unsigned long else return new DynamicMMap(Flags, MapStart, MapGrow, MapLimit); } - /*}}}*/ -// CacheGenerator::MakeStatusCache - Construct the status cache /*{{{*/ -// --------------------------------------------------------------------- -/* This makes sure that the status cache (the cache that has all - index files from the sources list and all local ones) is ready - to be mmaped. If OutMap is not zero then a MMap object representing - the cache will be stored there. This is pretty much mandetory if you - are using AllowMem. AllowMem lets the function be run as non-root - where it builds the cache 'fast' into a memory buffer. */ +static bool writeBackMMapToFile(pkgCacheGenerator * const Gen, DynamicMMap * const Map, + std::string const &FileName) +{ + FileFd SCacheF(FileName, FileFd::WriteAtomic); + if (_error->PendingError() == true) + return false; + + fchmod(SCacheF.Fd(),0644); + + // Write out the main data + if (SCacheF.Write(Map->Data(),Map->Size()) == false) + return _error->Error(_("IO Error saving source cache")); + SCacheF.Sync(); + + // Write out the proper header + Gen->GetCache().HeaderP->Dirty = false; + if (SCacheF.Seek(0) == false || + SCacheF.Write(Map->Data(),sizeof(*Gen->GetCache().HeaderP)) == false) + return _error->Error(_("IO Error saving source cache")); + Gen->GetCache().HeaderP->Dirty = true; + SCacheF.Sync(); + return true; +} +static bool loadBackMMapFromFile(std::unique_ptr &Gen, + SPtr &Map, OpProgress * const Progress, std::string const &FileName) +{ + Map = CreateDynamicMMap(NULL, 0); + FileFd CacheF(FileName, FileFd::ReadOnly); + map_pointer_t const alloc = Map->RawAllocate(CacheF.Size()); + if ((alloc == 0 && _error->PendingError()) + || CacheF.Read((unsigned char *)Map->Data() + alloc, + CacheF.Size()) == false) + return false; + Gen.reset(new pkgCacheGenerator(Map.Get(),Progress)); + return true; +} APT_DEPRECATED bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, MMap **OutMap, bool AllowMem) { return pkgCacheGenerator::MakeStatusCache(List, &Progress, OutMap, AllowMem); } @@ -1617,18 +1634,6 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress bool const Debug = _config->FindB("Debug::pkgCacheGen", false); std::vector Files; - /* - for (std::vector::const_iterator i = List.begin(); - i != List.end(); - ++i) - { - std::vector *Indexes = (*i)->GetIndexFiles(); - for (std::vector::const_iterator j = Indexes->begin(); - j != Indexes->end(); - ++j) - Files.push_back (*j); - } -*/ if (_system->AddStatusFiles(Files) == false) return false; @@ -1649,160 +1654,130 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress CreateDirectory(dir, flNotFile(SrcCacheFile)); } - // Decide if we can write to the cache - bool Writeable = false; - if (CacheFile.empty() == false) - Writeable = access(flNotFile(CacheFile).c_str(),W_OK) == 0; - else - if (SrcCacheFile.empty() == false) - Writeable = access(flNotFile(SrcCacheFile).c_str(),W_OK) == 0; - if (Debug == true) - std::clog << "Do we have write-access to the cache files? " << (Writeable ? "YES" : "NO") << std::endl; - - if (Writeable == false && AllowMem == false && CacheFile.empty() == false) - return _error->Error(_("Unable to write to %s"),flNotFile(CacheFile).c_str()); - if (Progress != NULL) Progress->OverallProgress(0,1,1,_("Reading package lists")); - // Cache is OK, Fin. - if (CheckValidity(CacheFile, List, Files.begin(),Files.end(),OutMap) == true) + bool pkgcache_fine = false; + bool srcpkgcache_fine = false; + bool volatile_fine = List.GetVolatileFiles().empty(); + + if (CheckValidity(CacheFile, List, Files.begin(), Files.end(), volatile_fine ? OutMap : NULL) == true) { - if (Progress != NULL) - Progress->OverallProgress(1,1,1,_("Reading package lists")); if (Debug == true) - std::clog << "pkgcache.bin is valid - no need to build anything" << std::endl; - return true; + std::clog << "pkgcache.bin is valid - no need to build any cache" << std::endl; + pkgcache_fine = true; + srcpkgcache_fine = true; } - else if (Debug == true) - std::clog << "pkgcache.bin is NOT valid" << std::endl; - - /* At this point we know we need to reconstruct the package cache, - begin. */ - SPtr CacheF; - SPtr Map; - if (Writeable == true && CacheFile.empty() == false) + if (pkgcache_fine == false) { - _error->PushToStack(); - unlink(CacheFile.c_str()); - CacheF = new FileFd(CacheFile,FileFd::WriteAtomic); - fchmod(CacheF->Fd(),0644); - Map = CreateDynamicMMap(CacheF, MMap::Public); - if (_error->PendingError() == true) + if (CheckValidity(SrcCacheFile, List, Files.end(), Files.end()) == true) { - delete CacheF.UnGuard(); - delete Map.UnGuard(); if (Debug == true) - std::clog << "Open filebased MMap FAILED" << std::endl; - Writeable = false; - if (AllowMem == false) - { - _error->MergeWithStack(); - return false; - } - _error->RevertToStack(); - } - else - { - _error->MergeWithStack(); - if (Debug == true) - std::clog << "Open filebased MMap" << std::endl; + std::clog << "srcpkgcache.bin is valid - it can be reused" << std::endl; + srcpkgcache_fine = true; } } - if (Writeable == false || CacheFile.empty() == true) + + if (volatile_fine == true && srcpkgcache_fine == true && pkgcache_fine == true) { - // Just build it in memory.. - Map = CreateDynamicMMap(NULL); - if (Debug == true) - std::clog << "Open memory Map (not filebased)" << std::endl; + if (Progress != NULL) + Progress->OverallProgress(1,1,1,_("Reading package lists")); + return true; } - - // Lets try the source cache. - map_filesize_t CurrentSize = 0; - map_filesize_t TotalSize = 0; - if (CheckValidity(SrcCacheFile, List, Files.end(), - Files.end()) == true) + + bool Writeable = false; + if (srcpkgcache_fine == false || pkgcache_fine == false) { + if (CacheFile.empty() == false) + Writeable = access(flNotFile(CacheFile).c_str(),W_OK) == 0; + else if (SrcCacheFile.empty() == false) + Writeable = access(flNotFile(SrcCacheFile).c_str(),W_OK) == 0; + if (Debug == true) - std::clog << "srcpkgcache.bin is valid - populate MMap with it." << std::endl; - // Preload the map with the source cache - FileFd SCacheF(SrcCacheFile,FileFd::ReadOnly); - map_pointer_t const alloc = Map->RawAllocate(SCacheF.Size()); - if ((alloc == 0 && _error->PendingError()) - || SCacheF.Read((unsigned char *)Map->Data() + alloc, - SCacheF.Size()) == false) - return false; + std::clog << "Do we have write-access to the cache files? " << (Writeable ? "YES" : "NO") << std::endl; + + if (Writeable == false && AllowMem == false) + { + if (CacheFile.empty() == false) + return _error->Error(_("Unable to write to %s"),flNotFile(CacheFile).c_str()); + else if (SrcCacheFile.empty() == false) + return _error->Error(_("Unable to write to %s"),flNotFile(SrcCacheFile).c_str()); + else + return _error->Error("Unable to create caches as file usage is disabled, but memory not allowed either!"); + } + } - TotalSize = ComputeSize(NULL, Files.begin(), Files.end()); + // At this point we know we need to construct something, so get storage ready + SPtr Map = CreateDynamicMMap(NULL, 0); + if (Debug == true) + std::clog << "Open memory Map (not filebased)" << std::endl; - // Build the status cache - pkgCacheGenerator Gen(Map.Get(),Progress); - if (_error->PendingError() == true) - return false; - if (BuildCache(Gen, Progress, CurrentSize, TotalSize, NULL, - Files.begin(),Files.end()) == false) + std::unique_ptr Gen{nullptr}; + map_filesize_t CurrentSize = 0; + std::vector VolatileFiles = List.GetVolatileFiles(); + map_filesize_t TotalSize = ComputeSize(NULL, VolatileFiles.begin(), VolatileFiles.end()); + if (srcpkgcache_fine == true && pkgcache_fine == false) + { + if (Debug == true) + std::clog << "srcpkgcache.bin was valid - populate MMap with it" << std::endl; + if (loadBackMMapFromFile(Gen, Map, Progress, SrcCacheFile) == false) return false; + srcpkgcache_fine = true; + TotalSize += ComputeSize(NULL, Files.begin(), Files.end()); } - else + else if (srcpkgcache_fine == false) { if (Debug == true) std::clog << "srcpkgcache.bin is NOT valid - rebuild" << std::endl; - TotalSize = ComputeSize(&List, Files.begin(),Files.end()); - - // Build the source cache - pkgCacheGenerator Gen(Map.Get(),Progress); - if (_error->PendingError() == true) - return false; - if (BuildCache(Gen, Progress, CurrentSize, TotalSize, &List, - Files.end(),Files.end()) == false) + Gen.reset(new pkgCacheGenerator(Map.Get(),Progress)); + + TotalSize += ComputeSize(&List, Files.begin(),Files.end()); + if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, &List, + Files.end(),Files.end()) == false) return false; - - // Write it back + if (Writeable == true && SrcCacheFile.empty() == false) - { - FileFd SCacheF(SrcCacheFile,FileFd::WriteAtomic); - if (_error->PendingError() == true) + if (writeBackMMapToFile(Gen.get(), Map.Get(), SrcCacheFile) == false) return false; - - fchmod(SCacheF.Fd(),0644); - - // Write out the main data - if (SCacheF.Write(Map->Data(),Map->Size()) == false) - return _error->Error(_("IO Error saving source cache")); - SCacheF.Sync(); - - // Write out the proper header - Gen.GetCache().HeaderP->Dirty = false; - if (SCacheF.Seek(0) == false || - SCacheF.Write(Map->Data(),sizeof(*Gen.GetCache().HeaderP)) == false) - return _error->Error(_("IO Error saving source cache")); - Gen.GetCache().HeaderP->Dirty = true; - SCacheF.Sync(); - } - - // Build the status cache - if (BuildCache(Gen, Progress, CurrentSize, TotalSize, NULL, - Files.begin(), Files.end()) == false) + } + + if (pkgcache_fine == false) + { + if (Debug == true) + std::clog << "Building status cache in pkgcache.bin now" << std::endl; + if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL, + Files.begin(), Files.end()) == false) return false; + + if (Writeable == true && CacheFile.empty() == false) + if (writeBackMMapToFile(Gen.get(), Map.Get(), CacheFile) == false) + return false; } + if (Debug == true) - std::clog << "Caches are ready for shipping" << std::endl; + std::clog << "Caches done. Now bring in the volatile files (if any)" << std::endl; - if (_error->PendingError() == true) - return false; - if (OutMap != 0) + if (volatile_fine == false) { - if (CacheF != 0) + if (Gen == nullptr) { - delete Map.UnGuard(); - *OutMap = new MMap(*CacheF,0); + if (Debug == true) + std::clog << "Populate new MMap with cachefile contents" << std::endl; + if (loadBackMMapFromFile(Gen, Map, Progress, CacheFile) == false) + return false; } - else - { - *OutMap = Map.UnGuard(); - } + + Files = List.GetVolatileFiles(); + if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL, + Files.begin(), Files.end()) == false) + return false; } - + + if (OutMap != nullptr) + *OutMap = Map.UnGuard(); + + if (Debug == true) + std::clog << "Everything is ready for shipping" << std::endl; return true; } /*}}}*/ @@ -1817,7 +1792,7 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O if (_system->AddStatusFiles(Files) == false) return false; - SPtr Map = CreateDynamicMMap(NULL); + SPtr Map = CreateDynamicMMap(NULL, 0); map_filesize_t CurrentSize = 0; map_filesize_t TotalSize = 0; diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 0d0fb893f..4b6b91992 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -116,7 +116,6 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ APT_PUBLIC static bool MakeStatusCache(pkgSourceList &List,OpProgress *Progress, MMap **OutMap = 0,bool AllowMem = false); APT_PUBLIC static bool MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap); - APT_PUBLIC static DynamicMMap* CreateDynamicMMap(FileFd *CacheF, unsigned long Flags = 0); void ReMap(void const * const oldMap, void const * const newMap); diff --git a/apt-pkg/pkgsystem.h b/apt-pkg/pkgsystem.h index 5be93d059..5b31457e0 100644 --- a/apt-pkg/pkgsystem.h +++ b/apt-pkg/pkgsystem.h @@ -52,7 +52,7 @@ class Configuration; class pkgIndexFile; class pkgSystem -{ +{ public: // Global list of supported systems @@ -81,7 +81,8 @@ class pkgSystem virtual bool ArchiveSupported(const char *Type) = 0; // Return a list of system index files.. - virtual bool AddStatusFiles(std::vector &List) = 0; + virtual bool AddStatusFiles(std::vector &List) = 0; + virtual bool FindIndex(pkgCache::PkgFileIterator File, pkgIndexFile *&Found) const = 0; diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index eef0ee709..46e51f592 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -274,6 +274,10 @@ pkgSourceList::~pkgSourceList() { for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I) delete *I; + SrcList.clear(); + for (pkgIndexFile * const File : VolatileFiles) + delete File; + VolatileFiles.clear(); } /*}}}*/ // SourceList::ReadMainList - Read the main source list from etc /*{{{*/ @@ -339,7 +343,7 @@ bool pkgSourceList::ReadAppend(string const &File) else return ParseFileOldStyle(File); } - + /*}}}*/ // SourceList::ReadFileOldStyle - Read Traditional style sources.list /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -454,7 +458,15 @@ bool pkgSourceList::FindIndex(pkgCache::PkgFileIterator File, } } } - + for (vector::const_iterator J = VolatileFiles.begin(); + J != VolatileFiles.end(); ++J) + { + if ((*J)->FindInCache(*File.Cache()) == File) + { + Found = (*J); + return true; + } + } return false; } /*}}}*/ @@ -511,4 +523,14 @@ time_t pkgSourceList::GetLastModifiedTime() return mtime_sources; } /*}}}*/ - +std::vector pkgSourceList::GetVolatileFiles() const /*{{{*/ +{ + return VolatileFiles; +} + /*}}}*/ +void pkgSourceList::AddVolatileFile(pkgIndexFile * const File) /*{{{*/ +{ + if (File != NULL) + VolatileFiles.push_back(File); +} + /*}}}*/ diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index d80131438..47a562d18 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -50,6 +50,7 @@ class metaIndex; class pkgSourceList { void * const d; + std::vector VolatileFiles; public: // List of supported source list types @@ -113,6 +114,24 @@ class pkgSourceList // query last-modified time time_t GetLastModifiedTime(); + /** \brief add file for parsing, but not to the cache + * + * pkgIndexFiles origining from pkgSourcesList are included in + * srcpkgcache, the status files added via #AddStatusFiles are + * included in pkgcache, but these files here are not included in + * any cache to have the possibility of having a file included just + * for a single run like a local .deb/.dsc file. + * + * The volatile files do not count as "normal" sourceslist entries, + * can't be iterated over with #begin and #end and can't be + * downloaded, but they can be found via #FindIndex. + * + * @param File is an index file; pointer-ownership is transferred + */ + void AddVolatileFile(pkgIndexFile * const File); + /** @return list of files registered with #AddVolatileFile */ + std::vector GetVolatileFiles() const; + pkgSourceList(); virtual ~pkgSourceList(); }; diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h index ed9342db0..51703b0ad 100644 --- a/apt-private/private-cachefile.h +++ b/apt-private/private-cachefile.h @@ -11,17 +11,6 @@ #include -// FIXME: we need to find a way to export this -class APT_PUBLIC SourceList : public pkgSourceList -{ - public: - // Add custom metaIndex (e.g. local files) - void AddMetaIndex(metaIndex *mi) { - SrcList.push_back(mi); - } - -}; - // class CacheFile - Cover class for some dependency cache functions /*{{{*/ class APT_PUBLIC CacheFile : public pkgCacheFile { @@ -36,16 +25,6 @@ class APT_PUBLIC CacheFile : public pkgCacheFile return false; return true; } - // FIXME: this can go once the "libapt-pkg" pkgSourceList has a way - // to add custom metaIndexes (or custom local files or so) - bool BuildSourceList(OpProgress */*Progress*/ = NULL) { - if (SrcList != NULL) - return true; - SrcList = new SourceList(); - if (SrcList->ReadMainList() == false) - return _error->Error(_("The list of sources could not be read.")); - return true; - } bool Open(bool WithLock = true) { OpTextProgress Prog(*_config); diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 116e01038..074874903 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -647,24 +648,8 @@ bool DoInstall(CommandLine &CmdL) // first check for local pkgs and add them to the cache for (const char **I = CmdL.FileList; *I != 0; I++) { - if(FileExists(*I)) - { - // FIXME: make this more elegant - std::string TypeStr = flExtension(*I) + "-file"; - pkgSourceList::Type *Type = pkgSourceList::Type::GetType(TypeStr.c_str()); - if(Type != 0) - { - std::vector List; - std::map Options; - if(Type->CreateItem(List, *I, "", "", Options)) - { - // we have our own CacheFile that gives us a SourceList - // with superpowerz - SourceList *sources = (SourceList*)Cache.GetSourceList(); - sources->AddMetaIndex(List[0]); - } - } - } + if(FileExists(*I) && flExtension(*I) == "deb") + Cache.GetSourceList()->AddVolatileFile(new debDebPkgFileIndex(*I)); } // then open the cache diff --git a/test/integration/framework b/test/integration/framework index 6ae5003f7..f3cc1eff9 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -99,10 +99,14 @@ msgdone() { } getaptconfig() { if [ -f ./aptconfig.conf ]; then - echo "./aptconfig.conf" + echo "$(readlink -f ./aptconfig.conf)" elif [ -f ../aptconfig.conf ]; then - echo "../aptconfig.conf" - fi + echo "$(readlink -f ../aptconfig.conf)" + elif [ -f ../../aptconfig.conf ]; then + echo "$(readlink -f ../../aptconfig.conf)" + elif [ -f "${TMPWORKINGDIRECTORY}/aptconfig.conf" ]; then + echo "$(readlink -f "${TMPWORKINGDIRECTORY}/aptconfig.conf")" + fi } runapt() { msgdebug "Executing: ${CCMD}$*${CDEBUG} " @@ -141,6 +145,8 @@ gdb() { case "$1" in aptget) CMD="apt-get";; aptcache) CMD="apt-cache";; + aptcdrom) CMD="apt-cdrom";; + aptconfig) CMD="apt-config";; aptmark) CMD="apt-mark";; apthelper) CMD="apt-helper";; aptftparchive) CMD="apt-ftparchive";; diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb index 0f34692fe..991185dea 100755 --- a/test/integration/test-apt-get-install-deb +++ b/test/integration/test-apt-get-install-deb @@ -5,15 +5,21 @@ TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture "i386" +configarchitecture 'amd64' 'i386' # regression test for #754904 testfailureequal 'E: Unable to locate package /dev/null' aptget install -qq /dev/null -# and ensure we fail for invalid debs -cat > foo.deb < foo.rpm < Date: Mon, 20 Jul 2015 10:17:29 +0200 Subject: elimate duplicated code in pkgIndexFile subclasses Trade deduplication of code for a bunch of new virtuals, so it is actually visible how the different indexes behave cleaning up the interface at large in the process. Git-Dch: Ignore --- apt-pkg/contrib/fileutl.cc | 15 +- apt-pkg/contrib/fileutl.h | 5 +- apt-pkg/deb/debindexfile.cc | 416 ++++++++---------------------- apt-pkg/deb/debindexfile.h | 84 +++--- apt-pkg/deb/deblistparser.cc | 7 +- apt-pkg/deb/deblistparser.h | 2 +- apt-pkg/edsp/edspindexfile.cc | 75 +++--- apt-pkg/edsp/edspindexfile.h | 16 +- apt-pkg/edsp/edspsystem.cc | 8 +- apt-pkg/indexfile.cc | 175 ++++++++++++- apt-pkg/indexfile.h | 79 ++++-- apt-pkg/pkgcachegen.cc | 18 +- apt-pkg/pkgcachegen.h | 17 +- cmdline/apt-internal-solver.cc | 1 + test/integration/framework | 2 +- test/integration/test-apt-get-install-deb | 12 +- 16 files changed, 460 insertions(+), 472 deletions(-) diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index f40526b5c..3b2e06431 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -2115,28 +2115,27 @@ std::string GetTempDir() /*{{{*/ return string(tmpdir); } /*}}}*/ -FileFd* GetTempFile(std::string const &Prefix, bool ImmediateUnlink) /*{{{*/ +FileFd* GetTempFile(std::string const &Prefix, bool ImmediateUnlink, FileFd * const TmpFd) /*{{{*/ { char fn[512]; - FileFd *Fd = new FileFd(); + FileFd * const Fd = TmpFd == NULL ? new FileFd() : TmpFd; - std::string tempdir = GetTempDir(); - snprintf(fn, sizeof(fn), "%s/%s.XXXXXX", + std::string const tempdir = GetTempDir(); + snprintf(fn, sizeof(fn), "%s/%s.XXXXXX", tempdir.c_str(), Prefix.c_str()); - int fd = mkstemp(fn); + int const fd = mkstemp(fn); if(ImmediateUnlink) unlink(fn); - if (fd < 0) + if (fd < 0) { _error->Errno("GetTempFile",_("Unable to mkstemp %s"), fn); return NULL; } - if (!Fd->OpenDescriptor(fd, FileFd::WriteOnly, FileFd::None, true)) + if (!Fd->OpenDescriptor(fd, FileFd::ReadWrite, FileFd::None, true)) { _error->Errno("GetTempFile",_("Unable to write to %s"),fn); return NULL; } - return Fd; } /*}}}*/ diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 3a99e3e61..acfd560ab 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -159,8 +159,9 @@ time_t GetModificationTime(std::string const &Path); bool Rename(std::string From, std::string To); std::string GetTempDir(); -FileFd* GetTempFile(std::string const &Prefix = "", - bool ImmediateUnlink = true); +FileFd* GetTempFile(std::string const &Prefix = "", + bool ImmediateUnlink = true, + FileFd * const TmpFd = NULL); /** \brief Ensure the existence of the given Path * diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index e67233e5f..627cd36c5 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -36,27 +36,20 @@ #include #include #include +#include #include /*}}}*/ -using std::string; - -// SourcesIndex::debSourcesIndex - Constructor /*{{{*/ -// --------------------------------------------------------------------- -/* */ +// Sources Index /*{{{*/ debSourcesIndex::debSourcesIndex(IndexTarget const &Target,bool const Trusted) : - pkgIndexTargetFile(Target, Trusted), d(NULL) + pkgDebianIndexTargetFile(Target, Trusted), d(NULL) { } - /*}}}*/ -// SourcesIndex::SourceInfo - Short 1 liner describing a source /*{{{*/ -// --------------------------------------------------------------------- -/* The result looks like: - http://foo/debian/ stable/main src 1.1.1 (dsc) */ -string debSourcesIndex::SourceInfo(pkgSrcRecords::Parser const &Record, +std::string debSourcesIndex::SourceInfo(pkgSrcRecords::Parser const &Record, pkgSrcRecords::File const &File) const { - string Res = Target.Description; + // The result looks like: http://foo/debian/ stable/main src 1.1.1 (dsc) + std::string Res = Target.Description; Res.erase(Target.Description.rfind(' ')); Res += " "; @@ -67,294 +60,111 @@ string debSourcesIndex::SourceInfo(pkgSrcRecords::Parser const &Record, Res += " (" + File.Type + ")"; return Res; } - /*}}}*/ -// SourcesIndex::CreateSrcParser - Get a parser for the source files /*{{{*/ -// --------------------------------------------------------------------- -/* */ pkgSrcRecords::Parser *debSourcesIndex::CreateSrcParser() const { - string const SourcesURI = IndexFileName(); + std::string const SourcesURI = IndexFileName(); if (FileExists(SourcesURI)) return new debSrcRecordParser(SourcesURI, this); return NULL; +} +bool debSourcesIndex::OpenListFile(FileFd &, std::string const &) +{ + return true; +} +pkgCacheListParser * debSourcesIndex::CreateListParser(FileFd &) +{ + return NULL; +} +uint8_t debSourcesIndex::GetIndexFlags() const +{ + return 0; } /*}}}*/ - -// PackagesIndex::debPackagesIndex - Contructor /*{{{*/ -// --------------------------------------------------------------------- -/* */ +// Packages Index /*{{{*/ debPackagesIndex::debPackagesIndex(IndexTarget const &Target, bool const Trusted) : - pkgIndexTargetFile(Target, Trusted), d(NULL) + pkgDebianIndexTargetFile(Target, Trusted), d(NULL) { } - /*}}}*/ -// PackagesIndex::ArchiveInfo - Short version of the archive url /*{{{*/ -// --------------------------------------------------------------------- -/* This is a shorter version that is designed to be < 60 chars or so */ -string debPackagesIndex::ArchiveInfo(pkgCache::VerIterator Ver) const +std::string debPackagesIndex::ArchiveInfo(pkgCache::VerIterator const &Ver) const { - std::string const Dist = Target.Option(IndexTarget::RELEASE); - string Res = Target.Option(IndexTarget::SITE) + " " + Dist; - std::string const Component = Target.Option(IndexTarget::COMPONENT); - if (Component.empty() == false) - Res += "/" + Component; + std::string Res = Target.Description; + Res.erase(Target.Description.rfind(' ')); Res += " "; Res += Ver.ParentPkg().Name(); Res += " "; + std::string const Dist = Target.Option(IndexTarget::RELEASE); if (Dist.empty() == false && Dist[Dist.size() - 1] != '/') Res.append(Ver.Arch()).append(" "); Res += Ver.VerStr(); return Res; } - /*}}}*/ -// PackagesIndex::Merge - Load the index file into a cache /*{{{*/ -// --------------------------------------------------------------------- -/* */ -bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const -{ - string const PackageFile = IndexFileName(); - FileFd Pkg(PackageFile,FileFd::ReadOnly, FileFd::Extension); - debListParser Parser(&Pkg, Target.Option(IndexTarget::ARCHITECTURE)); - - if (_error->PendingError() == true) - return _error->Error("Problem opening %s",PackageFile.c_str()); - if (Prog != NULL) - Prog->SubProgress(0, Target.Description); - - - std::string const URI = Target.Option(IndexTarget::REPO_URI); - std::string Dist = Target.Option(IndexTarget::RELEASE); - if (Dist.empty()) - Dist = "/"; - ::URI Tmp(URI); - if (Gen.SelectFile(PackageFile, *this, Target.Option(IndexTarget::ARCHITECTURE), Target.Option(IndexTarget::COMPONENT)) == false) - return _error->Error("Problem with SelectFile %s",PackageFile.c_str()); - - // Store the IMS information - pkgCache::PkgFileIterator File = Gen.GetCurFile(); - pkgCacheGenerator::Dynamic DynFile(File); - File->Size = Pkg.FileSize(); - File->mtime = Pkg.ModificationTime(); - - if (Gen.MergeList(Parser) == false) - return _error->Error("Problem with MergeList %s",PackageFile.c_str()); - - return true; -} - /*}}}*/ -// PackagesIndex::FindInCache - Find this index /*{{{*/ -// --------------------------------------------------------------------- -/* */ -pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const +uint8_t debPackagesIndex::GetIndexFlags() const { - string const FileName = IndexFileName(); - pkgCache::PkgFileIterator File = Cache.FileBegin(); - for (; File.end() == false; ++File) - { - if (File.FileName() == NULL || FileName != File.FileName()) - continue; - - struct stat St; - if (stat(File.FileName(),&St) != 0) - { - if (_config->FindB("Debug::pkgCacheGen", false)) - std::clog << "PackagesIndex::FindInCache - stat failed on " << File.FileName() << std::endl; - return pkgCache::PkgFileIterator(Cache); - } - if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime) - { - if (_config->FindB("Debug::pkgCacheGen", false)) - std::clog << "PackagesIndex::FindInCache - size (" << St.st_size << " <> " << File->Size - << ") or mtime (" << St.st_mtime << " <> " << File->mtime - << ") doesn't match for " << File.FileName() << std::endl; - return pkgCache::PkgFileIterator(Cache); - } - return File; - } - - return File; + return 0; } /*}}}*/ - -// TranslationsIndex::debTranslationsIndex - Contructor /*{{{*/ +// Translation-* Index /*{{{*/ debTranslationsIndex::debTranslationsIndex(IndexTarget const &Target) : - pkgIndexTargetFile(Target, true), d(NULL) + pkgDebianIndexTargetFile(Target, true), d(NULL) {} - /*}}}*/ -bool debTranslationsIndex::HasPackages() const /*{{{*/ +bool debTranslationsIndex::HasPackages() const { return Exists(); } - /*}}}*/ -// TranslationsIndex::Merge - Load the index file into a cache /*{{{*/ -// --------------------------------------------------------------------- -/* */ -bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const -{ - // Check the translation file, if in use - string const TranslationFile = IndexFileName(); - if (FileExists(TranslationFile)) - { - FileFd Trans(TranslationFile,FileFd::ReadOnly, FileFd::Extension); - debTranslationsParser TransParser(&Trans); - if (_error->PendingError() == true) - return false; - - if (Prog != NULL) - Prog->SubProgress(0, Target.Description); - if (Gen.SelectFile(TranslationFile, *this, "", Target.Option(IndexTarget::COMPONENT), pkgCache::Flag::NotSource | pkgCache::Flag::NoPackages) == false) - return _error->Error("Problem with SelectFile %s",TranslationFile.c_str()); - - // Store the IMS information - pkgCache::PkgFileIterator TransFile = Gen.GetCurFile(); - TransFile->Size = Trans.FileSize(); - TransFile->mtime = Trans.ModificationTime(); - - if (Gen.MergeList(TransParser) == false) - return _error->Error("Problem with MergeList %s",TranslationFile.c_str()); - } - +bool debTranslationsIndex::OpenListFile(FileFd &Pkg, std::string const &FileName) +{ + if (FileExists(FileName)) + return pkgDebianIndexTargetFile::OpenListFile(Pkg, FileName); return true; } - /*}}}*/ -// TranslationsIndex::FindInCache - Find this index /*{{{*/ -// --------------------------------------------------------------------- -/* */ -pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) const +uint8_t debTranslationsIndex::GetIndexFlags() const { - string FileName = IndexFileName(); - - pkgCache::PkgFileIterator File = Cache.FileBegin(); - for (; File.end() == false; ++File) - { - if (FileName != File.FileName()) - continue; - - struct stat St; - if (stat(File.FileName(),&St) != 0) - { - if (_config->FindB("Debug::pkgCacheGen", false)) - std::clog << "TranslationIndex::FindInCache - stat failed on " << File.FileName() << std::endl; - return pkgCache::PkgFileIterator(Cache); - } - if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime) - { - if (_config->FindB("Debug::pkgCacheGen", false)) - std::clog << "TranslationIndex::FindInCache - size (" << St.st_size << " <> " << File->Size - << ") or mtime (" << St.st_mtime << " <> " << File->mtime - << ") doesn't match for " << File.FileName() << std::endl; - return pkgCache::PkgFileIterator(Cache); - } - return File; - } - return File; + return pkgCache::Flag::NotSource | pkgCache::Flag::NoPackages; } - /*}}}*/ - -// StatusIndex::debStatusIndex - Constructor /*{{{*/ -// --------------------------------------------------------------------- -/* */ -debStatusIndex::debStatusIndex(string File) : pkgIndexFile(true), d(NULL), File(File) +std::string debTranslationsIndex::GetArchitecture() const { + return std::string(); } - /*}}}*/ -// StatusIndex::Size - Return the size of the index /*{{{*/ -// --------------------------------------------------------------------- -/* */ -unsigned long debStatusIndex::Size() const +pkgCacheListParser * debTranslationsIndex::CreateListParser(FileFd &Pkg) { - struct stat S; - if (stat(File.c_str(),&S) != 0) - return 0; - return S.st_size; -} - /*}}}*/ -// StatusIndex::Merge - Load the index file into a cache /*{{{*/ -// --------------------------------------------------------------------- -/* */ -bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const -{ - FileFd Pkg(File,FileFd::ReadOnly, FileFd::Extension); - if (_error->PendingError() == true) - return false; - debListParser Parser(&Pkg); - if (_error->PendingError() == true) - return false; - - if (Prog != NULL) - Prog->SubProgress(0,File); - if (Gen.SelectFile(File, *this, "", "now", pkgCache::Flag::NotSource) == false) - return _error->Error("Problem with SelectFile %s",File.c_str()); - - // Store the IMS information - pkgCache::PkgFileIterator CFile = Gen.GetCurFile(); - pkgCacheGenerator::Dynamic DynFile(CFile); - CFile->Size = Pkg.FileSize(); - CFile->mtime = Pkg.ModificationTime(); - - if (Gen.MergeList(Parser) == false) - return _error->Error("Problem with MergeList %s",File.c_str()); - return true; + if (Pkg.IsOpen() == false) + return NULL; + _error->PushToStack(); + pkgCacheListParser * const Parser = new debTranslationsParser(&Pkg); + bool const newError = _error->PendingError(); + _error->MergeWithStack(); + return newError ? NULL : Parser; } /*}}}*/ -// StatusIndex::FindInCache - Find this index /*{{{*/ -// --------------------------------------------------------------------- -/* */ -pkgCache::PkgFileIterator debStatusIndex::FindInCache(pkgCache &Cache) const +// dpkg/status Index /*{{{*/ +debStatusIndex::debStatusIndex(std::string const &File) : pkgDebianIndexRealFile(File, true), d(NULL) { - pkgCache::PkgFileIterator File = Cache.FileBegin(); - for (; File.end() == false; ++File) - { - if (this->File != File.FileName()) - continue; - - struct stat St; - if (stat(File.FileName(),&St) != 0) - { - if (_config->FindB("Debug::pkgCacheGen", false)) - std::clog << "StatusIndex::FindInCache - stat failed on " << File.FileName() << std::endl; - return pkgCache::PkgFileIterator(Cache); - } - if ((unsigned)St.st_size != File->Size || St.st_mtime != File->mtime) - { - if (_config->FindB("Debug::pkgCacheGen", false)) - std::clog << "StatusIndex::FindInCache - size (" << St.st_size << " <> " << File->Size - << ") or mtime (" << St.st_mtime << " <> " << File->mtime - << ") doesn't match for " << File.FileName() << std::endl; - return pkgCache::PkgFileIterator(Cache); - } - return File; - } - return File; } - /*}}}*/ -// StatusIndex::Exists - Check if the index is available /*{{{*/ -// --------------------------------------------------------------------- -/* */ -APT_CONST bool debStatusIndex::Exists() const +std::string debStatusIndex::GetArchitecture() const { - // Abort if the file does not exist. - return true; + return std::string(); } - /*}}}*/ - -// debDebPkgFileIndex - Single .deb file /*{{{*/ -debDebPkgFileIndex::debDebPkgFileIndex(std::string const &DebFile) - : pkgIndexFile(true), d(NULL), DebFile(DebFile) +std::string debStatusIndex::GetComponent() const { - DebFileFullPath = flAbsPath(DebFile); + return "now"; } -std::string debDebPkgFileIndex::ArchiveURI(std::string /*File*/) const +uint8_t debStatusIndex::GetIndexFlags() const { - return "file:" + DebFileFullPath; + return pkgCache::Flag::NotSource; } -bool debDebPkgFileIndex::Exists() const + /*}}}*/ +// DebPkgFile Index - a single .deb file as an index /*{{{*/ +debDebPkgFileIndex::debDebPkgFileIndex(std::string const &DebFile) + : pkgDebianIndexRealFile(DebFile, true), d(NULL), DebFile(DebFile) { - return FileExists(DebFile); } bool debDebPkgFileIndex::GetContent(std::ostream &content, std::string const &debfile) { + struct stat Buf; + if (stat(debfile.c_str(), &Buf) != 0) + return false; + // get the control data out of the deb file via dpkg-deb -I std::string dpkg = _config->Find("Dir::Bin::dpkg","dpkg-deb"); std::vector Args; @@ -381,91 +191,73 @@ bool debDebPkgFileIndex::GetContent(std::ostream &content, std::string const &de ExecWait(Child, "Popen"); content << "Filename: " << debfile << "\n"; - struct stat Buf; - if (stat(debfile.c_str(), &Buf) != 0) - return false; content << "Size: " << Buf.st_size << "\n"; return true; } -bool debDebPkgFileIndex::Merge(pkgCacheGenerator& Gen, OpProgress* Prog) const +bool debDebPkgFileIndex::OpenListFile(FileFd &Pkg, std::string const &FileName) { - if(Prog) - Prog->SubProgress(0, "Reading deb file"); - // write the control data to a tempfile - SPtr DebControl = GetTempFile("deb-file-" + flNotDir(DebFile)); - if(DebControl == NULL) + if (GetTempFile("deb-file-" + flNotDir(FileName), true, &Pkg) == NULL) return false; std::ostringstream content; - if (GetContent(content, DebFile) == false) + if (GetContent(content, FileName) == false) return false; std::string const contentstr = content.str(); if (contentstr.empty()) return true; - DebControl->Write(contentstr.c_str(), contentstr.length()); - // rewind for the listparser - DebControl->Seek(0); - - // and give it to the list parser - debDebFileParser Parser(DebControl, DebFile); - if(Gen.SelectFile(DebFile, *this, "", "now", pkgCache::Flag::LocalSource) == false) - return _error->Error("Problem with SelectFile %s", DebFile.c_str()); - - pkgCache::PkgFileIterator File = Gen.GetCurFile(); - File->Size = DebControl->Size(); - File->mtime = DebControl->ModificationTime(); - - if (Gen.MergeList(Parser) == false) - return _error->Error("Problem with MergeLister for %s", DebFile.c_str()); - + if (Pkg.Write(contentstr.c_str(), contentstr.length()) == false || Pkg.Seek(0) == false) + return false; return true; } +pkgCacheListParser * debDebPkgFileIndex::CreateListParser(FileFd &Pkg) +{ + if (Pkg.IsOpen() == false) + return NULL; + _error->PushToStack(); + pkgCacheListParser * const Parser = new debDebFileParser(&Pkg, DebFile); + bool const newError = _error->PendingError(); + _error->MergeWithStack(); + return newError ? NULL : Parser; +} +uint8_t debDebPkgFileIndex::GetIndexFlags() const +{ + return pkgCache::Flag::LocalSource; +} +std::string debDebPkgFileIndex::GetArchitecture() const +{ + return std::string(); +} +std::string debDebPkgFileIndex::GetComponent() const +{ + return "local-deb"; +} pkgCache::PkgFileIterator debDebPkgFileIndex::FindInCache(pkgCache &Cache) const { + std::string const FileName = IndexFileName(); pkgCache::PkgFileIterator File = Cache.FileBegin(); for (; File.end() == false; ++File) { - if (File.FileName() == NULL || DebFile != File.FileName()) + if (File.FileName() == NULL || FileName != File.FileName()) continue; - - return File; + // we can't do size checks here as file size != content size + return File; } return File; } -unsigned long debDebPkgFileIndex::Size() const -{ - struct stat buf; - if(stat(DebFile.c_str(), &buf) != 0) - return 0; - return buf.st_size; -} - /*}}}*/ -// debDscFileIndex - a .dsc file /*{{{*/ + /*}}}*/ +// DscFile Index - a single .dsc file as an index /*{{{*/ debDscFileIndex::debDscFileIndex(std::string const &DscFile) - : pkgIndexFile(true), d(NULL), DscFile(DscFile) + : pkgDebianIndexRealFile(DscFile, true), d(NULL) { } -bool debDscFileIndex::Exists() const -{ - return FileExists(DscFile); -} - -unsigned long debDscFileIndex::Size() const -{ - struct stat buf; - if(stat(DscFile.c_str(), &buf) == 0) - return buf.st_size; - return 0; -} pkgSrcRecords::Parser *debDscFileIndex::CreateSrcParser() const { - if (!FileExists(DscFile)) + if (Exists() == false) return NULL; - - return new debDscRecordParser(DscFile,this); + return new debDscRecordParser(File, this); } /*}}}*/ @@ -478,7 +270,7 @@ class APT_HIDDEN debIFTypeSrc : public pkgIndexFile::Type class APT_HIDDEN debIFTypePkg : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &File) const APT_OVERRIDE { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -492,7 +284,7 @@ class APT_HIDDEN debIFTypeTrans : public debIFTypePkg class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &File) const APT_OVERRIDE { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -501,7 +293,7 @@ class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &File) const APT_OVERRIDE { return new debDebFileRecordParser(File.FileName()); }; @@ -510,7 +302,7 @@ class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type { public: - virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string DscFile) const APT_OVERRIDE + virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string const &DscFile) const APT_OVERRIDE { return new debDscRecordParser(DscFile, NULL); }; @@ -519,9 +311,9 @@ class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDebianSourceDir : public pkgIndexFile::Type { public: - virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string SourceDir) const APT_OVERRIDE + virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string const &SourceDir) const APT_OVERRIDE { - return new debDscRecordParser(SourceDir + string("/debian/control"), NULL); + return new debDscRecordParser(SourceDir + std::string("/debian/control"), NULL); }; debIFTypeDebianSourceDir() {Label = "Debian control file";}; }; diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 4a818121a..02708b558 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -26,69 +26,73 @@ class OpProgress; class pkgAcquire; class pkgCacheGenerator; - -class debStatusIndex : public pkgIndexFile +class debStatusIndex : public pkgDebianIndexRealFile { void * const d; - protected: - std::string File; +protected: + virtual std::string GetArchitecture() const APT_OVERRIDE; + virtual std::string GetComponent() const APT_OVERRIDE; + virtual uint8_t GetIndexFlags() const APT_OVERRIDE; - public: +public: virtual const Type *GetType() const APT_CONST; - // Interface for acquire - virtual std::string Describe(bool /*Short*/) const APT_OVERRIDE {return File;}; - // Interface for the Cache Generator - virtual bool Exists() const APT_OVERRIDE; virtual bool HasPackages() const APT_OVERRIDE {return true;}; - virtual unsigned long Size() const APT_OVERRIDE; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; + // Abort if the file does not exist. + virtual bool Exists() const APT_OVERRIDE {return true;}; - debStatusIndex(std::string File); + debStatusIndex(std::string const &File); virtual ~debStatusIndex(); }; -class debPackagesIndex : public pkgIndexTargetFile +class debPackagesIndex : public pkgDebianIndexTargetFile { void * const d; - public: +protected: + virtual uint8_t GetIndexFlags() const; +public: virtual const Type *GetType() const APT_CONST; // Stuff for accessing files on remote items - virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const APT_OVERRIDE; + virtual std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const APT_OVERRIDE; // Interface for the Cache Generator virtual bool HasPackages() const APT_OVERRIDE {return true;}; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; debPackagesIndex(IndexTarget const &Target, bool const Trusted); virtual ~debPackagesIndex(); }; -class debTranslationsIndex : public pkgIndexTargetFile +class debTranslationsIndex : public pkgDebianIndexTargetFile { void * const d; - public: +protected: + virtual std::string GetArchitecture() const APT_OVERRIDE; + virtual uint8_t GetIndexFlags() const APT_OVERRIDE; + virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; + APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; + +public: virtual const Type *GetType() const APT_CONST; // Interface for the Cache Generator virtual bool HasPackages() const APT_OVERRIDE; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; debTranslationsIndex(IndexTarget const &Target); virtual ~debTranslationsIndex(); }; -class debSourcesIndex : public pkgIndexTargetFile +class debSourcesIndex : public pkgDebianIndexTargetFile { void * const d; + virtual uint8_t GetIndexFlags() const; + virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; + APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; + public: virtual const Type *GetType() const APT_CONST; @@ -107,19 +111,20 @@ class debSourcesIndex : public pkgIndexTargetFile virtual ~debSourcesIndex(); }; -class debDebPkgFileIndex : public pkgIndexFile +class debDebPkgFileIndex : public pkgDebianIndexRealFile { - private: void * const d; std::string DebFile; - std::string DebFileFullPath; - public: - virtual const Type *GetType() const APT_CONST; +protected: + virtual std::string GetComponent() const APT_OVERRIDE; + virtual std::string GetArchitecture() const APT_OVERRIDE; + virtual uint8_t GetIndexFlags() const APT_OVERRIDE; + virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; + APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; - virtual std::string Describe(bool /*Short*/) const APT_OVERRIDE { - return DebFile; - } +public: + virtual const Type *GetType() const APT_CONST; /** get the control (file) content of the deb file * @@ -130,35 +135,22 @@ class debDebPkgFileIndex : public pkgIndexFile static bool GetContent(std::ostream &content, std::string const &debfile); // Interface for the Cache Generator - virtual bool Exists() const APT_OVERRIDE; - virtual bool HasPackages() const APT_OVERRIDE { - return true; - }; - virtual unsigned long Size() const APT_OVERRIDE; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + virtual bool HasPackages() const APT_OVERRIDE {return true;} virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; // Interface for acquire - virtual std::string ArchiveURI(std::string /*File*/) const APT_OVERRIDE; debDebPkgFileIndex(std::string const &DebFile); virtual ~debDebPkgFileIndex(); }; -class debDscFileIndex : public pkgIndexFile +class debDscFileIndex : public pkgDebianIndexRealFile { - private: void * const d; - std::string DscFile; public: virtual const Type *GetType() const APT_CONST; virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; - virtual bool Exists() const APT_OVERRIDE; virtual bool HasPackages() const APT_OVERRIDE {return false;}; - virtual unsigned long Size() const APT_OVERRIDE; - virtual std::string Describe(bool /*Short*/) const APT_OVERRIDE { - return DscFile; - }; debDscFileIndex(std::string const &DscFile); virtual ~debDscFileIndex(); diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index b7988d499..cb2b15668 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -50,8 +50,9 @@ static debListParser::WordList PrioList[] = { /* Provide an architecture and only this one and "all" will be accepted in Step(), if no Architecture is given we will accept every arch we would accept in general with checkArchitecture() */ -debListParser::debListParser(FileFd *File, string const &Arch) : d(NULL), Tags(File), - Arch(Arch) { +debListParser::debListParser(FileFd *File, string const &Arch) : + pkgCacheListParser(), d(NULL), Tags(File), Arch(Arch) +{ if (Arch == "native") this->Arch = _config->Find("APT::Architecture"); Architectures = APT::Configuration::getArchitectures(); @@ -931,7 +932,7 @@ unsigned char debListParser::GetPrio(string Str) bool debListParser::SameVersion(unsigned short const Hash, /*{{{*/ pkgCache::VerIterator const &Ver) { - if (pkgCacheGenerator::ListParser::SameVersion(Hash, Ver) == false) + if (pkgCacheListParser::SameVersion(Hash, Ver) == false) return false; // status file has no (Download)Size, but all others are fair game // status file is parsed last, so the first version we encounter is diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 30e52718d..975620070 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -26,7 +26,7 @@ class FileFd; -class APT_HIDDEN debListParser : public pkgCacheGenerator::ListParser +class APT_HIDDEN debListParser : public pkgCacheListParser { public: diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index 649d94b5d..a8a528131 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -26,59 +26,66 @@ #include /*}}}*/ -// edspIndex::edspIndex - Constructor /*{{{*/ -// --------------------------------------------------------------------- -/* */ -edspIndex::edspIndex(std::string File) : debStatusIndex(File), d(NULL) +// EDSP Index /*{{{*/ +edspIndex::edspIndex(std::string const &File) : pkgDebianIndexRealFile(File, true), d(NULL) { } - /*}}}*/ -// StatusIndex::Merge - Load the index file into a cache /*{{{*/ -bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const +std::string edspIndex::GetComponent() const { - FileFd Pkg; - if (File != "stdin") - Pkg.Open(File, FileFd::ReadOnly); - else - Pkg.OpenDescriptor(STDIN_FILENO, FileFd::ReadOnly); - if (_error->PendingError() == true) - return false; - edspListParser Parser(&Pkg); - if (_error->PendingError() == true) - return false; - - if (Prog != NULL) - Prog->SubProgress(0,File); - if (Gen.SelectFile(File, *this, "", "edsp") == false) - return _error->Error("Problem with SelectFile %s",File.c_str()); - - // Store the IMS information - pkgCache::PkgFileIterator CFile = Gen.GetCurFile(); - pkgCacheGenerator::Dynamic DynFile(CFile); - CFile->Size = Pkg.FileSize(); - CFile->mtime = Pkg.ModificationTime(); - - if (Gen.MergeList(Parser) == false) - return _error->Error("Problem with MergeList %s",File.c_str()); + return "edsp"; +} +std::string edspIndex::GetArchitecture() const +{ + return std::string(); +} +bool edspIndex::HasPackages() const +{ + return true; +} +bool edspIndex::Exists() const +{ + return true; +} +uint8_t edspIndex::GetIndexFlags() const +{ + return 0; +} +bool edspIndex::OpenListFile(FileFd &Pkg, std::string const &FileName) +{ + if (FileName.empty() == false && FileName != "stdin") + return pkgDebianIndexRealFile::OpenListFile(Pkg, FileName); + if (Pkg.OpenDescriptor(STDIN_FILENO, FileFd::ReadOnly) == false) + return _error->Error("Problem opening %s",FileName.c_str()); return true; +} +pkgCacheListParser * edspIndex::CreateListParser(FileFd &Pkg) +{ + if (Pkg.IsOpen() == false) + return NULL; + _error->PushToStack(); + pkgCacheListParser * const Parser = new edspListParser(&Pkg); + bool const newError = _error->PendingError(); + _error->MergeWithStack(); + return newError ? NULL : Parser; } /*}}}*/ + // Index File types for APT /*{{{*/ class APT_HIDDEN edspIFType: public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator) const APT_OVERRIDE + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &) const APT_OVERRIDE { // we don't have a record parser for this type as the file is not presistent return NULL; }; edspIFType() {Label = "EDSP scenario file";}; }; -APT_HIDDEN edspIFType _apt_Universe; +APT_HIDDEN edspIFType _apt_Edsp; const pkgIndexFile::Type *edspIndex::GetType() const { - return &_apt_Universe; + return &_apt_Edsp; } /*}}}*/ diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h index b2a510f14..edf799023 100644 --- a/apt-pkg/edsp/edspindexfile.h +++ b/apt-pkg/edsp/edspindexfile.h @@ -18,18 +18,24 @@ class OpProgress; class pkgCacheGenerator; -class APT_HIDDEN edspIndex : public debStatusIndex +class APT_HIDDEN edspIndex : public pkgDebianIndexRealFile { /** \brief dpointer placeholder (for later in case we need it) */ void * const d; - public: +protected: + APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; + virtual bool OpenListFile(FileFd &Pkg, std::string const &File) APT_OVERRIDE; + virtual uint8_t GetIndexFlags() const APT_OVERRIDE; + virtual std::string GetComponent() const APT_OVERRIDE; + virtual std::string GetArchitecture() const APT_OVERRIDE; +public: virtual const Type *GetType() const APT_CONST; + virtual bool Exists() const APT_OVERRIDE; + virtual bool HasPackages() const APT_OVERRIDE; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; - - edspIndex(std::string File); + edspIndex(std::string const &File); virtual ~edspIndex(); }; diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc index f65fcc0d2..c4583252f 100644 --- a/apt-pkg/edsp/edspsystem.cc +++ b/apt-pkg/edsp/edspsystem.cc @@ -81,13 +81,9 @@ bool edspSystem::ArchiveSupported(const char * /*Type*/) return false; } /*}}}*/ -// System::Score - Determine if we should use the edsp system /*{{{*/ -signed edspSystem::Score(Configuration const &Cnf) +// System::Score - Never use the EDSP system automatically /*{{{*/ +signed edspSystem::Score(Configuration const &) { - if (Cnf.Find("edsp::scenario", "") == "stdin") - return 1000; - if (RealFileExists(Cnf.FindFile("edsp::scenario","")) == true) - return 1000; return -1000; } /*}}}*/ diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index cce17403d..b592ae5a0 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -16,14 +16,23 @@ #include #include #include +#include #include #include +#include #include +#include + +#include +#include +#include + #include #include #include #include +#include /*}}}*/ // Global list of Item supported @@ -52,13 +61,13 @@ pkgIndexFile::Type *pkgIndexFile::Type::GetType(const char *Type) return 0; } /*}}}*/ -pkgIndexFile::pkgIndexFile(bool Trusted) : /*{{{*/ +pkgIndexFile::pkgIndexFile(bool const Trusted) : /*{{{*/ d(NULL), Trusted(Trusted) { } /*}}}*/ // IndexFile::ArchiveInfo - Stub /*{{{*/ -std::string pkgIndexFile::ArchiveInfo(pkgCache::VerIterator /*Ver*/) const +std::string pkgIndexFile::ArchiveInfo(pkgCache::VerIterator const &/*Ver*/) const { return std::string(); } @@ -89,7 +98,7 @@ bool pkgIndexFile::TranslationsAvailable() { is already done in getLanguages(). Note also that this check is rather bad (doesn't take three character like ast into account). TODO: Remove method with next API break */ -APT_DEPRECATED bool pkgIndexFile::CheckLanguageCode(const char *Lang) +APT_DEPRECATED bool pkgIndexFile::CheckLanguageCode(const char * const Lang) { if (strlen(Lang) == 2 || (strlen(Lang) == 5 && Lang[2] == '_')) return true; @@ -172,24 +181,24 @@ std::string IndexTarget::Format(std::string format) const /*{{{*/ } /*}}}*/ -pkgIndexTargetFile::pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted) :/*{{{*/ - pkgIndexFile(Trusted), d(NULL), Target(Target) +pkgDebianIndexTargetFile::pkgDebianIndexTargetFile(IndexTarget const &Target, bool const Trusted) :/*{{{*/ + pkgDebianIndexFile(Trusted), d(NULL), Target(Target) { } /*}}}*/ -std::string pkgIndexTargetFile::ArchiveURI(std::string File) const/*{{{*/ +std::string pkgDebianIndexTargetFile::ArchiveURI(std::string const &File) const/*{{{*/ { return Target.Option(IndexTarget::REPO_URI) + File; } /*}}}*/ -std::string pkgIndexTargetFile::Describe(bool Short) const /*{{{*/ +std::string pkgDebianIndexTargetFile::Describe(bool const Short) const /*{{{*/ { if (Short) return Target.Description; return Target.Description + " (" + IndexFileName() + ")"; } /*}}}*/ -std::string pkgIndexTargetFile::IndexFileName() const /*{{{*/ +std::string pkgDebianIndexTargetFile::IndexFileName() const /*{{{*/ { std::string const s = Target.Option(IndexTarget::FILENAME); if (FileExists(s)) @@ -205,7 +214,7 @@ std::string pkgIndexTargetFile::IndexFileName() const /*{{{*/ return s; } /*}}}*/ -unsigned long pkgIndexTargetFile::Size() const /*{{{*/ +unsigned long pkgDebianIndexTargetFile::Size() const /*{{{*/ { unsigned long size = 0; @@ -223,11 +232,155 @@ unsigned long pkgIndexTargetFile::Size() const /*{{{*/ return size; } /*}}}*/ -bool pkgIndexTargetFile::Exists() const /*{{{*/ +bool pkgDebianIndexTargetFile::Exists() const /*{{{*/ { return FileExists(IndexFileName()); } /*}}}*/ +std::string pkgDebianIndexTargetFile::GetArchitecture() const /*{{{*/ +{ + return Target.Option(IndexTarget::ARCHITECTURE); +} + /*}}}*/ +std::string pkgDebianIndexTargetFile::GetComponent() const /*{{{*/ +{ + return Target.Option(IndexTarget::COMPONENT); +} + /*}}}*/ +bool pkgDebianIndexTargetFile::OpenListFile(FileFd &Pkg, std::string const &FileName)/*{{{*/ +{ + if (Pkg.Open(FileName, FileFd::ReadOnly, FileFd::Extension) == false) + return _error->Error("Problem opening %s",FileName.c_str()); + return true; +} + /*}}}*/ +std::string pkgDebianIndexTargetFile::GetProgressDescription() const +{ + return Target.Description; +} + +pkgDebianIndexRealFile::pkgDebianIndexRealFile(std::string const &File, bool const Trusted) :/*{{{*/ + pkgDebianIndexFile(Trusted), d(NULL), File(flAbsPath(File)) +{ +} + /*}}}*/ +// IndexRealFile::Size - Return the size of the index /*{{{*/ +unsigned long pkgDebianIndexRealFile::Size() const +{ + struct stat S; + if (stat(File.c_str(),&S) != 0) + return 0; + return S.st_size; +} + /*}}}*/ +bool pkgDebianIndexRealFile::Exists() const /*{{{*/ +{ + return FileExists(File); +} + /*}}}*/ +std::string pkgDebianIndexRealFile::Describe(bool const /*Short*/) const/*{{{*/ +{ + return File; +} + /*}}}*/ +std::string pkgDebianIndexRealFile::ArchiveURI(std::string const &/*File*/) const/*{{{*/ +{ + return "file:" + File; +} + /*}}}*/ +std::string pkgDebianIndexRealFile::IndexFileName() const /*{{{*/ +{ + return File; +} + /*}}}*/ +std::string pkgDebianIndexRealFile::GetProgressDescription() const +{ + return File; +} +bool pkgDebianIndexRealFile::OpenListFile(FileFd &Pkg, std::string const &FileName)/*{{{*/ +{ + if (Pkg.Open(FileName, FileFd::ReadOnly, FileFd::None) == false) + return _error->Error("Problem opening %s",FileName.c_str()); + return true; +} + /*}}}*/ + +pkgDebianIndexFile::pkgDebianIndexFile(bool const Trusted) : pkgIndexFile(Trusted) +{ +} +pkgDebianIndexFile::~pkgDebianIndexFile() +{ +} +pkgCacheListParser * pkgDebianIndexFile::CreateListParser(FileFd &Pkg) +{ + if (Pkg.IsOpen() == false) + return NULL; + _error->PushToStack(); + pkgCacheListParser * const Parser = new debListParser(&Pkg, GetArchitecture()); + bool const newError = _error->PendingError(); + _error->MergeWithStack(); + return newError ? NULL : Parser; +} +bool pkgDebianIndexFile::Merge(pkgCacheGenerator &Gen,OpProgress * const Prog) +{ + std::string const PackageFile = IndexFileName(); + FileFd Pkg; + if (OpenListFile(Pkg, PackageFile) == false) + return false; + _error->PushToStack(); + std::unique_ptr Parser(CreateListParser(Pkg)); + bool const newError = _error->PendingError(); + if (newError == false && Parser == nullptr) + return true; + if (Parser == NULL) + return false; + + if (Prog != NULL) + Prog->SubProgress(0, GetProgressDescription()); + + if (Gen.SelectFile(PackageFile, *this, GetArchitecture(), GetComponent(), GetIndexFlags()) == false) + return _error->Error("Problem with SelectFile %s",PackageFile.c_str()); + + // Store the IMS information + pkgCache::PkgFileIterator File = Gen.GetCurFile(); + pkgCacheGenerator::Dynamic DynFile(File); + File->Size = Pkg.FileSize(); + File->mtime = Pkg.ModificationTime(); + + if (Gen.MergeList(*Parser) == false) + return _error->Error("Problem with MergeList %s",PackageFile.c_str()); + return true; +} +pkgCache::PkgFileIterator pkgDebianIndexFile::FindInCache(pkgCache &Cache) const +{ + std::string const FileName = IndexFileName(); + pkgCache::PkgFileIterator File = Cache.FileBegin(); + for (; File.end() == false; ++File) + { + if (File.FileName() == NULL || FileName != File.FileName()) + continue; + + struct stat St; + if (stat(File.FileName(),&St) != 0) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "DebianIndexFile::FindInCache - stat failed on " << File.FileName() << std::endl; + return pkgCache::PkgFileIterator(Cache); + } + if ((map_filesize_t)St.st_size != File->Size || St.st_mtime != File->mtime) + { + if (_config->FindB("Debug::pkgCacheGen", false)) + std::clog << "DebianIndexFile::FindInCache - size (" << St.st_size << " <> " << File->Size + << ") or mtime (" << St.st_mtime << " <> " << File->mtime + << ") doesn't match for " << File.FileName() << std::endl; + return pkgCache::PkgFileIterator(Cache); + } + return File; + } + + return File; +} APT_CONST pkgIndexFile::~pkgIndexFile() {} -APT_CONST pkgIndexTargetFile::~pkgIndexTargetFile() {} +APT_CONST pkgDebianIndexTargetFile::~pkgDebianIndexTargetFile() {} +APT_CONST pkgDebianIndexRealFile::~pkgDebianIndexRealFile() {} diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 5be7794bf..77e80ed41 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -38,6 +38,7 @@ class pkgAcquire; #endif class pkgCacheGenerator; +class pkgCacheListParser; class OpProgress; class IndexTarget /*{{{*/ @@ -105,12 +106,12 @@ class pkgIndexFile // Global list of Items supported static Type **GlobalList; static unsigned long GlobalListLen; - static Type *GetType(const char *Type) APT_PURE; + static Type *GetType(const char * const Type) APT_PURE; const char *Label; - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator /*File*/) const {return 0;}; - virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string /*File*/) const {return 0;}; + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &/*File*/) const {return 0;}; + virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string const &/*File*/) const {return 0;}; Type(); virtual ~Type() {}; }; @@ -118,13 +119,13 @@ class pkgIndexFile virtual const Type *GetType() const = 0; // Return descriptive strings of various sorts - virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const; + virtual std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const; virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, pkgSrcRecords::File const &File) const; - virtual std::string Describe(bool Short = false) const = 0; + virtual std::string Describe(bool const Short = false) const = 0; // Interface for acquire - virtual std::string ArchiveURI(std::string /*File*/) const {return std::string();}; + virtual std::string ArchiveURI(std::string const &/*File*/) const {return std::string();}; // Interface for the record parsers virtual pkgSrcRecords::Parser *CreateSrcParser() const {return 0;}; @@ -133,40 +134,78 @@ class pkgIndexFile virtual bool Exists() const = 0; virtual bool HasPackages() const = 0; virtual unsigned long Size() const = 0; - virtual bool Merge(pkgCacheGenerator &/*Gen*/, OpProgress* /*Prog*/) const { return false; }; - APT_DEPRECATED virtual bool Merge(pkgCacheGenerator &Gen, OpProgress &Prog) const - { return Merge(Gen, &Prog); }; - virtual bool MergeFileProvides(pkgCacheGenerator &/*Gen*/,OpProgress* /*Prog*/) const {return true;}; - APT_DEPRECATED virtual bool MergeFileProvides(pkgCacheGenerator &Gen, OpProgress &Prog) const - {return MergeFileProvides(Gen, &Prog);}; + virtual bool Merge(pkgCacheGenerator &/*Gen*/, OpProgress* const /*Prog*/) { return true; }; + virtual bool MergeFileProvides(pkgCacheGenerator &/*Gen*/,OpProgress* /*Prog*/) {return true;}; virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; static bool TranslationsAvailable(); - static bool CheckLanguageCode(const char *Lang); + static bool CheckLanguageCode(const char * const Lang); static std::string LanguageCode(); bool IsTrusted() const { return Trusted; }; - explicit pkgIndexFile(bool Trusted); + explicit pkgIndexFile(bool const Trusted); virtual ~pkgIndexFile(); }; -class pkgIndexTargetFile : public pkgIndexFile +class pkgDebianIndexFile : public pkgIndexFile +{ +protected: + virtual std::string IndexFileName() const = 0; + virtual std::string GetComponent() const = 0; + virtual std::string GetArchitecture() const = 0; + virtual std::string GetProgressDescription() const = 0; + virtual uint8_t GetIndexFlags() const = 0; + virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) = 0; + APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg); + +public: + virtual bool Merge(pkgCacheGenerator &Gen, OpProgress* const Prog) APT_OVERRIDE; + virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; + + pkgDebianIndexFile(bool const Trusted); + virtual ~pkgDebianIndexFile(); +}; + +class pkgDebianIndexTargetFile : public pkgDebianIndexFile { void * const d; protected: IndexTarget const Target; - std::string IndexFileName() const; + virtual std::string IndexFileName() const APT_OVERRIDE; + virtual std::string GetComponent() const APT_OVERRIDE; + virtual std::string GetArchitecture() const APT_OVERRIDE; + virtual std::string GetProgressDescription() const APT_OVERRIDE; + virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; + +public: + virtual std::string ArchiveURI(std::string const &File) const APT_OVERRIDE; + virtual std::string Describe(bool const Short = false) const APT_OVERRIDE; + virtual bool Exists() const APT_OVERRIDE; + virtual unsigned long Size() const APT_OVERRIDE; + + pkgDebianIndexTargetFile(IndexTarget const &Target, bool const Trusted); + virtual ~pkgDebianIndexTargetFile(); +}; + +class pkgDebianIndexRealFile : public pkgDebianIndexFile +{ + void * const d; +protected: + std::string File; + virtual std::string IndexFileName() const APT_OVERRIDE; + virtual std::string GetProgressDescription() const APT_OVERRIDE; + virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; public: - virtual std::string ArchiveURI(std::string File) const APT_OVERRIDE; - virtual std::string Describe(bool Short = false) const APT_OVERRIDE; + virtual std::string Describe(bool const /*Short*/ = false) const APT_OVERRIDE; virtual bool Exists() const APT_OVERRIDE; virtual unsigned long Size() const APT_OVERRIDE; + virtual std::string ArchiveURI(std::string const &/*File*/) const APT_OVERRIDE; - pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted); - virtual ~pkgIndexTargetFile(); + pkgDebianIndexRealFile(std::string const &File, bool const Trusted); + virtual ~pkgDebianIndexRealFile(); }; #endif diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 9529f42dc..cf845b0fb 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1051,7 +1051,7 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg, // --------------------------------------------------------------------- /* This creates a Group and the Package to link this dependency to if needed and handles also the caching of the old endpoint */ -bool pkgCacheGenerator::ListParser::NewDepends(pkgCache::VerIterator &Ver, +bool pkgCacheListParser::NewDepends(pkgCache::VerIterator &Ver, const string &PackageName, const string &Arch, const string &Version, @@ -1077,7 +1077,7 @@ bool pkgCacheGenerator::ListParser::NewDepends(pkgCache::VerIterator &Ver, if (idxVersion == 0) { - idxVersion = StoreString(VERSIONNUMBER, Version); + idxVersion = StoreString(pkgCacheGenerator::VERSIONNUMBER, Version); if (unlikely(idxVersion == 0)) return false; } @@ -1124,7 +1124,7 @@ bool pkgCacheGenerator::ListParser::NewDepends(pkgCache::VerIterator &Ver, } /*}}}*/ // ListParser::NewProvides - Create a Provides element /*{{{*/ -bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver, +bool pkgCacheListParser::NewProvides(pkgCache::VerIterator &Ver, const string &PkgName, const string &PkgArch, const string &Version, @@ -1145,7 +1145,7 @@ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver, map_stringitem_t idxProvideVersion = 0; if (Version.empty() == false) { - idxProvideVersion = StoreString(VERSIONNUMBER, Version); + idxProvideVersion = StoreString(pkgCacheGenerator::VERSIONNUMBER, Version); if (unlikely(idxProvideVersion == 0)) return false; } @@ -1178,7 +1178,7 @@ bool pkgCacheGenerator::NewProvides(pkgCache::VerIterator &Ver, } /*}}}*/ // ListParser::NewProvidesAllArch - add provides for all architectures /*{{{*/ -bool pkgCacheGenerator::ListParser::NewProvidesAllArch(pkgCache::VerIterator &Ver, string const &Package, +bool pkgCacheListParser::NewProvidesAllArch(pkgCache::VerIterator &Ver, string const &Package, string const &Version, uint8_t const Flags) { pkgCache &Cache = Owner->Cache; pkgCache::GrpIterator const Grp = Cache.FindGrp(Package); @@ -1188,7 +1188,7 @@ bool pkgCacheGenerator::ListParser::NewProvidesAllArch(pkgCache::VerIterator &Ve { map_stringitem_t idxProvideVersion = 0; if (Version.empty() == false) { - idxProvideVersion = StoreString(VERSIONNUMBER, Version); + idxProvideVersion = StoreString(pkgCacheGenerator::VERSIONNUMBER, Version); if (unlikely(idxProvideVersion == 0)) return false; } @@ -1209,7 +1209,7 @@ bool pkgCacheGenerator::ListParser::NewProvidesAllArch(pkgCache::VerIterator &Ve return true; } /*}}}*/ -bool pkgCacheGenerator::ListParser::SameVersion(unsigned short const Hash,/*{{{*/ +bool pkgCacheListParser::SameVersion(unsigned short const Hash, /*{{{*/ pkgCache::VerIterator const &Ver) { return Hash == Ver->Hash; @@ -1835,5 +1835,5 @@ bool pkgCacheGenerator::FinishCache(OpProgress * /*Progress*/) } /*}}}*/ -pkgCacheGenerator::ListParser::ListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false), d(NULL) {} -pkgCacheGenerator::ListParser::~ListParser() {} +pkgCacheListParser::pkgCacheListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false), d(NULL) {} +pkgCacheListParser::~pkgCacheListParser() {} diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 4b6b91992..15e73627d 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -32,10 +32,10 @@ class FileFd; class pkgSourceList; class OpProgress; class pkgIndexFile; +class pkgCacheListParser; class APT_HIDDEN pkgCacheGenerator /*{{{*/ { - private: APT_HIDDEN map_stringitem_t WriteStringInMap(std::string const &String) { return WriteStringInMap(String.c_str()); }; APT_HIDDEN map_stringitem_t WriteStringInMap(const char *String); APT_HIDDEN map_stringitem_t WriteStringInMap(const char *String, const unsigned long &Len); @@ -46,10 +46,10 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ std::map strPkgNames; std::map strVersions; + friend class pkgCacheListParser; + typedef pkgCacheListParser ListParser; + public: - - class ListParser; - friend class ListParser; template class Dynamic { public: @@ -138,11 +138,12 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ }; /*}}}*/ // This is the abstract package list parser class. /*{{{*/ -class APT_HIDDEN pkgCacheGenerator::ListParser +class APT_HIDDEN pkgCacheListParser { pkgCacheGenerator *Owner; friend class pkgCacheGenerator; - + template using Dynamic = pkgCacheGenerator::Dynamic; + // Some cache items pkgCache::VerIterator OldDepVer; map_pointer_t *OldDepLast; @@ -197,8 +198,8 @@ class APT_HIDDEN pkgCacheGenerator::ListParser virtual bool CollectFileProvides(pkgCache &/*Cache*/, pkgCache::VerIterator &/*Ver*/) {return true;}; - ListParser(); - virtual ~ListParser(); + pkgCacheListParser(); + virtual ~pkgCacheListParser(); }; /*}}}*/ diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index 939061b93..af301dbcd 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -109,6 +109,7 @@ int main(int argc,const char *argv[]) /*{{{*/ if (_config->FindI("quiet", 0) < 1) _config->Set("Debug::EDSP::WriteSolution", true); + _config->Set("APT::System", "Debian APT solver interface"); _config->Set("APT::Solver", "internal"); _config->Set("edsp::scenario", "stdin"); int input = STDIN_FILENO; diff --git a/test/integration/framework b/test/integration/framework index f3cc1eff9..53157e2d0 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1296,7 +1296,7 @@ testdpkgstatus() { local PKGS="$(dpkg -l "$@" 2>/dev/null | grep "^${STATE}" | wc -l)" if [ "$PKGS" != $NR ]; then echo >&2 $PKGS - dpkg -l "$@" | grep '^[a-z]' >&2 + dpkg -l "$@" | grep '^[a-z]' >&2 || true msgfail else msgpass diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb index 991185dea..bd720bede 100755 --- a/test/integration/test-apt-get-install-deb +++ b/test/integration/test-apt-get-install-deb @@ -22,9 +22,9 @@ E: Couldn't find any package by regex './foo.rpm'" aptget install -qq ./foo.rpm mv foo.rpm foo.deb testfailure aptget install ./foo.deb testsuccess grep '^E: Sub-process Popen returned an error code' rootdir/tmp/testfailure.output -testequal 'E: Encountered a section with no Package: header -E: Problem with MergeLister for ./foo.deb -E: The package lists or status file could not be parsed or opened.' tail -n 3 rootdir/tmp/testfailure.output +testequal "E: Encountered a section with no Package: header +E: Problem with MergeList ${TMPWORKINGDIRECTORY}/foo.deb +E: The package lists or status file could not be parsed or opened." tail -n 3 rootdir/tmp/testfailure.output # fakeroot is currently not found, framwork needs updating buildsimplenativepackage 'foo' 'i386,amd64' '1.0' @@ -45,7 +45,7 @@ The following packages have unmet dependencies: E: Unable to correct problems, you have held broken packages." aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s -q=0 testdpkgnotinstalled 'foo' -testsuccess aptget install ./incoming/foo_1.0_i386.deb +testsuccess aptget install ./incoming/foo_1.0_i386.deb -o Debug::pkgCacheGen=1 testdpkginstalled 'foo' testsuccessequal "Reading package lists... @@ -58,5 +58,5 @@ The following NEW packages will be installed: foo 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. Remv foo:i386 [1.0] -Inst foo (1.0 now [amd64]) -Conf foo (1.0 now [amd64])" aptget install ./incoming/foo_1.0_amd64.deb -s -q=0 +Inst foo (1.0 local-deb [amd64]) +Conf foo (1.0 local-deb [amd64])" aptget install ./incoming/foo_1.0_amd64.deb -s -q=0 -- cgit v1.2.3 From 1d3eea5caf65aacd7f112d14030a0499f32b9c75 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 20 Jul 2015 10:33:07 +0200 Subject: eliminate dead file-provides code in cache generation The code was never active in production, it just sits there collecting dust and given that it is never tested probably doesn't even work anymore the way it was supposed to be (whatever that was exactly in the first place). So just remove it before I have to "fix" it again next time. Git-Dch: Ignore --- apt-pkg/indexfile.h | 1 - apt-pkg/pkgcachegen.cc | 91 ++------------------------------------------------ apt-pkg/pkgcachegen.h | 15 ++------- 3 files changed, 4 insertions(+), 103 deletions(-) diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 77e80ed41..844f0cd3b 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -135,7 +135,6 @@ class pkgIndexFile virtual bool HasPackages() const = 0; virtual unsigned long Size() const = 0; virtual bool Merge(pkgCacheGenerator &/*Gen*/, OpProgress* const /*Prog*/) { return true; }; - virtual bool MergeFileProvides(pkgCacheGenerator &/*Gen*/,OpProgress* /*Prog*/) {return true;}; virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; static bool TranslationsAvailable(); diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index cf845b0fb..654f82baa 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -56,7 +56,7 @@ using std::string; /* We set the dirty flag and make sure that is written to the disk */ pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) : Map(*pMap), Cache(pMap,false), Progress(Prog), - CurrentRlsFile(NULL), CurrentFile(NULL), FoundFileDeps(0), d(NULL) + CurrentRlsFile(NULL), CurrentFile(NULL), d(NULL) { if (_error->PendingError() == true) return; @@ -267,10 +267,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List, } if (OutVer != 0) - { - FoundFileDeps |= List.HasFileDeps(); return true; - } } if (Cache.HeaderP->PackageCount >= std::numeric_limits::max()) @@ -286,7 +283,6 @@ bool pkgCacheGenerator::MergeList(ListParser &List, return _error->Error(_("Wow, you exceeded the number of dependencies " "this APT is capable of.")); - FoundFileDeps |= List.HasFileDeps(); return true; } // CacheGenerator::MergeListGroup /*{{{*/ @@ -547,57 +543,6 @@ bool pkgCacheGenerator::AddNewDescription(ListParser &List, pkgCache::VerIterato } /*}}}*/ /*}}}*/ -// CacheGenerator::MergeFileProvides - Merge file provides /*{{{*/ -// --------------------------------------------------------------------- -/* If we found any file depends while parsing the main list we need to - resolve them. Since it is undesired to load the entire list of files - into the cache as virtual packages we do a two stage effort. MergeList - identifies the file depends and this creates Provdies for them by - re-parsing all the indexs. */ -bool pkgCacheGenerator::MergeFileProvides(ListParser &List) -{ - List.Owner = this; - - unsigned int Counter = 0; - while (List.Step() == true) - { - string PackageName = List.Package(); - if (PackageName.empty() == true) - return false; - string Version = List.Version(); - if (Version.empty() == true) - continue; - - pkgCache::PkgIterator Pkg = Cache.FindPkg(PackageName); - Dynamic DynPkg(Pkg); - if (Pkg.end() == true) - return _error->Error(_("Error occurred while processing %s (%s%d)"), - PackageName.c_str(), "FindPkg", 1); - Counter++; - if (Counter % 100 == 0 && Progress != 0) - Progress->Progress(List.Offset()); - - unsigned short Hash = List.VersionHash(); - pkgCache::VerIterator Ver = Pkg.VersionList(); - Dynamic DynVer(Ver); - for (; Ver.end() == false; ++Ver) - { - if (List.SameVersion(Hash, Ver) == true && Version == Ver.VerStr()) - { - if (List.CollectFileProvides(Cache,Ver) == false) - return _error->Error(_("Error occurred while processing %s (%s%d)"), - PackageName.c_str(), "CollectFileProvides", 1); - break; - } - } - - if (Ver.end() == true) - _error->Warning(_("Package %s %s was not found while processing file dependencies"),PackageName.c_str(),Version.c_str()); - } - - return true; -} - /*}}}*/ // CacheGenerator::NewGroup - Add a new group /*{{{*/ // --------------------------------------------------------------------- /* This creates a new group structure and adds it to the hash table */ @@ -1063,10 +1008,6 @@ bool pkgCacheListParser::NewDepends(pkgCache::VerIterator &Ver, if (unlikely(Owner->NewGroup(Grp, PackageName) == false)) return false; - // Is it a file dependency? - if (unlikely(PackageName[0] == '/')) - FoundFileDeps = true; - map_stringitem_t idxVersion = 0; if (Version.empty() == false) { @@ -1489,13 +1430,9 @@ static bool BuildCache(pkgCacheGenerator &Gen, FileIterator const Start, FileIterator const End) { std::vector Files; - bool const HasFileDeps = Gen.HasFileDeps(); bool mergeFailure = false; auto const indexFileMerge = [&](pkgIndexFile * const I) { - if (HasFileDeps) - Files.push_back(I); - if (I->HasPackages() == false || mergeFailure) return; @@ -1547,24 +1484,6 @@ static bool BuildCache(pkgCacheGenerator &Gen, if (mergeFailure) return false; } - - if (HasFileDeps == true) - { - if (Progress != NULL) - Progress->Done(); - TotalSize = ComputeSize(List, Start, End); - CurrentSize = 0; - for (std::vector::const_iterator I = Files.begin(); I != Files.end(); ++I) - { - map_filesize_t Size = (*I)->Size(); - if (Progress != NULL) - Progress->OverallProgress(CurrentSize,TotalSize,Size,_("Collecting File Provides")); - CurrentSize += Size; - if ((*I)->MergeFileProvides(Gen,Progress) == false) - return false; - } - } - return true; } /*}}}*/ @@ -1828,12 +1747,6 @@ static bool IsDuplicateDescription(pkgCache::DescIterator Desc, return false; } /*}}}*/ -// CacheGenerator::FinishCache /*{{{*/ -bool pkgCacheGenerator::FinishCache(OpProgress * /*Progress*/) -{ - return true; -} - /*}}}*/ -pkgCacheListParser::pkgCacheListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false), d(NULL) {} +pkgCacheListParser::pkgCacheListParser() : Owner(NULL), OldDepLast(NULL), d(NULL) {} pkgCacheListParser::~pkgCacheListParser() {} diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 15e73627d..97b91ba9f 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -74,9 +74,6 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ std::string PkgFileName; pkgCache::PackageFile *CurrentFile; - // Flag file dependencies - bool FoundFileDeps; - bool NewGroup(pkgCache::GrpIterator &Grp,const std::string &Name); bool NewPackage(pkgCache::PkgIterator &Pkg,const std::string &Name, const std::string &Arch); bool NewFileVer(pkgCache::VerIterator &Ver,ListParser &List); @@ -104,15 +101,11 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ bool SelectReleaseFile(const std::string &File, const std::string &Site, unsigned long Flags = 0); bool MergeList(ListParser &List,pkgCache::VerIterator *Ver = 0); inline pkgCache &GetCache() {return Cache;}; - inline pkgCache::PkgFileIterator GetCurFile() + inline pkgCache::PkgFileIterator GetCurFile() {return pkgCache::PkgFileIterator(Cache,CurrentFile);}; - inline pkgCache::RlsFileIterator GetCurRlsFile() + inline pkgCache::RlsFileIterator GetCurRlsFile() {return pkgCache::RlsFileIterator(Cache,CurrentRlsFile);}; - bool HasFileDeps() {return FoundFileDeps;}; - bool MergeFileProvides(ListParser &List); - bool FinishCache(OpProgress *Progress) APT_DEPRECATED APT_CONST; - APT_PUBLIC static bool MakeStatusCache(pkgSourceList &List,OpProgress *Progress, MMap **OutMap = 0,bool AllowMem = false); APT_PUBLIC static bool MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap); @@ -148,9 +141,6 @@ class APT_HIDDEN pkgCacheListParser pkgCache::VerIterator OldDepVer; map_pointer_t *OldDepLast; - // Flag file dependencies - bool FoundFileDeps; - void * const d; protected: @@ -194,7 +184,6 @@ class APT_HIDDEN pkgCacheListParser virtual bool Step() = 0; - inline bool HasFileDeps() {return FoundFileDeps;}; virtual bool CollectFileProvides(pkgCache &/*Cache*/, pkgCache::VerIterator &/*Ver*/) {return true;}; -- cgit v1.2.3 From 7f8c0eed6983db7b8959f1498fc8bc80c98d719e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 20 Jul 2015 12:32:46 +0200 Subject: parse packages from all architectures into the cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we can dynamically create dependencies and provides as needed rather than requiring to know with which architectures we will deal before running we can allow the listparser to parse all records rather than skipping records of "unknown" architectures. This can e.g. happen if a user has foreign architecture packages in his status file without dpkg knowing about this architecture (or apt configured in this way). A sideeffect is that now arch:all packages are (correctly) recorded as available from any Packages file, not just from the native one – which has its downsides for the resolver as mixed-arch source packages can appear in different architectures at different times, but that is the problem of the resolver and dealing with it in the parser is at best a hack (and also depends on a helpful repository). Another sideeffect is that his allows :none packages to appear in Packages files again as we don't do any kind of checks now, but given that they aren't really supported (anymore) by anyone we can live with that. --- apt-pkg/deb/deblistparser.cc | 39 +--------- apt-pkg/deb/deblistparser.h | 9 +-- apt-pkg/edsp/edsplistparser.cc | 2 +- apt-pkg/edsp/edsplistparser.h | 2 +- apt-pkg/indexfile.cc | 2 +- apt-pkg/pkgcache.cc | 87 +++++++++------------ test/integration/test-apt-cache | 3 +- .../test-bug-612958-use-dpkg-multiarch-config | 19 ++--- .../test-bug-686346-package-missing-architecture | 8 -- test/integration/test-parse-all-archs-into-cache | 91 ++++++++++++++++++++++ .../test-specific-architecture-dependencies | 6 +- 11 files changed, 152 insertions(+), 116 deletions(-) create mode 100755 test/integration/test-parse-all-archs-into-cache diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index cb2b15668..c7c4ffe77 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -50,13 +50,9 @@ static debListParser::WordList PrioList[] = { /* Provide an architecture and only this one and "all" will be accepted in Step(), if no Architecture is given we will accept every arch we would accept in general with checkArchitecture() */ -debListParser::debListParser(FileFd *File, string const &Arch) : - pkgCacheListParser(), d(NULL), Tags(File), Arch(Arch) +debListParser::debListParser(FileFd *File) : + pkgCacheListParser(), d(NULL), Tags(File) { - if (Arch == "native") - this->Arch = _config->Find("APT::Architecture"); - Architectures = APT::Configuration::getArchitectures(); - MultiArchEnabled = Architectures.size() > 1; } /*}}}*/ // ListParser::Package - Return the package name /*{{{*/ @@ -887,34 +883,7 @@ bool debListParser::GrabWord(string Word,WordList *List,unsigned char &Out) bool debListParser::Step() { iOffset = Tags.Offset(); - while (Tags.Step(Section) == true) - { - /* See if this is the correct Architecture, if it isn't then we - drop the whole section. A missing arch tag only happens (in theory) - inside the Status file, so that is a positive return */ - string const Architecture = Section.FindS("Architecture"); - - if (Arch.empty() == true || Arch == "any" || MultiArchEnabled == false) - { - if (APT::Configuration::checkArchitecture(Architecture) == true) - return true; - /* parse version stanzas without an architecture only in the status file - (and as misfortune bycatch flat-archives) */ - if ((Arch.empty() == true || Arch == "any") && Architecture.empty() == true) - return true; - } - else - { - if (Architecture == Arch) - return true; - - if (Architecture == "all" && Arch == _config->Find("APT::Architecture")) - return true; - } - - iOffset = Tags.Offset(); - } - return false; + return Tags.Step(Section); } /*}}}*/ // ListParser::GetPrio - Convert the priority from a string /*{{{*/ @@ -950,7 +919,7 @@ bool debListParser::SameVersion(unsigned short const Hash, /*{{{*/ /*}}}*/ debDebFileParser::debDebFileParser(FileFd *File, std::string const &DebFile) - : debListParser(File, ""), DebFile(DebFile) + : debListParser(File), DebFile(DebFile) { } diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 975620070..747e022d8 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -45,9 +45,6 @@ class APT_HIDDEN debListParser : public pkgCacheListParser pkgTagFile Tags; pkgTagSection Section; map_filesize_t iOffset; - std::string Arch; - std::vector Architectures; - bool MultiArchEnabled; virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver); bool ParseDepends(pkgCache::VerIterator &Ver,const char *Tag, @@ -96,7 +93,7 @@ class APT_HIDDEN debListParser : public pkgCacheListParser APT_PUBLIC static const char *ConvertRelation(const char *I,unsigned int &Op); - debListParser(FileFd *File, std::string const &Arch = ""); + debListParser(FileFd *File); virtual ~debListParser(); }; @@ -118,8 +115,8 @@ class APT_HIDDEN debTranslationsParser : public debListParser virtual std::string Architecture() APT_OVERRIDE { return ""; } virtual std::string Version() APT_OVERRIDE { return ""; } - debTranslationsParser(FileFd *File, std::string const &Arch = "") - : debListParser(File, Arch) {}; + debTranslationsParser(FileFd *File) + : debListParser(File) {}; }; #endif diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index 63f006628..a54a46b1e 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -22,7 +22,7 @@ /*}}}*/ // ListParser::edspListParser - Constructor /*{{{*/ -edspListParser::edspListParser(FileFd *File, std::string const &Arch) : debListParser(File, Arch), d(NULL) +edspListParser::edspListParser(FileFd *File) : debListParser(File), d(NULL) {} /*}}}*/ // ListParser::NewVersion - Fill in the version structure /*{{{*/ diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index 2a09e8c47..221229302 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -38,7 +38,7 @@ class APT_HIDDEN edspListParser : public debListParser bool LoadReleaseInfo(pkgCache::RlsFileIterator &FileI,FileFd &File, std::string const §ion); - edspListParser(FileFd *File, std::string const &Arch = ""); + edspListParser(FileFd *File); virtual ~edspListParser(); protected: diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index b592ae5a0..06312c173 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -316,7 +316,7 @@ pkgCacheListParser * pkgDebianIndexFile::CreateListParser(FileFd &Pkg) if (Pkg.IsOpen() == false) return NULL; _error->PushToStack(); - pkgCacheListParser * const Parser = new debListParser(&Pkg, GetArchitecture()); + pkgCacheListParser * const Parser = new debListParser(&Pkg); bool const newError = _error->PendingError(); _error->MergeWithStack(); return newError ? NULL : Parser; diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index e8c95738e..045d7b41e 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include @@ -866,10 +868,32 @@ pkgCache::VerFileIterator pkgCache::VerIterator::NewestFile() const // --------------------------------------------------------------------- /* This describes the version from a release-centric manner. The output is a list of Label:Version/Archive */ +static std::string PkgFileIteratorToRelString(pkgCache::PkgFileIterator const &File) +{ + std::string Res; + if (File.Label() != 0) + Res = Res + File.Label() + ':'; + + if (File.Archive() != 0) + { + if (File.Version() == 0) + Res += File.Archive(); + else + Res = Res + File.Version() + '/' + File.Archive(); + } + else + { + // No release file, print the host name that this came from + if (File.Site() == 0 || File.Site()[0] == 0) + Res += "localhost"; + else + Res += File.Site(); + } + return Res; +} string pkgCache::VerIterator::RelStr() const { - bool First = true; - string Res; + std::vector RelStrs; for (pkgCache::VerFileIterator I = this->FileList(); I.end() == false; ++I) { // Do not print 'not source' entries' @@ -877,58 +901,21 @@ string pkgCache::VerIterator::RelStr() const if (File.Flagged(pkgCache::Flag::NotSource)) continue; - // See if we have already printed this out.. - bool Seen = false; - for (pkgCache::VerFileIterator J = this->FileList(); I != J; ++J) - { - pkgCache::PkgFileIterator const File2 = J.File(); - if (File2.Label() == 0 || File.Label() == 0) - continue; - - if (strcmp(File.Label(),File2.Label()) != 0) - continue; - - if (File2.Version() == File.Version()) - { - Seen = true; - break; - } - if (File2.Version() == 0 || File.Version() == 0) - break; - if (strcmp(File.Version(),File2.Version()) == 0) - Seen = true; - } - - if (Seen == true) + std::string const RS = PkgFileIteratorToRelString(File); + if (std::find(RelStrs.begin(), RelStrs.end(), RS) != RelStrs.end()) continue; - - if (First == false) - Res += ", "; - else - First = false; - - if (File.Label() != 0) - Res = Res + File.Label() + ':'; - if (File.Archive() != 0) - { - if (File.Version() == 0) - Res += File.Archive(); - else - Res = Res + File.Version() + '/' + File.Archive(); - } - else - { - // No release file, print the host name that this came from - if (File.Site() == 0 || File.Site()[0] == 0) - Res += "localhost"; - else - Res += File.Site(); - } + RelStrs.push_back(RS); + } + std::ostringstream os; + if (likely(RelStrs.empty() == false)) + { + std::copy(RelStrs.begin(), RelStrs.end()-1, std::ostream_iterator(os, ", ")); + os << *RelStrs.rbegin(); } if (S->ParentPkg != 0) - Res.append(" [").append(Arch()).append("]"); - return Res; + os << " [" << Arch() << "]"; + return os.str(); } /*}}}*/ // VerIterator::MultiArchType - string representing MultiArch flag /*{{{*/ diff --git a/test/integration/test-apt-cache b/test/integration/test-apt-cache index 1d90eed5c..97d180a74 100755 --- a/test/integration/test-apt-cache +++ b/test/integration/test-apt-cache @@ -54,7 +54,8 @@ testsuccessequal 'bar' aptcache pkgnames bar testsuccessequal 'fancy foo' aptcache pkgnames f -testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages" aptcache madison foo +testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main amd64 Packages + foo | 1 | file:$(readlink -f .)/aptarchive unstable/main i386 Packages" aptcache madison foo ### depends diff --git a/test/integration/test-bug-612958-use-dpkg-multiarch-config b/test/integration/test-bug-612958-use-dpkg-multiarch-config index 7bf5781e8..9556a5aef 100755 --- a/test/integration/test-bug-612958-use-dpkg-multiarch-config +++ b/test/integration/test-bug-612958-use-dpkg-multiarch-config @@ -5,22 +5,19 @@ TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture 'i386' -setupaptarchive - -insertinstalledpackage 'libapt' 'i386' '1.0' -insertinstalledpackage 'libapt' 'amd64' '1.0' -insertinstalledpackage 'libapt' 'armel' '1.0' testpass() { - rm rootdir/var/cache/apt/*.bin - msgtest 'Test architecture handling' "$1 with $2" - testsuccess --nomsg aptcache show libapt:$2 + msgtest 'Test architecture handling success' "$1 with $2" + rm -f archs.conf + aptconfig dump --no-empty --format='%V%n' APT::Architectures > archs.conf + testsuccess --nomsg grep "^$2\$" archs.conf } testfail() { - rm rootdir/var/cache/apt/*.bin - msgtest 'Test architecture handling' "$1 with $2" - testfailure --nomsg aptcache show libapt:$2 + msgtest 'Test architecture handling failure' "$1 with $2" + rm -f archs.conf + aptconfig dump --no-empty --format='%V%n' APT::Architectures > archs.conf + testfailure --nomsg grep "^$2\$" archs.conf } testpass 'no config' 'i386' diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture index d51bbabfe..dae0fa81d 100755 --- a/test/integration/test-bug-686346-package-missing-architecture +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -11,7 +11,6 @@ insertinstalledpackage 'pkgd' 'none' '1' insertpackage 'unstable' 'pkga' 'amd64' '2' 'Depends: pkgb' insertpackage 'unstable' 'pkgb' 'amd64' '2' insertpackage 'unstable' 'pkgc' 'amd64' '1' 'Conflicts: pkgb' -insertpackage 'unstable' 'pkge' 'none' '1' setupaptarchive @@ -41,13 +40,6 @@ Inst pkga (2 unstable [amd64]) Conf pkgb (2 unstable [amd64]) Conf pkga (2 unstable [amd64])' aptget install pkga -s -# ensure that arch-less stanzas from Packages files are ignored -msgtest 'Package is distributed in the Packages files' 'pkge' -grep -q 'Package: pkge' $(find aptarchive -name 'Packages') && msgpass || msgfail -testnopackage pkge -testnopackage pkge:none -testnopackage pkge:* - # do not automatically change from none-arch to whatever-arch as # this breaks other none packages and dpkg has this ruleset as # this difference seems so important that it has to be maintained … diff --git a/test/integration/test-parse-all-archs-into-cache b/test/integration/test-parse-all-archs-into-cache new file mode 100755 index 000000000..f61862912 --- /dev/null +++ b/test/integration/test-parse-all-archs-into-cache @@ -0,0 +1,91 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +insertpackage 'unstable' 'bar' 'i386' '1' 'Depends: foo' +insertpackage 'unstable' 'foo' 'i386' '1' 'Multi-Arch: foreign +Depends: libfoo1' +insertpackage 'unstable' 'libfoo1' 'i386' '1' 'Multi-Arch: same' +insertpackage 'experimental' 'foo' 'i386' '2' 'Multi-Arch: foreign +Depends: libfoo1 (>= 2)' +insertpackage 'experimental' 'libfoo1' 'i386' '2' 'Multi-Arch: same' + +# note: the system has amd64 not configured! +insertinstalledpackage 'foo' 'amd64' '1' 'Multi-Arch: foreign +Depends: libfoo1' + +setupaptarchive + +testfailureequal "Reading package lists... +Building dependency tree... +You might want to run 'apt-get -f install' to correct these. +The following packages have unmet dependencies: + foo:amd64 : Depends: libfoo1:amd64 but it is not installable +E: Unmet dependencies. Try using -f." aptget check -s + +insertinstalledpackage 'libfoo1' 'amd64' '1' 'Multi-Arch: same' + +testsuccessequal 'Reading package lists... +Building dependency tree...' aptget check -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + libfoo1 +The following packages will be REMOVED: + foo:amd64 +The following NEW packages will be installed: + foo libfoo1 +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv foo:amd64 [1] +Inst libfoo1 (1 unstable [i386]) +Inst foo (1 unstable [i386]) +Conf libfoo1 (1 unstable [i386]) +Conf foo (1 unstable [i386])' aptget install foo -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + libfoo1 +The following packages will be REMOVED: + foo:amd64 libfoo1:amd64 +The following NEW packages will be installed: + foo libfoo1 +0 upgraded, 2 newly installed, 2 to remove and 0 not upgraded. +Remv foo:amd64 [1] +Remv libfoo1:amd64 [1] +Inst libfoo1 (2 experimental [i386]) +Inst foo (2 experimental [i386]) +Conf libfoo1 (2 experimental [i386]) +Conf foo (2 experimental [i386])' aptget install foo/experimental -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo libfoo1 +The following packages will be REMOVED: + foo:amd64 +The following NEW packages will be installed: + bar foo libfoo1 +0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +Remv foo:amd64 [1] +Inst libfoo1 (1 unstable [i386]) +Inst foo (1 unstable [i386]) +Inst bar (1 unstable [i386]) +Conf libfoo1 (1 unstable [i386]) +Conf foo (1 unstable [i386]) +Conf bar (1 unstable [i386])' aptget install bar -s + +configarchitecture 'i386' 'amd64' + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + bar +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1 unstable [i386]) +Conf bar (1 unstable [i386])' aptget install bar -s diff --git a/test/integration/test-specific-architecture-dependencies b/test/integration/test-specific-architecture-dependencies index 1c72d7b22..e3dfd0c2a 100755 --- a/test/integration/test-specific-architecture-dependencies +++ b/test/integration/test-specific-architecture-dependencies @@ -289,12 +289,14 @@ The following NEW packages will be installed: Inst foo-native-depender (1 unstable [amd64]) Conf foo-native-depender (1 unstable [amd64])' aptget install foo-native-depender -s -# libold:i386 is installed, but we don't see it as i386 isn't configured testequal 'Reading package lists... Building dependency tree... +The following packages will be REMOVED: + libold:i386 The following NEW packages will be installed: breaker-x32 -0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv libold:i386 [1] Inst breaker-x32 (1 unstable [amd64]) Conf breaker-x32 (1 unstable [amd64])' aptget install breaker-x32:amd64 -s -- cgit v1.2.3 From cc480836c739e36dc0c741fa333248c0a8150ec7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 20 Jul 2015 13:34:25 +0200 Subject: drop obsolete explicit :none handling in pkgCacheGen We archieve the same without the special handling now, so drop this code. Makes supporting this abdomination a little longer bearable as well. Git-Dch: Ignore --- apt-pkg/deb/deblistparser.cc | 3 ++- apt-pkg/pkgcachegen.cc | 50 -------------------------------------------- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index c7c4ffe77..a908057d7 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -69,7 +69,8 @@ string debListParser::Package() { // --------------------------------------------------------------------- /* This will return the Architecture of the package this section describes */ string debListParser::Architecture() { - return Section.FindS("Architecture"); + std::string const Arch = Section.FindS("Architecture"); + return Arch.empty() ? "none" : Arch; } /*}}}*/ // ListParser::ArchitectureAll /*{{{*/ diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 654f82baa..07a21d27f 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -229,22 +229,6 @@ bool pkgCacheGenerator::MergeList(ListParser &List, continue; } - if (Arch.empty() == true) - { - // use the pseudo arch 'none' for arch-less packages - Arch = "none"; - /* We might built a SingleArchCache here, which we don't want to blow up - just for these :none packages to a proper MultiArchCache, so just ensure - that we have always a native package structure first for SingleArch */ - pkgCache::PkgIterator NP; - Dynamic DynPkg(NP); - if (NewPackage(NP, PackageName, _config->Find("APT::Architecture")) == false) - // TRANSLATOR: The first placeholder is a package name, - // the other two should be copied verbatim as they include debug info - return _error->Error(_("Error occurred while processing %s (%s%d)"), - PackageName.c_str(), "NewPackage", 0); - } - // Get a pointer to the package structure pkgCache::PkgIterator Pkg; Dynamic DynPkg(Pkg); @@ -440,40 +424,6 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator return _error->Error(_("Error occurred while processing %s (%s%d)"), Pkg.Name(), "AddImplicitDepends", 1); } - /* :none packages are packages without an architecture. They are forbidden by - debian-policy, so usually they will only be in (old) dpkg status files - - and dpkg will complain about them - and are pretty rare. We therefore do - usually not create conflicts while the parent is created, but only if a :none - package (= the target) appears. This creates incorrect dependencies on :none - for architecture-specific dependencies on the package we copy from, but we - will ignore this bug as architecture-specific dependencies are only allowed - in jessie and until then the :none packages should be extinct (hopefully). - In other words: This should work long enough to allow graceful removal of - these packages, it is not supposed to allow users to keep using them … */ - if (strcmp(Pkg.Arch(), "none") == 0) - { - pkgCache::PkgIterator M = Grp.FindPreferredPkg(); - if (M.end() == false && Pkg != M) - { - pkgCache::DepIterator D = M.RevDependsList(); - Dynamic DynD(D); - for (; D.end() == false; ++D) - { - if ((D->Type != pkgCache::Dep::Conflicts && - D->Type != pkgCache::Dep::DpkgBreaks && - D->Type != pkgCache::Dep::Replaces) || - D.ParentPkg().Group() == Grp) - continue; - - map_pointer_t *OldDepLast = NULL; - pkgCache::VerIterator ConVersion = D.ParentVer(); - Dynamic DynV(ConVersion); - // duplicate the Conflicts/Breaks/Replaces for :none arch - NewDepends(Pkg, ConVersion, D->Version, - D->CompareOp, D->Type, OldDepLast); - } - } - } } if (unlikely(AddImplicitDepends(Grp, Pkg, Ver) == false)) return _error->Error(_("Error occurred while processing %s (%s%d)"), -- cgit v1.2.3 From dd676dc71e31c20f66d5b9d9ac1c5a4c8883cd79 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Aug 2015 17:40:57 +0200 Subject: enhance "hit paywall" error message to mention the probable cause MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reporting errors from Done() is bad for progress reporting and such, so factoring this out is a good idea and we start with moving the supposed- to-be clearsigned file isn't clearsigned out first – improving the error message in the process as we use the same message for a similar case (NODATA) as this is what I have to look at with the venue wifi at DebCamp and the old errormessage doesn't really say anything. --- apt-pkg/acquire-item.cc | 90 +++++++++++----------- apt-pkg/acquire-item.h | 23 ++++++ apt-pkg/acquire-worker.cc | 9 ++- test/integration/test-apt-update-nofallback | 5 +- .../test-ubuntu-bug-346386-apt-get-update-paywall | 11 +-- ...st-ubuntu-bug-784473-InRelease-one-message-only | 5 +- 6 files changed, 83 insertions(+), 60 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 8a566fea0..0a7e0e11f 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -514,6 +514,23 @@ void pkgAcquire::Item::Start(string const &/*Message*/, unsigned long long const FileSize = Size; } /*}}}*/ +// Acquire::Item::VerifyDone - check if Item was downloaded OK /*{{{*/ +/* Note that hash-verification is 'hardcoded' in acquire-worker and has + * already passed if this method is called. */ +bool pkgAcquire::Item::VerifyDone(std::string const &Message, + pkgAcquire::MethodConfig const * const /*Cnf*/) +{ + std::string const FileName = LookupTag(Message,"Filename"); + if (FileName.empty() == true) + { + Status = StatError; + ErrorText = "Method gave a blank filename"; + return false; + } + + return true; +} + /*}}}*/ // Acquire::Item::Done - Item downloaded OK /*{{{*/ void pkgAcquire::Item::Done(string const &/*Message*/, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const /*Cnf*/) @@ -585,8 +602,8 @@ bool pkgAcquire::Item::RenameOnError(pkgAcquire::Item::RenameOnErrorState const Status = StatError; break; case NotClearsigned: - errtext = _("Does not start with a cleartext signature"); - Status = StatError; + strprintf(errtext, _("Clearsigned file isn't valid, got '%s' (does the network require authentication?)"), "NOSPLIT"); + Status = StatAuthError; break; case MaximumSizeExceeded: // the method is expected to report a good error for this @@ -783,7 +800,7 @@ bool pkgAcqMetaBase::CheckStopAuthentication(pkgAcquire::Item * const I, const s _error->Error(_("GPG error: %s: %s"), Desc.Description.c_str(), LookupTag(Message,"Message").c_str()); - I->Status = StatError; + I->Status = StatAuthError; return true; } else { _error->Warning(_("GPG error: %s: %s"), @@ -829,14 +846,7 @@ bool pkgAcqMetaBase::CheckDownloadDone(pkgAcqTransactionItem * const I, const st // We have just finished downloading a Release file (it is not // verified yet) - string const FileName = LookupTag(Message,"Filename"); - if (FileName.empty() == true) - { - I->Status = StatError; - I->ErrorText = "Method gave a blank filename"; - return false; - } - + std::string const FileName = LookupTag(Message,"Filename"); if (FileName != I->DestFile && RealFileExists(I->DestFile) == false) { I->Local = true; @@ -1142,6 +1152,16 @@ string pkgAcqMetaClearSig::Custom600Headers() const return Header; } /*}}}*/ +bool pkgAcqMetaClearSig::VerifyDone(std::string const &Message, + pkgAcquire::MethodConfig const * const Cnf) +{ + Item::VerifyDone(Message, Cnf); + + if (FileExists(DestFile) && !StartsWithGPGClearTextSignature(DestFile)) + return RenameOnError(NotClearsigned); + + return true; +} // pkgAcqMetaClearSig::Done - We got a file /*{{{*/ void pkgAcqMetaClearSig::Done(std::string const &Message, HashStringList const &Hashes, @@ -1149,17 +1169,6 @@ void pkgAcqMetaClearSig::Done(std::string const &Message, { Item::Done(Message, Hashes, Cnf); - // if we expect a ClearTextSignature (InRelease), ensure that - // this is what we get and if not fail to queue a - // Release/Release.gpg, see #346386 - if (FileExists(DestFile) && !StartsWithGPGClearTextSignature(DestFile)) - { - pkgAcquire::Item::Failed(Message, Cnf); - RenameOnError(NotClearsigned); - TransactionManager->AbortTransaction(); - return; - } - if(AuthPass == false) { if(CheckDownloadDone(this, Message, Hashes) == true) @@ -1190,6 +1199,16 @@ void pkgAcqMetaClearSig::Failed(string const &Message,pkgAcquire::MethodConfig c if (AuthPass == false) { + if (Status == StatAuthError) + { + // if we expected a ClearTextSignature (InRelease) and got a file, + // but it wasn't valid we end up here (see VerifyDone). + // As these is usually called by web-portals we do not try Release/Release.gpg + // as this is gonna fail anyway and instead abort our try (LP#346386) + TransactionManager->AbortTransaction(); + return; + } + // Queue the 'old' InRelease file for removal if we try Release.gpg // as otherwise the file will stay around and gives a false-auth // impression (CVE-2012-0214) @@ -2500,7 +2519,7 @@ void pkgAcqIndex::StageDownloadDone(string const &Message, HashStringList const Complete = true; // Handle the unzipd case - string FileName = LookupTag(Message,"Alt-Filename"); + std::string FileName = LookupTag(Message,"Alt-Filename"); if (FileName.empty() == false) { Stage = STAGE_DECOMPRESS_AND_VERIFY; @@ -2511,13 +2530,7 @@ void pkgAcqIndex::StageDownloadDone(string const &Message, HashStringList const SetActiveSubprocess("copy"); return; } - FileName = LookupTag(Message,"Filename"); - if (FileName.empty() == true) - { - Status = StatError; - ErrorText = "Method gave a blank filename"; - } // Methods like e.g. "file:" will give us a (compressed) FileName that is // not the "DestFile" we set, in this case we uncompress from the local file @@ -2791,15 +2804,7 @@ void pkgAcqArchive::Done(string const &Message, HashStringList const &Hashes, Item::Done(Message, Hashes, Cfg); // Grab the output filename - string FileName = LookupTag(Message,"Filename"); - if (FileName.empty() == true) - { - Status = StatError; - ErrorText = "Method gave a blank filename"; - return; - } - - // Reference filename + std::string const FileName = LookupTag(Message,"Filename"); if (DestFile != FileName && RealFileExists(DestFile) == false) { StoreFilename = DestFile = FileName; @@ -3121,14 +3126,7 @@ void pkgAcqFile::Done(string const &Message,HashStringList const &CalcHashes, { Item::Done(Message,CalcHashes,Cnf); - string FileName = LookupTag(Message,"Filename"); - if (FileName.empty() == true) - { - Status = StatError; - ErrorText = "Method gave a blank filename"; - return; - } - + std::string const FileName = LookupTag(Message,"Filename"); Complete = true; // The files timestamp matches diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 2349d386c..d6bcdafcb 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -176,6 +176,28 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ */ virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + /** \brief Invoked by the acquire worker to check if the successfully + * fetched object is also the objected we wanted to have. + * + * Note that the object might \e not have been written to + * DestFile; check for the presence of an Alt-Filename entry in + * Message to find the file to which it was really written. + * + * This is called before Done is called and can prevent it by returning + * \b false which will result in Failed being called instead. + * + * You should prefer to use this method over calling Failed() from Done() + * as this has e.g. the wrong progress reporting. + * + * \param Message Data from the acquire method. Use LookupTag() + * to parse it. + * \param Cnf The method via which the object was fetched. + * + * \sa pkgAcqMethod + */ + virtual bool VerifyDone(std::string const &Message, + pkgAcquire::MethodConfig const * const Cnf); + /** \brief Invoked by the acquire worker when the object was * fetched successfully. * @@ -563,6 +585,7 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual std::string Custom600Headers() const APT_OVERRIDE; + virtual bool VerifyDone(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index dc03a8870..2c84020fe 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -411,11 +411,14 @@ bool pkgAcquire::Worker::RunMessages() else consideredOkay = true; + if (consideredOkay == true) + consideredOkay = Owner->VerifyDone(Message, Config); + else // hashsum mismatch + Owner->Status = pkgAcquire::Item::StatAuthError; + if (consideredOkay == true) { Owner->Done(Message, ReceivedHashes, Config); - - // Log that we are done if (Log != 0) { if (isIMSHit) @@ -426,9 +429,7 @@ bool pkgAcquire::Worker::RunMessages() } else { - Owner->Status = pkgAcquire::Item::StatAuthError; Owner->Failed(Message,Config); - if (Log != 0) Log->Fail(Owner->GetItemDesc()); } diff --git a/test/integration/test-apt-update-nofallback b/test/integration/test-apt-update-nofallback index 2ded73122..5bffab6ee 100755 --- a/test/integration/test-apt-update-nofallback +++ b/test/integration/test-apt-update-nofallback @@ -151,9 +151,8 @@ test_subvert_inrelease() # replace InRelease with something else mv $APTARCHIVE/dists/unstable/Release $APTARCHIVE/dists/unstable/InRelease - testfailureequal "W: Failed to fetch file:${APTARCHIVE}/dists/unstable/InRelease Does not start with a cleartext signature - -E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq + testfailuremsg "W: Failed to fetch file:${APTARCHIVE}/dists/unstable/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) +E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update # ensure we keep the repo testfileequal lists.before "$(listcurrentlistsdirectory)" diff --git a/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall index ea516fc12..8f468b376 100755 --- a/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall +++ b/test/integration/test-ubuntu-bug-346386-apt-get-update-paywall @@ -36,8 +36,8 @@ ensure_n_canary_strings_in_dir() { LISTS='rootdir/var/lib/apt/lists' rm -rf rootdir/var/lib/apt/lists -msgtest 'Got expected failure message' 'apt-get update' -aptget update -qq 2>&1 | grep -q 'W:.*Does not start with a cleartext signature' && msgpass || msgfail +testfailure aptget update +testsuccess grep '^W:.*Clearsigned file .*NOSPLIT.*' rootdir/tmp/testfailure.output ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0 testequal 'lock @@ -48,8 +48,8 @@ for f in Release Release.gpg main_binary-amd64_Packages main_source_Sources; do echo 'peng neee-wom' > $LISTS/localhost:8080_dists_stable_${f} done -msgtest 'Got expected failure message in' 'apt-get update' -aptget update -qq 2>&1 | grep -q 'W:.*Does not start with a cleartext signature' && msgpass || msgfail +testfailure aptget update +testsuccess grep '^W:.*Clearsigned file .*NOSPLIT.*' rootdir/tmp/testfailure.output ensure_n_canary_strings_in_dir $LISTS 'peng neee-wom' 4 ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0 @@ -58,7 +58,8 @@ ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0 echo 'peng neee-wom' > $LISTS/localhost:8080_dists_stable_InRelease rm -f $LISTS/localhost:8080_dists_stable_Release $LISTS/localhost:8080_dists_stable_Release.gpg msgtest 'excpected failure of' 'apt-get update' -aptget update -qq 2>&1 | grep -q 'W:.*Does not start with a cleartext signature' && msgpass || msgfail +testfailure aptget update +testsuccess grep '^W:.*Clearsigned file .*NOSPLIT.*' rootdir/tmp/testfailure.output ensure_n_canary_strings_in_dir $LISTS 'peng neee-wom' 3 ensure_n_canary_strings_in_dir $LISTS 'ni ni ni' 0 diff --git a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only index 754487a90..dbcb49a41 100755 --- a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only +++ b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only @@ -27,8 +27,9 @@ MD5Sum: 1b895931853981ad8204d2439821b999 4144 Packages.gz'; echo; cat ${RELEASE}.old;) > ${RELEASE} done -msgtest 'The unsigned garbage before signed block is' 'ignored' -aptget update -qq 2>&1 | grep -q 'W:.*Does not start with a cleartext signature' && msgpass || msgfail +testfailure aptget update +testsuccess grep '^W:.*Clearsigned file .*NOSPLIT.*' rootdir/tmp/testfailure.output + ROOTDIR="$(readlink -f .)" testsuccessequal "Package files: -- cgit v1.2.3 From 0efb29eb36184bbe6de7b1013d1898796d94b171 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Aug 2015 19:01:49 +0200 Subject: drop extra newline in 'Failed to fetch' and 'GPG error' message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I never understood why there is an extra newline in those messages, so now is as good time as any to drop them. Lets see if someone complains with a good reason to keep it… --- apt-pkg/acquire-item.cc | 2 +- apt-pkg/update.cc | 2 +- test/integration/test-apt-update-nofallback | 4 ---- test/integration/test-apt-update-not-modified | 2 -- test/integration/test-apt-update-rollback | 4 ---- test/integration/test-bug-595691-empty-and-broken-archive-files | 2 -- 6 files changed, 2 insertions(+), 14 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 0a7e0e11f..3ed52dbf2 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -790,7 +790,7 @@ bool pkgAcqMetaBase::CheckStopAuthentication(pkgAcquire::Item * const I, const s _error->Warning(_("An error occurred during the signature " "verification. The repository is not updated " "and the previous index files will be used. " - "GPG error: %s: %s\n"), + "GPG error: %s: %s"), Desc.Description.c_str(), LookupTag(Message,"Message").c_str()); RunScripts("APT::Update::Auth-Failure"); diff --git a/apt-pkg/update.cc b/apt-pkg/update.cc index 2908a4820..6e65c387c 100644 --- a/apt-pkg/update.cc +++ b/apt-pkg/update.cc @@ -74,7 +74,7 @@ bool AcquireUpdate(pkgAcquire &Fetcher, int const PulseInterval, uri.User.clear(); uri.Password.clear(); string descUri = string(uri); - _error->Warning(_("Failed to fetch %s %s\n"), descUri.c_str(), + _error->Warning(_("Failed to fetch %s %s"), descUri.c_str(), (*I)->ErrorText.c_str()); if ((*I)->Status == pkgAcquire::Item::StatTransientNetworkError) diff --git a/test/integration/test-apt-update-nofallback b/test/integration/test-apt-update-nofallback index 5bffab6ee..2f4ddc016 100755 --- a/test/integration/test-apt-update-nofallback +++ b/test/integration/test-apt-update-nofallback @@ -171,9 +171,7 @@ test_inrelease_to_invalid_inrelease() inject_evil_package testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:${APTARCHIVE} unstable InRelease: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) - W: Failed to fetch file:${APTARCHIVE}/dists/unstable/InRelease The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) - W: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq # ensure we keep the repo @@ -195,9 +193,7 @@ test_release_gpg_to_invalid_release_release_gpg() inject_evil_package testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:${APTARCHIVE} unstable Release: The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) - W: Failed to fetch file:${APTARCHIVE}/dists/unstable/Release.gpg The following signatures were invalid: BADSIG 5A90D141DBAC8DAE Joe Sixpack (APT Testcases Dummy) - W: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq testfailure grep 'evil' rootdir/var/lib/apt/lists/*Release diff --git a/test/integration/test-apt-update-not-modified b/test/integration/test-apt-update-not-modified index 6d176a655..3f822586a 100755 --- a/test/integration/test-apt-update-not-modified +++ b/test/integration/test-apt-update-not-modified @@ -47,7 +47,6 @@ Get:2 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable Err:2 $1 unstable/main amd64 Packages Hash Sum mismatch W: Failed to fetch $1/dists/unstable/main/binary-amd64/Packages.gz Hash Sum mismatch - E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)" rm -rf aptarchive/dists @@ -107,7 +106,6 @@ Get:4 $1 unstable/main amd64 Packages [$(stat -c '%s' 'aptarchive/dists/unstable Err:4 $1 unstable/main amd64 Packages Hash Sum mismatch W: Failed to fetch $1/dists/unstable/main/binary-amd64/Packages.gz Hash Sum mismatch - E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update testfileequal 'listsdir-without-amd64.lst' "$(listcurrentlistsdirectory)" rm -rf aptarchive/dists diff --git a/test/integration/test-apt-update-rollback b/test/integration/test-apt-update-rollback index 70619dd08..646484e7b 100755 --- a/test/integration/test-apt-update-rollback +++ b/test/integration/test-apt-update-rollback @@ -61,7 +61,6 @@ test_inrelease_to_broken_hash_reverts_all() { # test the error condition testfailureequal "W: Failed to fetch file:${APTARCHIVE}/dists/unstable/main/source/Sources.gz Hash Sum mismatch - E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq # ensure that the Packages file is also rolled back testfileequal lists.before "$(listcurrentlistsdirectory)" @@ -128,7 +127,6 @@ E: There are problems and -y was used without --force-yes" aptget install -qq -y break_repository_sources_index '+1hour' testfailureequal "W: Failed to fetch file:$APTARCHIVE/dists/unstable/main/source/Sources.gz Hash Sum mismatch - E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq testfileequal lists.before "$(listcurrentlistsdirectory)" @@ -145,9 +143,7 @@ test_inrelease_to_unauth_inrelease() { signreleasefiles 'Marvin Paranoid' testwarningequal "W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:${APTARCHIVE} unstable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2 - W: Failed to fetch file:$APTARCHIVE/dists/unstable/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E8525D47528144E2 - W: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq testfileequal lists.before "$(listcurrentlistsdirectory)" diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index 47dd62712..0c02aee30 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -55,7 +55,6 @@ Reading package lists..." "empty archive Packages.$COMPRESS over file" Err:2 file:$APTARCHIVE Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:${APTARCHIVE}/Packages.$COMPRESS Empty files can't be valid archives - E: Some index files failed to download. They have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over file" } @@ -72,7 +71,6 @@ Reading package lists..." "empty archive Packages.$COMPRESS over http" Err:2 http://localhost:8080 Packages Empty files can't be valid archives W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial/localhost:8080_Packages.${COMPRESS}) Empty files can't be valid archives - E: Some index files failed to download. They have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over http" } -- cgit v1.2.3 From 3cbeed985254de7e8d186ebebb69a659727eaeb0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 3 Aug 2015 07:00:33 +0200 Subject: mark again deps of pkgs in APT::Never-MarkAuto-Sections as manual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In 50ef3344c3afaaf9943142906b2f976a0337d264 (and similar for other branches), while 'fixing' the edgecase of a package being in multiple sections (e.g. moved from libs to oldlibs in newer releases) I accidently broke the feature itself completely by operating on the package itself and no longer on its dependencies… The behaviour isn't ideal in multiple ways, which we are hopefully able to fix with new ideas as mentioned in the buglog, but until then the functionality of this "hack" should be restored. Reported-By: Raphaël Hertzog Tested-By: Adam Conrad Closes: 793360 LP: 1479207 Thanks: Raphaël Hertzog and Adam Conrad for detailed reports and initial patches --- apt-pkg/depcache.cc | 9 +- test/integration/framework | 4 +- test/integration/test-apt-never-markauto-sections | 106 ++++++++++++++++++++++ 3 files changed, 116 insertions(+), 3 deletions(-) create mode 100755 test/integration/test-apt-never-markauto-sections diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 7b1448c73..e466cba28 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1093,7 +1093,12 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, if (DebugMarker == true) std::clog << OutputInDepth(Depth) << "MarkInstall " << Pkg << " FU=" << FromUser << std::endl; - DepIterator Dep = P.InstVerIter(*this).DependsList(); + VerIterator const PV = P.InstVerIter(*this); + if (unlikely(PV.end() == true)) + return false; + bool const PinNeverMarkAutoSection = (PV->Section != 0 && ConfigValueInSubTree("APT::Never-MarkAuto-Sections", PV.Section())); + + DepIterator Dep = PV.DependsList(); for (; Dep.end() != true;) { // Grok or groups @@ -1206,7 +1211,7 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, continue; } // now check if we should consider it a automatic dependency or not - if(InstPkg->CurrentVer == 0 && InstVer->Section != 0 && ConfigValueInSubTree("APT::Never-MarkAuto-Sections", InstVer.Section())) + if(InstPkg->CurrentVer == 0 && PinNeverMarkAutoSection) { if(DebugAutoInstall == true) std::clog << OutputInDepth(Depth) << "Setting NOT as auto-installed (direct " diff --git a/test/integration/framework b/test/integration/framework index 53157e2d0..2f08c5fdc 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -570,10 +570,12 @@ echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME} -- Joe Sixpack $(date -R)" > ${BUILDDIR}/debian/changelog echo "Source: $NAME -Section: $SECTION Priority: $PRIORITY Maintainer: Joe Sixpack Standards-Version: 3.9.3" > ${BUILDDIR}/debian/control + if [ "$SECTION" != '' ]; then + echo "Section: $SECTION" >> ${BUILDDIR}/debian/control + fi local BUILDDEPS="$(echo "$DEPENDENCIES" | grep '^Build-')" test -z "$BUILDDEPS" || echo "$BUILDDEPS" >> ${BUILDDIR}/debian/control echo " diff --git a/test/integration/test-apt-never-markauto-sections b/test/integration/test-apt-never-markauto-sections new file mode 100755 index 000000000..6c88c69fa --- /dev/null +++ b/test/integration/test-apt-never-markauto-sections @@ -0,0 +1,106 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +aptconfig dump --no-empty --format '%v%n' APT::Never-MarkAuto-Sections > nevermarkauto.sections +testsuccess grep '^metapackages$' nevermarkauto.sections + +# this is a very crude regression test, not a "this is how it should be" test: +# In theory mydesktop-core and texteditor should be marked as manual, but +# texteditor is installed as a dependency of bad-texteditor, not of +# mydesktop-core and mydesktop-core is removed while bad-texteditor is +# installed losing the manual bit as the problem resolver will later decide to +# drop bad-texteditor and re-instate mydesktop-core which is considered an +# auto-install at that point (in theory the never-auto handling should be +# copied to this place – as to the many other places dependencies are resolved +# 'by hand' instead of via MarkInstall AutoInst… +# +# Both could be fixed if apt would figure out early that installing +# bad-texteditor is a bad idea and eventually it should (as mydesktop-core is +# a direct descendant of mydesktop which was a user-request mydesktop-core should +# be as protected from removal as mydesktop is), but this is hard in the general case +# as with more or-groups and provides you can produce 'legal' examples for this. + +buildsimplenativepackage 'mydesktop' 'all' '1' 'unstable' 'Depends: mydesktop-core, foreignpkg +Recommends: notavailable' '' 'metapackages' +buildsimplenativepackage 'mydesktop-core' 'amd64' '1' 'unstable' 'Depends: bad-texteditor | texteditor, browser (>= 42), nosection, foreignpkg +Recommends: notavailable +Multi-Arch: foreign' '' 'metapackages' +buildsimplenativepackage 'browser' 'amd64' '41' 'stable' +buildsimplenativepackage 'browser' 'amd64' '42' 'unstable' +buildsimplenativepackage 'texteditor' 'amd64' '1' 'stable' +buildsimplenativepackage 'bad-texteditor' 'amd64' '1' 'stable' 'Depends: texteditor +Conflicts: mydesktop-core' +buildsimplenativepackage 'nosection' 'amd64' '1' 'stable' '' '' '' +buildsimplenativepackage 'foreignpkg' 'i386' '1' 'stable' 'Multi-Arch: foreign' +setupaptarchive + +testsuccess aptcache show nosection +testfailure grep 'Section' rootdir/tmp/testsuccess.output +testequal 'dpkg' aptmark showmanual + +testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 + +testequal 'browser +dpkg +foreignpkg:i386 +mydesktop +nosection' aptmark showmanual +testmarkedauto 'mydesktop-core' 'texteditor' + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + mydesktop mydesktop-core texteditor +0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. +Remv mydesktop [1] +Remv mydesktop-core [1] +Remv texteditor [1]' aptget autoremove mydesktop -s + +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + mydesktop mydesktop-core texteditor +0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. +Remv mydesktop [1] +Remv mydesktop-core [1] +Remv texteditor [1]' aptget autoremove texteditor -s +testsuccess aptget autoremove texteditor -y + +testdpkgnotinstalled mydesktop mydesktop-core texteditor +testdpkginstalled browser + +testequal 'browser +dpkg +foreignpkg:i386 +nosection' aptmark showmanual +testmarkedauto + +# test that installed/upgraded auto-pkgs are not set to manual + +testsuccess aptget install browser=41 -y --force-yes + +testequal 'browser +dpkg +foreignpkg:i386 +nosection' aptmark showmanual +testmarkedauto +testsuccess aptmark auto browser +testmarkedauto 'browser' +testsuccess aptmark auto nosection +testmarkedauto 'browser' 'nosection' +testequal 'dpkg +foreignpkg:i386' aptmark showmanual + +testsuccess aptget install mydesktop -y + +testequal 'dpkg +foreignpkg:i386 +mydesktop' aptmark showmanual +testmarkedauto 'browser' 'nosection' 'mydesktop-core' 'texteditor' -- cgit v1.2.3 From 628e7405052dd5b758ad1480a103971b3ea34c4b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Aug 2015 20:26:37 +0200 Subject: update symbols file to current state of affairs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cxx11abi transition happens, we changed a bunch of methods and all that stuff which is really good™ for an abi. Lets just slowly start to stop changing more and a first step is to document the current so changes aren't hidding in a big wall of change anymore. Git-Dch: Ignore --- debian/libapt-inst1.6.symbols | 25 +- debian/libapt-pkg4.15.symbols | 1051 ++++++++++++++++++++++------------------- 2 files changed, 563 insertions(+), 513 deletions(-) diff --git a/debian/libapt-inst1.6.symbols b/debian/libapt-inst1.6.symbols index 74c4665a2..e4b71c1f8 100644 --- a/debian/libapt-inst1.6.symbols +++ b/debian/libapt-inst1.6.symbols @@ -3,7 +3,7 @@ libapt-inst.so.1.6 libapt-inst1.6 #MINVER# (c++)"ExtractTar::Done(bool)@Base" 0.8.0 (c++)"ExtractTar::Go(pkgDirStream&)@Base" 0.8.0 (c++)"ExtractTar::StartGzip()@Base" 0.8.0 - (c++)"ExtractTar::ExtractTar(FileFd&, unsigned long long, std::basic_string, std::allocator >)@Base" 1.0.5 + (c++)"ExtractTar::ExtractTar(FileFd&, unsigned long long, std::__cxx11::basic_string, std::allocator >)@Base" 1.0.5 (c++)"ExtractTar::~ExtractTar()@Base" 0.8.0 (c++)"debDebFile::GotoMember(char const*)@Base" 0.8.0 (c++)"debDebFile::CheckMember(char const*)@Base" 0.8.0 @@ -18,7 +18,7 @@ libapt-inst.so.1.6 libapt-inst1.6 #MINVER# (c++)"debDebFile::MemControlExtract::~MemControlExtract()@Base" 0.8.0 (c++)"debDebFile::debDebFile(FileFd&)@Base" 0.8.0 (c++)"pkgExtract::FinishedFile(pkgDirStream::Item&, int)@Base" 0.8.0 - (c++)"pkgExtract::CheckDirReplace(std::basic_string, std::allocator >, unsigned int)@Base" 0.8.0 + (c++)"pkgExtract::CheckDirReplace(std::__cxx11::basic_string, std::allocator >, unsigned int)@Base" 0.8.0 (c++)"pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator, bool)@Base" 0.8.0 (c++)"pkgExtract::Fail(pkgDirStream::Item&, int)@Base" 0.8.0 (c++)"pkgExtract::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0 @@ -43,49 +43,28 @@ libapt-inst.so.1.6 libapt-inst1.6 #MINVER# (c++)"pkgDirStream::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0 (c++)"pkgDirStream::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@Base" 1.0.5 (c++)"pkgDirStream::~pkgDirStream()@Base" 0.8.0 - (c++|optional)"pkgCache::DepIterator::operator++(int)@Base" 0.8.0 - (c++|optional)"pkgCache::DepIterator::operator++()@Base" 0.8.0 - (c++|optional)"pkgCache::VerIterator::operator++(int)@Base" 0.8.0 - (c++|optional)"pkgCache::VerIterator::operator++()@Base" 0.8.0 (c++)"ARArchive::LoadHeaders()@Base" 0.8.0 (c++)"ARArchive::ARArchive(FileFd&)@Base" 0.8.0 (c++)"ARArchive::~ARArchive()@Base" 0.8.0 (c++)"pkgFLCache::NodeIterator::RealPackage() const@Base" 0.8.0 (c++)"pkgFLCache::Header::CheckSizes(pkgFLCache::Header&) const@Base" 0.8.0 - (c++|optional)"pkgCache::DepIterator::OwnerPointer() const@Base" 0.8.0 - (c++|optional)"pkgCache::VerIterator::OwnerPointer() const@Base" 0.8.0 (c++)"ARArchive::FindMember(char const*) const@Base" 0.8.0 (c++)"typeinfo for ExtractTar@Base" 0.8.0 (c++)"typeinfo for pkgExtract@Base" 0.8.0 (c++)"typeinfo for pkgDirStream@Base" 0.8.0 (c++)"typeinfo for debDebFile::ControlExtract@Base" 0.8.0 (c++)"typeinfo for debDebFile::MemControlExtract@Base" 0.8.0 - (c++|optional)"typeinfo for pkgCache::DepIterator@Base" 0.8.0 - (c++|optional)"typeinfo for pkgCache::VerIterator@Base" 0.8.0 - (c++|optional)"typeinfo for pkgCache::Iterator@Base" 0.8.0 - (c++|optional)"typeinfo for pkgCache::Iterator@Base" 0.8.0 (c++)"typeinfo name for ExtractTar@Base" 0.8.0 (c++)"typeinfo name for pkgExtract@Base" 0.8.0 (c++)"typeinfo name for pkgDirStream@Base" 0.8.0 (c++)"typeinfo name for debDebFile::ControlExtract@Base" 0.8.0 (c++)"typeinfo name for debDebFile::MemControlExtract@Base" 0.8.0 - (c++|optional)"typeinfo name for pkgCache::DepIterator@Base" 0.8.0 - (c++|optional)"typeinfo name for pkgCache::VerIterator@Base" 0.8.0 - (c++|optional)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 - (c++|optional)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 (c++)"vtable for ExtractTar@Base" 0.8.0 (c++)"vtable for pkgExtract@Base" 0.8.0 (c++)"vtable for pkgDirStream@Base" 0.8.0 (c++)"vtable for debDebFile::ControlExtract@Base" 0.8.0 (c++)"vtable for debDebFile::MemControlExtract@Base" 0.8.0 - (c++|optional)"vtable for pkgCache::DepIterator@Base" 0.8.0 - (c++|optional)"vtable for pkgCache::VerIterator@Base" 0.8.0 - (c++|optional)"vtable for pkgCache::Iterator@Base" 0.8.0 - (c++|optional)"vtable for pkgCache::Iterator@Base" 0.8.0 ### gcc artefacts (c++|optional=std)"std::vector >::~vector()@Base" 0.8.12 ### try to ignore std:: template instances - (c++|regex|optional=std)"^std::basic_string<.+ >\(.+\)@Base$" 0.8.0 - (c++|regex|optional=std)"^typeinfo name for std::iterator<.*>@Base$" 0.8.0 - (c++|regex|optional=std)"^typeinfo for std::iterator<.*>@Base$" 0.8.0 (c++|optional=std)"std::ctype::do_widen(char) const@Base" 1.0.3 diff --git a/debian/libapt-pkg4.15.symbols b/debian/libapt-pkg4.15.symbols index ee7f7a66e..693fad872 100644 --- a/debian/libapt-pkg4.15.symbols +++ b/debian/libapt-pkg4.15.symbols @@ -2,86 +2,86 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# * Build-Depends-Package: libapt-pkg-dev TFRewritePackageOrder@Base 0.8.0 TFRewriteSourceOrder@Base 0.8.0 - (c++)"FileExists(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"IdentCdrom(std::basic_string, std::allocator >, std::basic_string, std::allocator >&, unsigned int)@Base" 0.8.0 + (c++)"FileExists(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"IdentCdrom(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int)@Base" 0.8.0 (c++)"ListUpdate(pkgAcquireStatus&, pkgSourceList&, int)@Base" 0.8.0 - (c++)"MountCdrom(std::basic_string, std::allocator >, std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"ParseCWord(char const*&, std::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"ReadPinDir(pkgPolicy&, std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"MountCdrom(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"ParseCWord(char const*&, std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 + (c++)"ReadPinDir(pkgPolicy&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"RunScripts(char const*)@Base" 0.8.0 - (c++)"SafeGetCWD()@Base" 0.8.0 - (c++)"QuoteString(std::basic_string, std::allocator > const&, char const*)@Base" 0.8.0 - (c++)"ReadPinFile(pkgPolicy&, std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"SafeGetCWD[abi:cxx11]()@Base" 0.8.0 + (c++)"QuoteString(std::__cxx11::basic_string, std::allocator > const&, char const*)@Base" 0.8.0 + (c++)"ReadPinFile(pkgPolicy&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"RegexChoice(RxChoiceList*, char const**, char const**)@Base" 0.8.0 (c++)"SetNonBlock(int, bool)@Base" 0.8.0 - (c++)"flExtension(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"Base64Encode(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"ReadMessages(int, std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.8.0 + (c++)"flExtension(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"Base64Encode(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"ReadMessages(int, std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.8.0 (c++)"SetCloseExec(int, bool)@Base" 0.8.0 - (c++)"StringToBool(std::basic_string, std::allocator > const&, int)@Base" 0.8.0 - (c++)"UnmountCdrom(std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"StringToBool(std::__cxx11::basic_string, std::allocator > const&, int)@Base" 0.8.0 + (c++)"UnmountCdrom(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"_GetErrorObj()@Base" 0.8.0 (c++)"Base256ToNum(char const*, unsigned long long&, unsigned int)@Base" 1.0.5 (c++)"pkgFixBroken(pkgDepCache&)@Base" 0.8.0 - (c++)"DeQuoteString(__gnu_cxx::__normal_iterator, std::allocator > > const&, __gnu_cxx::__normal_iterator, std::allocator > > const&)@Base" 0.8.0 - (c++)"DeQuoteString(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"OutputInDepth(unsigned long, char const*)@Base" 0.8.0 - (c++)"ReadConfigDir(Configuration&, std::basic_string, std::allocator > const&, bool const&, unsigned int const&)@Base" 0.8.0 - (c++)"URItoFileName(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"UTF8ToCodeset(char const*, std::basic_string, std::allocator > const&, std::basic_string, std::allocator >*)@Base" 0.8.0 + (c++)"DeQuoteString(__gnu_cxx::__normal_iterator, std::allocator > > const&, __gnu_cxx::__normal_iterator, std::allocator > > const&)@Base" 0.8.0 + (c++)"DeQuoteString(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"OutputInDepth[abi:cxx11](unsigned long, char const*)@Base" 0.8.0 + (c++)"ReadConfigDir(Configuration&, std::__cxx11::basic_string, std::allocator > const&, bool const&, unsigned int const&)@Base" 0.8.0 + (c++)"URItoFileName(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"UTF8ToCodeset(char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >*)@Base" 0.8.0 (c++)"pkgInitConfig(Configuration&)@Base" 0.8.0 (c++)"pkgInitSystem(Configuration&, pkgSystem*&)@Base" 0.8.0 (c++)"safe_snprintf(char*, char*, char const*, ...)@Base" 0.8.0 - (c++)"stringcasecmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, char const*, char const*)@Base" 0.8.0 - (c++)"stringcasecmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >)@Base" 0.8.0 -# (c++|optional=inline)"stringcasecmp(std::basic_string, std::allocator > const&, char const*)@Base" 0.8.0 + (c++)"stringcasecmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, char const*, char const*)@Base" 0.8.0 + (c++)"stringcasecmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >)@Base" 0.8.0 +# (c++|optional=inline)"stringcasecmp(std::__cxx11::basic_string, std::allocator > const&, char const*)@Base" 0.8.0 (c++)"stringcasecmp(char const*, char const*, char const*, char const*)@Base" 0.8.0 (c++)"tolower_ascii(int)@Base" 0.8.0 - (c++)"ParseQuoteWord(char const*&, std::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"ReadConfigFile(Configuration&, std::basic_string, std::allocator > const&, bool const&, unsigned int const&)@Base" 0.8.0 + (c++)"ParseQuoteWord(char const*&, std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 + (c++)"ReadConfigFile(Configuration&, std::__cxx11::basic_string, std::allocator > const&, bool const&, unsigned int const&)@Base" 0.8.0 (c++)"TokSplitString(char, char*, char**, unsigned long)@Base" 0.8.0 - (c++)"maybe_add_auth(URI&, std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"maybe_add_auth(URI&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgApplyStatus(pkgDepCache&)@Base" 0.8.0 - (c++)"CheckDomainList(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"CreateDirectory(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"DirectoryExists(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"VectorizeString(std::basic_string, std::allocator > const&, char const&)@Base" 0.8.0 + (c++)"CheckDomainList(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"CreateDirectory(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"DirectoryExists(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"VectorizeString(std::__cxx11::basic_string, std::allocator > const&, char const&)@Base" 0.8.0 (c++)"pkgPrioSortList(pkgCache&, pkgCache::Version**)@Base" 0.8.0 (c++)"pkgMakeStatusCache(pkgSourceList&, OpProgress&, MMap**, bool)@Base" 0.8.0 (c++)"pkgMinimizeUpgrade(pkgDepCache&)@Base" 0.8.0 (c++)"pkgAllUpgrade(pkgDepCache&)@Base" 0.8.0 (c++)"pkgDistUpgrade(pkgDepCache&)@Base" 0.8.0 - (c++)"GetListOfFilesInDir(std::basic_string, std::allocator > const&, std::vector, std::allocator >, std::allocator, std::allocator > > > const&, bool const&)@Base" 0.8.0 - (c++)"GetListOfFilesInDir(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, bool const&, bool const&)@Base" 0.8.0 + (c++)"GetListOfFilesInDir(std::__cxx11::basic_string, std::allocator > const&, std::vector, std::allocator >, std::allocator, std::allocator > > > const&, bool const&)@Base" 0.8.0 + (c++)"GetListOfFilesInDir(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool const&, bool const&)@Base" 0.8.0 (c++)"pkgMakeOnlyStatusCache(OpProgress&, DynamicMMap**)@Base" 0.8.0 (c++)"WaitFd(int, bool, unsigned long)@Base" 0.8.0 - (c++)"GetLock(std::basic_string, std::allocator >, bool)@Base" 0.8.0 - (c++)"Hex2Num(std::basic_string, std::allocator > const&, unsigned char*, unsigned int)@Base" 0.8.0 + (c++)"GetLock(std::__cxx11::basic_string, std::allocator >, bool)@Base" 0.8.0 + (c++)"Hex2Num(std::__cxx11::basic_string, std::allocator > const&, unsigned char*, unsigned int)@Base" 0.8.0 (c++)"CopyFile(FileFd&, FileFd&)@Base" 0.8.0 (c++)"ExecFork()@Base" 0.8.0 (c++)"ExecWait(int, char const*, bool)@Base" 0.8.0 (c++)"StrToNum(char const*, unsigned long&, unsigned int, unsigned int)@Base" 0.8.0 - (c++)"SubstVar(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"SubstVar(std::basic_string, std::allocator >, SubstVar const*)@Base" 0.8.0 - (c++)"flNoLink(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"flNotDir(std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"SubstVar(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"SubstVar(std::__cxx11::basic_string, std::allocator >, SubstVar const*)@Base" 0.8.0 + (c++)"flNoLink(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"flNotDir(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"ioprintf(std::basic_ostream >&, char const*, ...)@Base" 0.8.0 - (c++)"IsMounted(std::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"LookupTag(std::basic_string, std::allocator > const&, char const*, char const*)@Base" 0.8.0 - (c++)"SizeToStr(double)@Base" 0.8.0 + (c++)"IsMounted(std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 + (c++)"LookupTag(std::__cxx11::basic_string, std::allocator > const&, char const*, char const*)@Base" 0.8.0 + (c++)"SizeToStr[abi:cxx11](double)@Base" 0.8.0 (c++)"TFRewrite(_IO_FILE*, pkgTagSection const&, char const**, TFRewriteData*)@Base" 0.8.0 - (c++)"TimeToStr(unsigned long)@Base" 0.8.0 + (c++)"TimeToStr[abi:cxx11](unsigned long)@Base" 0.8.0 (c++)"_strstrip(char*)@Base" 0.8.0 - (c++)"flCombine(std::basic_string, std::allocator >, std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"flNotFile(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"stringcmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, char const*, char const*)@Base" 0.8.0 - (c++)"stringcmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >)@Base" 0.8.0 + (c++)"flCombine(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"flNotFile(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"stringcmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, char const*, char const*)@Base" 0.8.0 + (c++)"stringcmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >)@Base" 0.8.0 (c++)"stringcmp(char const*, char const*, char const*, char const*)@Base" 0.8.0 - (c++)"strprintf(std::basic_string, std::allocator >&, char const*, ...)@Base" 0.8.0 + (c++)"strprintf(std::__cxx11::basic_string, std::allocator >&, char const*, ...)@Base" 0.8.0 (c++)"HashString::SupportedHashes()@Base" 0.8.0 (c++)"HashString::_SupportedHashes@Base" 0.8.0 - (c++)"HashString::HashString(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"HashString::HashString(std::basic_string, std::allocator >, std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"HashString::HashString(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"HashString::HashString(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"HashString::HashString()@Base" 0.8.0 (c++)"HashString::~HashString()@Base" 0.8.0 (c++)"OpProgress::CheckChange(float)@Base" 0.8.0 @@ -90,11 +90,8 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"OpProgress::OpProgress()@Base" 0.8.0 (c++)"OpProgress::~OpProgress()@Base" 0.8.0 (c++)"SourceCopy::GetFileName()@Base" 0.8.0 - (c++)"SourceCopy::RewriteEntry(_IO_FILE*, std::basic_string, std::allocator >)@Base" 0.8.0 (c++)"SourceCopy::Type()@Base" 0.8.0 (c++)"SourceCopy::~SourceCopy()@Base" 0.8.0 - (c++)"pkgAcqFile::Failed(std::basic_string, std::allocator >, pkgAcquire::MethodConfig*)@Base" 0.8.0 - (c++)"pkgAcqFile::DescURI()@Base" 0.8.0 (c++)"pkgAcqFile::~pkgAcqFile()@Base" 0.8.0 (c++)"pkgAcquire::WorkerStep(pkgAcquire::Worker*)@Base" 0.8.0 (c++)"pkgAcquire::FetchNeeded()@Base" 0.8.0 @@ -105,22 +102,17 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgAcquire::Add(pkgAcquire::Worker*)@Base" 0.8.0 (c++)"pkgAcquire::Run(int)@Base" 0.8.0 (c++)"pkgAcquire::Bump()@Base" 0.8.0 - (c++)"pkgAcquire::Item::ReportMirrorFailure(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcquire::Item::Failed(std::basic_string, std::allocator >, pkgAcquire::MethodConfig*)@Base" 0.8.0 - (c++)"pkgAcquire::Item::Rename(std::basic_string, std::allocator >, std::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgAcquire::Item::Finished()@Base" 0.8.0 - (c++)"pkgAcquire::Item::ShortDesc()@Base" 0.8.0 (c++)"pkgAcquire::Item::~Item()@Base" 0.8.0 - (c++)"pkgAcquire::Clean(std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgAcquire::Clean(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgAcquire::Queue::Bump()@Base" 0.8.0 (c++)"pkgAcquire::Queue::Cycle()@Base" 0.8.0 (c++)"pkgAcquire::Queue::Dequeue(pkgAcquire::Item*)@Base" 0.8.0 (c++)"pkgAcquire::Queue::Enqueue(pkgAcquire::ItemDesc&)@Base" 0.8.0 (c++)"pkgAcquire::Queue::Startup()@Base" 0.8.0 - (c++)"pkgAcquire::Queue::FindItem(std::basic_string, std::allocator >, pkgAcquire::Worker*)@Base" 0.8.0 + (c++)"pkgAcquire::Queue::FindItem(std::__cxx11::basic_string, std::allocator >, pkgAcquire::Worker*)@Base" 0.8.0 (c++)"pkgAcquire::Queue::ItemDone(pkgAcquire::Queue::QItem*)@Base" 0.8.0 (c++)"pkgAcquire::Queue::Shutdown(bool)@Base" 0.8.0 - (c++)"pkgAcquire::Queue::Queue(std::basic_string, std::allocator >, pkgAcquire*)@Base" 0.8.0 (c++)"pkgAcquire::Queue::~Queue()@Base" 0.8.0 (c++)"pkgAcquire::Remove(pkgAcquire::Item*)@Base" 0.8.0 (c++)"pkgAcquire::Remove(pkgAcquire::Worker*)@Base" 0.8.0 @@ -128,9 +120,9 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgAcquire::SetFds(int&, fd_set*, fd_set*)@Base" 0.8.0 (c++)"pkgAcquire::UriEnd()@Base" 0.8.0 (c++)"pkgAcquire::Worker::OutFdReady()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::MediaChange(std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgAcquire::Worker::MediaChange(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgAcquire::Worker::RunMessages()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::Capabilities(std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgAcquire::Worker::Capabilities(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgAcquire::Worker::ReadMessages()@Base" 0.8.0 (c++)"pkgAcquire::Worker::MethodFailure()@Base" 0.8.0 (c++)"pkgAcquire::Worker::SendConfiguration()@Base" 0.8.0 @@ -145,23 +137,22 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgAcquire::Worker::~Worker()@Base" 0.8.0 (c++)"pkgAcquire::Dequeue(pkgAcquire::Item*)@Base" 0.8.0 (c++)"pkgAcquire::Enqueue(pkgAcquire::ItemDesc&)@Base" 0.8.0 - (c++)"pkgAcquire::ItemDesc::~ItemDesc()@Base" 0.8.0 (c++)"pkgAcquire::Shutdown()@Base" 0.8.0 (c++)"pkgAcquire::UriBegin()@Base" 0.8.0 - (c++)"pkgAcquire::GetConfig(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcquire::QueueName(std::basic_string, std::allocator >, pkgAcquire::MethodConfig const*&)@Base" 0.8.0 + (c++)"pkgAcquire::GetConfig(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgAcquire::QueueName(std::__cxx11::basic_string, std::allocator >, pkgAcquire::MethodConfig const*&)@Base" 0.8.0 (c++)"pkgAcquire::pkgAcquire(pkgAcquireStatus*)@Base" 0.8.0 (c++)"pkgAcquire::pkgAcquire()@Base" 0.8.0 (c++)"pkgAcquire::~pkgAcquire()@Base" 0.8.0 (c++)"pkgRecords::Lookup(pkgCache::VerFileIterator const&)@Base" 0.8.0 (c++)"pkgRecords::Lookup(pkgCache::DescFileIterator const&)@Base" 0.8.0 - (c++)"pkgRecords::Parser::Maintainer()@Base" 0.8.0 - (c++)"pkgRecords::Parser::Name()@Base" 0.8.0 + (c++)"pkgRecords::Parser::Maintainer[abi:cxx11]()@Base" 0.8.0 + (c++)"pkgRecords::Parser::Name[abi:cxx11]()@Base" 0.8.0 (c++)"pkgRecords::Parser::GetRec(char const*&, char const*&)@Base" 0.8.0 - (c++)"pkgRecords::Parser::FileName()@Base" 0.8.0 - (c++)"pkgRecords::Parser::Homepage()@Base" 0.8.0 - (c++)"pkgRecords::Parser::SourcePkg()@Base" 0.8.0 - (c++)"pkgRecords::Parser::SourceVer()@Base" 0.8.0 + (c++)"pkgRecords::Parser::FileName[abi:cxx11]()@Base" 0.8.0 + (c++)"pkgRecords::Parser::Homepage[abi:cxx11]()@Base" 0.8.0 + (c++)"pkgRecords::Parser::SourcePkg[abi:cxx11]()@Base" 0.8.0 + (c++)"pkgRecords::Parser::SourceVer[abi:cxx11]()@Base" 0.8.0 (c++)"pkgRecords::pkgRecords(pkgCache&)@Base" 0.8.0 (c++)"pkgRecords::~pkgRecords()@Base" 0.8.0 (c++)"pkgTagFile::Step(pkgTagSection&)@Base" 0.8.0 @@ -180,7 +171,7 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"DynamicMMap::DynamicMMap(unsigned long, unsigned long const&, unsigned long const&, unsigned long const&)@Base" 0.8.0 (c++)"DynamicMMap::~DynamicMMap()@Base" 0.8.0 (c++)"GlobalError::DumpErrors(std::basic_ostream >&, GlobalError::MsgType const&, bool const&)@Base" 0.8.0 - (c++)"GlobalError::PopMessage(std::basic_string, std::allocator >&)@Base" 0.8.0 + (c++)"GlobalError::PopMessage(std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 (c++)"GlobalError::InsertErrno(GlobalError::MsgType const&, char const*, char const*, ...)@Base" 0.8.0 (c++)"GlobalError::PushToStack()@Base" 0.8.0 (c++)"GlobalError::RevertToStack()@Base" 0.8.0 @@ -199,7 +190,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"GlobalError::WarningE(char const*, char const*, ...)@Base" 0.8.0 (c++)"GlobalError::GlobalError()@Base" 0.8.0 (c++)"PackageCopy::GetFileName()@Base" 0.8.0 - (c++)"PackageCopy::RewriteEntry(_IO_FILE*, std::basic_string, std::allocator >)@Base" 0.8.0 (c++)"PackageCopy::Type()@Base" 0.8.0 (c++)"PackageCopy::~PackageCopy()@Base" 0.8.0 (c++)"pkgDepCache::IsDeleteOk(pkgCache::PkgIterator const&, bool, unsigned long, bool)@Base" 0.8.0 @@ -212,27 +202,22 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgDepCache::IsInstallOk(pkgCache::PkgIterator const&, bool, unsigned long, bool)@Base" 0.8.0 (c++)"pkgDepCache::MarkInstall(pkgCache::PkgIterator const&, bool, unsigned long, bool, bool)@Base" 0.8.0 (c++)"pkgDepCache::SetReInstall(pkgCache::PkgIterator const&, bool)@Base" 0.8.0 - (c++)"pkgDepCache::VersionState(pkgCache::DepIterator, unsigned char, unsigned char, unsigned char)@Base" 0.8.0 (c++)"pkgDepCache::BuildGroupOrs(pkgCache::VerIterator const&)@Base" 0.8.0 (c++)"pkgDepCache::InRootSetFunc::InRootSet(pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"pkgDepCache::InRootSetFunc::~InRootSetFunc()@Base" 0.8.0 (c++)"pkgDepCache::readStateFile(OpProgress*)@Base" 0.8.0 (c++)"pkgDepCache::GetRootSetFunc()@Base" 0.8.0 - (c++)"pkgDepCache::UpdateVerState(pkgCache::PkgIterator)@Base" 0.8.0 (c++)"pkgDepCache::writeStateFile(OpProgress*, bool)@Base" 0.8.0 - (c++)"pkgDepCache::DependencyState(pkgCache::DepIterator&)@Base" 0.8.0 (c++)"pkgDepCache::DefaultRootSetFunc::InRootSet(pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc()@Base" 0.8.0 (c++)"pkgDepCache::MarkFollowsSuggests()@Base" 0.8.0 (c++)"pkgDepCache::MarkFollowsRecommends()@Base" 0.8.0 (c++)"pkgDepCache::Init(OpProgress*)@Base" 0.8.0 - (c++)"pkgDepCache::Policy::IsImportantDep(pkgCache::DepIterator const&)@Base" 0.8.0 (c++)"pkgDepCache::Policy::GetCandidateVer(pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"pkgDepCache::Policy::~Policy()@Base" 0.8.0 (c++)"pkgDepCache::Update(pkgCache::DepIterator)@Base" 0.8.0 (c++)"pkgDepCache::Update(OpProgress*)@Base" 0.8.0 (c++)"pkgDepCache::Update(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgDepCache::CheckDep(pkgCache::DepIterator, int, pkgCache::PkgIterator&)@Base" 0.8.0 (c++)"pkgDepCache::MarkAuto(pkgCache::PkgIterator const&, bool)@Base" 0.8.0 (c++)"pkgDepCache::MarkKeep(pkgCache::PkgIterator const&, bool, bool, unsigned long)@Base" 0.8.0 (c++)"pkgDepCache::MarkRequired(pkgDepCache::InRootSetFunc&)@Base" 0.8.0 @@ -242,28 +227,24 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgSimulate::Policy::GetCandidateVer(pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"pkgSimulate::Policy::~Policy()@Base" 0.8.0 (c++)"pkgSimulate::Remove(pkgCache::PkgIterator, bool)@Base" 0.8.0 - (c++)"pkgSimulate::Install(pkgCache::PkgIterator, std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgSimulate::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgSimulate::Configure(pkgCache::PkgIterator)@Base" 0.8.0 (c++)"pkgSimulate::pkgSimulate(pkgDepCache*)@Base" 0.8.0 (c++)"pkgSimulate::~pkgSimulate()@Base" 0.8.0 - (c++)"indexRecords::Load(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"indexRecords::Lookup(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"indexRecords::MetaKeys()@Base" 0.8.0 - (c++)"indexRecords::~indexRecords()@Base" 0.8.0 (c++)"pkgAcqMethod::FetchResult::TakeHashes(Hashes&)@Base" 0.8.0 (c++)"pkgAcqMethod::FetchResult::FetchResult()@Base" 0.8.0 - (c++)"pkgAcqMethod::Configuration(std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgAcqMethod::Configuration(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgAcqMethod::Log(char const*, ...)@Base" 0.8.0 (c++)"pkgAcqMethod::Run(bool)@Base" 0.8.0 (c++)"pkgAcqMethod::Exit()@Base" 0.8.0 - (c++)"pkgAcqMethod::Fail(std::basic_string, std::allocator >, bool)@Base" 0.8.0 + (c++)"pkgAcqMethod::Fail(std::__cxx11::basic_string, std::allocator >, bool)@Base" 0.8.0 (c++)"pkgAcqMethod::Fail(bool)@Base" 0.8.0 (c++)"pkgAcqMethod::Fetch(pkgAcqMethod::FetchItem*)@Base" 0.8.0 (c++)"pkgAcqMethod::Status(char const*, ...)@Base" 0.8.0 (c++)"pkgAcqMethod::URIDone(pkgAcqMethod::FetchResult&, pkgAcqMethod::FetchResult*)@Base" 0.8.0 - (c++)"pkgAcqMethod::Redirect(std::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"pkgAcqMethod::Redirect(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 (c++)"pkgAcqMethod::URIStart(pkgAcqMethod::FetchResult&)@Base" 0.8.0 - (c++)"pkgAcqMethod::MediaFail(std::basic_string, std::allocator >, std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgAcqMethod::MediaFail(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgAcqMethod::pkgAcqMethod(char const*, unsigned long)@Base" 0.8.0 (c++)"pkgAcqMethod::~pkgAcqMethod()@Base" 0.8.0 (c++)"pkgCacheFile::BuildCaches(OpProgress*, bool)@Base" 0.8.0 @@ -274,7 +255,7 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgCacheFile::Close()@Base" 0.8.0 (c++)"pkgCacheFile::pkgCacheFile()@Base" 0.8.0 (c++)"pkgCacheFile::~pkgCacheFile()@Base" 0.8.0 - (c++)"pkgIndexFile::LanguageCode()@Base" 0.8.0 + (c++)"pkgIndexFile::LanguageCode[abi:cxx11]()@Base" 0.8.0 (c++)"pkgIndexFile::CheckLanguageCode(char const*)@Base" 0.8.0 (c++)"pkgIndexFile::TranslationsAvailable()@Base" 0.8.0 (c++)"pkgIndexFile::Type::GlobalList@Base" 0.8.0 @@ -282,7 +263,7 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgIndexFile::Type::GetType(char const*)@Base" 0.8.0 (c++)"pkgIndexFile::Type::Type()@Base" 0.8.0 (c++)"pkgOrderList::VisitRDeps(bool (pkgOrderList::*)(pkgCache::DepIterator), pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgOrderList::OrderUnpack(std::basic_string, std::allocator >*)@Base" 0.8.0 + (c++)"pkgOrderList::OrderUnpack(std::__cxx11::basic_string, std::allocator >*)@Base" 0.8.0 (c++)"pkgOrderList::DepConfigure(pkgCache::DepIterator)@Base" 0.8.0 (c++)"pkgOrderList::DepUnPackDep(pkgCache::DepIterator)@Base" 0.8.0 (c++)"pkgOrderList::DepUnPackPre(pkgCache::DepIterator)@Base" 0.8.0 @@ -308,39 +289,31 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgOrderList::~pkgOrderList()@Base" 0.8.0 (c++)"Configuration::MatchAgainstConfig::MatchAgainstConfig(char const*)@Base" 0.8.0 (c++)"Configuration::MatchAgainstConfig::~MatchAgainstConfig()@Base" 0.8.0 - (c++)"Configuration::Set(char const*, std::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"Configuration::Set(char const*, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 (c++)"Configuration::Set(char const*, int const&)@Base" 0.8.0 (c++)"Configuration::Dump(std::basic_ostream >&)@Base" 0.8.0 - (c++)"Configuration::Clear(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"Configuration::Clear(std::basic_string, std::allocator > const&, int const&)@Base" 0.8.0 - (c++)"Configuration::Clear(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"Configuration::CndSet(char const*, std::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"Configuration::Clear(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"Configuration::Clear(std::__cxx11::basic_string, std::allocator > const&, int const&)@Base" 0.8.0 + (c++)"Configuration::Clear(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"Configuration::CndSet(char const*, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 (c++)"Configuration::Lookup(char const*, bool const&)@Base" 0.8.0 (c++)"Configuration::Lookup(Configuration::Item*, char const*, unsigned long const&, bool const&)@Base" 0.8.0 (c++)"Configuration::Configuration(Configuration::Item const*)@Base" 0.8.0 (c++)"Configuration::Configuration()@Base" 0.8.0 (c++)"Configuration::~Configuration()@Base" 0.8.0 (c++)"WeakPointable::~WeakPointable()@Base" 0.8.0 - (c++)"debListParser::ParseDepends(char const*, char const*, std::basic_string, std::allocator >&, std::basic_string, std::allocator >&, unsigned int&, bool const&, bool const&)@Base" 0.8.0 + (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&, bool const&)@Base" 0.8.0 (c++)"debListParser::ConvertRelation(char const*, unsigned int&)@Base" 0.8.0 - (c++)"debListParser::GetPrio(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcqArchive::Failed(std::basic_string, std::allocator >, pkgAcquire::MethodConfig*)@Base" 0.8.0 - (c++)"pkgAcqArchive::DescURI()@Base" 0.8.0 + (c++)"debListParser::GetPrio(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgAcqArchive::Finished()@Base" 0.8.0 (c++)"pkgAcqArchive::QueueNext()@Base" 0.8.0 - (c++)"pkgAcqArchive::ShortDesc()@Base" 0.8.0 - (c++)"pkgAcqArchive::pkgAcqArchive(pkgAcquire*, pkgSourceList*, pkgRecords*, pkgCache::VerIterator const&, std::basic_string, std::allocator >&)@Base" 0.8.0 + (c++)"pkgAcqArchive::pkgAcqArchive(pkgAcquire*, pkgSourceList*, pkgRecords*, pkgCache::VerIterator const&, std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 (c++)"pkgAcqArchive::~pkgAcqArchive()@Base" 0.8.0 - (c++)"pkgSourceList::ReadAppend(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgSourceList::ReadMainList()@Base" 0.8.0 - (c++)"pkgSourceList::ReadSourceDir(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgSourceList::Read(std::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgSourceList::Type::GlobalList@Base" 0.8.0 (c++)"pkgSourceList::Type::GlobalListLen@Base" 0.8.0 (c++)"pkgSourceList::Type::GetType(char const*)@Base" 0.8.0 - (c++)"pkgSourceList::Type::Type()@Base" 0.8.0 + (c++)"pkgSourceList::ReadMainList()@Base" 0.8.0 (c++)"pkgSourceList::Reset()@Base" 0.8.0 - (c++)"pkgSourceList::pkgSourceList(std::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgSourceList::pkgSourceList()@Base" 0.8.0 (c++)"pkgSourceList::~pkgSourceList()@Base" 0.8.0 (c++)"pkgSrcRecords::File::~File()@Base" 0.8.0 @@ -352,25 +325,19 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgSrcRecords::~pkgSrcRecords()@Base" 0.8.0 (c++)"pkgTagSection::TrimRecord(bool, char const*&)@Base" 0.8.0 (c++)"pkgTagSection::Trim()@Base" 0.8.0 - (c++)"pkgVendorList::CreateList(Configuration&)@Base" 0.8.0 - (c++)"pkgVendorList::FindVendor(std::vector, std::allocator >, std::allocator, std::allocator > > >)@Base" 0.8.0 - (c++)"pkgVendorList::ReadMainList()@Base" 0.8.0 - (c++)"pkgVendorList::LookupFingerprint(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgVendorList::Read(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgVendorList::~pkgVendorList()@Base" 0.8.0 (c++)"OpTextProgress::Done()@Base" 0.8.0 (c++)"OpTextProgress::Write(char const*)@Base" 0.8.0 (c++)"OpTextProgress::Update()@Base" 0.8.0 (c++)"OpTextProgress::OpTextProgress(Configuration&)@Base" 0.8.0 (c++)"OpTextProgress::~OpTextProgress()@Base" 0.8.0 (c++)"pkgVersionMatch::ExpressionMatches(char const*, char const*)@Base" 0.8.0 - (c++)"pkgVersionMatch::ExpressionMatches(std::basic_string, std::allocator > const&, char const*)@Base" 0.8.0 + (c++)"pkgVersionMatch::ExpressionMatches(std::__cxx11::basic_string, std::allocator > const&, char const*)@Base" 0.8.0 (c++)"pkgVersionMatch::Find(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgVersionMatch::MatchVer(char const*, std::basic_string, std::allocator >, bool)@Base" 0.8.0 + (c++)"pkgVersionMatch::MatchVer(char const*, std::__cxx11::basic_string, std::allocator >, bool)@Base" 0.8.0 (c++)"pkgVersionMatch::FileMatch(pkgCache::PkgFileIterator)@Base" 0.8.0 - (c++)"pkgVersionMatch::pkgVersionMatch(std::basic_string, std::allocator >, pkgVersionMatch::MatchType)@Base" 0.8.0 + (c++)"pkgVersionMatch::pkgVersionMatch(std::__cxx11::basic_string, std::allocator >, pkgVersionMatch::MatchType)@Base" 0.8.0 (c++)"pkgVersionMatch::~pkgVersionMatch()@Base" 0.8.0 - (c++)"TranslationsCopy::CopyTranslations(std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, pkgCdromStatus*)@Base" 0.8.0 + (c++)"TranslationsCopy::CopyTranslations(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, pkgCdromStatus*)@Base" 0.8.0 (c++)"pkgAcquireStatus::Done(pkgAcquire::ItemDesc&)@Base" 0.8.0 (c++)"pkgAcquireStatus::Fail(pkgAcquire::ItemDesc&)@Base" 0.8.0 (c++)"pkgAcquireStatus::Stop()@Base" 0.8.0 @@ -379,10 +346,8 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgAcquireStatus::Start()@Base" 0.8.0 (c++)"pkgAcquireStatus::IMSHit(pkgAcquire::ItemDesc&)@Base" 0.8.0 (c++)"pkgAcquireStatus::pkgAcquireStatus()@Base" 0.8.0 - (c++)"PreferenceSection::TrimRecord(bool, char const*&)@Base" 0.8.0 - (c++)"pkgArchiveCleaner::Go(std::basic_string, std::allocator >, pkgCache&)@Base" 0.8.0 + (c++)"pkgArchiveCleaner::Go(std::__cxx11::basic_string, std::allocator >, pkgCache&)@Base" 0.8.0 (c++)"pkgCacheGenerator::MakeStatusCache(pkgSourceList&, OpProgress*, MMap**, bool)@Base" 0.8.0 - (c++)"pkgCacheGenerator::CreateDynamicMMap(FileFd*, unsigned long)@Base" 0.8.0 (c++)"pkgCacheGenerator::MakeOnlyStatusCache(OpProgress*, DynamicMMap**)@Base" 0.8.0 (c++)"pkgPackageManager::FixMissing()@Base" 0.8.0 (c++)"pkgPackageManager::EarlyRemove(pkgCache::PkgIterator)@Base" 0.8.0 @@ -399,7 +364,7 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgPackageManager::Go(int)@Base" 0.8.0 (c++)"pkgPackageManager::Reset()@Base" 0.8.0 (c++)"pkgPackageManager::Remove(pkgCache::PkgIterator, bool)@Base" 0.8.0 - (c++)"pkgPackageManager::Install(pkgCache::PkgIterator, std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgPackageManager::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgPackageManager::Configure(pkgCache::PkgIterator)@Base" 0.8.0 (c++)"pkgPackageManager::DoInstall(int)@Base" 0.8.0 (c++)"pkgPackageManager::pkgPackageManager(pkgDepCache*)@Base" 0.8.0 @@ -411,7 +376,7 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"debVersioningSystem::CmpFragment(char const*, char const*, char const*, char const*)@Base" 0.8.0 (c++)"debVersioningSystem::DoCmpVersion(char const*, char const*, char const*, char const*)@Base" 0.8.0 (c++)"debVersioningSystem::DoCmpReleaseVer(char const*, char const*, char const*, char const*)@Base" 0.8.0 - (c++)"debVersioningSystem::UpstreamVersion(char const*)@Base" 0.8.0 + (c++)"debVersioningSystem::UpstreamVersion[abi:cxx11](char const*)@Base" 0.8.0 (c++)"debVersioningSystem::CheckDep(char const*, int, char const*)@Base" 0.8.0 (c++)"debVersioningSystem::debVersioningSystem()@Base" 0.8.0 (c++)"debVersioningSystem::~debVersioningSystem()@Base" 0.8.0 @@ -424,24 +389,21 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgVersioningSystem::TestCompatibility(pkgVersioningSystem const&)@Base" 0.8.0 (c++)"pkgVersioningSystem::GetVS(char const*)@Base" 0.8.0 (c++)"pkgVersioningSystem::pkgVersioningSystem()@Base" 0.8.0 - (c++)"APT::CacheFilter::PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"APT::CacheFilter::PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 (c++)"APT::CacheFilter::PackageNameMatchesRegEx::~PackageNameMatchesRegEx()@Base" 0.8.0 (c++)"APT::CacheFilter::PackageNameMatchesRegEx::operator()(pkgCache::GrpIterator const&)@Base" 0.8.0 (c++)"APT::CacheFilter::PackageNameMatchesRegEx::operator()(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"APT::Configuration::getLanguages(bool const&, bool const&, char const**)@Base" 0.8.0 - (c++)"APT::Configuration::getArchitectures(bool const&)@Base" 0.8.0 - (c++)"APT::Configuration::checkArchitecture(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"APT::Configuration::getCompressionTypes(bool const&)@Base" 0.8.0 - (c++)"APT::CacheSetHelper::canNotFindPkgName(pkgCacheFile&, std::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"APT::Configuration::checkArchitecture(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"APT::CacheSetHelper::canNotFindPkgName(pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 (c++)"APT::CacheSetHelper::canNotFindNewestVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"APT::CacheSetHelper::canNotFindCandidateVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"APT::CacheSetHelper::canNotFindInstalledVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"APT::CacheSetHelper::~CacheSetHelper()@Base" 0.8.0 - (c++)"URI::NoUserPassword(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"URI::CopyFrom(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"URI::SiteOnly(std::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"URI::NoUserPassword(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"URI::CopyFrom(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"URI::SiteOnly(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 (c++)"URI::~URI()@Base" 0.8.0 - (c++)"URI::operator std::basic_string, std::allocator >()@Base" 0.8.0 + (c++)"URI::operator std::__cxx11::basic_string, std::allocator >[abi:cxx11]()@Base" 0.8.0 (c++)"MMap::Map(FileFd&)@Base" 0.8.0 (c++)"MMap::Sync(unsigned long, unsigned long)@Base" 0.8.0 (c++)"MMap::Sync()@Base" 0.8.0 @@ -454,58 +416,40 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"FileFd::Tell()@Base" 0.8.0 (c++)"FileFd::Close()@Base" 0.8.0 (c++)"FileFd::~FileFd()@Base" 0.8.0 - (c++)"Vendor::CheckDist(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"Vendor::Vendor(std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::vector >*)@Base" 0.8.0 - (c++)"Vendor::~Vendor()@Base" 0.8.0 (c++)"pkgCache::CompTypeDeb(unsigned char)@Base" 0.8.0 (c++)"pkgCache::DepIterator::GlobOr(pkgCache::DepIterator&, pkgCache::DepIterator&)@Base" 0.8.0 - (c++)"pkgCache::DepIterator::operator++(int)@Base" 0.8.0 (c++)"pkgCache::DepIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::GrpIterator::operator++(int)@Base" 0.8.0 (c++)"pkgCache::GrpIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::PkgIterator::operator++(int)@Base" 0.8.0 (c++)"pkgCache::PkgIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::PrvIterator::operator++(int)@Base" 0.8.0 - (c++)"pkgCache::PrvIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::VerIterator::operator++(int)@Base" 0.8.0 - (c++)"pkgCache::VerIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::DescIterator::operator++(int)@Base" 0.8.0 - (c++)"pkgCache::DescIterator::operator++()@Base" 0.8.0 (c++)"pkgCache::PkgFileIterator::IsOk()@Base" 0.8.0 - (c++)"pkgCache::PkgFileIterator::RelStr()@Base" 0.8.0 - (c++)"pkgCache::PkgFileIterator::operator++(int)@Base" 0.8.0 - (c++)"pkgCache::PkgFileIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::VerFileIterator::operator++(int)@Base" 0.8.0 - (c++)"pkgCache::VerFileIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::DescFileIterator::operator++(int)@Base" 0.8.0 - (c++)"pkgCache::DescFileIterator::operator++()@Base" 0.8.0 + (c++)"pkgCache::PkgFileIterator::RelStr[abi:cxx11]()@Base" 0.8.0 (c++)"pkgCache::ReMap(bool const&)@Base" 0.8.0 (c++)"pkgCache::Header::Header()@Base" 0.8.0 (c++)"pkgCache::DepType(unsigned char)@Base" 0.8.0 - (c++)"pkgCache::FindGrp(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"pkgCache::FindPkg(std::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"pkgCache::FindPkg(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"pkgCache::FindGrp(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"pkgCache::FindPkg(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 + (c++)"pkgCache::FindPkg(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 (c++)"pkgCache::CompType(unsigned char)@Base" 0.8.0 (c++)"pkgCache::Priority(unsigned char)@Base" 0.8.0 (c++)"pkgCache::pkgCache(MMap*, bool)@Base" 0.8.0 (c++)"pkgCache::~pkgCache()@Base" 0.8.0 - (c++)"pkgCdrom::DropRepeats(std::vector, std::allocator >, std::allocator, std::allocator > > >&, char const*)@Base" 0.8.0 - (c++)"pkgCdrom::FindPackages(std::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::basic_string, std::allocator >&, pkgCdromStatus*, unsigned int)@Base" 0.8.0 + (c++)"pkgCdrom::DropRepeats(std::vector, std::allocator >, std::allocator, std::allocator > > >&, char const*)@Base" 0.8.0 + (c++)"pkgCdrom::FindPackages(std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::__cxx11::basic_string, std::allocator >&, pkgCdromStatus*, unsigned int)@Base" 0.8.0 (c++)"pkgCdrom::WriteDatabase(Configuration&)@Base" 0.8.0 - (c++)"pkgCdrom::DropBinaryArch(std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.8.0 - (c++)"pkgCdrom::WriteSourceList(std::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, bool)@Base" 0.8.0 - (c++)"pkgCdrom::ReduceSourcelist(std::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.8.0 + (c++)"pkgCdrom::DropBinaryArch(std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.8.0 + (c++)"pkgCdrom::WriteSourceList(std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, bool)@Base" 0.8.0 + (c++)"pkgCdrom::ReduceSourcelist(std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.8.0 (c++)"pkgCdrom::Add(pkgCdromStatus*)@Base" 0.8.0 - (c++)"pkgCdrom::Ident(std::basic_string, std::allocator >&, pkgCdromStatus*)@Base" 0.8.0 - (c++)"pkgCdrom::Score(std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"IndexCopy::CopyPackages(std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, pkgCdromStatus*)@Base" 0.8.0 - (c++)"IndexCopy::ReconstructChop(unsigned long&, std::basic_string, std::allocator >, std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"IndexCopy::ReconstructPrefix(std::basic_string, std::allocator >&, std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"IndexCopy::ConvertToSourceList(std::basic_string, std::allocator >, std::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"IndexCopy::ChopDirs(std::basic_string, std::allocator >, unsigned int)@Base" 0.8.0 - (c++)"IndexCopy::GrabFirst(std::basic_string, std::allocator >, std::basic_string, std::allocator >&, unsigned int)@Base" 0.8.0 - (c++)"SigVerify::CopyAndVerify(std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >, std::vector, std::allocator >, std::allocator, std::allocator > > >)@Base" 0.8.0 - (c++)"SigVerify::RunGPGV(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, int const&, int*)@Base" 0.8.0 + (c++)"pkgCdrom::Ident(std::__cxx11::basic_string, std::allocator >&, pkgCdromStatus*)@Base" 0.8.0 + (c++)"pkgCdrom::Score(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"IndexCopy::CopyPackages(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, pkgCdromStatus*)@Base" 0.8.0 + (c++)"IndexCopy::ReconstructChop(unsigned long&, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"IndexCopy::ReconstructPrefix(std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"IndexCopy::ConvertToSourceList(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 + (c++)"IndexCopy::ChopDirs(std::__cxx11::basic_string, std::allocator >, unsigned int)@Base" 0.8.0 + (c++)"IndexCopy::GrabFirst(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int)@Base" 0.8.0 + (c++)"SigVerify::CopyAndVerify(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >, std::vector, std::allocator >, std::allocator, std::allocator > > >)@Base" 0.8.0 + (c++)"SigVerify::RunGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&, int*)@Base" 0.8.0 (c++)"debSystem::Initialize(Configuration&)@Base" 0.8.0 (c++)"debSystem::AddStatusFiles(std::vector >&)@Base" 0.8.0 (c++)"debSystem::ArchiveSupported(char const*)@Base" 0.8.0 @@ -516,14 +460,14 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"debSystem::~debSystem()@Base" 0.8.0 (c++)"pkgDPkgPM::SendV2Pkgs(_IO_FILE*)@Base" 0.8.0 (c++)"pkgDPkgPM::DoTerminalPty(int)@Base" 0.8.0 - (c++)"pkgDPkgPM::WriteHistoryTag(std::basic_string, std::allocator > const&, std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgDPkgPM::WriteHistoryTag(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgDPkgPM::WriteApportReport(char const*, char const*)@Base" 0.8.0 (c++)"pkgDPkgPM::RunScriptsWithPkgs(char const*)@Base" 0.8.0 (c++)"pkgDPkgPM::Go(int)@Base" 0.8.0 (c++)"pkgDPkgPM::Reset()@Base" 0.8.0 (c++)"pkgDPkgPM::Remove(pkgCache::PkgIterator, bool)@Base" 0.8.0 (c++)"pkgDPkgPM::DoStdin(int)@Base" 0.8.0 - (c++)"pkgDPkgPM::Install(pkgCache::PkgIterator, std::basic_string, std::allocator >)@Base" 0.8.0 + (c++)"pkgDPkgPM::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 (c++)"pkgDPkgPM::OpenLog()@Base" 0.8.0 (c++)"pkgDPkgPM::CloseLog()@Base" 0.8.0 (c++)"pkgDPkgPM::Configure(pkgCache::PkgIterator)@Base" 0.8.0 @@ -534,7 +478,7 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"pkgPolicy::PkgPin::~PkgPin()@Base" 0.8.0 (c++)"pkgPolicy::GetMatch(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgPolicy::CreatePin(pkgVersionMatch::MatchType, std::basic_string, std::allocator >, std::basic_string, std::allocator >, short)@Base" 0.8.0 + (c++)"pkgPolicy::CreatePin(pkgVersionMatch::MatchType, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, short)@Base" 0.8.0 (c++)"pkgPolicy::pkgPolicy(pkgCache*)@Base" 0.8.0 (c++)"pkgPolicy::~pkgPolicy()@Base" 0.8.0 (c++)"pkgSystem::GlobalList@Base" 0.8.0 @@ -542,79 +486,54 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgSystem::GlobalListLen@Base" 0.8.0 (c++)"pkgSystem::Score(Configuration const&)@Base" 0.8.0 (c++)"pkgSystem::GetSystem(char const*)@Base" 0.8.0 - (c++)"pkgSystem::pkgSystem()@Base" 0.8.0 - (c++)"HashString::VerifyFile(std::basic_string, std::allocator >) const@Base" 0.8.0 + (c++)"HashString::VerifyFile(std::__cxx11::basic_string, std::allocator >) const@Base" 0.8.0 (c++)"HashString::empty() const@Base" 0.8.0 - (c++)"HashString::toStr() const@Base" 0.8.0 + (c++)"HashString::toStr[abi:cxx11]() const@Base" 0.8.0 (c++)"CommandLine::FileSize() const@Base" 0.8.0 (c++)"GlobalError::empty(GlobalError::MsgType const&) const@Base" 0.8.0 - (c++)"indexRecords::GetValidUntil() const@Base" 0.8.0 - (c++)"indexRecords::GetExpectedDist() const@Base" 0.8.0 - (c++)"indexRecords::Exists(std::basic_string, std::allocator > const&) const@Base" 0.8.0 - (c++)"indexRecords::GetDist() const@Base" 0.8.0 - (c++)"indexRecords::CheckDist(std::basic_string, std::allocator >) const@Base" 0.8.0 - (c++)"pkgIndexFile::ArchiveURI(std::basic_string, std::allocator >) const@Base" 0.8.0 - (c++)"pkgIndexFile::SourceInfo(pkgSrcRecords::Parser const&, pkgSrcRecords::File const&) const@Base" 0.8.0 - (c++)"pkgIndexFile::ArchiveInfo(pkgCache::VerIterator) const@Base" 0.8.0 (c++)"pkgIndexFile::FindInCache(pkgCache&) const@Base" 0.8.0 (c++)"pkgIndexFile::CreateSrcParser() const@Base" 0.8.0 - (c++)"pkgIndexFile::MergeFileProvides(pkgCacheGenerator&, OpProgress&) const@Base" 0.8.0 - (c++)"pkgIndexFile::Type::CreatePkgParser(pkgCache::PkgFileIterator) const@Base" 0.8.0 - (c++)"pkgIndexFile::Merge(pkgCacheGenerator&, OpProgress&) const@Base" 0.8.0 (c++)"Configuration::MatchAgainstConfig::Match(char const*) const@Base" 0.8.0 - (c++)"Configuration::Find(char const*, char const*) const@Base" 0.8.0 - (c++)"Configuration::Item::FullTag(Configuration::Item const*) const@Base" 0.8.0 + (c++)"Configuration::Find[abi:cxx11](char const*, char const*) const@Base" 0.8.0 + (c++)"Configuration::Item::FullTag[abi:cxx11](Configuration::Item const*) const@Base" 0.8.0 (c++)"Configuration::FindB(char const*, bool const&) const@Base" 0.8.0 (c++)"Configuration::FindI(char const*, int const&) const@Base" 0.8.0 (c++)"Configuration::Exists(char const*) const@Base" 0.8.0 - (c++)"Configuration::FindAny(char const*, char const*) const@Base" 0.8.0 - (c++)"Configuration::FindDir(char const*, char const*) const@Base" 0.8.0 - (c++)"Configuration::FindFile(char const*, char const*) const@Base" 0.8.0 + (c++)"Configuration::FindAny[abi:cxx11](char const*, char const*) const@Base" 0.8.0 + (c++)"Configuration::FindDir[abi:cxx11](char const*, char const*) const@Base" 0.8.0 + (c++)"Configuration::FindFile[abi:cxx11](char const*, char const*) const@Base" 0.8.0 (c++)"Configuration::ExistsAny(char const*) const@Base" 0.8.0 (c++)"pkgSourceList::GetIndexes(pkgAcquire*, bool) const@Base" 0.8.0 - (c++)"pkgSourceList::Type::FixupURI(std::basic_string, std::allocator >&) const@Base" 0.8.0 - (c++)"pkgSourceList::Type::ParseLine(std::vector >&, char const*, unsigned long const&, std::basic_string, std::allocator > const&) const@Base" 0.8.0 + (c++)"pkgSourceList::Type::FixupURI(std::__cxx11::basic_string, std::allocator >&) const@Base" 0.8.0 (c++)"pkgSourceList::FindIndex(pkgCache::PkgFileIterator, pkgIndexFile*&) const@Base" 0.8.0 (c++)"pkgTagSection::Find(char const*, char const*&, char const*&) const@Base" 0.8.0 (c++)"pkgTagSection::Find(char const*, unsigned int&) const@Base" 0.8.0 (c++)"pkgTagSection::FindI(char const*, long) const@Base" 0.8.0 - (c++)"pkgTagSection::FindS(char const*) const@Base" 0.8.0 + (c++)"pkgTagSection::FindS[abi:cxx11](char const*) const@Base" 0.8.0 (c++)"pkgTagSection::FindULL(char const*, unsigned long long const&) const@Base" 0.8.0 (c++)"pkgTagSection::FindFlag(char const*, unsigned long&, unsigned long) const@Base" 0.8.0 - (c++)"Vendor::GetVendorID() const@Base" 0.8.0 - (c++)"Vendor::LookupFingerprint(std::basic_string, std::allocator >) const@Base" 0.8.0 (c++)"pkgCache::DepIterator::AllTargets() const@Base" 0.8.0 (c++)"pkgCache::DepIterator::IsCritical() const@Base" 0.8.0 - (c++)"pkgCache::DepIterator::OwnerPointer() const@Base" 0.8.0 (c++)"pkgCache::DepIterator::SmartTargetPkg(pkgCache::PkgIterator&) const@Base" 0.8.0 - (c++)"pkgCache::GrpIterator::OwnerPointer() const@Base" 0.8.0 (c++)"pkgCache::GrpIterator::FindPreferredPkg(bool const&) const@Base" 0.8.0 - (c++)"pkgCache::GrpIterator::FindPkg(std::basic_string, std::allocator >) const@Base" 0.8.0 + (c++)"pkgCache::GrpIterator::FindPkg(std::__cxx11::basic_string, std::allocator >) const@Base" 0.8.0 (c++)"pkgCache::GrpIterator::NextPkg(pkgCache::PkgIterator const&) const@Base" 0.8.0 (c++)"pkgCache::PkgIterator::CurVersion() const@Base" 0.8.0 (c++)"pkgCache::PkgIterator::CandVersion() const@Base" 0.8.0 - (c++)"pkgCache::PkgIterator::OwnerPointer() const@Base" 0.8.0 (c++)"pkgCache::PkgIterator::State() const@Base" 0.8.0 - (c++)"pkgCache::PkgIterator::FullName(bool const&) const@Base" 0.8.0 - (c++)"pkgCache::PrvIterator::OwnerPointer() const@Base" 0.8.0 (c++)"pkgCache::VerIterator::CompareVer(pkgCache::VerIterator const&) const@Base" 0.8.0 (c++)"pkgCache::VerIterator::NewestFile() const@Base" 0.8.0 (c++)"pkgCache::VerIterator::Downloadable() const@Base" 0.8.0 - (c++)"pkgCache::VerIterator::OwnerPointer() const@Base" 0.8.0 (c++)"pkgCache::VerIterator::TranslatedDescription() const@Base" 0.8.0 - (c++)"pkgCache::VerIterator::RelStr() const@Base" 0.8.0 + (c++)"pkgCache::VerIterator::RelStr[abi:cxx11]() const@Base" 0.8.0 (c++)"pkgCache::VerIterator::Automatic() const@Base" 0.8.0 - (c++)"pkgCache::DescIterator::OwnerPointer() const@Base" 0.8.0 - (c++)"pkgCache::PkgFileIterator::OwnerPointer() const@Base" 0.8.0 - (c++)"pkgCache::VerFileIterator::OwnerPointer() const@Base" 0.8.0 - (c++)"pkgCache::DescFileIterator::OwnerPointer() const@Base" 0.8.0 (c++)"pkgCache::sHash(char const*) const@Base" 0.8.0 - (c++)"pkgCache::sHash(std::basic_string, std::allocator > const&) const@Base" 0.8.0 + (c++)"pkgCache::sHash(std::__cxx11::basic_string, std::allocator > const&) const@Base" 0.8.0 (c++)"pkgCache::Header::CheckSizes(pkgCache::Header&) const@Base" 0.8.0 (c++)"debSystem::CreatePM(pkgDepCache*) const@Base" 0.8.0 (c++)"debSystem::FindIndex(pkgCache::PkgFileIterator, pkgIndexFile*&) const@Base" 0.8.0 - (c++)"metaIndex::GetURI() const@Base" 0.8.0 - (c++)"metaIndex::GetDist() const@Base" 0.8.0 + (c++)"metaIndex::GetURI[abi:cxx11]() const@Base" 0.8.0 + (c++)"metaIndex::GetDist[abi:cxx11]() const@Base" 0.8.0 (c++)"metaIndex::GetType() const@Base" 0.8.0 (c++)"typeinfo for OpProgress@Base" 0.8.0 (c++)"typeinfo for SourceCopy@Base" 0.8.0 @@ -624,7 +543,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"typeinfo for PackageCopy@Base" 0.8.0 (c++)"typeinfo for pkgDepCache@Base" 0.8.0 (c++)"typeinfo for pkgSimulate@Base" 0.8.0 - (c++)"typeinfo for indexRecords@Base" 0.8.0 (c++)"typeinfo for pkgAcqMethod@Base" 0.8.0 (c++)"typeinfo for pkgCacheFile@Base" 0.8.0 (c++)"typeinfo for pkgIndexFile@Base" 0.8.0 @@ -633,14 +551,12 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"typeinfo for pkgTagSection@Base" 0.8.0 (c++)"typeinfo for OpTextProgress@Base" 0.8.0 (c++)"typeinfo for pkgAcquireStatus@Base" 0.8.0 - (c++)"typeinfo for PreferenceSection@Base" 0.8.0 (c++)"typeinfo for pkgPackageManager@Base" 0.8.0 (c++)"typeinfo for debVersioningSystem@Base" 0.8.0 (c++)"typeinfo for pkgUdevCdromDevices@Base" 0.8.0 (c++)"typeinfo for pkgVersioningSystem@Base" 0.8.0 (c++)"typeinfo for MMap@Base" 0.8.0 (c++)"typeinfo for FileFd@Base" 0.8.0 - (c++)"typeinfo for Vendor@Base" 0.8.0 (c++)"typeinfo for pkgCache@Base" 0.8.0 (c++)"typeinfo for IndexCopy@Base" 0.8.0 (c++)"typeinfo for debSystem@Base" 0.8.0 @@ -659,24 +575,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"typeinfo for pkgSourceList::Type@Base" 0.8.0 (c++)"typeinfo for pkgSrcRecords::Parser@Base" 0.8.0 (c++)"typeinfo for APT::CacheSetHelper@Base" 0.8.0 - (c++)"typeinfo for pkgCache::DepIterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::GrpIterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::PkgIterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::PrvIterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::VerIterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::DescIterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::PkgFileIterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::VerFileIterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::DescFileIterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Iterator@Base" 0.8.0 (c++)"typeinfo for pkgCache::Namespace@Base" 0.8.0 (c++)"typeinfo name for OpProgress@Base" 0.8.0 (c++)"typeinfo name for SourceCopy@Base" 0.8.0 @@ -686,7 +584,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"typeinfo name for PackageCopy@Base" 0.8.0 (c++)"typeinfo name for pkgDepCache@Base" 0.8.0 (c++)"typeinfo name for pkgSimulate@Base" 0.8.0 - (c++)"typeinfo name for indexRecords@Base" 0.8.0 (c++)"typeinfo name for pkgAcqMethod@Base" 0.8.0 (c++)"typeinfo name for pkgCacheFile@Base" 0.8.0 (c++)"typeinfo name for pkgIndexFile@Base" 0.8.0 @@ -695,14 +592,12 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"typeinfo name for pkgTagSection@Base" 0.8.0 (c++)"typeinfo name for OpTextProgress@Base" 0.8.0 (c++)"typeinfo name for pkgAcquireStatus@Base" 0.8.0 - (c++)"typeinfo name for PreferenceSection@Base" 0.8.0 (c++)"typeinfo name for pkgPackageManager@Base" 0.8.0 (c++)"typeinfo name for debVersioningSystem@Base" 0.8.0 (c++)"typeinfo name for pkgUdevCdromDevices@Base" 0.8.0 (c++)"typeinfo name for pkgVersioningSystem@Base" 0.8.0 (c++)"typeinfo name for MMap@Base" 0.8.0 (c++)"typeinfo name for FileFd@Base" 0.8.0 - (c++)"typeinfo name for Vendor@Base" 0.8.0 (c++)"typeinfo name for pkgCache@Base" 0.8.0 (c++)"typeinfo name for IndexCopy@Base" 0.8.0 (c++)"typeinfo name for debSystem@Base" 0.8.0 @@ -721,24 +616,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"typeinfo name for pkgSourceList::Type@Base" 0.8.0 (c++)"typeinfo name for pkgSrcRecords::Parser@Base" 0.8.0 (c++)"typeinfo name for APT::CacheSetHelper@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::DepIterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::GrpIterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::PkgIterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::PrvIterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::VerIterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::DescIterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::PkgFileIterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::VerFileIterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::DescFileIterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Iterator@Base" 0.8.0 (c++)"typeinfo name for pkgCache::Namespace@Base" 0.8.0 (c++)"vtable for OpProgress@Base" 0.8.0 (c++)"vtable for SourceCopy@Base" 0.8.0 @@ -748,7 +625,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"vtable for PackageCopy@Base" 0.8.0 (c++)"vtable for pkgDepCache@Base" 0.8.0 (c++)"vtable for pkgSimulate@Base" 0.8.0 - (c++)"vtable for indexRecords@Base" 0.8.0 (c++)"vtable for pkgAcqMethod@Base" 0.8.0 (c++)"vtable for pkgCacheFile@Base" 0.8.0 (c++)"vtable for pkgIndexFile@Base" 0.8.0 @@ -756,14 +632,12 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"vtable for pkgTagSection@Base" 0.8.0 (c++)"vtable for OpTextProgress@Base" 0.8.0 (c++)"vtable for pkgAcquireStatus@Base" 0.8.0 - (c++)"vtable for PreferenceSection@Base" 0.8.0 (c++)"vtable for pkgPackageManager@Base" 0.8.0 (c++)"vtable for debVersioningSystem@Base" 0.8.0 (c++)"vtable for pkgUdevCdromDevices@Base" 0.8.0 (c++)"vtable for pkgVersioningSystem@Base" 0.8.0 (c++)"vtable for MMap@Base" 0.8.0 (c++)"vtable for FileFd@Base" 0.8.0 - (c++)"vtable for Vendor@Base" 0.8.0 (c++)"vtable for pkgCache@Base" 0.8.0 (c++)"vtable for IndexCopy@Base" 0.8.0 (c++)"vtable for debSystem@Base" 0.8.0 @@ -782,24 +656,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"vtable for pkgSourceList::Type@Base" 0.8.0 (c++)"vtable for pkgSrcRecords::Parser@Base" 0.8.0 (c++)"vtable for APT::CacheSetHelper@Base" 0.8.0 - (c++)"vtable for pkgCache::DepIterator@Base" 0.8.0 - (c++)"vtable for pkgCache::GrpIterator@Base" 0.8.0 - (c++)"vtable for pkgCache::PkgIterator@Base" 0.8.0 - (c++)"vtable for pkgCache::PrvIterator@Base" 0.8.0 - (c++)"vtable for pkgCache::VerIterator@Base" 0.8.0 - (c++)"vtable for pkgCache::DescIterator@Base" 0.8.0 - (c++)"vtable for pkgCache::PkgFileIterator@Base" 0.8.0 - (c++)"vtable for pkgCache::VerFileIterator@Base" 0.8.0 - (c++)"vtable for pkgCache::DescFileIterator@Base" 0.8.0 - (c++)"vtable for pkgCache::Iterator@Base" 0.8.0 - (c++)"vtable for pkgCache::Iterator@Base" 0.8.0 - (c++)"vtable for pkgCache::Iterator@Base" 0.8.0 - (c++)"vtable for pkgCache::Iterator@Base" 0.8.0 - (c++)"vtable for pkgCache::Iterator@Base" 0.8.0 - (c++)"vtable for pkgCache::Iterator@Base" 0.8.0 - (c++)"vtable for pkgCache::Iterator@Base" 0.8.0 - (c++)"vtable for pkgCache::Iterator@Base" 0.8.0 - (c++)"vtable for pkgCache::Iterator@Base" 0.8.0 (c++)"non-virtual thunk to pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc()@Base" 0.8.0 (c++)"operator<<(std::basic_ostream >&, pkgCache::DepIterator)@Base" 0.8.0 (c++)"operator<<(std::basic_ostream >&, pkgCache::PkgIterator)@Base" 0.8.0 @@ -812,7 +668,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgAcquireStatus::~pkgAcquireStatus()@Base" 0.8.0 (c++)"IndexCopy::~IndexCopy()@Base" 0.8.0 (c++)"pkgIndexFile::Type::~Type()@Base" 0.8.0 - (c++)"pkgAcqBaseIndex::~pkgAcqBaseIndex()@Base" 0.8.0 (c++)"pkgArchiveCleaner::~pkgArchiveCleaner()@Base" 0.8.0 (c++)"typeinfo for pkgArchiveCleaner@Base" 0.8.0 (c++)"typeinfo name for pkgArchiveCleaner@Base" 0.8.0 @@ -847,41 +702,41 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mips mipsel powerpc powerpcspe sh4 sparc x32|c++)"_strtabexpand(char*, unsigned int)@Base" 0.8.0 (arch=alpha amd64 ia64 kfreebsd-amd64 s390 s390x sparc64 ppc64|c++)"_strtabexpand(char*, unsigned long)@Base" 0.8.0 ### architecture specific: time_t - (arch=!x32|c++)"TimeRFC1123(long)@Base" 0.8.0 + (arch=!x32|c++)"TimeRFC1123[abi:cxx11](long)@Base" 0.8.0 (arch=x32|c++)"TimeRFC1123(long long)@Base" 0.8.0 (arch=!x32|c++)"FTPMDTMStrToTime(char const*, long&)@Base" 0.8.0 (arch=x32|c++)"FTPMDTMStrToTime(char const*, long long&)@Base" 0.8.0 - (arch=!x32|c++)"StrToTime(std::basic_string, std::allocator > const&, long&)@Base" 0.8.0 - (arch=x32|c++)"StrToTime(std::basic_string, std::allocator > const&, long long&)@Base" 0.8.0 + (arch=!x32|c++)"StrToTime(std::__cxx11::basic_string, std::allocator > const&, long&)@Base" 0.8.0 + (arch=x32|c++)"StrToTime(std::__cxx11::basic_string, std::allocator > const&, long long&)@Base" 0.8.0 (arch=!x32|c++)"RFC1123StrToTime(char const*, long&)@Base" 0.8.0 (arch=x32|c++)"RFC1123StrToTime(char const*, long long&)@Base" 0.8.0 ### - (c++)"CreateAPTDirectoryIfNeeded(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 0.8.2 + (c++)"CreateAPTDirectoryIfNeeded(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.2 (c++)"FileFd::FileSize()@Base" 0.8.8 (c++)"Base256ToNum(char const*, unsigned long&, unsigned int)@Base" 0.8.11 - (c++)"pkgDepCache::SetCandidateRelease(pkgCache::VerIterator, std::basic_string, std::allocator > const&, std::list, std::allocator > >&)@Base" 0.8.11 - (c++)"pkgDepCache::SetCandidateRelease(pkgCache::VerIterator, std::basic_string, std::allocator > const&)@Base" 0.8.11 - (c++)"RealFileExists(std::basic_string, std::allocator >)@Base" 0.8.11 - (c++)"StripEpoch(std::basic_string, std::allocator > const&)@Base" 0.8.11 + (c++)"pkgDepCache::SetCandidateRelease(pkgCache::VerIterator, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::list, std::allocator > >&)@Base" 0.8.11 + (c++)"pkgDepCache::SetCandidateRelease(pkgCache::VerIterator, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.11 + (c++)"RealFileExists(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.11 + (c++)"StripEpoch(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.11 (c++)"pkgTagSection::FindFlag(unsigned long&, unsigned long, char const*, char const*)@Base" 0.8.11 - (c++)"FindMountPointForDevice(char const*)@Base" 0.8.12 + (c++)"FindMountPointForDevice[abi:cxx11](char const*)@Base" 0.8.12 (c++)"pkgUdevCdromDevices::ScanForRemovable(bool)@Base" 0.8.12 (c++)"APT::Configuration::Compressor::Compressor(char const*, char const*, char const*, char const*, char const*, unsigned short)@Base" 0.8.12 (c++)"APT::Configuration::Compressor::~Compressor()@Base" 0.8.12 (c++)"APT::Configuration::getCompressors(bool)@Base" 0.8.12 - (c++)"APT::Configuration::getCompressorExtensions()@Base" 0.8.12 + (c++)"APT::Configuration::getCompressorExtensions[abi:cxx11]()@Base" 0.8.12 (c++)"pkgCache::DepIterator::IsNegative() const@Base" 0.8.15~exp1 (c++)"Configuration::CndSet(char const*, int)@Base" 0.8.15.3 (c++)"pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator)@Base" 0.8.15.3 - (c++)"DeEscapeString(std::basic_string, std::allocator > const&)@Base" 0.8.15.4 - (c++)"GetModificationTime(std::basic_string, std::allocator > const&)@Base" 0.8.15.6 + (c++)"DeEscapeString(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.15.4 + (c++)"GetModificationTime(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.15.6 (c++)"pkgSourceList::GetLastModifiedTime()@Base" 0.8.15.6 (c++)"pkgCacheFile::RemoveCaches()@Base" 0.8.15.7 (c++)"pkgOrderList::VisitNode(pkgCache::PkgIterator, char const*)@Base" 0.8.15.7 ### external dependency resolver ### - (c++)"EDSP::WriteError(char const*, std::basic_string, std::allocator > const&, _IO_FILE*)@Base" 0.8.16~exp2 - (c++)"EDSP::ReadRequest(int, std::list, std::allocator >, std::allocator, std::allocator > > >&, std::list, std::allocator >, std::allocator, std::allocator > > >&, bool&, bool&, bool&)@Base" 0.8.16~exp2 - (c++)"EDSP::ApplyRequest(std::list, std::allocator >, std::allocator, std::allocator > > > const&, std::list, std::allocator >, std::allocator, std::allocator > > > const&, pkgDepCache&)@Base" 0.8.16~exp2 + (c++)"EDSP::WriteError(char const*, std::__cxx11::basic_string, std::allocator > const&, _IO_FILE*)@Base" 0.8.16~exp2 + (c++)"EDSP::ReadRequest(int, std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > >&, std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > >&, bool&, bool&, bool&)@Base" 0.8.16~exp2 + (c++)"EDSP::ApplyRequest(std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > > const&, std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > > const&, pkgDepCache&)@Base" 0.8.16~exp2 (c++)"EDSP::ReadResponse(int, pkgDepCache&, OpProgress*)@Base" 0.8.16~exp2 (c++)"EDSP::WriteRequest(pkgDepCache&, _IO_FILE*, bool, bool, bool, OpProgress*)@Base" 0.8.16~exp2 (c++)"EDSP::ExecuteSolver(char const*, int*, int*)@Base" 0.8.16~exp2 @@ -889,8 +744,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"EDSP::WriteScenario(pkgDepCache&, _IO_FILE*, OpProgress*)@Base" 0.8.16~exp2 (c++)"EDSP::WriteSolution(pkgDepCache&, _IO_FILE*)@Base" 0.8.16~exp2 (c++)"EDSP::ResolveExternal(char const*, pkgDepCache&, bool, bool, bool, OpProgress*)@Base" 0.8.16~exp2 - (c++)"EDSP::DepMap@Base" 0.8.16~exp2 - (c++)"EDSP::PrioMap@Base" 0.8.16~exp2 (c++)"pkgDepCache::Policy::GetPriority(pkgCache::PkgIterator const&)@Base" 0.8.16~exp6 (c++)"pkgDepCache::Policy::GetPriority(pkgCache::PkgFileIterator const&)@Base" 0.8.16~exp6 ### generalisation of checksums (with lfs) -- mostly api-compatible available (without sha512 in previous versions) @@ -920,26 +773,22 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"vtable for SHA1Summation@Base" 0.8.16~exp6 (c++)"vtable for SHA256Summation@Base" 0.8.16~exp6 (c++)"vtable for SHA512Summation@Base" 0.8.16~exp6 - (c++)"vtable for SHA2SummationBase@Base" 0.8.16~exp6 - (c++)"vtable for SummationImplementation@Base" 0.8.16~exp6 ### large file support - available in older api-compatible versions without lfs ### (c++)"StrToNum(char const*, unsigned long long&, unsigned int, unsigned int)@Base" 0.8.16~exp6 - (c++)"OpProgress::SubProgress(unsigned long long, std::basic_string, std::allocator > const&, float)@Base" 0.8.16~exp6 - (c++)"OpProgress::OverallProgress(unsigned long long, unsigned long long, unsigned long long, std::basic_string, std::allocator > const&)@Base" 0.8.16~exp6 + (c++)"OpProgress::SubProgress(unsigned long long, std::__cxx11::basic_string, std::allocator > const&, float)@Base" 0.8.16~exp6 + (c++)"OpProgress::OverallProgress(unsigned long long, unsigned long long, unsigned long long, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.16~exp6 (c++)"OpProgress::Progress(unsigned long long)@Base" 0.8.16~exp6 - (c++)"SourceCopy::GetFile(std::basic_string, std::allocator >&, unsigned long long&)@Base" 0.8.16~exp6 + (c++)"SourceCopy::GetFile(std::__cxx11::basic_string, std::allocator >&, unsigned long long&)@Base" 0.8.16~exp6 (c++)"pkgAcquire::UriIterator::~UriIterator()@Base" 0.8.16~exp6 (c++)"pkgAcquire::MethodConfig::~MethodConfig()@Base" 0.8.16~exp6 - (c++)"pkgAcquire::Item::Start(std::basic_string, std::allocator >, unsigned long long)@Base" 0.8.16~exp6 - (c++)"pkgRecords::Parser::RecordField(char const*)@Base" 0.8.16~exp6 + (c++)"pkgRecords::Parser::RecordField[abi:cxx11](char const*)@Base" 0.8.16~exp6 (c++)"pkgTagFile::Jump(pkgTagSection&, unsigned long long)@Base" 0.8.16~exp6 (c++)"pkgTagFile::Offset()@Base" 0.8.16~exp6 (c++)"pkgTagFile::pkgTagFile(FileFd*, unsigned long long)@Base" 0.8.16~exp6 (c++)"DynamicMMap::RawAllocate(unsigned long long, unsigned long)@Base" 0.8.16~exp6 - (c++)"PackageCopy::GetFile(std::basic_string, std::allocator >&, unsigned long long&)@Base" 0.8.16~exp6 + (c++)"PackageCopy::GetFile(std::__cxx11::basic_string, std::allocator >&, unsigned long long&)@Base" 0.8.16~exp6 (c++)"pkgTagSection::~pkgTagSection()@Base" 0.8.16~exp6 (c++)"pkgAcquireStatus::Fetched(unsigned long long, unsigned long long)@Base" 0.8.16~exp6 - (c++)"PreferenceSection::~PreferenceSection()@Base" 0.8.16~exp6 (c++)"FileFd::Read(void*, unsigned long long, unsigned long long*)@Base" 0.8.16~exp6 (c++)"FileFd::Seek(unsigned long long)@Base" 0.8.16~exp6 (c++)"FileFd::Skip(unsigned long long)@Base" 0.8.16~exp6 @@ -981,103 +830,85 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"FileFd::OpenDescriptor(int, unsigned int, FileFd::CompressMode, bool)@Base" 0.8.16~exp9 (c++)"FileFd::OpenDescriptor(int, unsigned int, APT::Configuration::Compressor const&, bool)@Base" 0.8.16~exp9 (c++)"FileFd::ModificationTime()@Base" 0.8.16~exp9 - (c++)"FileFd::Open(std::basic_string, std::allocator >, unsigned int, FileFd::CompressMode, unsigned long)@Base" 0.8.16~exp9 - (c++)"FileFd::Open(std::basic_string, std::allocator >, unsigned int, APT::Configuration::Compressor const&, unsigned long)@Base" 0.8.16~exp9 + (c++)"FileFd::Open(std::__cxx11::basic_string, std::allocator >, unsigned int, FileFd::CompressMode, unsigned long)@Base" 0.8.16~exp9 + (c++)"FileFd::Open(std::__cxx11::basic_string, std::allocator >, unsigned int, APT::Configuration::Compressor const&, unsigned long)@Base" 0.8.16~exp9 (c++)"FileFd::ReadLine(char*, unsigned long long)@Base" 0.8.16~exp9 (c++)"SummationImplementation::AddFD(FileFd&, unsigned long long)@Base" 0.8.16~exp9 (c++|optional=deprecated,previous-inline)"FileFd::gzFd()@Base" 0.8.0 ### CacheSet rework: making them real containers breaks bigtime the API (for the CacheSetHelper) - (c++)"APT::PackageContainer, std::allocator > >::const_iterator::getPkg() const@Base" 0.8.16~exp9 (c++)"APT::PackageContainer, std::allocator > >::empty() const@Base" 0.8.16~exp9 - (c++)"APT::PackageContainer > >::const_iterator::getPkg() const@Base" 0.8.16~exp9 - (c++)"APT::PackageContainer > >::empty() const@Base" 0.8.16~exp9 - (c++)"APT::VersionContainer > >::empty() const@Base" 0.8.16~exp9 - (c++)"APT::VersionContainer > >::iterator::getVer() const@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::canNotFindTask(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::canNotFindRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >)@Base" 0.8.16~exp9 + (c++)"APT::PackageContainer > >::empty() const@Base" 0.8.16~exp9 + (c++)"APT::VersionContainer > >::empty() const@Base" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::canNotFindTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::canNotFindRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.16~exp9 (c++)"APT::CacheSetHelper::canNotFindAllVer(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::canNotFindPackage(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator > const&)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::showTaskSelection(pkgCache::PkgIterator const&, std::basic_string, std::allocator > const&)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::showRegExSelection(pkgCache::PkgIterator const&, std::basic_string, std::allocator > const&)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const&, pkgCache::VerIterator, std::basic_string, std::allocator > const&, bool)@Base" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::canNotFindPackage(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::showTaskSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::showRegExSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const&, pkgCache::VerIterator, std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 0.8.16~exp9 (c++)"APT::CacheSetHelper::canNotFindCandInstVer(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 (c++)"APT::CacheSetHelper::canNotFindInstCandVer(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 (c++)"APT::PackageContainer, std::allocator > >::clear()@Base" 0.8.16~exp9 (c++)"APT::PackageContainer, std::allocator > >::insert(pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 - (c++)"APT::PackageContainer > >::clear()@Base" 0.8.16~exp9 - (c++)"APT::PackageContainer > >::insert(pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 - (c++)"APT::VersionContainer > >::clear()@Base" 0.8.16~exp9 - (c++)"APT::VersionContainer > >::insert(pkgCache::VerIterator const&)@Base" 0.8.16~exp9 + (c++)"APT::PackageContainer > >::clear()@Base" 0.8.16~exp9 + (c++)"APT::PackageContainer > >::insert(pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 + (c++)"APT::VersionContainer > >::clear()@Base" 0.8.16~exp9 + (c++)"APT::VersionContainer > >::insert(pkgCache::VerIterator const&)@Base" 0.8.16~exp9 (c++)"APT::VersionContainerInterface::getCandidateVer(pkgCacheFile&, pkgCache::PkgIterator const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 (c++)"APT::VersionContainerInterface::getInstalledVer(pkgCacheFile&, pkgCache::PkgIterator const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 - (c++)"APT::VersionContainerInterface::FromModifierCommandLine(unsigned short&, APT::VersionContainerInterface*, pkgCacheFile&, char const*, std::list > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 + (c++)"APT::VersionContainerInterface::FromModifierCommandLine(unsigned short&, APT::VersionContainerInterface*, pkgCacheFile&, char const*, std::__cxx11::list > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 (c++)"EDSP::WriteLimitedScenario(pkgDepCache&, _IO_FILE*, APT::PackageContainer, std::allocator > > const&, OpProgress*)@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::PackageContainer, std::allocator > >::const_iterator@Base" 0.8.16~exp9 (c++)"typeinfo for APT::PackageContainer, std::allocator > >@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::PackageContainer > >::const_iterator@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::PackageContainer > >@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::VersionContainer > >::iterator@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::VersionContainer > >@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::PackageContainerInterface::const_iterator@Base" 0.8.16~exp9 + (c++)"typeinfo for APT::PackageContainer > >@Base" 0.8.16~exp9 + (c++)"typeinfo for APT::VersionContainer > >@Base" 0.8.16~exp9 (c++)"typeinfo for APT::PackageContainerInterface@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::VersionContainerInterface::const_iterator@Base" 0.8.16~exp9 (c++)"typeinfo for APT::VersionContainerInterface@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::PackageContainer, std::allocator > >::const_iterator@Base" 0.8.16~exp9 (c++)"typeinfo name for APT::PackageContainer, std::allocator > >@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::PackageContainer > >::const_iterator@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::PackageContainer > >@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::VersionContainer > >::iterator@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::VersionContainer > >@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::PackageContainerInterface::const_iterator@Base" 0.8.16~exp9 + (c++)"typeinfo name for APT::PackageContainer > >@Base" 0.8.16~exp9 + (c++)"typeinfo name for APT::VersionContainer > >@Base" 0.8.16~exp9 (c++)"typeinfo name for APT::PackageContainerInterface@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::VersionContainerInterface::const_iterator@Base" 0.8.16~exp9 (c++)"typeinfo name for APT::VersionContainerInterface@Base" 0.8.16~exp9 - (c++)"vtable for APT::PackageContainer, std::allocator > >::const_iterator@Base" 0.8.16~exp9 (c++)"vtable for APT::PackageContainer, std::allocator > >@Base" 0.8.16~exp9 - (c++)"vtable for APT::PackageContainer > >::const_iterator@Base" 0.8.16~exp9 - (c++)"vtable for APT::PackageContainer > >@Base" 0.8.16~exp9 - (c++)"vtable for APT::VersionContainer > >::iterator@Base" 0.8.16~exp9 - (c++)"vtable for APT::VersionContainer > >@Base" 0.8.16~exp9 - (c++)"vtable for APT::PackageContainerInterface::const_iterator@Base" 0.8.16~exp9 + (c++)"vtable for APT::PackageContainer > >@Base" 0.8.16~exp9 + (c++)"vtable for APT::VersionContainer > >@Base" 0.8.16~exp9 (c++)"vtable for APT::PackageContainerInterface@Base" 0.8.16~exp9 - (c++)"vtable for APT::VersionContainerInterface::const_iterator@Base" 0.8.16~exp9 (c++)"vtable for APT::VersionContainerInterface@Base" 0.8.16~exp9 ### rework of the packagemanager rework - (c++)"APT::Progress::PackageManager::ConffilePrompt(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::Error(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::ConffilePrompt(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::Error(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerFancy::HandleSIGWINCH(int)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerFancy::~PackageManagerFancy()@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerFancy::PackageManagerFancy()@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerFancy::SetupTerminalScrollArea(int)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerFancy::StatusChanged(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerFancy::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerFancy::Stop()@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManager::fork()@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManager::GetPulseInterval()@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManager::~PackageManager()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::ConffilePrompt(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::Error(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::ConffilePrompt(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::Error(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerProgressDeb822Fd::~PackageManagerProgressDeb822Fd()@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerProgressDeb822Fd::PackageManagerProgressDeb822Fd(int)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerProgressDeb822Fd::StartDpkg()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::StatusChanged(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerProgressDeb822Fd::Stop()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::WriteToStatusFd(std::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::WriteToStatusFd(std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerProgressFactory()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::ConffilePrompt(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::Error(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::ConffilePrompt(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::Error(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerProgressFd::~PackageManagerProgressFd()@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerProgressFd::PackageManagerProgressFd(int)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerProgressFd::StartDpkg()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::StatusChanged(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerProgressFd::Stop()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::WriteToStatusFd(std::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::WriteToStatusFd(std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManager::Pulse()@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManager::StartDpkg()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::StatusChanged(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManager::Stop()@Base" 0.9.13~exp1 (c++)"APT::Progress::PackageManagerText::~PackageManagerText()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerText::StatusChanged(std::basic_string, std::allocator >, unsigned int, unsigned int, std::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::String::Strip(std::basic_string, std::allocator > const&)@Base" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerText::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 + (c++)"APT::String::Strip(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.9.13~exp1 (c++)"pkgDPkgPM::BuildPackagesProgressMap()@Base" 0.9.13~exp1 (c++)"pkgDPkgPM::DoDpkgStatusFd(int)@Base" 0.9.13~exp1 (c++)"pkgDPkgPM::ProcessDpkgStatusLine(char*)@Base" 0.9.13~exp1 @@ -1101,15 +932,8 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"APT::Progress::PackageManagerFancy::instances@Base" 0.9.14.2 (c++)"APT::Progress::PackageManagerFancy::Start(int)@Base" 0.9.14.2 (c++)"APT::Progress::PackageManager::Start(int)@Base" 0.9.14.2 -### deb822 sources.list format - (c++)"pkgSourceList::ParseFileDeb822(std::basic_string, std::allocator >)@Base" 0.9.14.3~exp1 - (c++)"pkgSourceList::ParseFileOldStyle(std::basic_string, std::allocator >)@Base" 0.9.14.3~exp1 - (c++)"pkgSourceList::Type::ParseStanza(std::vector >&, pkgTagSection&, int, FileFd&)@Base" 0.9.14.3~exp1 ### install foo.deb support - (c++)"flAbsPath(std::basic_string, std::allocator >)@Base" 1.1~exp1 - (c++)"GetTempFile(std::basic_string, std::allocator > const&, bool)@Base" 1.1~exp1 - (c++)"pkgIndexFile::Type::CreateSrcPkgParser(std::basic_string, std::allocator >) const@Base" 1.1~exp1 - (c++)"metaIndex::LocalFileName() const@Base" 1.1~exp1 + (c++)"flAbsPath(std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp1 (c++)"metaIndex::~metaIndex()@Base" 1.1~exp1 ### CacheFilter functors (c++)"APT::CacheFilter::ANDMatcher::AND(APT::CacheFilter::Matcher*)@Base" 1.1~exp4 @@ -1151,7 +975,7 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"APT::CacheFilter::PackageMatcher::operator()(pkgCache::VerIterator const&)@Base" 1.1~exp4 (c++)"APT::CacheFilter::PackageMatcher::~PackageMatcher()@Base" 1.1~exp4 (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::~PackageNameMatchesFnmatch()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::PackageNameMatchesFnmatch(std::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::PackageNameMatchesFnmatch(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 (c++)"APT::CacheFilter::TrueMatcher::operator()(pkgCache::GrpIterator const&)@Base" 1.1~exp4 (c++)"APT::CacheFilter::TrueMatcher::operator()(pkgCache::PkgIterator const&)@Base" 1.1~exp4 (c++)"APT::CacheFilter::TrueMatcher::operator()(pkgCache::VerIterator const&)@Base" 1.1~exp4 @@ -1191,37 +1015,37 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"vtable for APT::CacheFilter::TrueMatcher@Base" 1.1~exp4 ### cacheset redesign (API, but not ABI compatible) # (c++|optional=inline)"APT::PackageContainerInterface::FromCommandLine(APT::PackageContainerInterface*, pkgCacheFile&, char const**, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::PackageContainerInterface::FromModifierCommandLine(unsigned short&, APT::PackageContainerInterface*, pkgCacheFile&, char const*, std::list > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::PackageContainerInterface::FromName(pkgCacheFile&, std::basic_string, std::allocator > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::PackageContainerInterface::FromTask(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::PackageContainerInterface::FromRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::VersionContainerInterface::FromString(APT::VersionContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&, bool)@Base" 0.8.16~exp9 +# (c++|optional=inline)"APT::PackageContainerInterface::FromModifierCommandLine(unsigned short&, APT::PackageContainerInterface*, pkgCacheFile&, char const*, std::__cxx11::list > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 +# (c++|optional=inline)"APT::PackageContainerInterface::FromName(pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 +# (c++|optional=inline)"APT::PackageContainerInterface::FromTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.8.16~exp9 +# (c++|optional=inline)"APT::PackageContainerInterface::FromRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.8.16~exp9 +# (c++|optional=inline)"APT::VersionContainerInterface::FromString(APT::VersionContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&, bool)@Base" 0.8.16~exp9 # (c++|optional=inline)"APT::VersionContainerInterface::FromPackage(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 # (c++|optional=inline)"APT::VersionContainerInterface::FromCommandLine(APT::VersionContainerInterface*, pkgCacheFile&, char const**, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++)"APT::PackageContainerInterface::FromString(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++)"APT::PackageContainerInterface::FromGroup(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.9.7 -# (c++)"APT::PackageContainerInterface::FromFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.9.11 - (c++)"APT::CacheSetHelper::canNotFindFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::canNotFindPackage(APT::CacheSetHelper::PkgSelector, APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 +# (c++)"APT::PackageContainerInterface::FromString(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 +# (c++)"APT::PackageContainerInterface::FromGroup(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.9.7 +# (c++)"APT::PackageContainerInterface::FromFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.9.11 + (c++)"APT::CacheSetHelper::canNotFindFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::canNotFindPackage(APT::CacheSetHelper::PkgSelector, APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 (c++)"APT::CacheSetHelper::canNotFindVersion(APT::CacheSetHelper::VerSelector, APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 1.1~exp4 (c++)"APT::CacheSetHelper::canNotGetCandInstVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 1.1~exp4 (c++)"APT::CacheSetHelper::canNotGetInstCandVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 1.1~exp4 (c++)"APT::CacheSetHelper::canNotGetVersion(APT::CacheSetHelper::VerSelector, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFrom(APT::CacheSetHelper::PkgSelector, APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFrom(APT::CacheSetHelper::PkgSelector, APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 (c++)"APT::CacheSetHelper::PackageFromCommandLine(APT::PackageContainerInterface*, pkgCacheFile&, char const**)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromModifierCommandLine(unsigned short&, APT::PackageContainerInterface*, pkgCacheFile&, char const*, std::list > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromName(pkgCacheFile&, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromPackageName(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromString(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromTask(APT::PackageContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::showFnmatchSelection(pkgCache::PkgIterator const&, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::showPackageSelection(pkgCache::PkgIterator const&, APT::CacheSetHelper::PkgSelector, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::showVersionSelection(pkgCache::PkgIterator const&, pkgCache::VerIterator const&, APT::CacheSetHelper::VerSelector, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromModifierCommandLine(unsigned short&, APT::PackageContainerInterface*, pkgCacheFile&, char const*, std::__cxx11::list > const&)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromName(pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromPackageName(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromString(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::showFnmatchSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::showPackageSelection(pkgCache::PkgIterator const&, APT::CacheSetHelper::PkgSelector, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"APT::CacheSetHelper::showVersionSelection(pkgCache::PkgIterator const&, pkgCache::VerIterator const&, APT::CacheSetHelper::VerSelector, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 (c++)"APT::VersionContainerInterface::FromCommandLine(APT::VersionContainerInterface*, pkgCacheFile&, char const**, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&)@Base" 1.1~exp4 (c++)"APT::VersionContainerInterface::FromPackage(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&)@Base" 1.1~exp4 - (c++)"APT::VersionContainerInterface::FromString(APT::VersionContainerInterface*, pkgCacheFile&, std::basic_string, std::allocator >, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&, bool)@Base" 1.1~exp4 + (c++)"APT::VersionContainerInterface::FromString(APT::VersionContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&, bool)@Base" 1.1~exp4 ### all the hashes are belong to us # (c++|optional=inline)"Hashes::AddFD(int, unsigned long long, bool, bool, bool, bool)@Base" 0.8.16~exp6 # (c++|optional=inline)"Hashes::AddFD(FileFd&, unsigned long long, bool, bool, bool, bool)@Base" 0.8.16~exp9 @@ -1241,76 +1065,46 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"HashStringList::push_back(HashString const&)@Base" 1.1~exp1 (c++)"HashStringList::supported(char const*)@Base" 1.1~exp1 (c++)"HashStringList::usable() const@Base" 1.1~exp1 - (c++)"HashStringList::VerifyFile(std::basic_string, std::allocator >) const@Base" 1.1~exp1 + (c++)"HashStringList::VerifyFile(std::__cxx11::basic_string, std::allocator >) const@Base" 1.1~exp1 (c++)"HashString::operator==(HashString const&) const@Base" 1.1~exp1 (c++)"HashString::operator!=(HashString const&) const@Base" 1.1~exp1 - (c++)"indexRecords::GetSupportsAcquireByHash() const@Base" 1.1~exp1 - (c++)"pkgAcqArchive::Done(std::basic_string, std::allocator >, unsigned long long, HashStringList const&, pkgAcquire::MethodConfig*)@Base" 1.1~exp1 (c++)"pkgAcqArchive::IsTrusted() const@Base" 1.1~exp1 - (c++)"pkgAcqFile::Custom600Headers() const@Base" 1.1~exp1 - (c++)"pkgAcqFile::Done(std::basic_string, std::allocator >, unsigned long long, HashStringList const&, pkgAcquire::MethodConfig*)@Base" 1.1~exp1 - (c++)"pkgAcqFile::pkgAcqFile(pkgAcquire*, std::basic_string, std::allocator >, HashStringList const&, unsigned long long, std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, bool)@Base" 1.1~exp1 + (c++)"pkgAcqFile::Custom600Headers[abi:cxx11]() const@Base" 1.1~exp1 (c++)"pkgAcqMethod::DropPrivsOrDie()@Base" 1.1~exp1 - (c++)"pkgAcquire::Item::Custom600Headers() const@Base" 1.1~exp1 - (c++)"pkgAcquire::Item::Done(std::basic_string, std::allocator >, unsigned long long, HashStringList const&, pkgAcquire::MethodConfig*)@Base" 1.1~exp1 + (c++)"pkgAcquire::Item::Custom600Headers[abi:cxx11]() const@Base" 1.1~exp1 (c++)"pkgAcquire::Item::IsTrusted() const@Base" 1.1~exp1 (c++)"pkgRecords::Parser::Hashes() const@Base" 1.1~exp1 - (c++)"pkgRecords::Parser::LongDesc(std::basic_string, std::allocator > const&)@Base" 1.1~exp1 - (c++)"pkgRecords::Parser::ShortDesc(std::basic_string, std::allocator > const&)@Base" 1.1~exp1 + (c++)"pkgRecords::Parser::LongDesc(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp1 + (c++)"pkgRecords::Parser::ShortDesc(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp1 (c++)"typeinfo for Hashes@Base" 1.1~exp1 (c++)"typeinfo name for Hashes@Base" 1.1~exp1 (c++)"vtable for Hashes@Base" 1.1~exp1 - (c++)"typeinfo for pkgAcqBaseIndex@Base" 1.1~exp1 - (c++)"typeinfo name for pkgAcqBaseIndex@Base" 1.1~exp1 - (c++)"vtable for pkgAcqBaseIndex@Base" 1.1~exp1 ### more transactional update - (c++)"pkgAcqBaseIndex::VerifyHashByMetaKey(HashStringList const&)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::AbortTransaction()@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::Add(pkgAcquire::Item*)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::CheckAuthDone(std::basic_string, std::allocator >, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::CheckDownloadDone(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::CheckStopAuthentication(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::CommitTransaction()@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::GetCustom600Headers(std::basic_string, std::allocator > const&) const@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::QueueForSignatureVerify(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::QueueIndexes(bool)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::TransactionHasError()@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::TransactionStageCopy(pkgAcquire::Item*, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::TransactionStageRemoval(pkgAcquire::Item*, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::VerifyVendor(std::basic_string, std::allocator >, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcquire::GetLock(std::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"pkgAcquire::GetLock(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 (c++)"pkgAcquire::Item::Dequeue()@Base" 1.1~exp4 - (c++)"pkgAcquire::Item::Item(pkgAcquire*, HashStringList const&, pkgAcqMetaBase*)@Base" 1.1~exp4 (c++)"pkgAcquire::Item::QueueURI(pkgAcquire::ItemDesc&)@Base" 1.1~exp4 - (c++)"pkgAcquire::Item::SetActiveSubprocess(std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcquire::Setup(pkgAcquireStatus*, std::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgArchiveCleaner::Erase(char const*, std::basic_string, std::allocator >, std::basic_string, std::allocator >, stat&)@Base" 1.1~exp4 + (c++)"pkgAcquire::Item::SetActiveSubprocess(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"pkgAcquire::Setup(pkgAcquireStatus*, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 + (c++)"pkgArchiveCleaner::Erase(char const*, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, stat&)@Base" 1.1~exp4 (c++)"pkgDepCache::MarkAndSweep()@Base" 1.1~exp4 (c++)"pkgDepCache::MarkAndSweep(pkgDepCache::InRootSetFunc&)@Base" 1.1~exp4 - (c++)"pkgAcqMetaBase::~pkgAcqMetaBase()@Base" 1.1~exp4 - (c++)"typeinfo for pkgAcqMetaBase@Base" 1.1~exp4 - (c++)"typeinfo name for pkgAcqMetaBase@Base" 1.1~exp4 - (c++)"vtable for pkgAcqMetaBase@Base" 1.1~exp4 ### mixed stuff - (c++)"GetListOfFilesInDir(std::basic_string, std::allocator > const&, bool)@Base" 0.8.16~exp13 + (c++)"GetListOfFilesInDir(std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 0.8.16~exp13 (c++)"pkgCache::DepIterator::IsIgnorable(pkgCache::PkgIterator const&) const@Base" 0.8.16~exp10 (c++)"pkgCache::DepIterator::IsIgnorable(pkgCache::PrvIterator const&) const@Base" 0.8.16~exp10 (c++)"FileFd::Write(int, void const*, unsigned long long)@Base" 0.8.16~exp14 (c++)"_strrstrip(char*)@Base" 0.9.7.9~exp2 - (c++)"SplitClearSignedFile(std::basic_string, std::allocator > const&, FileFd*, std::vector, std::allocator >, std::allocator, std::allocator > > >*, FileFd*)@Base" 0.9.7.9~exp2 - (c++)"OpenMaybeClearSignedFile(std::basic_string, std::allocator > const&, FileFd&)@Base" 0.9.7.9~exp2 - (c++)"ExecGPGV(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, int const&, int*)@Base" 0.9.7.9~exp2 - (c++)"SigVerify::RunGPGV(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, int const&)@Base" 0.9.7.9~exp2 + (c++)"SplitClearSignedFile(std::__cxx11::basic_string, std::allocator > const&, FileFd*, std::vector, std::allocator >, std::allocator, std::allocator > > >*, FileFd*)@Base" 0.9.7.9~exp2 + (c++)"OpenMaybeClearSignedFile(std::__cxx11::basic_string, std::allocator > const&, FileFd&)@Base" 0.9.7.9~exp2 + (c++)"SigVerify::RunGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&)@Base" 0.9.7.9~exp2 (c++)"Configuration::Dump(std::basic_ostream >&, char const*, char const*, bool)@Base" 0.9.3 (c++)"AcquireUpdate(pkgAcquire&, int, bool, bool)@Base" 0.9.3 - (c++)"pkgCache::DepIterator::IsMultiArchImplicit() const@Base" 0.9.6 - (c++)"pkgCache::PrvIterator::IsMultiArchImplicit() const@Base" 0.9.6 - (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::PackageArchitectureMatchesSpecification(std::basic_string, std::allocator > const&, bool)@Base" 0.9.7 + (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::PackageArchitectureMatchesSpecification(std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 0.9.7 (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::~PackageArchitectureMatchesSpecification()@Base" 0.9.7 (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::operator()(pkgCache::PkgIterator const&)@Base" 0.9.7 (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::operator()(char const* const&)@Base" 0.9.7 - (c++)"APT::Configuration::checkLanguage(std::basic_string, std::allocator >, bool)@Base" 0.9.7.5 - (c++)"pkgCdrom::DropTranslation(std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.9.7.5 + (c++)"APT::Configuration::checkLanguage(std::__cxx11::basic_string, std::allocator >, bool)@Base" 0.9.7.5 + (c++)"pkgCdrom::DropTranslation(std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.9.7.5 (c++)"pkgCache::DepIterator::IsSatisfied(pkgCache::PrvIterator const&) const@Base" 0.9.8 (c++)"pkgCache::DepIterator::IsSatisfied(pkgCache::VerIterator const&) const@Base" 0.9.8 (c++)"operator<<(std::basic_ostream >&, GlobalError::Item)@Base" 0.9.9 @@ -1322,52 +1116,43 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"CommandLine::GetCommand(CommandLine::Dispatch const*, unsigned int, char const* const*)@Base" 0.9.11 (c++)"CommandLine::MakeArgs(char, char const*, char const*, unsigned long)@Base" 0.9.11 (c++)"Configuration::Clear()@Base" 0.9.11 - (c++)"Glob(std::basic_string, std::allocator > const&, int)@Base" 0.9.11 + (c++)"Glob(std::__cxx11::basic_string, std::allocator > const&, int)@Base" 0.9.11 (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::operator()(pkgCache::GrpIterator const&)@Base" 0.9.11 (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::operator()(pkgCache::PkgIterator const&)@Base" 0.9.11 (c++)"pkgTagSection::pkgTagSection()@Base" 0.9.11 (c++)"strv_length(char const**)@Base" 0.9.11 - (c++)"StringSplit(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, unsigned int)@Base" 0.9.11.3 + (c++)"StringSplit(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, unsigned int)@Base" 0.9.11.3 (c++)"pkgAcquire::Item::RenameOnError(pkgAcquire::Item::RenameOnErrorState)@Base" 0.9.12 - (c++)"APT::String::Endswith(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 0.9.13.1 + (c++)"APT::String::Endswith(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.9.13.1 (c++)"ExecFork(std::set, std::allocator >)@Base" 0.9.13.1 (c++)"MergeKeepFdsFromConfiguration(std::set, std::allocator >&)@Base" 0.9.13.1 - (c++)"HashString::FromFile(std::basic_string, std::allocator >)@Base" 0.9.13.1 - (c++)"HashString::GetHashForFile(std::basic_string, std::allocator >) const@Base" 0.9.13.1 - (c++)"indexRecords::GetSuite() const@Base" 0.9.13.2 - (c++)"GetTempDir()@Base" 0.9.14.2 - (c++)"APT::Configuration::getBuildProfiles()@Base" 0.9.16 - (c++)"APT::Configuration::getBuildProfilesString()@Base" 0.9.16 - (c++)"Configuration::FindVector(char const*, std::basic_string, std::allocator > const&) const@Base" 0.9.16 - (c++)"debListParser::ParseDepends(char const*, char const*, std::basic_string, std::allocator >&, std::basic_string, std::allocator >&, unsigned int&)@Base" 0.9.16 - (c++)"debListParser::ParseDepends(char const*, char const*, std::basic_string, std::allocator >&, std::basic_string, std::allocator >&, unsigned int&, bool const&)@Base" 0.9.16 - (c++)"debListParser::ParseDepends(char const*, char const*, std::basic_string, std::allocator >&, std::basic_string, std::allocator >&, unsigned int&, bool const&, bool const&, bool const&)@Base" 0.9.16 - (c++)"Rename(std::basic_string, std::allocator >, std::basic_string, std::allocator >)@Base" 0.9.16 + (c++)"HashString::FromFile(std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13.1 + (c++)"HashString::GetHashForFile(std::__cxx11::basic_string, std::allocator >) const@Base" 0.9.13.1 + (c++)"GetTempDir[abi:cxx11]()@Base" 0.9.14.2 + (c++)"APT::Configuration::getBuildProfiles[abi:cxx11]()@Base" 0.9.16 + (c++)"APT::Configuration::getBuildProfilesString[abi:cxx11]()@Base" 0.9.16 + (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&)@Base" 0.9.16 + (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&)@Base" 0.9.16 + (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&, bool const&, bool const&)@Base" 0.9.16 + (c++)"Rename(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.16 (c++)"pkgDepCache::IsInstallOkDependenciesSatisfiableByCandidates(pkgCache::PkgIterator const&, bool, unsigned long, bool)@Base" 1.0 (c++)"APT::Progress::PackageManagerFancy::GetTerminalSize()@Base" 1.0 - (c++)"APT::Progress::PackageManagerFancy::GetTextProgressStr(float, int)@Base" 1.0 + (c++)"APT::Progress::PackageManagerFancy::GetTextProgressStr[abi:cxx11](float, int)@Base" 1.0 (c++)"pkgCdromStatus::GetOpProgress()@Base" 1.0 (c++)"pkgCdromStatus::SetTotal(int)@Base" 1.0 (c++)"EDSP::ExecuteSolver(char const*, int*, int*, bool)@Base" 1.0.4 (c++)"pkgPackageManager::EarlyRemove(pkgCache::PkgIterator, pkgCache::DepIterator const*)@Base" 1.0.4 (c++)"pkgSrcRecords::Step()@Base" 1.0.4 - (c++)"debTranslationsParser::Architecture()@Base" 1.0.4 - (c++)"debTranslationsParser::~debTranslationsParser()@Base" 1.0.4 - (c++)"debTranslationsParser::Version()@Base" 1.0.4 - (c++)"typeinfo for debTranslationsParser@Base" 1.0.4 - (c++)"typeinfo name for debTranslationsParser@Base" 1.0.4 - (c++)"vtable for debTranslationsParser@Base" 1.0.4 (c++)"pkgDPkgPM::SetupSlavePtyMagic()@Base" 1.0.8 (c++)"HashStringList::find(char const*) const@Base" 1.0.9.4 (c++)"HashStringList::operator==(HashStringList const&) const@Base" 1.0.9.4 (c++)"HashStringList::operator!=(HashStringList const&) const@Base" 1.0.9.4 (c++)"HashStringList::push_back(HashString const&)@Base" 1.0.9.4 (c++)"HashStringList::supported(char const*)@Base" 1.0.9.4 - (c++)"HashStringList::VerifyFile(std::basic_string, std::allocator >) const@Base" 1.0.9.4 + (c++)"HashStringList::VerifyFile(std::__cxx11::basic_string, std::allocator >) const@Base" 1.0.9.4 (c++)"HashString::operator==(HashString const&) const@Base" 1.0.9.4 (c++)"HashString::operator!=(HashString const&) const@Base" 1.0.9.4 (c++)"pkgSrcRecords::Parser::Files2(std::vector >&)@Base" 1.0.9.4 - (c++)"debSrcRecordParser::Files2(std::vector >&)@Base" 1.0.9.4 (c++)"APT::Progress::PackageManager::PackageManager()@Base" 1.1~exp1 (c++)"pkgDPkgPM::Go(APT::Progress::PackageManager*)@Base" 1.1~exp1 (c++)"pkgPackageManager::DoInstall(APT::Progress::PackageManager*)@Base" 1.1~exp1 @@ -1378,54 +1163,340 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# (c++)"pkgTagSection::Exists(char const*) const@Base" 1.1~exp1 (c++)"pkgTagSection::FindB(char const*, bool const&) const@Base" 1.1~exp1 (c++)"pkgTagSection::Scan(char const*, unsigned long, bool)@Base" 1.1~exp1 - (c++)"StartsWithGPGClearTextSignature(std::basic_string, std::allocator > const&)@Base" 1.1~exp1 + (c++)"StartsWithGPGClearTextSignature(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp1 (c++)"Popen(char const**, FileFd&, int&, FileFd::OpenMode)@Base" 1.1~exp1 - (c++)"APT::String::Startswith(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)@Base" 1.1~exp2 + (c++)"APT::String::Startswith(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp2 (c++)"APT::Upgrade::Upgrade(pkgDepCache&, int, OpProgress*)@Base" 1.1~exp4 (c++)"pkgProblemResolver::Resolve(bool, OpProgress*)@Base" 1.1~exp4 (c++)"pkgProblemResolver::ResolveByKeep(OpProgress*)@Base" 1.1~exp4 - (c++)"pkgCache::PkgIterator::Section() const@Base" 1.1~exp4 - (c++)"APT::PackageContainer, std::allocator > >::iterator::getPkg() const@Base" 1.1~exp4 - (c++)"typeinfo for APT::PackageContainer, std::allocator > >::iterator@Base" 1.1~exp4 - (c++)"typeinfo name for APT::PackageContainer, std::allocator > >::iterator@Base" 1.1~exp4 - (c++)"vtable for APT::PackageContainer, std::allocator > >::iterator@Base" 1.1~exp4 (c++)"DropPrivileges()@Base" 1.1~exp4 - (c++)"FileFd::FileFd(std::basic_string, std::allocator >, unsigned int, unsigned long)@Base" 1.1~exp4 - (c++)"indexRecords::indexRecords(std::basic_string, std::allocator > const&)@Base" 1.1~exp5 - (c++)"indexRecords::IsAlwaysTrusted() const@Base" 1.1~exp5 - (c++)"indexRecords::IsNeverTrusted() const@Base" 1.1~exp5 - (c++)"indexRecords::SetTrusted(bool)@Base" 1.1~exp5 - (c++)"metaIndex::metaIndex(std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, char const*)@Base" 1.1~exp9 + (c++)"FileFd::FileFd(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned long)@Base" 1.1~exp4 + (c++)"metaIndex::metaIndex(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, char const*)@Base" 1.1~exp9 (c++)"pkgTagSection::Get(char const*&, char const*&, unsigned int) const@Base" 1.1~exp9 -### demangle strangeness - buildd report it as MISSING and as new… - (c++)"pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire*, std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::vector > const*, indexRecords*)@Base" 0.8.0 -### gcc-4.6 artefacts -# (c++|optional=implicit)"HashString::operator=(HashString const&)@Base" 0.8.0 -# (c++|optional=implicit)"HashString::HashString(HashString const&)@Base" 0.8.0 -# (c++|optional=inline)"APT::VersionContainer > >::iterator std::max_element > >::iterator, CompareProviders>(APT::VersionContainer > >::iterator, APT::VersionContainer > >::iterator, CompareProviders)@Base" 0.8.0 -# (c++|optional=inline)"pkgCache::VerIterator::ParentPkg() const@Base" 0.8.0 -### empty destructors included in the .h file -# (c++|optional=inline)"pkgVersioningSystem::~pkgVersioningSystem()@Base" 0.8.0 -# (c++|optional=inline)"pkgSystem::~pkgSystem()@Base" 0.8.0 -# (c++|optional=inline)"pkgRecords::Parser::~Parser()@Base" 0.8.0 -# (c++|optional=inline)"pkgSrcRecords::Parser::~Parser()@Base" 0.8.0 -# (c++|optional=inline)"pkgIndexFile::Type::~Type()@Base" 0.8.0 -# (c++|optional=inline)"pkgSourceList::Type::~Type()@Base" 0.8.0 -# (c++|optional=inline)"pkgIndexFile::~pkgIndexFile()@Base" 0.8.0 -# (c++|optional=inline)"metaIndex::~metaIndex()@Base" 0.8.0 -### std library artefacts - (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0 - (c++|optional=std)"char* std::basic_string, std::allocator >::_S_construct<__gnu_cxx::__normal_iterator, std::allocator > > >(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, std::allocator const&, std::forward_iterator_tag)@Base" 0.8.0 - (c++|optional=std)"char* std::basic_string, std::allocator >::_S_construct<__gnu_cxx::__normal_iterator, std::allocator > > >(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, std::allocator const&, std::forward_iterator_tag)@Base" 0.8.0 - (c++|optional=std)"char* std::basic_string, std::allocator >::_S_construct(char const*, char const*, std::allocator const&, std::forward_iterator_tag)@Base" 0.8.0 - (c++|optional=std)"char* std::basic_string, std::allocator >::_S_construct(char*, char*, std::allocator const&, std::forward_iterator_tag)@Base" 0.8.0 +### ABI 5 changed so much (+ abicxx11 transition) + (c++)"APT::CacheSetHelper::CacheSetHelper(bool, GlobalError::MsgType)@Base" 1.1~exp9 + (c++)"APT::Configuration::getArchitectures[abi:cxx11](bool const&)@Base" 1.1~exp9 + (c++)"APT::Configuration::getCompressionTypes[abi:cxx11](bool const&)@Base" 1.1~exp9 + (c++)"APT::Configuration::getLanguages[abi:cxx11](bool const&, bool const&, char const**)@Base" 1.1~exp9 + (c++)"APT::PackageContainerInterface::operator=(APT::PackageContainerInterface const&)@Base" 1.1~exp9 + (c++)"APT::PackageContainerInterface::PackageContainerInterface(APT::CacheSetHelper::PkgSelector)@Base" 1.1~exp9 + (c++)"APT::PackageContainerInterface::~PackageContainerInterface()@Base" 1.1~exp9 + (c++)"APT::PackageContainerInterface::PackageContainerInterface()@Base" 1.1~exp9 + (c++)"APT::PackageContainer > >::~PackageContainer()@Base" 1.1~exp9 + (c++)"APT::PackageContainer > >::size() const@Base" 1.1~exp9 + (c++)"APT::PackageContainer, std::allocator > >::~PackageContainer()@Base" 1.1~exp9 + (c++)"APT::PackageContainer, std::allocator > >::size() const@Base" 1.1~exp9 + (c++)"APT::PackageUniverse::empty() const@Base" 1.1~exp9 + (c++)"APT::PackageUniverse::~PackageUniverse()@Base" 1.1~exp9 + (c++)"APT::PackageUniverse::PackageUniverse(pkgCache*)@Base" 1.1~exp9 + (c++)"APT::PackageUniverse::PackageUniverse(pkgCacheFile*)@Base" 1.1~exp9 + (c++)"APT::PackageUniverse::size() const@Base" 1.1~exp9 + (c++)"APT::Progress::PackageManagerText::PackageManagerText()@Base" 1.1~exp9 + (c++)"APT::VersionContainerInterface::FromDependency(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::DepIterator const&, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&)@Base" 1.1~exp9 + (c++)"APT::VersionContainerInterface::operator=(APT::VersionContainerInterface const&)@Base" 1.1~exp9 + (c++)"APT::VersionContainerInterface::~VersionContainerInterface()@Base" 1.1~exp9 + (c++)"APT::VersionContainerInterface::VersionContainerInterface()@Base" 1.1~exp9 + (c++)"APT::VersionContainer > >::size() const@Base" 1.1~exp9 + (c++)"APT::VersionContainer > >::~VersionContainer()@Base" 1.1~exp9 + (c++)"ChangeOwnerAndPermissionOfFile(char const*, char const*, char const*, char const*, unsigned int)@Base" 1.1~exp9 + (c++)"CommandLine::CommandLine()@Base" 1.1~exp9 + (c++)"Configuration::FindVector(char const*, std::__cxx11::basic_string, std::allocator > const&, bool) const@Base" 1.1~exp9 + (c++)"debDebianSourceDirIndex::GetType() const@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::~debDebPkgFileIndex()@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::debDebPkgFileIndex(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::FindInCache(pkgCache&) const@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetArchitecture[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetComponent[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetContent(std::basic_ostream >&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetIndexFlags() const@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetType() const@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::HasPackages() const@Base" 1.1~exp9 + (c++)"debDebPkgFileIndex::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"debDscFileIndex::CreateSrcParser() const@Base" 1.1~exp9 + (c++)"debDscFileIndex::~debDscFileIndex()@Base" 1.1~exp9 + (c++)"debDscFileIndex::debDscFileIndex(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"debDscFileIndex::GetType() const@Base" 1.1~exp9 + (c++)"debDscFileIndex::HasPackages() const@Base" 1.1~exp9 + (c++)"debPackagesIndex::ArchiveInfo[abi:cxx11](pkgCache::VerIterator const&) const@Base" 1.1~exp9 + (c++)"debPackagesIndex::~debPackagesIndex()@Base" 1.1~exp9 + (c++)"debPackagesIndex::debPackagesIndex(IndexTarget const&, bool)@Base" 1.1~exp9 + (c++)"debPackagesIndex::GetIndexFlags() const@Base" 1.1~exp9 + (c++)"debPackagesIndex::GetType() const@Base" 1.1~exp9 + (c++)"debPackagesIndex::HasPackages() const@Base" 1.1~exp9 + (c++)"debSourcesIndex::CreateSrcParser() const@Base" 1.1~exp9 + (c++)"debSourcesIndex::~debSourcesIndex()@Base" 1.1~exp9 + (c++)"debSourcesIndex::debSourcesIndex(IndexTarget const&, bool)@Base" 1.1~exp9 + (c++)"debSourcesIndex::GetIndexFlags() const@Base" 1.1~exp9 + (c++)"debSourcesIndex::GetType() const@Base" 1.1~exp9 + (c++)"debSourcesIndex::HasPackages() const@Base" 1.1~exp9 + (c++)"debSourcesIndex::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"debSourcesIndex::SourceInfo[abi:cxx11](pkgSrcRecords::Parser const&, pkgSrcRecords::File const&) const@Base" 1.1~exp9 + (c++)"debStatusIndex::~debStatusIndex()@Base" 1.1~exp9 + (c++)"debStatusIndex::debStatusIndex(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"debStatusIndex::Exists() const@Base" 1.1~exp9 + (c++)"debStatusIndex::GetArchitecture[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"debStatusIndex::GetComponent[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"debStatusIndex::GetIndexFlags() const@Base" 1.1~exp9 + (c++)"debStatusIndex::GetType() const@Base" 1.1~exp9 + (c++)"debStatusIndex::HasPackages() const@Base" 1.1~exp9 + (c++)"debTranslationsIndex::~debTranslationsIndex()@Base" 1.1~exp9 + (c++)"debTranslationsIndex::debTranslationsIndex(IndexTarget const&)@Base" 1.1~exp9 + (c++)"debTranslationsIndex::GetArchitecture[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"debTranslationsIndex::GetIndexFlags() const@Base" 1.1~exp9 + (c++)"debTranslationsIndex::GetType() const@Base" 1.1~exp9 + (c++)"debTranslationsIndex::HasPackages() const@Base" 1.1~exp9 + (c++)"debTranslationsIndex::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"ExecGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&)@Base" 1.1~exp9 + (c++)"ExecGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&, int*, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"FileFd::FileFd()@Base" 1.1~exp9 + (c++)"FileFd::FileFd(int, bool)@Base" 1.1~exp9 + (c++)"FileFd::FileFd(int, unsigned int, FileFd::CompressMode)@Base" 1.1~exp9 + (c++)"FileFd::FileFd(std::__cxx11::basic_string, std::allocator >, unsigned int, FileFd::CompressMode, unsigned long)@Base" 1.1~exp9 + (c++)"GetTempFile(std::__cxx11::basic_string, std::allocator > const&, bool, FileFd*)@Base" 1.1~exp9 + (c++)"Hashes::AddFD(FileFd&, unsigned long long)@Base" 1.1~exp9 + (c++)"Hashes::AddFD(int, unsigned long long)@Base" 1.1~exp9 + (c++)"Hashes::Add(unsigned char const*, unsigned long long)@Base" 1.1~exp9 + (c++)"Hashes::Hashes(HashStringList const&)@Base" 1.1~exp9 + (c++)"Hashes::Hashes(unsigned int)@Base" 1.1~exp9 + (c++)"HashStringList::FileSize() const@Base" 1.1~exp9 + (c++)"HashStringList::FileSize(unsigned long long)@Base" 1.1~exp9 + (c++)"IndexCopy::IndexCopy()@Base" 1.1~exp9 + (c++)"IndexTarget::Format(std::__cxx11::basic_string, std::allocator >) const@Base" 1.1~exp9 + (c++)"IndexTarget::~IndexTarget()@Base" 1.1~exp9 + (c++)"IndexTarget::IndexTarget(IndexTarget const&)@Base" 1.1~exp9 + (c++)"IndexTarget::IndexTarget(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool, bool, std::map, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > > const&)@Base" 1.1~exp9 + (c++)"IndexTarget::Option[abi:cxx11](IndexTarget::OptionKeys) const@Base" 1.1~exp9 + (c++)"metaIndex::CheckDist(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 + (c++)"metaIndex::Describe[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"metaIndex::Exists(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 + (c++)"metaIndex::FindInCache(pkgCache&, bool) const@Base" 1.1~exp9 + (c++)"metaIndex::GetCodename[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"metaIndex::GetDate() const@Base" 1.1~exp9 + (c++)"metaIndex::GetExpectedDist[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"metaIndex::GetLoadedSuccessfully() const@Base" 1.1~exp9 + (c++)"metaIndex::GetSignedBy[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"metaIndex::GetSuite[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"metaIndex::GetSupportsAcquireByHash() const@Base" 1.1~exp9 + (c++)"metaIndex::GetTrusted() const@Base" 1.1~exp9 + (c++)"metaIndex::GetValidUntil() const@Base" 1.1~exp9 + (c++)"metaIndex::Lookup(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 + (c++)"metaIndex::MetaKeys[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"metaIndex::swapLoad(metaIndex*)@Base" 1.1~exp9 + (c++)"PackageCopy::PackageCopy()@Base" 1.1~exp9 + (c++)"PackageCopy::RewriteEntry(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgAcqArchive::DescURI[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgAcqArchive::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 + (c++)"pkgAcqArchive::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 + (c++)"pkgAcqArchive::GetExpectedHashes() const@Base" 1.1~exp9 + (c++)"pkgAcqArchive::GetFinalFilename[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgAcqArchive::HashesRequired() const@Base" 1.1~exp9 + (c++)"pkgAcqArchive::ShortDesc[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::DescURI[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::GetExpectedHashes() const@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::HashesRequired() const@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::~pkgAcqChangelog()@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::pkgAcqChangelog(pkgAcquire*, pkgCache::RlsFileIterator const&, char const*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::pkgAcqChangelog(pkgAcquire*, pkgCache::VerIterator const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::pkgAcqChangelog(pkgAcquire*, std::__cxx11::basic_string, std::allocator > const&, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::URI[abi:cxx11](pkgCache::RlsFileIterator const&, char const*, char const*, char const*)@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::URI[abi:cxx11](pkgCache::VerIterator const&)@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::URI(std::__cxx11::basic_string, std::allocator > const&, char const*, char const*, char const*)@Base" 1.1~exp9 + (c++)"pkgAcqChangelog::URITemplate[abi:cxx11](pkgCache::RlsFileIterator const&)@Base" 1.1~exp9 + (c++)"pkgAcqFile::DescURI[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgAcqFile::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 + (c++)"pkgAcqFile::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 + (c++)"pkgAcqFile::GetExpectedHashes() const@Base" 1.1~exp9 + (c++)"pkgAcqFile::HashesRequired() const@Base" 1.1~exp9 + (c++)"pkgAcqFile::pkgAcqFile(pkgAcquire*, std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, unsigned long long, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 1.1~exp9 + (c++)"pkgAcqMethod::FetchItem::FetchItem()@Base" 1.1~exp9 + (c++)"pkgAcqMethod::FetchItem::~FetchItem()@Base" 1.1~exp9 + (c++)"pkgAcqMethod::FetchResult::~FetchResult()@Base" 1.1~exp9 + (c++)"pkgAcqMethod::URIAcquire(std::__cxx11::basic_string, std::allocator > const&, pkgAcqMethod::FetchItem*)@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::GetFinalFilename[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::GetItemDesc()@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::GetOwner() const@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::HashesRequired() const@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::HashSum[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::Item(pkgAcquire*)@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::Rename(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::ReportMirrorFailure(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::ShortDesc[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::Start(std::__cxx11::basic_string, std::allocator > const&, unsigned long long)@Base" 1.1~exp9 + (c++)"pkgAcquire::Item::VerifyDone(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 + (c++)"pkgAcquire::Queue::QItem::Custom600Headers[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgAcquire::Queue::QItem::GetExpectedHashes() const@Base" 1.1~exp9 + (c++)"pkgAcquire::Queue::QItem::GetMaximumSize() const@Base" 1.1~exp9 + (c++)"pkgAcquire::Queue::QItem::SyncDestinationFiles() const@Base" 1.1~exp9 + (c++)"pkgAcquire::Queue::Queue(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire*)@Base" 1.1~exp9 + (c++)"pkgAcquire::UriIterator::UriIterator(pkgAcquire::Queue*)@Base" 1.1~exp9 + (c++)"pkgArchiveCleaner::pkgArchiveCleaner()@Base" 1.1~exp9 + (c++)"pkgCache::DepIterator::IsImplicit() const@Base" 1.1~exp9 + (c++)"pkgCacheFile::pkgCacheFile(pkgDepCache*)@Base" 1.1~exp9 + (c++)"pkgCache::PkgIterator::FullName[abi:cxx11](bool const&) const@Base" 1.1~exp9 + (c++)"pkgCache::RlsFileIterator::IsOk()@Base" 1.1~exp9 + (c++)"pkgCache::RlsFileIterator::RelStr[abi:cxx11]()@Base" 1.1~exp9 + (c++)"pkgCdrom::~pkgCdrom()@Base" 1.1~exp9 + (c++)"pkgCdrom::pkgCdrom()@Base" 1.1~exp9 + (c++)"pkgCdromStatus::~pkgCdromStatus()@Base" 1.1~exp9 + (c++)"pkgCdromStatus::pkgCdromStatus()@Base" 1.1~exp9 + (c++)"pkgDebianIndexFile::FindInCache(pkgCache&) const@Base" 1.1~exp9 + (c++)"pkgDebianIndexFile::~pkgDebianIndexFile()@Base" 1.1~exp9 + (c++)"pkgDebianIndexFile::pkgDebianIndexFile(bool)@Base" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::ArchiveURI(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::Describe[abi:cxx11](bool) const@Base" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::Exists() const@Base" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::GetProgressDescription[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::IndexFileName[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::~pkgDebianIndexRealFile()@Base" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::pkgDebianIndexRealFile(std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::Size() const@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::ArchiveURI(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::Describe[abi:cxx11](bool) const@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::Exists() const@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::GetArchitecture[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::GetComponent[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::GetProgressDescription[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::IndexFileName[abi:cxx11]() const@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::~pkgDebianIndexTargetFile()@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::pkgDebianIndexTargetFile(IndexTarget const&, bool)@Base" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::Size() const@Base" 1.1~exp9 + (c++)"pkgDepCache::CheckDep(pkgCache::DepIterator const&, int, pkgCache::PkgIterator&)@Base" 1.1~exp9 + (c++)"pkgDepCache::DependencyState(pkgCache::DepIterator const&)@Base" 1.1~exp9 + (c++)"pkgDepCache::Policy::IsImportantDep(pkgCache::DepIterator const&) const@Base" 1.1~exp9 + (c++)"pkgDepCache::UpdateVerState(pkgCache::PkgIterator const&)@Base" 1.1~exp9 + (c++)"pkgDepCache::VersionState(pkgCache::DepIterator, unsigned char, unsigned char, unsigned char) const@Base" 1.1~exp9 + (c++)"pkgIndexFile::ArchiveInfo[abi:cxx11](pkgCache::VerIterator const&) const@Base" 1.1~exp9 + (c++)"pkgIndexFile::ArchiveURI(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 + (c++)"pkgIndexFile::~pkgIndexFile()@Base" 1.1~exp9 + (c++)"pkgIndexFile::pkgIndexFile(bool)@Base" 1.1~exp9 + (c++)"pkgIndexFile::SourceInfo[abi:cxx11](pkgSrcRecords::Parser const&, pkgSrcRecords::File const&) const@Base" 1.1~exp9 + (c++)"pkgIndexFile::Type::CreatePkgParser(pkgCache::PkgFileIterator const&) const@Base" 1.1~exp9 + (c++)"pkgIndexFile::Type::CreateSrcPkgParser(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 + (c++)"pkgRecords::Parser::~Parser()@Base" 1.1~exp9 + (c++)"pkgRecords::Parser::Parser()@Base" 1.1~exp9 + (c++)"pkgSourceList::AddVolatileFile(pkgIndexFile*)@Base" 1.1~exp9 + (c++)"pkgSourceList::GetVolatileFiles() const@Base" 1.1~exp9 + (c++)"pkgSourceList::ReadAppend(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgSourceList::ReadSourceDir(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgSourceList::Read(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgSourceList::Type::ParseLine(std::vector >&, char const*, unsigned int, std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 + (c++)"pkgSourceList::Type::ParseStanza(std::vector >&, pkgTagSection&, unsigned int, FileFd&)@Base" 1.1~exp9 + (c++)"pkgSourceList::Type::~Type()@Base" 1.1~exp9 + (c++)"pkgSourceList::Type::Type(char const*, char const*)@Base" 1.1~exp9 + (c++)"pkgSrcRecords::Parser::~Parser()@Base" 1.1~exp9 + (c++)"pkgSrcRecords::Parser::Parser(pkgIndexFile const*)@Base" 1.1~exp9 + (c++)"pkgSystem::~pkgSystem()@Base" 1.1~exp9 + (c++)"pkgSystem::pkgSystem(char const*, pkgVersioningSystem*)@Base" 1.1~exp9 + (c++)"pkgTagSection::FindFlag(char const*, unsigned char&, unsigned char) const@Base" 1.1~exp9 + (c++)"pkgTagSection::FindFlag(unsigned char&, unsigned char, char const*, char const*)@Base" 1.1~exp9 + (c++)"pkgTagSection::FindRawS[abi:cxx11](char const*) const@Base" 1.1~exp9 + (c++)"pkgTagSection::Tag::Remove(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgTagSection::Tag::Rename(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgTagSection::Tag::Rewrite(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"pkgTagSection::Tag::~Tag()@Base" 1.1~exp9 + (c++)"pkgTagSection::Write(FileFd&, char const* const*, std::vector > const&) const@Base" 1.1~exp9 + (c++)"pkgUserTagSection::~pkgUserTagSection()@Base" 1.1~exp9 + (c++)"pkgUserTagSection::TrimRecord(bool, char const*&)@Base" 1.1~exp9 + (c++)"pkgVersioningSystem::~pkgVersioningSystem()@Base" 1.1~exp9 + (c++)"SigVerify::~SigVerify()@Base" 1.1~exp9 + (c++)"SigVerify::SigVerify()@Base" 1.1~exp9 + (c++)"SourceCopy::RewriteEntry(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"SourceCopy::SourceCopy()@Base" 1.1~exp9 + (c++)"TranslationsCopy::~TranslationsCopy()@Base" 1.1~exp9 + (c++)"TranslationsCopy::TranslationsCopy()@Base" 1.1~exp9 + (c++)"typeinfo for APT::PackageUniverse@Base" 1.1~exp9 + (c++)"typeinfo for debDebianSourceDirIndex@Base" 1.1~exp9 + (c++)"typeinfo for debDebPkgFileIndex@Base" 1.1~exp9 + (c++)"typeinfo for debDscFileIndex@Base" 1.1~exp9 + (c++)"typeinfo for debPackagesIndex@Base" 1.1~exp9 + (c++)"typeinfo for debSourcesIndex@Base" 1.1~exp9 + (c++)"typeinfo for debStatusIndex@Base" 1.1~exp9 + (c++)"typeinfo for debTranslationsIndex@Base" 1.1~exp9 + (c++)"typeinfo for pkgAcqChangelog@Base" 1.1~exp9 + (c++)"typeinfo for pkgAcqMethod::FetchItem@Base" 1.1~exp9 + (c++)"typeinfo for pkgAcqMethod::FetchResult@Base" 1.1~exp9 + (c++)"typeinfo for pkgCdrom@Base" 1.1~exp9 + (c++)"typeinfo for pkgCdromStatus@Base" 1.1~exp9 + (c++)"typeinfo for pkgDebianIndexFile@Base" 1.1~exp9 + (c++)"typeinfo for pkgDebianIndexRealFile@Base" 1.1~exp9 + (c++)"typeinfo for pkgDebianIndexTargetFile@Base" 1.1~exp9 + (c++)"typeinfo for pkgDepCache::ActionGroup@Base" 1.1~exp9 + (c++)"typeinfo for pkgOrderList@Base" 1.1~exp9 + (c++)"typeinfo for pkgProblemResolver@Base" 1.1~exp9 + (c++)"typeinfo for pkgRecords@Base" 1.1~exp9 + (c++)"typeinfo for pkgSourceList@Base" 1.1~exp9 + (c++)"typeinfo for pkgUserTagSection@Base" 1.1~exp9 + (c++)"typeinfo for SigVerify@Base" 1.1~exp9 + (c++)"typeinfo for TranslationsCopy@Base" 1.1~exp9 + (c++)"typeinfo name for APT::PackageUniverse@Base" 1.1~exp9 + (c++)"typeinfo name for debDebianSourceDirIndex@Base" 1.1~exp9 + (c++)"typeinfo name for debDebPkgFileIndex@Base" 1.1~exp9 + (c++)"typeinfo name for debDscFileIndex@Base" 1.1~exp9 + (c++)"typeinfo name for debPackagesIndex@Base" 1.1~exp9 + (c++)"typeinfo name for debSourcesIndex@Base" 1.1~exp9 + (c++)"typeinfo name for debStatusIndex@Base" 1.1~exp9 + (c++)"typeinfo name for debTranslationsIndex@Base" 1.1~exp9 + (c++)"typeinfo name for pkgAcqChangelog@Base" 1.1~exp9 + (c++)"typeinfo name for pkgAcqMethod::FetchItem@Base" 1.1~exp9 + (c++)"typeinfo name for pkgAcqMethod::FetchResult@Base" 1.1~exp9 + (c++)"typeinfo name for pkgCdrom@Base" 1.1~exp9 + (c++)"typeinfo name for pkgCdromStatus@Base" 1.1~exp9 + (c++)"typeinfo name for pkgDebianIndexFile@Base" 1.1~exp9 + (c++)"typeinfo name for pkgDebianIndexRealFile@Base" 1.1~exp9 + (c++)"typeinfo name for pkgDebianIndexTargetFile@Base" 1.1~exp9 + (c++)"typeinfo name for pkgDepCache::ActionGroup@Base" 1.1~exp9 + (c++)"typeinfo name for pkgOrderList@Base" 1.1~exp9 + (c++)"typeinfo name for pkgProblemResolver@Base" 1.1~exp9 + (c++)"typeinfo name for pkgRecords@Base" 1.1~exp9 + (c++)"typeinfo name for pkgSourceList@Base" 1.1~exp9 + (c++)"typeinfo name for pkgUserTagSection@Base" 1.1~exp9 + (c++)"typeinfo name for SigVerify@Base" 1.1~exp9 + (c++)"typeinfo name for TranslationsCopy@Base" 1.1~exp9 + (c++)"URI::ArchiveOnly(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 + (c++)"void std::vector >::emplace_back(APT::Configuration::Compressor&&)@Base" 1.1~exp9 + (c++)"void std::vector >::emplace_back(char const*&&)@Base" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgCache::GrpIterator*&&)@Base" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgCache::PkgIterator*&&)@Base" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgCache::RlsFileIterator*&&)@Base" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgCache::VerIterator*&&)@Base" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgDPkgPM::Item&&)@Base" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgIndexFile*&&)@Base" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgTagSection::Tag&&)@Base" 1.1~exp9 + (c++)"void std::vector, std::allocator >, std::allocator, std::allocator > > >::emplace_back, std::allocator > >(std::__cxx11::basic_string, std::allocator >&&)@Base" 1.1~exp9 + (c++)"vtable for APT::PackageUniverse@Base" 1.1~exp9 + (c++)"vtable for debDebianSourceDirIndex@Base" 1.1~exp9 + (c++)"vtable for debDebPkgFileIndex@Base" 1.1~exp9 + (c++)"vtable for debDscFileIndex@Base" 1.1~exp9 + (c++)"vtable for debPackagesIndex@Base" 1.1~exp9 + (c++)"vtable for debSourcesIndex@Base" 1.1~exp9 + (c++)"vtable for debStatusIndex@Base" 1.1~exp9 + (c++)"vtable for debTranslationsIndex@Base" 1.1~exp9 + (c++)"vtable for pkgAcqChangelog@Base" 1.1~exp9 + (c++)"vtable for pkgAcqMethod::FetchItem@Base" 1.1~exp9 + (c++)"vtable for pkgAcqMethod::FetchResult@Base" 1.1~exp9 + (c++)"vtable for pkgCdrom@Base" 1.1~exp9 + (c++)"vtable for pkgCdromStatus@Base" 1.1~exp9 + (c++)"vtable for pkgDebianIndexFile@Base" 1.1~exp9 + (c++)"vtable for pkgDebianIndexRealFile@Base" 1.1~exp9 + (c++)"vtable for pkgDebianIndexTargetFile@Base" 1.1~exp9 + (c++)"vtable for pkgDepCache::ActionGroup@Base" 1.1~exp9 + (c++)"vtable for pkgOrderList@Base" 1.1~exp9 + (c++)"vtable for pkgProblemResolver@Base" 1.1~exp9 + (c++)"vtable for pkgRecords@Base" 1.1~exp9 + (c++)"vtable for pkgSourceList@Base" 1.1~exp9 + (c++)"vtable for pkgUserTagSection@Base" 1.1~exp9 + (c++)"vtable for SigVerify@Base" 1.1~exp9 + (c++)"vtable for TranslationsCopy@Base" 1.1~exp9 ### try to ignore std:: template instances + (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0 (c++|regex|optional=std)"^(void |)std::[^ ]+<.+ >::(_|~).+\(.*\)@Base$" 0.8.0 (c++|regex|optional=std)"^std::[^ ]+<.+ >::(append|insert|reserve|operator[^ ]+)\(.*\)@Base$" 0.8.0 (c++|regex|optional=std)"^(void |DiffInfo\* |)std::_.*@Base$" 0.8.0 - (c++|regex|optional=std)"^std::reverse_iterator<.+ > std::__.+@Base$" 0.8.0 - (c++|regex|optional=std)"^std::basic_string<.+ >\(.+\)@Base$" 0.8.0 (c++|regex|optional=std)"^__gnu_cxx::__[^ ]+<.*@Base$" 0.8.0 - (c++|regex|optional=std)"^typeinfo name for std::iterator<.*>@Base$" 0.8.0 - (c++|regex|optional=std)"^typeinfo for std::iterator<.*>@Base$" 0.8.0 (c++|optional=std)"std::ctype::do_widen(char) const@Base" 1.0.3 -- cgit v1.2.3 From ae97af1fdf726a0e7e553b2fb5734b6e09a088d0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Aug 2015 11:08:35 +0200 Subject: change to libapt-pkg abi 5.0 with versioned symbols We changed an aweful lot of stuff, so 5.0 is properly better than 4.X as a semantic version and as we are at it lets add some trivial symbol versioning as well: We just mark all exported symbols with the same version for now. This isn't really the proper thing to do as if we add symbols in later versions (with the same abi) they will get the same symbols version, but our .symbols file will protect us from the problems arising from this as it will ensure that a package acutally depends on a version of the abi high enough to include the symbol. --- apt-pkg/contrib/macros.h | 4 +- buildlib/library.mak | 10 +- debian/libapt-inst1.6.symbols | 134 ++-- debian/libapt-pkg4.15.install.in | 2 - debian/libapt-pkg4.15.symbols | 1502 ------------------------------------- debian/libapt-pkg5.0.install.in | 2 + debian/libapt-pkg5.0.symbols | 1503 ++++++++++++++++++++++++++++++++++++++ prepare-release | 7 +- 8 files changed, 1586 insertions(+), 1578 deletions(-) delete mode 100644 debian/libapt-pkg4.15.install.in delete mode 100644 debian/libapt-pkg4.15.symbols create mode 100644 debian/libapt-pkg5.0.install.in create mode 100644 debian/libapt-pkg5.0.symbols diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h index 367a6a75b..afa385c75 100644 --- a/apt-pkg/contrib/macros.h +++ b/apt-pkg/contrib/macros.h @@ -159,8 +159,8 @@ // reverse-dependencies of libapt-pkg against the new SONAME. // Non-ABI-Breaks should only increase RELEASE number. // See also buildlib/libversion.mak -#define APT_PKG_MAJOR 4 -#define APT_PKG_MINOR 15 +#define APT_PKG_MAJOR 5 +#define APT_PKG_MINOR 0 #define APT_PKG_RELEASE 0 #define APT_PKG_ABI ((APT_PKG_MAJOR * 100) + APT_PKG_MINOR) diff --git a/buildlib/library.mak b/buildlib/library.mak index cc0286d7e..03f868116 100644 --- a/buildlib/library.mak +++ b/buildlib/library.mak @@ -21,6 +21,7 @@ $(LOCAL)-OBJS := $(addprefix $(OBJ)/,$(addsuffix .opic,$(notdir $(basename $(SOU $(LOCAL)-DEP := $(addprefix $(DEP)/,$(addsuffix .opic.d,$(notdir $(basename $(SOURCE))))) $(LOCAL)-HEADERS := $(addprefix $(INCLUDE)/,$(HEADERS)) $(LOCAL)-SONAME := lib$(LIBRARY).so.$(MAJOR) +$(LOCAL)-VERSIONSCRIPT := $(LIB)/lib$(LIBRARY)-$(MAJOR)-$(MINOR).symver $(LOCAL)-SLIBS := $(SLIBS) $(LOCAL)-LIBRARY := $(LIBRARY) @@ -39,7 +40,7 @@ MKDIRS += $(OBJ) $(DEP) $(LIB) $(dir $($(LOCAL)-HEADERS)) # The clean rules .PHONY: clean/$(LOCAL) veryclean/$(LOCAL) clean/$(LOCAL): - -rm -f $($(@F)-OBJS) $($(@F)-DEP) + -rm -f $($(@F)-OBJS) $($(@F)-DEP) $($(@F)-VERSIONSCRIPT) veryclean/$(LOCAL): clean/$(LOCAL) -rm -f $($(@F)-HEADERS) $(LIB)/lib$($(@F)-LIBRARY)*.so* @@ -50,11 +51,14 @@ $(LIB)/lib$(LIBRARY).so.$(MAJOR): $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR) $(LIB)/lib$(LIBRARY).so: $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR) ln -sf $( $@ + # The binary build rule -$(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS) $(LIBRARYDEPENDS) +$(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR): $($(LOCAL)-HEADERS) $($(LOCAL)-OBJS) $(LIBRARYDEPENDS) $($(LOCAL)-VERSIONSCRIPT) -rm -f $(LIB)/lib$($(@F)-LIBRARY)*.so* 2> /dev/null echo Building shared library $@ - $(CXX) $(CXXFLAGS) $(LDFLAGS) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\ + $(CXX) $(CXXFLAGS) $(LDFLAGS) -Wl,--version-script=$($(@F)-VERSIONSCRIPT) $(PICFLAGS) $(LFLAGS) $(LFLAGS_SO)\ -o $@ $(SONAME_MAGIC)$($(@F)-SONAME) -shared \ $(filter %.opic,$^) \ $($(@F)-SLIBS) diff --git a/debian/libapt-inst1.6.symbols b/debian/libapt-inst1.6.symbols index e4b71c1f8..87d9984e7 100644 --- a/debian/libapt-inst1.6.symbols +++ b/debian/libapt-inst1.6.symbols @@ -1,70 +1,72 @@ libapt-inst.so.1.6 libapt-inst1.6 #MINVER# * Build-Depends-Package: libapt-pkg-dev - (c++)"ExtractTar::Done(bool)@Base" 0.8.0 - (c++)"ExtractTar::Go(pkgDirStream&)@Base" 0.8.0 - (c++)"ExtractTar::StartGzip()@Base" 0.8.0 - (c++)"ExtractTar::ExtractTar(FileFd&, unsigned long long, std::__cxx11::basic_string, std::allocator >)@Base" 1.0.5 - (c++)"ExtractTar::~ExtractTar()@Base" 0.8.0 - (c++)"debDebFile::GotoMember(char const*)@Base" 0.8.0 - (c++)"debDebFile::CheckMember(char const*)@Base" 0.8.0 - (c++)"debDebFile::ControlExtract::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0 - (c++)"debDebFile::ControlExtract::~ControlExtract()@Base" 0.8.0 - (c++)"debDebFile::ExtractTarMember(pkgDirStream&, char const*)@Base" 0.9.15.4 - (c++)"debDebFile::ExtractArchive(pkgDirStream&)@Base" 0.8.0 - (c++)"debDebFile::MemControlExtract::TakeControl(void const*, unsigned long long)@Base" 1.0.5 - (c++)"debDebFile::MemControlExtract::Read(debDebFile&)@Base" 0.8.0 - (c++)"debDebFile::MemControlExtract::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0 - (c++)"debDebFile::MemControlExtract::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@Base" 1.0.5 - (c++)"debDebFile::MemControlExtract::~MemControlExtract()@Base" 0.8.0 - (c++)"debDebFile::debDebFile(FileFd&)@Base" 0.8.0 - (c++)"pkgExtract::FinishedFile(pkgDirStream::Item&, int)@Base" 0.8.0 - (c++)"pkgExtract::CheckDirReplace(std::__cxx11::basic_string, std::allocator >, unsigned int)@Base" 0.8.0 - (c++)"pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator, bool)@Base" 0.8.0 - (c++)"pkgExtract::Fail(pkgDirStream::Item&, int)@Base" 0.8.0 - (c++)"pkgExtract::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0 - (c++)"pkgExtract::Aborted()@Base" 0.8.0 - (c++)"pkgExtract::Finished()@Base" 0.8.0 - (c++)"pkgExtract::pkgExtract(pkgFLCache&, pkgCache::VerIterator)@Base" 0.8.0 - (c++)"pkgExtract::~pkgExtract()@Base" 0.8.0 - (c++)"pkgFLCache::TreeLookup(unsigned int*, char const*, char const*, unsigned long, unsigned int*, bool)@Base" 0.8.0 - (c++)"pkgFLCache::AddConfFile(char const*, char const*, pkgFLCache::PkgIterator const&, unsigned char const*)@Base" 0.8.0 - (c++)"pkgFLCache::AddDiversion(pkgFLCache::PkgIterator const&, char const*, char const*)@Base" 0.8.0 - (c++)"pkgFLCache::BeginDiverLoad()@Base" 0.8.0 - (c++)"pkgFLCache::FinishDiverLoad()@Base" 0.8.0 - (c++)"pkgFLCache::GetPkg(char const*, char const*, bool)@Base" 0.8.0 - (c++)"pkgFLCache::Header::Header()@Base" 0.8.0 - (c++)"pkgFLCache::GetNode(char const*, char const*, unsigned int, bool, bool)@Base" 0.8.0 - (c++)"pkgFLCache::DropNode(unsigned int)@Base" 0.8.0 - (c++)"pkgFLCache::HashNode(pkgFLCache::NodeIterator const&)@Base" 0.8.0 - (c++)"pkgFLCache::PrintTree(unsigned int, unsigned long)@Base" 0.8.0 - (c++)"pkgFLCache::pkgFLCache(DynamicMMap&)@Base" 0.8.0 - (c++)"pkgDirStream::FinishedFile(pkgDirStream::Item&, int)@Base" 0.8.0 - (c++)"pkgDirStream::Fail(pkgDirStream::Item&, int)@Base" 0.8.0 - (c++)"pkgDirStream::DoItem(pkgDirStream::Item&, int&)@Base" 0.8.0 - (c++)"pkgDirStream::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@Base" 1.0.5 - (c++)"pkgDirStream::~pkgDirStream()@Base" 0.8.0 - (c++)"ARArchive::LoadHeaders()@Base" 0.8.0 - (c++)"ARArchive::ARArchive(FileFd&)@Base" 0.8.0 - (c++)"ARArchive::~ARArchive()@Base" 0.8.0 - (c++)"pkgFLCache::NodeIterator::RealPackage() const@Base" 0.8.0 - (c++)"pkgFLCache::Header::CheckSizes(pkgFLCache::Header&) const@Base" 0.8.0 - (c++)"ARArchive::FindMember(char const*) const@Base" 0.8.0 - (c++)"typeinfo for ExtractTar@Base" 0.8.0 - (c++)"typeinfo for pkgExtract@Base" 0.8.0 - (c++)"typeinfo for pkgDirStream@Base" 0.8.0 - (c++)"typeinfo for debDebFile::ControlExtract@Base" 0.8.0 - (c++)"typeinfo for debDebFile::MemControlExtract@Base" 0.8.0 - (c++)"typeinfo name for ExtractTar@Base" 0.8.0 - (c++)"typeinfo name for pkgExtract@Base" 0.8.0 - (c++)"typeinfo name for pkgDirStream@Base" 0.8.0 - (c++)"typeinfo name for debDebFile::ControlExtract@Base" 0.8.0 - (c++)"typeinfo name for debDebFile::MemControlExtract@Base" 0.8.0 - (c++)"vtable for ExtractTar@Base" 0.8.0 - (c++)"vtable for pkgExtract@Base" 0.8.0 - (c++)"vtable for pkgDirStream@Base" 0.8.0 - (c++)"vtable for debDebFile::ControlExtract@Base" 0.8.0 - (c++)"vtable for debDebFile::MemControlExtract@Base" 0.8.0 + (c++)"ExtractTar::Done(bool)@APTINST_1.6" 0.8.0 + (c++)"ExtractTar::Go(pkgDirStream&)@APTINST_1.6" 0.8.0 + (c++)"ExtractTar::StartGzip()@APTINST_1.6" 0.8.0 + (c++)"ExtractTar::ExtractTar(FileFd&, unsigned long long, std::__cxx11::basic_string, std::allocator >)@APTINST_1.6" 1.0.5 + (c++)"ExtractTar::~ExtractTar()@APTINST_1.6" 0.8.0 + (c++)"debDebFile::GotoMember(char const*)@APTINST_1.6" 0.8.0 + (c++)"debDebFile::CheckMember(char const*)@APTINST_1.6" 0.8.0 + (c++)"debDebFile::ControlExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0 + (c++)"debDebFile::ControlExtract::~ControlExtract()@APTINST_1.6" 0.8.0 + (c++)"debDebFile::ExtractTarMember(pkgDirStream&, char const*)@APTINST_1.6" 0.9.15.4 + (c++)"debDebFile::ExtractArchive(pkgDirStream&)@APTINST_1.6" 0.8.0 + (c++)"debDebFile::MemControlExtract::TakeControl(void const*, unsigned long long)@APTINST_1.6" 1.0.5 + (c++)"debDebFile::MemControlExtract::Read(debDebFile&)@APTINST_1.6" 0.8.0 + (c++)"debDebFile::MemControlExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0 + (c++)"debDebFile::MemControlExtract::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@APTINST_1.6" 1.0.5 + (c++)"debDebFile::MemControlExtract::~MemControlExtract()@APTINST_1.6" 0.8.0 + (c++)"debDebFile::debDebFile(FileFd&)@APTINST_1.6" 0.8.0 + (c++)"pkgExtract::FinishedFile(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0 + (c++)"pkgExtract::CheckDirReplace(std::__cxx11::basic_string, std::allocator >, unsigned int)@APTINST_1.6" 0.8.0 + (c++)"pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator, bool)@APTINST_1.6" 0.8.0 + (c++)"pkgExtract::Fail(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0 + (c++)"pkgExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0 + (c++)"pkgExtract::Aborted()@APTINST_1.6" 0.8.0 + (c++)"pkgExtract::Finished()@APTINST_1.6" 0.8.0 + (c++)"pkgExtract::pkgExtract(pkgFLCache&, pkgCache::VerIterator)@APTINST_1.6" 0.8.0 + (c++)"pkgExtract::~pkgExtract()@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::TreeLookup(unsigned int*, char const*, char const*, unsigned long, unsigned int*, bool)@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::AddConfFile(char const*, char const*, pkgFLCache::PkgIterator const&, unsigned char const*)@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::AddDiversion(pkgFLCache::PkgIterator const&, char const*, char const*)@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::BeginDiverLoad()@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::FinishDiverLoad()@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::GetPkg(char const*, char const*, bool)@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::Header::Header()@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::GetNode(char const*, char const*, unsigned int, bool, bool)@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::DropNode(unsigned int)@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::HashNode(pkgFLCache::NodeIterator const&)@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::PrintTree(unsigned int, unsigned long)@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::pkgFLCache(DynamicMMap&)@APTINST_1.6" 0.8.0 + (c++)"pkgDirStream::FinishedFile(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0 + (c++)"pkgDirStream::Fail(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0 + (c++)"pkgDirStream::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0 + (c++)"pkgDirStream::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@APTINST_1.6" 1.0.5 + (c++)"pkgDirStream::~pkgDirStream()@APTINST_1.6" 0.8.0 + (c++)"ARArchive::LoadHeaders()@APTINST_1.6" 0.8.0 + (c++)"ARArchive::ARArchive(FileFd&)@APTINST_1.6" 0.8.0 + (c++)"ARArchive::~ARArchive()@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::NodeIterator::RealPackage() const@APTINST_1.6" 0.8.0 + (c++)"pkgFLCache::Header::CheckSizes(pkgFLCache::Header&) const@APTINST_1.6" 0.8.0 + (c++)"ARArchive::FindMember(char const*) const@APTINST_1.6" 0.8.0 + (c++)"typeinfo for ExtractTar@APTINST_1.6" 0.8.0 + (c++)"typeinfo for pkgExtract@APTINST_1.6" 0.8.0 + (c++)"typeinfo for pkgDirStream@APTINST_1.6" 0.8.0 + (c++)"typeinfo for debDebFile::ControlExtract@APTINST_1.6" 0.8.0 + (c++)"typeinfo for debDebFile::MemControlExtract@APTINST_1.6" 0.8.0 + (c++)"typeinfo name for ExtractTar@APTINST_1.6" 0.8.0 + (c++)"typeinfo name for pkgExtract@APTINST_1.6" 0.8.0 + (c++)"typeinfo name for pkgDirStream@APTINST_1.6" 0.8.0 + (c++)"typeinfo name for debDebFile::ControlExtract@APTINST_1.6" 0.8.0 + (c++)"typeinfo name for debDebFile::MemControlExtract@APTINST_1.6" 0.8.0 + (c++)"vtable for ExtractTar@APTINST_1.6" 0.8.0 + (c++)"vtable for pkgExtract@APTINST_1.6" 0.8.0 + (c++)"vtable for pkgDirStream@APTINST_1.6" 0.8.0 + (c++)"vtable for debDebFile::ControlExtract@APTINST_1.6" 0.8.0 + (c++)"vtable for debDebFile::MemControlExtract@APTINST_1.6" 0.8.0 ### gcc artefacts - (c++|optional=std)"std::vector >::~vector()@Base" 0.8.12 + (c++|optional=std)"std::vector >::~vector()@APTINST_1.6" 0.8.12 +### symbol versioning + APTINST_1.6@APTINST_1.6 1.1~exp9 ### try to ignore std:: template instances - (c++|optional=std)"std::ctype::do_widen(char) const@Base" 1.0.3 + (c++|optional=std)"std::ctype::do_widen(char) const@APTINST_1.6" 1.0.3 diff --git a/debian/libapt-pkg4.15.install.in b/debian/libapt-pkg4.15.install.in deleted file mode 100644 index 56bed39d3..000000000 --- a/debian/libapt-pkg4.15.install.in +++ /dev/null @@ -1,2 +0,0 @@ -bin/libapt-pkg*.so.* usr/lib/@DEB_HOST_MULTIARCH@/ -usr/share/locale/*/*/libapt-pkg*.mo diff --git a/debian/libapt-pkg4.15.symbols b/debian/libapt-pkg4.15.symbols deleted file mode 100644 index 693fad872..000000000 --- a/debian/libapt-pkg4.15.symbols +++ /dev/null @@ -1,1502 +0,0 @@ -libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER# -* Build-Depends-Package: libapt-pkg-dev - TFRewritePackageOrder@Base 0.8.0 - TFRewriteSourceOrder@Base 0.8.0 - (c++)"FileExists(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"IdentCdrom(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int)@Base" 0.8.0 - (c++)"ListUpdate(pkgAcquireStatus&, pkgSourceList&, int)@Base" 0.8.0 - (c++)"MountCdrom(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"ParseCWord(char const*&, std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"ReadPinDir(pkgPolicy&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"RunScripts(char const*)@Base" 0.8.0 - (c++)"SafeGetCWD[abi:cxx11]()@Base" 0.8.0 - (c++)"QuoteString(std::__cxx11::basic_string, std::allocator > const&, char const*)@Base" 0.8.0 - (c++)"ReadPinFile(pkgPolicy&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"RegexChoice(RxChoiceList*, char const**, char const**)@Base" 0.8.0 - (c++)"SetNonBlock(int, bool)@Base" 0.8.0 - (c++)"flExtension(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"Base64Encode(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"ReadMessages(int, std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.8.0 - (c++)"SetCloseExec(int, bool)@Base" 0.8.0 - (c++)"StringToBool(std::__cxx11::basic_string, std::allocator > const&, int)@Base" 0.8.0 - (c++)"UnmountCdrom(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"_GetErrorObj()@Base" 0.8.0 - (c++)"Base256ToNum(char const*, unsigned long long&, unsigned int)@Base" 1.0.5 - (c++)"pkgFixBroken(pkgDepCache&)@Base" 0.8.0 - (c++)"DeQuoteString(__gnu_cxx::__normal_iterator, std::allocator > > const&, __gnu_cxx::__normal_iterator, std::allocator > > const&)@Base" 0.8.0 - (c++)"DeQuoteString(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"OutputInDepth[abi:cxx11](unsigned long, char const*)@Base" 0.8.0 - (c++)"ReadConfigDir(Configuration&, std::__cxx11::basic_string, std::allocator > const&, bool const&, unsigned int const&)@Base" 0.8.0 - (c++)"URItoFileName(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"UTF8ToCodeset(char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >*)@Base" 0.8.0 - (c++)"pkgInitConfig(Configuration&)@Base" 0.8.0 - (c++)"pkgInitSystem(Configuration&, pkgSystem*&)@Base" 0.8.0 - (c++)"safe_snprintf(char*, char*, char const*, ...)@Base" 0.8.0 - (c++)"stringcasecmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, char const*, char const*)@Base" 0.8.0 - (c++)"stringcasecmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >)@Base" 0.8.0 -# (c++|optional=inline)"stringcasecmp(std::__cxx11::basic_string, std::allocator > const&, char const*)@Base" 0.8.0 - (c++)"stringcasecmp(char const*, char const*, char const*, char const*)@Base" 0.8.0 - (c++)"tolower_ascii(int)@Base" 0.8.0 - (c++)"ParseQuoteWord(char const*&, std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"ReadConfigFile(Configuration&, std::__cxx11::basic_string, std::allocator > const&, bool const&, unsigned int const&)@Base" 0.8.0 - (c++)"TokSplitString(char, char*, char**, unsigned long)@Base" 0.8.0 - (c++)"maybe_add_auth(URI&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgApplyStatus(pkgDepCache&)@Base" 0.8.0 - (c++)"CheckDomainList(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"CreateDirectory(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"DirectoryExists(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"VectorizeString(std::__cxx11::basic_string, std::allocator > const&, char const&)@Base" 0.8.0 - (c++)"pkgPrioSortList(pkgCache&, pkgCache::Version**)@Base" 0.8.0 - (c++)"pkgMakeStatusCache(pkgSourceList&, OpProgress&, MMap**, bool)@Base" 0.8.0 - (c++)"pkgMinimizeUpgrade(pkgDepCache&)@Base" 0.8.0 - (c++)"pkgAllUpgrade(pkgDepCache&)@Base" 0.8.0 - (c++)"pkgDistUpgrade(pkgDepCache&)@Base" 0.8.0 - (c++)"GetListOfFilesInDir(std::__cxx11::basic_string, std::allocator > const&, std::vector, std::allocator >, std::allocator, std::allocator > > > const&, bool const&)@Base" 0.8.0 - (c++)"GetListOfFilesInDir(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool const&, bool const&)@Base" 0.8.0 - (c++)"pkgMakeOnlyStatusCache(OpProgress&, DynamicMMap**)@Base" 0.8.0 - (c++)"WaitFd(int, bool, unsigned long)@Base" 0.8.0 - (c++)"GetLock(std::__cxx11::basic_string, std::allocator >, bool)@Base" 0.8.0 - (c++)"Hex2Num(std::__cxx11::basic_string, std::allocator > const&, unsigned char*, unsigned int)@Base" 0.8.0 - (c++)"CopyFile(FileFd&, FileFd&)@Base" 0.8.0 - (c++)"ExecFork()@Base" 0.8.0 - (c++)"ExecWait(int, char const*, bool)@Base" 0.8.0 - (c++)"StrToNum(char const*, unsigned long&, unsigned int, unsigned int)@Base" 0.8.0 - (c++)"SubstVar(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"SubstVar(std::__cxx11::basic_string, std::allocator >, SubstVar const*)@Base" 0.8.0 - (c++)"flNoLink(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"flNotDir(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"ioprintf(std::basic_ostream >&, char const*, ...)@Base" 0.8.0 - (c++)"IsMounted(std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"LookupTag(std::__cxx11::basic_string, std::allocator > const&, char const*, char const*)@Base" 0.8.0 - (c++)"SizeToStr[abi:cxx11](double)@Base" 0.8.0 - (c++)"TFRewrite(_IO_FILE*, pkgTagSection const&, char const**, TFRewriteData*)@Base" 0.8.0 - (c++)"TimeToStr[abi:cxx11](unsigned long)@Base" 0.8.0 - (c++)"_strstrip(char*)@Base" 0.8.0 - (c++)"flCombine(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"flNotFile(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"stringcmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, char const*, char const*)@Base" 0.8.0 - (c++)"stringcmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >)@Base" 0.8.0 - (c++)"stringcmp(char const*, char const*, char const*, char const*)@Base" 0.8.0 - (c++)"strprintf(std::__cxx11::basic_string, std::allocator >&, char const*, ...)@Base" 0.8.0 - (c++)"HashString::SupportedHashes()@Base" 0.8.0 - (c++)"HashString::_SupportedHashes@Base" 0.8.0 - (c++)"HashString::HashString(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"HashString::HashString(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"HashString::HashString()@Base" 0.8.0 - (c++)"HashString::~HashString()@Base" 0.8.0 - (c++)"OpProgress::CheckChange(float)@Base" 0.8.0 - (c++)"OpProgress::Done()@Base" 0.8.0 - (c++)"OpProgress::Update()@Base" 0.8.0 - (c++)"OpProgress::OpProgress()@Base" 0.8.0 - (c++)"OpProgress::~OpProgress()@Base" 0.8.0 - (c++)"SourceCopy::GetFileName()@Base" 0.8.0 - (c++)"SourceCopy::Type()@Base" 0.8.0 - (c++)"SourceCopy::~SourceCopy()@Base" 0.8.0 - (c++)"pkgAcqFile::~pkgAcqFile()@Base" 0.8.0 - (c++)"pkgAcquire::WorkerStep(pkgAcquire::Worker*)@Base" 0.8.0 - (c++)"pkgAcquire::FetchNeeded()@Base" 0.8.0 - (c++)"pkgAcquire::TotalNeeded()@Base" 0.8.0 - (c++)"pkgAcquire::MethodConfig::MethodConfig()@Base" 0.8.0 - (c++)"pkgAcquire::PartialPresent()@Base" 0.8.0 - (c++)"pkgAcquire::Add(pkgAcquire::Item*)@Base" 0.8.0 - (c++)"pkgAcquire::Add(pkgAcquire::Worker*)@Base" 0.8.0 - (c++)"pkgAcquire::Run(int)@Base" 0.8.0 - (c++)"pkgAcquire::Bump()@Base" 0.8.0 - (c++)"pkgAcquire::Item::Finished()@Base" 0.8.0 - (c++)"pkgAcquire::Item::~Item()@Base" 0.8.0 - (c++)"pkgAcquire::Clean(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcquire::Queue::Bump()@Base" 0.8.0 - (c++)"pkgAcquire::Queue::Cycle()@Base" 0.8.0 - (c++)"pkgAcquire::Queue::Dequeue(pkgAcquire::Item*)@Base" 0.8.0 - (c++)"pkgAcquire::Queue::Enqueue(pkgAcquire::ItemDesc&)@Base" 0.8.0 - (c++)"pkgAcquire::Queue::Startup()@Base" 0.8.0 - (c++)"pkgAcquire::Queue::FindItem(std::__cxx11::basic_string, std::allocator >, pkgAcquire::Worker*)@Base" 0.8.0 - (c++)"pkgAcquire::Queue::ItemDone(pkgAcquire::Queue::QItem*)@Base" 0.8.0 - (c++)"pkgAcquire::Queue::Shutdown(bool)@Base" 0.8.0 - (c++)"pkgAcquire::Queue::~Queue()@Base" 0.8.0 - (c++)"pkgAcquire::Remove(pkgAcquire::Item*)@Base" 0.8.0 - (c++)"pkgAcquire::Remove(pkgAcquire::Worker*)@Base" 0.8.0 - (c++)"pkgAcquire::RunFds(fd_set*, fd_set*)@Base" 0.8.0 - (c++)"pkgAcquire::SetFds(int&, fd_set*, fd_set*)@Base" 0.8.0 - (c++)"pkgAcquire::UriEnd()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::OutFdReady()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::MediaChange(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcquire::Worker::RunMessages()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::Capabilities(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcquire::Worker::ReadMessages()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::MethodFailure()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::SendConfiguration()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::Pulse()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::Start()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::ItemDone()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::Construct()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::InFdReady()@Base" 0.8.0 - (c++)"pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem*)@Base" 0.8.0 - (c++)"pkgAcquire::Worker::Worker(pkgAcquire::MethodConfig*)@Base" 0.8.0 - (c++)"pkgAcquire::Worker::Worker(pkgAcquire::Queue*, pkgAcquire::MethodConfig*, pkgAcquireStatus*)@Base" 0.8.0 - (c++)"pkgAcquire::Worker::~Worker()@Base" 0.8.0 - (c++)"pkgAcquire::Dequeue(pkgAcquire::Item*)@Base" 0.8.0 - (c++)"pkgAcquire::Enqueue(pkgAcquire::ItemDesc&)@Base" 0.8.0 - (c++)"pkgAcquire::Shutdown()@Base" 0.8.0 - (c++)"pkgAcquire::UriBegin()@Base" 0.8.0 - (c++)"pkgAcquire::GetConfig(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcquire::QueueName(std::__cxx11::basic_string, std::allocator >, pkgAcquire::MethodConfig const*&)@Base" 0.8.0 - (c++)"pkgAcquire::pkgAcquire(pkgAcquireStatus*)@Base" 0.8.0 - (c++)"pkgAcquire::pkgAcquire()@Base" 0.8.0 - (c++)"pkgAcquire::~pkgAcquire()@Base" 0.8.0 - (c++)"pkgRecords::Lookup(pkgCache::VerFileIterator const&)@Base" 0.8.0 - (c++)"pkgRecords::Lookup(pkgCache::DescFileIterator const&)@Base" 0.8.0 - (c++)"pkgRecords::Parser::Maintainer[abi:cxx11]()@Base" 0.8.0 - (c++)"pkgRecords::Parser::Name[abi:cxx11]()@Base" 0.8.0 - (c++)"pkgRecords::Parser::GetRec(char const*&, char const*&)@Base" 0.8.0 - (c++)"pkgRecords::Parser::FileName[abi:cxx11]()@Base" 0.8.0 - (c++)"pkgRecords::Parser::Homepage[abi:cxx11]()@Base" 0.8.0 - (c++)"pkgRecords::Parser::SourcePkg[abi:cxx11]()@Base" 0.8.0 - (c++)"pkgRecords::Parser::SourceVer[abi:cxx11]()@Base" 0.8.0 - (c++)"pkgRecords::pkgRecords(pkgCache&)@Base" 0.8.0 - (c++)"pkgRecords::~pkgRecords()@Base" 0.8.0 - (c++)"pkgTagFile::Step(pkgTagSection&)@Base" 0.8.0 - (c++)"pkgTagFile::~pkgTagFile()@Base" 0.8.0 - (c++)"CdromDevice::~CdromDevice()@Base" 0.8.0 - (c++)"CommandLine::DispatchArg(CommandLine::Dispatch*, bool)@Base" 0.8.0 - (c++)"CommandLine::SaveInConfig(unsigned int const&, char const* const*)@Base" 0.8.0 - (c++)"CommandLine::Parse(int, char const**)@Base" 0.8.0 - (c++)"CommandLine::HandleOpt(int&, int, char const**, char const*&, CommandLine::Args*, bool)@Base" 0.8.0 - (c++)"CommandLine::CommandLine(CommandLine::Args*, Configuration*)@Base" 0.8.0 - (c++)"CommandLine::~CommandLine()@Base" 0.8.0 - (c++)"DynamicMMap::WriteString(char const*, unsigned long)@Base" 0.8.0 - (c++)"DynamicMMap::Grow()@Base" 0.8.0 - (c++)"DynamicMMap::Allocate(unsigned long)@Base" 0.8.0 - (c++)"DynamicMMap::DynamicMMap(FileFd&, unsigned long, unsigned long const&, unsigned long const&, unsigned long const&)@Base" 0.8.0 - (c++)"DynamicMMap::DynamicMMap(unsigned long, unsigned long const&, unsigned long const&, unsigned long const&)@Base" 0.8.0 - (c++)"DynamicMMap::~DynamicMMap()@Base" 0.8.0 - (c++)"GlobalError::DumpErrors(std::basic_ostream >&, GlobalError::MsgType const&, bool const&)@Base" 0.8.0 - (c++)"GlobalError::PopMessage(std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"GlobalError::InsertErrno(GlobalError::MsgType const&, char const*, char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::PushToStack()@Base" 0.8.0 - (c++)"GlobalError::RevertToStack()@Base" 0.8.0 - (c++)"GlobalError::MergeWithStack()@Base" 0.8.0 - (c++)"GlobalError::Debug(char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::Errno(char const*, char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::Error(char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::Fatal(char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::DebugE(char const*, char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::FatalE(char const*, char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::Insert(GlobalError::MsgType const&, char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::Notice(char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::Discard()@Base" 0.8.0 - (c++)"GlobalError::NoticeE(char const*, char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::Warning(char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::WarningE(char const*, char const*, ...)@Base" 0.8.0 - (c++)"GlobalError::GlobalError()@Base" 0.8.0 - (c++)"PackageCopy::GetFileName()@Base" 0.8.0 - (c++)"PackageCopy::Type()@Base" 0.8.0 - (c++)"PackageCopy::~PackageCopy()@Base" 0.8.0 - (c++)"pkgDepCache::IsDeleteOk(pkgCache::PkgIterator const&, bool, unsigned long, bool)@Base" 0.8.0 - (c++)"pkgDepCache::MarkDelete(pkgCache::PkgIterator const&, bool, unsigned long, bool)@Base" 0.8.0 - (c++)"pkgDepCache::StateCache::StripEpoch(char const*)@Base" 0.8.0 - (c++)"pkgDepCache::StateCache::Update(pkgCache::PkgIterator, pkgCache&)@Base" 0.8.0 - (c++)"pkgDepCache::ActionGroup::release()@Base" 0.8.0 - (c++)"pkgDepCache::ActionGroup::ActionGroup(pkgDepCache&)@Base" 0.8.0 - (c++)"pkgDepCache::ActionGroup::~ActionGroup()@Base" 0.8.0 - (c++)"pkgDepCache::IsInstallOk(pkgCache::PkgIterator const&, bool, unsigned long, bool)@Base" 0.8.0 - (c++)"pkgDepCache::MarkInstall(pkgCache::PkgIterator const&, bool, unsigned long, bool, bool)@Base" 0.8.0 - (c++)"pkgDepCache::SetReInstall(pkgCache::PkgIterator const&, bool)@Base" 0.8.0 - (c++)"pkgDepCache::BuildGroupOrs(pkgCache::VerIterator const&)@Base" 0.8.0 - (c++)"pkgDepCache::InRootSetFunc::InRootSet(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgDepCache::InRootSetFunc::~InRootSetFunc()@Base" 0.8.0 - (c++)"pkgDepCache::readStateFile(OpProgress*)@Base" 0.8.0 - (c++)"pkgDepCache::GetRootSetFunc()@Base" 0.8.0 - (c++)"pkgDepCache::writeStateFile(OpProgress*, bool)@Base" 0.8.0 - (c++)"pkgDepCache::DefaultRootSetFunc::InRootSet(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc()@Base" 0.8.0 - (c++)"pkgDepCache::MarkFollowsSuggests()@Base" 0.8.0 - (c++)"pkgDepCache::MarkFollowsRecommends()@Base" 0.8.0 - (c++)"pkgDepCache::Init(OpProgress*)@Base" 0.8.0 - (c++)"pkgDepCache::Policy::GetCandidateVer(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgDepCache::Policy::~Policy()@Base" 0.8.0 - (c++)"pkgDepCache::Update(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgDepCache::Update(OpProgress*)@Base" 0.8.0 - (c++)"pkgDepCache::Update(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgDepCache::MarkAuto(pkgCache::PkgIterator const&, bool)@Base" 0.8.0 - (c++)"pkgDepCache::MarkKeep(pkgCache::PkgIterator const&, bool, bool, unsigned long)@Base" 0.8.0 - (c++)"pkgDepCache::MarkRequired(pkgDepCache::InRootSetFunc&)@Base" 0.8.0 - (c++)"pkgDepCache::Sweep()@Base" 0.8.0 - (c++)"pkgDepCache::pkgDepCache(pkgCache*, pkgDepCache::Policy*)@Base" 0.8.0 - (c++)"pkgDepCache::~pkgDepCache()@Base" 0.8.0 - (c++)"pkgSimulate::Policy::GetCandidateVer(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgSimulate::Policy::~Policy()@Base" 0.8.0 - (c++)"pkgSimulate::Remove(pkgCache::PkgIterator, bool)@Base" 0.8.0 - (c++)"pkgSimulate::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgSimulate::Configure(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgSimulate::pkgSimulate(pkgDepCache*)@Base" 0.8.0 - (c++)"pkgSimulate::~pkgSimulate()@Base" 0.8.0 - (c++)"pkgAcqMethod::FetchResult::TakeHashes(Hashes&)@Base" 0.8.0 - (c++)"pkgAcqMethod::FetchResult::FetchResult()@Base" 0.8.0 - (c++)"pkgAcqMethod::Configuration(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcqMethod::Log(char const*, ...)@Base" 0.8.0 - (c++)"pkgAcqMethod::Run(bool)@Base" 0.8.0 - (c++)"pkgAcqMethod::Exit()@Base" 0.8.0 - (c++)"pkgAcqMethod::Fail(std::__cxx11::basic_string, std::allocator >, bool)@Base" 0.8.0 - (c++)"pkgAcqMethod::Fail(bool)@Base" 0.8.0 - (c++)"pkgAcqMethod::Fetch(pkgAcqMethod::FetchItem*)@Base" 0.8.0 - (c++)"pkgAcqMethod::Status(char const*, ...)@Base" 0.8.0 - (c++)"pkgAcqMethod::URIDone(pkgAcqMethod::FetchResult&, pkgAcqMethod::FetchResult*)@Base" 0.8.0 - (c++)"pkgAcqMethod::Redirect(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"pkgAcqMethod::URIStart(pkgAcqMethod::FetchResult&)@Base" 0.8.0 - (c++)"pkgAcqMethod::MediaFail(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcqMethod::pkgAcqMethod(char const*, unsigned long)@Base" 0.8.0 - (c++)"pkgAcqMethod::~pkgAcqMethod()@Base" 0.8.0 - (c++)"pkgCacheFile::BuildCaches(OpProgress*, bool)@Base" 0.8.0 - (c++)"pkgCacheFile::BuildPolicy(OpProgress*)@Base" 0.8.0 - (c++)"pkgCacheFile::BuildDepCache(OpProgress*)@Base" 0.8.0 - (c++)"pkgCacheFile::BuildSourceList(OpProgress*)@Base" 0.8.0 - (c++)"pkgCacheFile::Open(OpProgress*, bool)@Base" 0.8.0 - (c++)"pkgCacheFile::Close()@Base" 0.8.0 - (c++)"pkgCacheFile::pkgCacheFile()@Base" 0.8.0 - (c++)"pkgCacheFile::~pkgCacheFile()@Base" 0.8.0 - (c++)"pkgIndexFile::LanguageCode[abi:cxx11]()@Base" 0.8.0 - (c++)"pkgIndexFile::CheckLanguageCode(char const*)@Base" 0.8.0 - (c++)"pkgIndexFile::TranslationsAvailable()@Base" 0.8.0 - (c++)"pkgIndexFile::Type::GlobalList@Base" 0.8.0 - (c++)"pkgIndexFile::Type::GlobalListLen@Base" 0.8.0 - (c++)"pkgIndexFile::Type::GetType(char const*)@Base" 0.8.0 - (c++)"pkgIndexFile::Type::Type()@Base" 0.8.0 - (c++)"pkgOrderList::VisitRDeps(bool (pkgOrderList::*)(pkgCache::DepIterator), pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgOrderList::OrderUnpack(std::__cxx11::basic_string, std::allocator >*)@Base" 0.8.0 - (c++)"pkgOrderList::DepConfigure(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgOrderList::DepUnPackDep(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgOrderList::DepUnPackPre(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgOrderList::DepUnPackCrit(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgOrderList::DepUnPackPreD(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgOrderList::OrderCompareA(void const*, void const*)@Base" 0.8.0 - (c++)"pkgOrderList::OrderCompareB(void const*, void const*)@Base" 0.8.0 - (c++)"pkgOrderList::OrderCritical()@Base" 0.8.0 - (c++)"pkgOrderList::VisitProvides(pkgCache::DepIterator, bool)@Base" 0.8.0 - (c++)"pkgOrderList::OrderConfigure()@Base" 0.8.0 - (c++)"pkgOrderList::VisitRProvides(bool (pkgOrderList::*)(pkgCache::DepIterator), pkgCache::VerIterator)@Base" 0.8.0 - (c++)"pkgOrderList::Me@Base" 0.8.0 - (c++)"pkgOrderList::DoRun()@Base" 0.8.0 - (c++)"pkgOrderList::Score(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgOrderList::AddLoop(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgOrderList::FileCmp(pkgCache::PkgIterator, pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgOrderList::CheckDep(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgOrderList::DepRemove(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgOrderList::IsMissing(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgOrderList::VisitDeps(bool (pkgOrderList::*)(pkgCache::DepIterator), pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgOrderList::WipeFlags(unsigned long)@Base" 0.8.0 - (c++)"pkgOrderList::pkgOrderList(pkgDepCache*)@Base" 0.8.0 - (c++)"pkgOrderList::~pkgOrderList()@Base" 0.8.0 - (c++)"Configuration::MatchAgainstConfig::MatchAgainstConfig(char const*)@Base" 0.8.0 - (c++)"Configuration::MatchAgainstConfig::~MatchAgainstConfig()@Base" 0.8.0 - (c++)"Configuration::Set(char const*, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"Configuration::Set(char const*, int const&)@Base" 0.8.0 - (c++)"Configuration::Dump(std::basic_ostream >&)@Base" 0.8.0 - (c++)"Configuration::Clear(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"Configuration::Clear(std::__cxx11::basic_string, std::allocator > const&, int const&)@Base" 0.8.0 - (c++)"Configuration::Clear(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"Configuration::CndSet(char const*, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"Configuration::Lookup(char const*, bool const&)@Base" 0.8.0 - (c++)"Configuration::Lookup(Configuration::Item*, char const*, unsigned long const&, bool const&)@Base" 0.8.0 - (c++)"Configuration::Configuration(Configuration::Item const*)@Base" 0.8.0 - (c++)"Configuration::Configuration()@Base" 0.8.0 - (c++)"Configuration::~Configuration()@Base" 0.8.0 - (c++)"WeakPointable::~WeakPointable()@Base" 0.8.0 - (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&, bool const&)@Base" 0.8.0 - (c++)"debListParser::ConvertRelation(char const*, unsigned int&)@Base" 0.8.0 - (c++)"debListParser::GetPrio(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgAcqArchive::Finished()@Base" 0.8.0 - (c++)"pkgAcqArchive::QueueNext()@Base" 0.8.0 - (c++)"pkgAcqArchive::pkgAcqArchive(pkgAcquire*, pkgSourceList*, pkgRecords*, pkgCache::VerIterator const&, std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"pkgAcqArchive::~pkgAcqArchive()@Base" 0.8.0 - (c++)"pkgSourceList::Type::GlobalList@Base" 0.8.0 - (c++)"pkgSourceList::Type::GlobalListLen@Base" 0.8.0 - (c++)"pkgSourceList::Type::GetType(char const*)@Base" 0.8.0 - (c++)"pkgSourceList::ReadMainList()@Base" 0.8.0 - (c++)"pkgSourceList::Reset()@Base" 0.8.0 - (c++)"pkgSourceList::pkgSourceList()@Base" 0.8.0 - (c++)"pkgSourceList::~pkgSourceList()@Base" 0.8.0 - (c++)"pkgSrcRecords::File::~File()@Base" 0.8.0 - (c++)"pkgSrcRecords::Find(char const*, bool const&)@Base" 0.8.0 - (c++)"pkgSrcRecords::Parser::BuildDepRec::~BuildDepRec()@Base" 0.8.0 - (c++)"pkgSrcRecords::Parser::BuildDepType(unsigned char const&)@Base" 0.8.0 - (c++)"pkgSrcRecords::Restart()@Base" 0.8.0 - (c++)"pkgSrcRecords::pkgSrcRecords(pkgSourceList&)@Base" 0.8.0 - (c++)"pkgSrcRecords::~pkgSrcRecords()@Base" 0.8.0 - (c++)"pkgTagSection::TrimRecord(bool, char const*&)@Base" 0.8.0 - (c++)"pkgTagSection::Trim()@Base" 0.8.0 - (c++)"OpTextProgress::Done()@Base" 0.8.0 - (c++)"OpTextProgress::Write(char const*)@Base" 0.8.0 - (c++)"OpTextProgress::Update()@Base" 0.8.0 - (c++)"OpTextProgress::OpTextProgress(Configuration&)@Base" 0.8.0 - (c++)"OpTextProgress::~OpTextProgress()@Base" 0.8.0 - (c++)"pkgVersionMatch::ExpressionMatches(char const*, char const*)@Base" 0.8.0 - (c++)"pkgVersionMatch::ExpressionMatches(std::__cxx11::basic_string, std::allocator > const&, char const*)@Base" 0.8.0 - (c++)"pkgVersionMatch::Find(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgVersionMatch::MatchVer(char const*, std::__cxx11::basic_string, std::allocator >, bool)@Base" 0.8.0 - (c++)"pkgVersionMatch::FileMatch(pkgCache::PkgFileIterator)@Base" 0.8.0 - (c++)"pkgVersionMatch::pkgVersionMatch(std::__cxx11::basic_string, std::allocator >, pkgVersionMatch::MatchType)@Base" 0.8.0 - (c++)"pkgVersionMatch::~pkgVersionMatch()@Base" 0.8.0 - (c++)"TranslationsCopy::CopyTranslations(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, pkgCdromStatus*)@Base" 0.8.0 - (c++)"pkgAcquireStatus::Done(pkgAcquire::ItemDesc&)@Base" 0.8.0 - (c++)"pkgAcquireStatus::Fail(pkgAcquire::ItemDesc&)@Base" 0.8.0 - (c++)"pkgAcquireStatus::Stop()@Base" 0.8.0 - (c++)"pkgAcquireStatus::Fetch(pkgAcquire::ItemDesc&)@Base" 0.8.0 - (c++)"pkgAcquireStatus::Pulse(pkgAcquire*)@Base" 0.8.0 - (c++)"pkgAcquireStatus::Start()@Base" 0.8.0 - (c++)"pkgAcquireStatus::IMSHit(pkgAcquire::ItemDesc&)@Base" 0.8.0 - (c++)"pkgAcquireStatus::pkgAcquireStatus()@Base" 0.8.0 - (c++)"pkgArchiveCleaner::Go(std::__cxx11::basic_string, std::allocator >, pkgCache&)@Base" 0.8.0 - (c++)"pkgCacheGenerator::MakeStatusCache(pkgSourceList&, OpProgress*, MMap**, bool)@Base" 0.8.0 - (c++)"pkgCacheGenerator::MakeOnlyStatusCache(OpProgress*, DynamicMMap**)@Base" 0.8.0 - (c++)"pkgPackageManager::FixMissing()@Base" 0.8.0 - (c++)"pkgPackageManager::EarlyRemove(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgPackageManager::GetArchives(pkgAcquire*, pkgSourceList*, pkgRecords*)@Base" 0.8.0 - (c++)"pkgPackageManager::SmartRemove(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgPackageManager::SmartUnPack(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgPackageManager::ConfigureAll()@Base" 0.8.0 - (c++)"pkgPackageManager::ImmediateAdd(pkgCache::PkgIterator, bool, unsigned int const&)@Base" 0.8.0 - (c++)"pkgPackageManager::OrderInstall()@Base" 0.8.0 - (c++)"pkgPackageManager::DepAlwaysTrue(pkgCache::DepIterator)@Base" 0.8.0 - (c++)"pkgPackageManager::CheckRConflicts(pkgCache::PkgIterator, pkgCache::DepIterator, char const*)@Base" 0.8.0 - (c++)"pkgPackageManager::CreateOrderList()@Base" 0.8.0 - (c++)"pkgPackageManager::DoInstallPostFork(int)@Base" 0.8.0 - (c++)"pkgPackageManager::Go(int)@Base" 0.8.0 - (c++)"pkgPackageManager::Reset()@Base" 0.8.0 - (c++)"pkgPackageManager::Remove(pkgCache::PkgIterator, bool)@Base" 0.8.0 - (c++)"pkgPackageManager::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgPackageManager::Configure(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgPackageManager::DoInstall(int)@Base" 0.8.0 - (c++)"pkgPackageManager::pkgPackageManager(pkgDepCache*)@Base" 0.8.0 - (c++)"pkgPackageManager::~pkgPackageManager()@Base" 0.8.0 - (c++)"pkgProblemResolver::InstallProtect()@Base" 0.8.0 - (c++)"pkgProblemResolver::This@Base" 0.8.0 - (c++)"pkgProblemResolver::pkgProblemResolver(pkgDepCache*)@Base" 0.8.0 - (c++)"pkgProblemResolver::~pkgProblemResolver()@Base" 0.8.0 - (c++)"debVersioningSystem::CmpFragment(char const*, char const*, char const*, char const*)@Base" 0.8.0 - (c++)"debVersioningSystem::DoCmpVersion(char const*, char const*, char const*, char const*)@Base" 0.8.0 - (c++)"debVersioningSystem::DoCmpReleaseVer(char const*, char const*, char const*, char const*)@Base" 0.8.0 - (c++)"debVersioningSystem::UpstreamVersion[abi:cxx11](char const*)@Base" 0.8.0 - (c++)"debVersioningSystem::CheckDep(char const*, int, char const*)@Base" 0.8.0 - (c++)"debVersioningSystem::debVersioningSystem()@Base" 0.8.0 - (c++)"debVersioningSystem::~debVersioningSystem()@Base" 0.8.0 - (c++)"pkgUdevCdromDevices::Scan()@Base" 0.8.0 - (c++)"pkgUdevCdromDevices::Dlopen()@Base" 0.8.0 - (c++)"pkgUdevCdromDevices::pkgUdevCdromDevices()@Base" 0.8.0 - (c++)"pkgUdevCdromDevices::~pkgUdevCdromDevices()@Base" 0.8.0 - (c++)"pkgVersioningSystem::GlobalList@Base" 0.8.0 - (c++)"pkgVersioningSystem::GlobalListLen@Base" 0.8.0 - (c++)"pkgVersioningSystem::TestCompatibility(pkgVersioningSystem const&)@Base" 0.8.0 - (c++)"pkgVersioningSystem::GetVS(char const*)@Base" 0.8.0 - (c++)"pkgVersioningSystem::pkgVersioningSystem()@Base" 0.8.0 - (c++)"APT::CacheFilter::PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"APT::CacheFilter::PackageNameMatchesRegEx::~PackageNameMatchesRegEx()@Base" 0.8.0 - (c++)"APT::CacheFilter::PackageNameMatchesRegEx::operator()(pkgCache::GrpIterator const&)@Base" 0.8.0 - (c++)"APT::CacheFilter::PackageNameMatchesRegEx::operator()(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"APT::Configuration::checkArchitecture(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"APT::CacheSetHelper::canNotFindPkgName(pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"APT::CacheSetHelper::canNotFindNewestVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"APT::CacheSetHelper::canNotFindCandidateVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"APT::CacheSetHelper::canNotFindInstalledVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"APT::CacheSetHelper::~CacheSetHelper()@Base" 0.8.0 - (c++)"URI::NoUserPassword(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"URI::CopyFrom(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"URI::SiteOnly(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"URI::~URI()@Base" 0.8.0 - (c++)"URI::operator std::__cxx11::basic_string, std::allocator >[abi:cxx11]()@Base" 0.8.0 - (c++)"MMap::Map(FileFd&)@Base" 0.8.0 - (c++)"MMap::Sync(unsigned long, unsigned long)@Base" 0.8.0 - (c++)"MMap::Sync()@Base" 0.8.0 - (c++)"MMap::Close(bool)@Base" 0.8.0 - (c++)"MMap::MMap(FileFd&, unsigned long)@Base" 0.8.0 - (c++)"MMap::MMap(unsigned long)@Base" 0.8.0 - (c++)"MMap::~MMap()@Base" 0.8.0 - (c++)"FileFd::Size()@Base" 0.8.0 - (c++)"FileFd::Sync()@Base" 0.8.0 - (c++)"FileFd::Tell()@Base" 0.8.0 - (c++)"FileFd::Close()@Base" 0.8.0 - (c++)"FileFd::~FileFd()@Base" 0.8.0 - (c++)"pkgCache::CompTypeDeb(unsigned char)@Base" 0.8.0 - (c++)"pkgCache::DepIterator::GlobOr(pkgCache::DepIterator&, pkgCache::DepIterator&)@Base" 0.8.0 - (c++)"pkgCache::DepIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::GrpIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::PkgIterator::operator++()@Base" 0.8.0 - (c++)"pkgCache::PkgFileIterator::IsOk()@Base" 0.8.0 - (c++)"pkgCache::PkgFileIterator::RelStr[abi:cxx11]()@Base" 0.8.0 - (c++)"pkgCache::ReMap(bool const&)@Base" 0.8.0 - (c++)"pkgCache::Header::Header()@Base" 0.8.0 - (c++)"pkgCache::DepType(unsigned char)@Base" 0.8.0 - (c++)"pkgCache::FindGrp(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"pkgCache::FindPkg(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"pkgCache::FindPkg(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.0 - (c++)"pkgCache::CompType(unsigned char)@Base" 0.8.0 - (c++)"pkgCache::Priority(unsigned char)@Base" 0.8.0 - (c++)"pkgCache::pkgCache(MMap*, bool)@Base" 0.8.0 - (c++)"pkgCache::~pkgCache()@Base" 0.8.0 - (c++)"pkgCdrom::DropRepeats(std::vector, std::allocator >, std::allocator, std::allocator > > >&, char const*)@Base" 0.8.0 - (c++)"pkgCdrom::FindPackages(std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::__cxx11::basic_string, std::allocator >&, pkgCdromStatus*, unsigned int)@Base" 0.8.0 - (c++)"pkgCdrom::WriteDatabase(Configuration&)@Base" 0.8.0 - (c++)"pkgCdrom::DropBinaryArch(std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.8.0 - (c++)"pkgCdrom::WriteSourceList(std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, bool)@Base" 0.8.0 - (c++)"pkgCdrom::ReduceSourcelist(std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.8.0 - (c++)"pkgCdrom::Add(pkgCdromStatus*)@Base" 0.8.0 - (c++)"pkgCdrom::Ident(std::__cxx11::basic_string, std::allocator >&, pkgCdromStatus*)@Base" 0.8.0 - (c++)"pkgCdrom::Score(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"IndexCopy::CopyPackages(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, pkgCdromStatus*)@Base" 0.8.0 - (c++)"IndexCopy::ReconstructChop(unsigned long&, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"IndexCopy::ReconstructPrefix(std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"IndexCopy::ConvertToSourceList(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&)@Base" 0.8.0 - (c++)"IndexCopy::ChopDirs(std::__cxx11::basic_string, std::allocator >, unsigned int)@Base" 0.8.0 - (c++)"IndexCopy::GrabFirst(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int)@Base" 0.8.0 - (c++)"SigVerify::CopyAndVerify(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >, std::vector, std::allocator >, std::allocator, std::allocator > > >)@Base" 0.8.0 - (c++)"SigVerify::RunGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&, int*)@Base" 0.8.0 - (c++)"debSystem::Initialize(Configuration&)@Base" 0.8.0 - (c++)"debSystem::AddStatusFiles(std::vector >&)@Base" 0.8.0 - (c++)"debSystem::ArchiveSupported(char const*)@Base" 0.8.0 - (c++)"debSystem::Lock()@Base" 0.8.0 - (c++)"debSystem::Score(Configuration const&)@Base" 0.8.0 - (c++)"debSystem::UnLock(bool)@Base" 0.8.0 - (c++)"debSystem::debSystem()@Base" 0.8.0 - (c++)"debSystem::~debSystem()@Base" 0.8.0 - (c++)"pkgDPkgPM::SendV2Pkgs(_IO_FILE*)@Base" 0.8.0 - (c++)"pkgDPkgPM::DoTerminalPty(int)@Base" 0.8.0 - (c++)"pkgDPkgPM::WriteHistoryTag(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgDPkgPM::WriteApportReport(char const*, char const*)@Base" 0.8.0 - (c++)"pkgDPkgPM::RunScriptsWithPkgs(char const*)@Base" 0.8.0 - (c++)"pkgDPkgPM::Go(int)@Base" 0.8.0 - (c++)"pkgDPkgPM::Reset()@Base" 0.8.0 - (c++)"pkgDPkgPM::Remove(pkgCache::PkgIterator, bool)@Base" 0.8.0 - (c++)"pkgDPkgPM::DoStdin(int)@Base" 0.8.0 - (c++)"pkgDPkgPM::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.0 - (c++)"pkgDPkgPM::OpenLog()@Base" 0.8.0 - (c++)"pkgDPkgPM::CloseLog()@Base" 0.8.0 - (c++)"pkgDPkgPM::Configure(pkgCache::PkgIterator)@Base" 0.8.0 - (c++)"pkgDPkgPM::pkgDPkgPM(pkgDepCache*)@Base" 0.8.0 - (c++)"pkgDPkgPM::~pkgDPkgPM()@Base" 0.8.0 - (c++)"pkgPolicy::GetPriority(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgPolicy::InitDefaults()@Base" 0.8.0 - (c++)"pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgPolicy::PkgPin::~PkgPin()@Base" 0.8.0 - (c++)"pkgPolicy::GetMatch(pkgCache::PkgIterator const&)@Base" 0.8.0 - (c++)"pkgPolicy::CreatePin(pkgVersionMatch::MatchType, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, short)@Base" 0.8.0 - (c++)"pkgPolicy::pkgPolicy(pkgCache*)@Base" 0.8.0 - (c++)"pkgPolicy::~pkgPolicy()@Base" 0.8.0 - (c++)"pkgSystem::GlobalList@Base" 0.8.0 - (c++)"pkgSystem::Initialize(Configuration&)@Base" 0.8.0 - (c++)"pkgSystem::GlobalListLen@Base" 0.8.0 - (c++)"pkgSystem::Score(Configuration const&)@Base" 0.8.0 - (c++)"pkgSystem::GetSystem(char const*)@Base" 0.8.0 - (c++)"HashString::VerifyFile(std::__cxx11::basic_string, std::allocator >) const@Base" 0.8.0 - (c++)"HashString::empty() const@Base" 0.8.0 - (c++)"HashString::toStr[abi:cxx11]() const@Base" 0.8.0 - (c++)"CommandLine::FileSize() const@Base" 0.8.0 - (c++)"GlobalError::empty(GlobalError::MsgType const&) const@Base" 0.8.0 - (c++)"pkgIndexFile::FindInCache(pkgCache&) const@Base" 0.8.0 - (c++)"pkgIndexFile::CreateSrcParser() const@Base" 0.8.0 - (c++)"Configuration::MatchAgainstConfig::Match(char const*) const@Base" 0.8.0 - (c++)"Configuration::Find[abi:cxx11](char const*, char const*) const@Base" 0.8.0 - (c++)"Configuration::Item::FullTag[abi:cxx11](Configuration::Item const*) const@Base" 0.8.0 - (c++)"Configuration::FindB(char const*, bool const&) const@Base" 0.8.0 - (c++)"Configuration::FindI(char const*, int const&) const@Base" 0.8.0 - (c++)"Configuration::Exists(char const*) const@Base" 0.8.0 - (c++)"Configuration::FindAny[abi:cxx11](char const*, char const*) const@Base" 0.8.0 - (c++)"Configuration::FindDir[abi:cxx11](char const*, char const*) const@Base" 0.8.0 - (c++)"Configuration::FindFile[abi:cxx11](char const*, char const*) const@Base" 0.8.0 - (c++)"Configuration::ExistsAny(char const*) const@Base" 0.8.0 - (c++)"pkgSourceList::GetIndexes(pkgAcquire*, bool) const@Base" 0.8.0 - (c++)"pkgSourceList::Type::FixupURI(std::__cxx11::basic_string, std::allocator >&) const@Base" 0.8.0 - (c++)"pkgSourceList::FindIndex(pkgCache::PkgFileIterator, pkgIndexFile*&) const@Base" 0.8.0 - (c++)"pkgTagSection::Find(char const*, char const*&, char const*&) const@Base" 0.8.0 - (c++)"pkgTagSection::Find(char const*, unsigned int&) const@Base" 0.8.0 - (c++)"pkgTagSection::FindI(char const*, long) const@Base" 0.8.0 - (c++)"pkgTagSection::FindS[abi:cxx11](char const*) const@Base" 0.8.0 - (c++)"pkgTagSection::FindULL(char const*, unsigned long long const&) const@Base" 0.8.0 - (c++)"pkgTagSection::FindFlag(char const*, unsigned long&, unsigned long) const@Base" 0.8.0 - (c++)"pkgCache::DepIterator::AllTargets() const@Base" 0.8.0 - (c++)"pkgCache::DepIterator::IsCritical() const@Base" 0.8.0 - (c++)"pkgCache::DepIterator::SmartTargetPkg(pkgCache::PkgIterator&) const@Base" 0.8.0 - (c++)"pkgCache::GrpIterator::FindPreferredPkg(bool const&) const@Base" 0.8.0 - (c++)"pkgCache::GrpIterator::FindPkg(std::__cxx11::basic_string, std::allocator >) const@Base" 0.8.0 - (c++)"pkgCache::GrpIterator::NextPkg(pkgCache::PkgIterator const&) const@Base" 0.8.0 - (c++)"pkgCache::PkgIterator::CurVersion() const@Base" 0.8.0 - (c++)"pkgCache::PkgIterator::CandVersion() const@Base" 0.8.0 - (c++)"pkgCache::PkgIterator::State() const@Base" 0.8.0 - (c++)"pkgCache::VerIterator::CompareVer(pkgCache::VerIterator const&) const@Base" 0.8.0 - (c++)"pkgCache::VerIterator::NewestFile() const@Base" 0.8.0 - (c++)"pkgCache::VerIterator::Downloadable() const@Base" 0.8.0 - (c++)"pkgCache::VerIterator::TranslatedDescription() const@Base" 0.8.0 - (c++)"pkgCache::VerIterator::RelStr[abi:cxx11]() const@Base" 0.8.0 - (c++)"pkgCache::VerIterator::Automatic() const@Base" 0.8.0 - (c++)"pkgCache::sHash(char const*) const@Base" 0.8.0 - (c++)"pkgCache::sHash(std::__cxx11::basic_string, std::allocator > const&) const@Base" 0.8.0 - (c++)"pkgCache::Header::CheckSizes(pkgCache::Header&) const@Base" 0.8.0 - (c++)"debSystem::CreatePM(pkgDepCache*) const@Base" 0.8.0 - (c++)"debSystem::FindIndex(pkgCache::PkgFileIterator, pkgIndexFile*&) const@Base" 0.8.0 - (c++)"metaIndex::GetURI[abi:cxx11]() const@Base" 0.8.0 - (c++)"metaIndex::GetDist[abi:cxx11]() const@Base" 0.8.0 - (c++)"metaIndex::GetType() const@Base" 0.8.0 - (c++)"typeinfo for OpProgress@Base" 0.8.0 - (c++)"typeinfo for SourceCopy@Base" 0.8.0 - (c++)"typeinfo for pkgAcqFile@Base" 0.8.0 - (c++)"typeinfo for pkgAcquire@Base" 0.8.0 - (c++)"typeinfo for DynamicMMap@Base" 0.8.0 - (c++)"typeinfo for PackageCopy@Base" 0.8.0 - (c++)"typeinfo for pkgDepCache@Base" 0.8.0 - (c++)"typeinfo for pkgSimulate@Base" 0.8.0 - (c++)"typeinfo for pkgAcqMethod@Base" 0.8.0 - (c++)"typeinfo for pkgCacheFile@Base" 0.8.0 - (c++)"typeinfo for pkgIndexFile@Base" 0.8.0 - (c++)"typeinfo for WeakPointable@Base" 0.8.0 - (c++)"typeinfo for pkgAcqArchive@Base" 0.8.0 - (c++)"typeinfo for pkgTagSection@Base" 0.8.0 - (c++)"typeinfo for OpTextProgress@Base" 0.8.0 - (c++)"typeinfo for pkgAcquireStatus@Base" 0.8.0 - (c++)"typeinfo for pkgPackageManager@Base" 0.8.0 - (c++)"typeinfo for debVersioningSystem@Base" 0.8.0 - (c++)"typeinfo for pkgUdevCdromDevices@Base" 0.8.0 - (c++)"typeinfo for pkgVersioningSystem@Base" 0.8.0 - (c++)"typeinfo for MMap@Base" 0.8.0 - (c++)"typeinfo for FileFd@Base" 0.8.0 - (c++)"typeinfo for pkgCache@Base" 0.8.0 - (c++)"typeinfo for IndexCopy@Base" 0.8.0 - (c++)"typeinfo for debSystem@Base" 0.8.0 - (c++)"typeinfo for metaIndex@Base" 0.8.0 - (c++)"typeinfo for pkgDPkgPM@Base" 0.8.0 - (c++)"typeinfo for pkgPolicy@Base" 0.8.0 - (c++)"typeinfo for pkgSystem@Base" 0.8.0 - (c++)"typeinfo for pkgAcquire::Item@Base" 0.8.0 - (c++)"typeinfo for pkgRecords::Parser@Base" 0.8.0 - (c++)"typeinfo for pkgDepCache::InRootSetFunc@Base" 0.8.0 - (c++)"typeinfo for pkgDepCache::DefaultRootSetFunc@Base" 0.8.0 - (c++)"typeinfo for pkgDepCache::Policy@Base" 0.8.0 - (c++)"typeinfo for pkgSimulate::Policy@Base" 0.8.0 - (c++)"typeinfo for pkgIndexFile::Type@Base" 0.8.0 - (c++)"typeinfo for Configuration::MatchAgainstConfig@Base" 0.8.0 - (c++)"typeinfo for pkgSourceList::Type@Base" 0.8.0 - (c++)"typeinfo for pkgSrcRecords::Parser@Base" 0.8.0 - (c++)"typeinfo for APT::CacheSetHelper@Base" 0.8.0 - (c++)"typeinfo for pkgCache::Namespace@Base" 0.8.0 - (c++)"typeinfo name for OpProgress@Base" 0.8.0 - (c++)"typeinfo name for SourceCopy@Base" 0.8.0 - (c++)"typeinfo name for pkgAcqFile@Base" 0.8.0 - (c++)"typeinfo name for pkgAcquire@Base" 0.8.0 - (c++)"typeinfo name for DynamicMMap@Base" 0.8.0 - (c++)"typeinfo name for PackageCopy@Base" 0.8.0 - (c++)"typeinfo name for pkgDepCache@Base" 0.8.0 - (c++)"typeinfo name for pkgSimulate@Base" 0.8.0 - (c++)"typeinfo name for pkgAcqMethod@Base" 0.8.0 - (c++)"typeinfo name for pkgCacheFile@Base" 0.8.0 - (c++)"typeinfo name for pkgIndexFile@Base" 0.8.0 - (c++)"typeinfo name for WeakPointable@Base" 0.8.0 - (c++)"typeinfo name for pkgAcqArchive@Base" 0.8.0 - (c++)"typeinfo name for pkgTagSection@Base" 0.8.0 - (c++)"typeinfo name for OpTextProgress@Base" 0.8.0 - (c++)"typeinfo name for pkgAcquireStatus@Base" 0.8.0 - (c++)"typeinfo name for pkgPackageManager@Base" 0.8.0 - (c++)"typeinfo name for debVersioningSystem@Base" 0.8.0 - (c++)"typeinfo name for pkgUdevCdromDevices@Base" 0.8.0 - (c++)"typeinfo name for pkgVersioningSystem@Base" 0.8.0 - (c++)"typeinfo name for MMap@Base" 0.8.0 - (c++)"typeinfo name for FileFd@Base" 0.8.0 - (c++)"typeinfo name for pkgCache@Base" 0.8.0 - (c++)"typeinfo name for IndexCopy@Base" 0.8.0 - (c++)"typeinfo name for debSystem@Base" 0.8.0 - (c++)"typeinfo name for metaIndex@Base" 0.8.0 - (c++)"typeinfo name for pkgDPkgPM@Base" 0.8.0 - (c++)"typeinfo name for pkgPolicy@Base" 0.8.0 - (c++)"typeinfo name for pkgSystem@Base" 0.8.0 - (c++)"typeinfo name for pkgAcquire::Item@Base" 0.8.0 - (c++)"typeinfo name for pkgRecords::Parser@Base" 0.8.0 - (c++)"typeinfo name for pkgDepCache::InRootSetFunc@Base" 0.8.0 - (c++)"typeinfo name for pkgDepCache::DefaultRootSetFunc@Base" 0.8.0 - (c++)"typeinfo name for pkgDepCache::Policy@Base" 0.8.0 - (c++)"typeinfo name for pkgSimulate::Policy@Base" 0.8.0 - (c++)"typeinfo name for pkgIndexFile::Type@Base" 0.8.0 - (c++)"typeinfo name for Configuration::MatchAgainstConfig@Base" 0.8.0 - (c++)"typeinfo name for pkgSourceList::Type@Base" 0.8.0 - (c++)"typeinfo name for pkgSrcRecords::Parser@Base" 0.8.0 - (c++)"typeinfo name for APT::CacheSetHelper@Base" 0.8.0 - (c++)"typeinfo name for pkgCache::Namespace@Base" 0.8.0 - (c++)"vtable for OpProgress@Base" 0.8.0 - (c++)"vtable for SourceCopy@Base" 0.8.0 - (c++)"vtable for pkgAcqFile@Base" 0.8.0 - (c++)"vtable for pkgAcquire@Base" 0.8.0 - (c++)"vtable for DynamicMMap@Base" 0.8.0 - (c++)"vtable for PackageCopy@Base" 0.8.0 - (c++)"vtable for pkgDepCache@Base" 0.8.0 - (c++)"vtable for pkgSimulate@Base" 0.8.0 - (c++)"vtable for pkgAcqMethod@Base" 0.8.0 - (c++)"vtable for pkgCacheFile@Base" 0.8.0 - (c++)"vtable for pkgIndexFile@Base" 0.8.0 - (c++)"vtable for pkgAcqArchive@Base" 0.8.0 - (c++)"vtable for pkgTagSection@Base" 0.8.0 - (c++)"vtable for OpTextProgress@Base" 0.8.0 - (c++)"vtable for pkgAcquireStatus@Base" 0.8.0 - (c++)"vtable for pkgPackageManager@Base" 0.8.0 - (c++)"vtable for debVersioningSystem@Base" 0.8.0 - (c++)"vtable for pkgUdevCdromDevices@Base" 0.8.0 - (c++)"vtable for pkgVersioningSystem@Base" 0.8.0 - (c++)"vtable for MMap@Base" 0.8.0 - (c++)"vtable for FileFd@Base" 0.8.0 - (c++)"vtable for pkgCache@Base" 0.8.0 - (c++)"vtable for IndexCopy@Base" 0.8.0 - (c++)"vtable for debSystem@Base" 0.8.0 - (c++)"vtable for metaIndex@Base" 0.8.0 - (c++)"vtable for pkgDPkgPM@Base" 0.8.0 - (c++)"vtable for pkgPolicy@Base" 0.8.0 - (c++)"vtable for pkgSystem@Base" 0.8.0 - (c++)"vtable for pkgAcquire::Item@Base" 0.8.0 - (c++)"vtable for pkgRecords::Parser@Base" 0.8.0 - (c++)"vtable for pkgDepCache::InRootSetFunc@Base" 0.8.0 - (c++)"vtable for pkgDepCache::DefaultRootSetFunc@Base" 0.8.0 - (c++)"vtable for pkgDepCache::Policy@Base" 0.8.0 - (c++)"vtable for pkgSimulate::Policy@Base" 0.8.0 - (c++)"vtable for pkgIndexFile::Type@Base" 0.8.0 - (c++)"vtable for Configuration::MatchAgainstConfig@Base" 0.8.0 - (c++)"vtable for pkgSourceList::Type@Base" 0.8.0 - (c++)"vtable for pkgSrcRecords::Parser@Base" 0.8.0 - (c++)"vtable for APT::CacheSetHelper@Base" 0.8.0 - (c++)"non-virtual thunk to pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc()@Base" 0.8.0 - (c++)"operator<<(std::basic_ostream >&, pkgCache::DepIterator)@Base" 0.8.0 - (c++)"operator<<(std::basic_ostream >&, pkgCache::PkgIterator)@Base" 0.8.0 - _config@Base 0.8.0 - _system@Base 0.8.0 - debSys@Base 0.8.0 - debVS@Base 0.8.0 - pkgLibVersion@Base 0.8.0 - pkgVersion@Base 0.8.0 - (c++)"pkgAcquireStatus::~pkgAcquireStatus()@Base" 0.8.0 - (c++)"IndexCopy::~IndexCopy()@Base" 0.8.0 - (c++)"pkgIndexFile::Type::~Type()@Base" 0.8.0 - (c++)"pkgArchiveCleaner::~pkgArchiveCleaner()@Base" 0.8.0 - (c++)"typeinfo for pkgArchiveCleaner@Base" 0.8.0 - (c++)"typeinfo name for pkgArchiveCleaner@Base" 0.8.0 - (c++)"vtable for pkgArchiveCleaner@Base" 0.8.0 -### architecture specific: va_list - (arch=armel armhf|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, std::__va_list&) const@Base" 0.8.15~exp1 - (arch=i386 hurd-i386 kfreebsd-i386 ppc64|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, char*&) const@Base" 0.8.15~exp1 - (arch=hppa ia64 mips mipsel sparc sparc64|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, void*&) const@Base" 0.8.15~exp1 - (arch=amd64 kfreebsd-amd64 powerpc powerpcspe s390 s390x x32|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __va_list_tag (&) [1]) const@Base" 0.8.15~exp1 - (arch=sh4|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __builtin_va_list&) const@Base" 0.8.15~exp1 - (arch=alpha|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __va_list_tag&) const@Base" 0.8.15~exp1 -### architecture specific: va_list & size_t - (arch=i386 hurd-i386 kfreebsd-i386|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, char*&, unsigned int&)@Base" 0.8.11.4 - (arch=armel armhf|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, std::__va_list&, unsigned int&)@Base" 0.8.11.4 - (arch=alpha|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag&, unsigned long&)@Base" 0.8.11.4 - (arch=powerpc powerpcspe x32|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned int&)@Base" 0.8.11.4 - (arch=amd64 kfreebsd-amd64 s390 s390x|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned long&)@Base" 0.8.11.4 - (arch=hppa mips mipsel sparc|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@Base" 0.8.11.4 - (arch=ia64 sparc64|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned long&)@Base" 0.8.11.4 - (arch=sh4|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __builtin_va_list&, unsigned int&)@Base" 0.8.11.4 - (arch=ppc64|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, char*&, unsigned long&)@Base" 0.8.11.4 - (arch=i386 hurd-i386 kfreebsd-i386|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned int&)@Base" 0.8.11.4 - (arch=armel armhf|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, std::__va_list&, int, unsigned int&)@Base" 0.8.11.4 - (arch=alpha|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag&, int, unsigned long&)@Base" 0.8.11.4 - (arch=powerpc powerpcspe x32|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned int&)@Base" 0.8.11.4 - (arch=amd64 kfreebsd-amd64 s390 s390x|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned long&)@Base" 0.8.11.4 - (arch=hppa mips mipsel sparc|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned int&)@Base" 0.8.11.4 - (arch=ia64 sparc64|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned long&)@Base" 0.8.11.4 1 - (arch=sh4|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __builtin_va_list&, int, unsigned int&)@Base" 0.8.11.4 - (arch=ppc64|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned long&)@Base" 0.8.11.4 -### architecture specific: size_t - (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mips mipsel powerpc powerpcspe sh4 sparc x32|c++)"_strtabexpand(char*, unsigned int)@Base" 0.8.0 - (arch=alpha amd64 ia64 kfreebsd-amd64 s390 s390x sparc64 ppc64|c++)"_strtabexpand(char*, unsigned long)@Base" 0.8.0 -### architecture specific: time_t - (arch=!x32|c++)"TimeRFC1123[abi:cxx11](long)@Base" 0.8.0 - (arch=x32|c++)"TimeRFC1123(long long)@Base" 0.8.0 - (arch=!x32|c++)"FTPMDTMStrToTime(char const*, long&)@Base" 0.8.0 - (arch=x32|c++)"FTPMDTMStrToTime(char const*, long long&)@Base" 0.8.0 - (arch=!x32|c++)"StrToTime(std::__cxx11::basic_string, std::allocator > const&, long&)@Base" 0.8.0 - (arch=x32|c++)"StrToTime(std::__cxx11::basic_string, std::allocator > const&, long long&)@Base" 0.8.0 - (arch=!x32|c++)"RFC1123StrToTime(char const*, long&)@Base" 0.8.0 - (arch=x32|c++)"RFC1123StrToTime(char const*, long long&)@Base" 0.8.0 -### - (c++)"CreateAPTDirectoryIfNeeded(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.2 - (c++)"FileFd::FileSize()@Base" 0.8.8 - (c++)"Base256ToNum(char const*, unsigned long&, unsigned int)@Base" 0.8.11 - (c++)"pkgDepCache::SetCandidateRelease(pkgCache::VerIterator, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::list, std::allocator > >&)@Base" 0.8.11 - (c++)"pkgDepCache::SetCandidateRelease(pkgCache::VerIterator, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.11 - (c++)"RealFileExists(std::__cxx11::basic_string, std::allocator >)@Base" 0.8.11 - (c++)"StripEpoch(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.11 - (c++)"pkgTagSection::FindFlag(unsigned long&, unsigned long, char const*, char const*)@Base" 0.8.11 - (c++)"FindMountPointForDevice[abi:cxx11](char const*)@Base" 0.8.12 - (c++)"pkgUdevCdromDevices::ScanForRemovable(bool)@Base" 0.8.12 - (c++)"APT::Configuration::Compressor::Compressor(char const*, char const*, char const*, char const*, char const*, unsigned short)@Base" 0.8.12 - (c++)"APT::Configuration::Compressor::~Compressor()@Base" 0.8.12 - (c++)"APT::Configuration::getCompressors(bool)@Base" 0.8.12 - (c++)"APT::Configuration::getCompressorExtensions[abi:cxx11]()@Base" 0.8.12 - (c++)"pkgCache::DepIterator::IsNegative() const@Base" 0.8.15~exp1 - (c++)"Configuration::CndSet(char const*, int)@Base" 0.8.15.3 - (c++)"pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator)@Base" 0.8.15.3 - (c++)"DeEscapeString(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.15.4 - (c++)"GetModificationTime(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.15.6 - (c++)"pkgSourceList::GetLastModifiedTime()@Base" 0.8.15.6 - (c++)"pkgCacheFile::RemoveCaches()@Base" 0.8.15.7 - (c++)"pkgOrderList::VisitNode(pkgCache::PkgIterator, char const*)@Base" 0.8.15.7 -### external dependency resolver ### - (c++)"EDSP::WriteError(char const*, std::__cxx11::basic_string, std::allocator > const&, _IO_FILE*)@Base" 0.8.16~exp2 - (c++)"EDSP::ReadRequest(int, std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > >&, std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > >&, bool&, bool&, bool&)@Base" 0.8.16~exp2 - (c++)"EDSP::ApplyRequest(std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > > const&, std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > > const&, pkgDepCache&)@Base" 0.8.16~exp2 - (c++)"EDSP::ReadResponse(int, pkgDepCache&, OpProgress*)@Base" 0.8.16~exp2 - (c++)"EDSP::WriteRequest(pkgDepCache&, _IO_FILE*, bool, bool, bool, OpProgress*)@Base" 0.8.16~exp2 - (c++)"EDSP::ExecuteSolver(char const*, int*, int*)@Base" 0.8.16~exp2 - (c++)"EDSP::WriteProgress(unsigned short, char const*, _IO_FILE*)@Base" 0.8.16~exp2 - (c++)"EDSP::WriteScenario(pkgDepCache&, _IO_FILE*, OpProgress*)@Base" 0.8.16~exp2 - (c++)"EDSP::WriteSolution(pkgDepCache&, _IO_FILE*)@Base" 0.8.16~exp2 - (c++)"EDSP::ResolveExternal(char const*, pkgDepCache&, bool, bool, bool, OpProgress*)@Base" 0.8.16~exp2 - (c++)"pkgDepCache::Policy::GetPriority(pkgCache::PkgIterator const&)@Base" 0.8.16~exp6 - (c++)"pkgDepCache::Policy::GetPriority(pkgCache::PkgFileIterator const&)@Base" 0.8.16~exp6 -### generalisation of checksums (with lfs) -- mostly api-compatible available (without sha512 in previous versions) - (c++)"AddCRC16(unsigned short, void const*, unsigned long long)@Base" 0.8.16~exp2 - (c++)"MD5Summation::Add(unsigned char const*, unsigned long long)@Base" 0.8.16~exp6 - (c++)"MD5Summation::Result()@Base" 0.8.16~exp2 - (c++)"MD5Summation::MD5Summation()@Base" 0.8.16~exp2 - (c++)"SHA1Summation::SHA1Summation()@Base" 0.8.16~exp2 - (c++)"SHA1Summation::Add(unsigned char const*, unsigned long long)@Base" 0.8.16~exp6 - (c++)"SHA1Summation::Result()@Base" 0.8.16~exp2 - (c++)"SHA256Summation::Add(unsigned char const*, unsigned long long)@Base" 0.8.16~exp6 - (c++)"SHA512Summation::Add(unsigned char const*, unsigned long long)@Base" 0.8.16~exp6 - (c++)"SummationImplementation::AddFD(int, unsigned long long)@Base" 0.8.16~exp6 - (c++)"typeinfo for MD5Summation@Base" 0.8.16~exp6 - (c++)"typeinfo for SHA1Summation@Base" 0.8.16~exp6 - (c++)"typeinfo for SHA256Summation@Base" 0.8.16~exp6 - (c++)"typeinfo for SHA512Summation@Base" 0.8.16~exp6 - (c++)"typeinfo for SHA2SummationBase@Base" 0.8.16~exp6 - (c++)"typeinfo for SummationImplementation@Base" 0.8.16~exp6 - (c++)"typeinfo name for MD5Summation@Base" 0.8.16~exp6 - (c++)"typeinfo name for SHA1Summation@Base" 0.8.16~exp6 - (c++)"typeinfo name for SHA256Summation@Base" 0.8.16~exp6 - (c++)"typeinfo name for SHA512Summation@Base" 0.8.16~exp6 - (c++)"typeinfo name for SHA2SummationBase@Base" 0.8.16~exp6 - (c++)"typeinfo name for SummationImplementation@Base" 0.8.16~exp6 - (c++)"vtable for MD5Summation@Base" 0.8.16~exp6 - (c++)"vtable for SHA1Summation@Base" 0.8.16~exp6 - (c++)"vtable for SHA256Summation@Base" 0.8.16~exp6 - (c++)"vtable for SHA512Summation@Base" 0.8.16~exp6 -### large file support - available in older api-compatible versions without lfs ### - (c++)"StrToNum(char const*, unsigned long long&, unsigned int, unsigned int)@Base" 0.8.16~exp6 - (c++)"OpProgress::SubProgress(unsigned long long, std::__cxx11::basic_string, std::allocator > const&, float)@Base" 0.8.16~exp6 - (c++)"OpProgress::OverallProgress(unsigned long long, unsigned long long, unsigned long long, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.16~exp6 - (c++)"OpProgress::Progress(unsigned long long)@Base" 0.8.16~exp6 - (c++)"SourceCopy::GetFile(std::__cxx11::basic_string, std::allocator >&, unsigned long long&)@Base" 0.8.16~exp6 - (c++)"pkgAcquire::UriIterator::~UriIterator()@Base" 0.8.16~exp6 - (c++)"pkgAcquire::MethodConfig::~MethodConfig()@Base" 0.8.16~exp6 - (c++)"pkgRecords::Parser::RecordField[abi:cxx11](char const*)@Base" 0.8.16~exp6 - (c++)"pkgTagFile::Jump(pkgTagSection&, unsigned long long)@Base" 0.8.16~exp6 - (c++)"pkgTagFile::Offset()@Base" 0.8.16~exp6 - (c++)"pkgTagFile::pkgTagFile(FileFd*, unsigned long long)@Base" 0.8.16~exp6 - (c++)"DynamicMMap::RawAllocate(unsigned long long, unsigned long)@Base" 0.8.16~exp6 - (c++)"PackageCopy::GetFile(std::__cxx11::basic_string, std::allocator >&, unsigned long long&)@Base" 0.8.16~exp6 - (c++)"pkgTagSection::~pkgTagSection()@Base" 0.8.16~exp6 - (c++)"pkgAcquireStatus::Fetched(unsigned long long, unsigned long long)@Base" 0.8.16~exp6 - (c++)"FileFd::Read(void*, unsigned long long, unsigned long long*)@Base" 0.8.16~exp6 - (c++)"FileFd::Seek(unsigned long long)@Base" 0.8.16~exp6 - (c++)"FileFd::Skip(unsigned long long)@Base" 0.8.16~exp6 - (c++)"FileFd::Write(void const*, unsigned long long)@Base" 0.8.16~exp6 - (c++)"FileFd::Truncate(unsigned long long)@Base" 0.8.16~exp6 - (c++)"pkgPolicy::GetPriority(pkgCache::PkgFileIterator const&)@Base" 0.8.16~exp6 - (c++)"typeinfo for pkgTagFile@Base" 0.8.16~exp6 - (c++)"typeinfo for pkgSrcRecords@Base" 0.8.16~exp6 - (c++)"typeinfo for pkgAcquire::UriIterator@Base" 0.8.16~exp6 - (c++)"typeinfo for pkgAcquire::MethodConfig@Base" 0.8.16~exp6 - (c++)"typeinfo for pkgAcquire::Queue@Base" 0.8.16~exp6 - (c++)"typeinfo for pkgAcquire::Worker@Base" 0.8.16~exp6 - (c++)"typeinfo name for pkgTagFile@Base" 0.8.16~exp6 - (c++)"typeinfo name for pkgSrcRecords@Base" 0.8.16~exp6 - (c++)"typeinfo name for pkgAcquire::UriIterator@Base" 0.8.16~exp6 - (c++)"typeinfo name for pkgAcquire::MethodConfig@Base" 0.8.16~exp6 - (c++)"typeinfo name for pkgAcquire::Queue@Base" 0.8.16~exp6 - (c++)"typeinfo name for pkgAcquire::Worker@Base" 0.8.16~exp6 - (c++)"vtable for pkgTagFile@Base" 0.8.16~exp6 - (c++)"vtable for pkgSrcRecords@Base" 0.8.16~exp6 - (c++)"vtable for pkgAcquire::UriIterator@Base" 0.8.16~exp6 - (c++)"vtable for pkgAcquire::MethodConfig@Base" 0.8.16~exp6 - (c++)"vtable for pkgAcquire::Queue@Base" 0.8.16~exp6 - (c++)"vtable for pkgAcquire::Worker@Base" 0.8.16~exp6 -### remove deprecated parameter - (c++)"pkgDepCache::SetCandidateVersion(pkgCache::VerIterator)@Base" 0.8.16~exp6 - (c++)"pkgDepCache::AddSizes(pkgCache::PkgIterator const&, bool)@Base" 0.8.16~exp6 - (c++)"pkgDepCache::AddStates(pkgCache::PkgIterator const&, bool)@Base" 0.8.16~exp6 -### used internally by public interfaces - if you use them directly, you can keep the pieces - (c++|optional=internal|regex)"^SHA256_.*@Base$" 0.8.16~exp2 - (c++|optional=internal|regex)"^SHA384_.*@Base$" 0.8.16~exp2 - (c++|optional=internal|regex)"^SHA512_.*@Base$" 0.8.16~exp2 -### orderlist rework: the touched methods are protected - (c++)"SigINT(int)@Base" 0.8.16~exp14 - (c++)"pkgPackageManager::SigINTStop@Base" 0.8.16~exp14 - (c++)"pkgPackageManager::SmartUnPack(pkgCache::PkgIterator, bool, int)@Base" 0.8.16~exp14 - (c++)"pkgPackageManager::SmartConfigure(pkgCache::PkgIterator, int)@Base" 0.8.16~exp14 -### FileFd rework: supporting different on-the-fly (de)compressing needs more parameter (abi), but the api is stable - (c++)"FileFd::OpenDescriptor(int, unsigned int, FileFd::CompressMode, bool)@Base" 0.8.16~exp9 - (c++)"FileFd::OpenDescriptor(int, unsigned int, APT::Configuration::Compressor const&, bool)@Base" 0.8.16~exp9 - (c++)"FileFd::ModificationTime()@Base" 0.8.16~exp9 - (c++)"FileFd::Open(std::__cxx11::basic_string, std::allocator >, unsigned int, FileFd::CompressMode, unsigned long)@Base" 0.8.16~exp9 - (c++)"FileFd::Open(std::__cxx11::basic_string, std::allocator >, unsigned int, APT::Configuration::Compressor const&, unsigned long)@Base" 0.8.16~exp9 - (c++)"FileFd::ReadLine(char*, unsigned long long)@Base" 0.8.16~exp9 - (c++)"SummationImplementation::AddFD(FileFd&, unsigned long long)@Base" 0.8.16~exp9 - (c++|optional=deprecated,previous-inline)"FileFd::gzFd()@Base" 0.8.0 -### CacheSet rework: making them real containers breaks bigtime the API (for the CacheSetHelper) - (c++)"APT::PackageContainer, std::allocator > >::empty() const@Base" 0.8.16~exp9 - (c++)"APT::PackageContainer > >::empty() const@Base" 0.8.16~exp9 - (c++)"APT::VersionContainer > >::empty() const@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::canNotFindTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::canNotFindRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::canNotFindAllVer(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::canNotFindPackage(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::showTaskSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::showRegExSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const&, pkgCache::VerIterator, std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::canNotFindCandInstVer(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 - (c++)"APT::CacheSetHelper::canNotFindInstCandVer(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 - (c++)"APT::PackageContainer, std::allocator > >::clear()@Base" 0.8.16~exp9 - (c++)"APT::PackageContainer, std::allocator > >::insert(pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 - (c++)"APT::PackageContainer > >::clear()@Base" 0.8.16~exp9 - (c++)"APT::PackageContainer > >::insert(pkgCache::PkgIterator const&)@Base" 0.8.16~exp9 - (c++)"APT::VersionContainer > >::clear()@Base" 0.8.16~exp9 - (c++)"APT::VersionContainer > >::insert(pkgCache::VerIterator const&)@Base" 0.8.16~exp9 - (c++)"APT::VersionContainerInterface::getCandidateVer(pkgCacheFile&, pkgCache::PkgIterator const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 - (c++)"APT::VersionContainerInterface::getInstalledVer(pkgCacheFile&, pkgCache::PkgIterator const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 - (c++)"APT::VersionContainerInterface::FromModifierCommandLine(unsigned short&, APT::VersionContainerInterface*, pkgCacheFile&, char const*, std::__cxx11::list > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 - (c++)"EDSP::WriteLimitedScenario(pkgDepCache&, _IO_FILE*, APT::PackageContainer, std::allocator > > const&, OpProgress*)@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::PackageContainer, std::allocator > >@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::PackageContainer > >@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::VersionContainer > >@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::PackageContainerInterface@Base" 0.8.16~exp9 - (c++)"typeinfo for APT::VersionContainerInterface@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::PackageContainer, std::allocator > >@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::PackageContainer > >@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::VersionContainer > >@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::PackageContainerInterface@Base" 0.8.16~exp9 - (c++)"typeinfo name for APT::VersionContainerInterface@Base" 0.8.16~exp9 - (c++)"vtable for APT::PackageContainer, std::allocator > >@Base" 0.8.16~exp9 - (c++)"vtable for APT::PackageContainer > >@Base" 0.8.16~exp9 - (c++)"vtable for APT::VersionContainer > >@Base" 0.8.16~exp9 - (c++)"vtable for APT::PackageContainerInterface@Base" 0.8.16~exp9 - (c++)"vtable for APT::VersionContainerInterface@Base" 0.8.16~exp9 -### rework of the packagemanager rework - (c++)"APT::Progress::PackageManager::ConffilePrompt(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::Error(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerFancy::HandleSIGWINCH(int)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerFancy::~PackageManagerFancy()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerFancy::PackageManagerFancy()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerFancy::SetupTerminalScrollArea(int)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerFancy::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerFancy::Stop()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::fork()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::GetPulseInterval()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::~PackageManager()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::ConffilePrompt(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::Error(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::~PackageManagerProgressDeb822Fd()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::PackageManagerProgressDeb822Fd(int)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::StartDpkg()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::Stop()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressDeb822Fd::WriteToStatusFd(std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFactory()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::ConffilePrompt(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::Error(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::~PackageManagerProgressFd()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::PackageManagerProgressFd(int)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::StartDpkg()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::Stop()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerProgressFd::WriteToStatusFd(std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::Pulse()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::StartDpkg()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManager::Stop()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerText::~PackageManagerText()@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerText::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13~exp1 - (c++)"APT::String::Strip(std::__cxx11::basic_string, std::allocator > const&)@Base" 0.9.13~exp1 - (c++)"pkgDPkgPM::BuildPackagesProgressMap()@Base" 0.9.13~exp1 - (c++)"pkgDPkgPM::DoDpkgStatusFd(int)@Base" 0.9.13~exp1 - (c++)"pkgDPkgPM::ProcessDpkgStatusLine(char*)@Base" 0.9.13~exp1 - (c++)"pkgDPkgPM::StartPtyMagic()@Base" 0.9.13~exp1 - (c++)"pkgDPkgPM::StopPtyMagic()@Base" 0.9.13~exp1 - (c++)"typeinfo for APT::Progress::PackageManager@Base" 0.9.13~exp1 - (c++)"typeinfo for APT::Progress::PackageManagerFancy@Base" 0.9.13~exp1 - (c++)"typeinfo for APT::Progress::PackageManagerProgressDeb822Fd@Base" 0.9.13~exp1 - (c++)"typeinfo for APT::Progress::PackageManagerProgressFd@Base" 0.9.13~exp1 - (c++)"typeinfo for APT::Progress::PackageManagerText@Base" 0.9.13~exp1 - (c++)"typeinfo name for APT::Progress::PackageManager@Base" 0.9.13~exp1 - (c++)"typeinfo name for APT::Progress::PackageManagerFancy@Base" 0.9.13~exp1 - (c++)"typeinfo name for APT::Progress::PackageManagerProgressDeb822Fd@Base" 0.9.13~exp1 - (c++)"typeinfo name for APT::Progress::PackageManagerProgressFd@Base" 0.9.13~exp1 - (c++)"typeinfo name for APT::Progress::PackageManagerText@Base" 0.9.13~exp1 - (c++)"vtable for APT::Progress::PackageManager@Base" 0.9.13~exp1 - (c++)"vtable for APT::Progress::PackageManagerFancy@Base" 0.9.13~exp1 - (c++)"vtable for APT::Progress::PackageManagerProgressDeb822Fd@Base" 0.9.13~exp1 - (c++)"vtable for APT::Progress::PackageManagerProgressFd@Base" 0.9.13~exp1 - (c++)"vtable for APT::Progress::PackageManagerText@Base" 0.9.13~exp1 - (c++)"APT::Progress::PackageManagerFancy::instances@Base" 0.9.14.2 - (c++)"APT::Progress::PackageManagerFancy::Start(int)@Base" 0.9.14.2 - (c++)"APT::Progress::PackageManager::Start(int)@Base" 0.9.14.2 -### install foo.deb support - (c++)"flAbsPath(std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp1 - (c++)"metaIndex::~metaIndex()@Base" 1.1~exp1 -### CacheFilter functors - (c++)"APT::CacheFilter::ANDMatcher::AND(APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::~ANDMatcher()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::operator()(pkgCache::GrpIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::operator()(pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ANDMatcher::operator()(pkgCache::VerIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::FalseMatcher::~FalseMatcher()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::FalseMatcher::operator()(pkgCache::GrpIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::FalseMatcher::operator()(pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::FalseMatcher::operator()(pkgCache::VerIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::Matcher::~Matcher()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::NOTMatcher::NOTMatcher(APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::NOTMatcher::~NOTMatcher()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::NOTMatcher::operator()(pkgCache::GrpIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::NOTMatcher::operator()(pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::NOTMatcher::operator()(pkgCache::VerIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::operator()(pkgCache::GrpIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::operator()(pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::operator()(pkgCache::VerIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::OR(APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::~ORMatcher()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::ORMatcher::ORMatcher()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::PackageIsNewInstall::operator()(pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::PackageIsNewInstall::~PackageIsNewInstall()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::PackageIsNewInstall::PackageIsNewInstall(pkgCacheFile*)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::PackageMatcher::operator()(pkgCache::GrpIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::PackageMatcher::operator()(pkgCache::VerIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::PackageMatcher::~PackageMatcher()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::~PackageNameMatchesFnmatch()@Base" 1.1~exp4 - (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::PackageNameMatchesFnmatch(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::TrueMatcher::operator()(pkgCache::GrpIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::TrueMatcher::operator()(pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::TrueMatcher::operator()(pkgCache::VerIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheFilter::TrueMatcher::~TrueMatcher()@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::ANDMatcher@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::FalseMatcher@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::Matcher@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::NOTMatcher@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::ORMatcher@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::PackageArchitectureMatchesSpecification@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::PackageIsNewInstall@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::PackageMatcher@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::PackageNameMatchesFnmatch@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::PackageNameMatchesRegEx@Base" 1.1~exp4 - (c++)"typeinfo for APT::CacheFilter::TrueMatcher@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::ANDMatcher@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::FalseMatcher@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::Matcher@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::NOTMatcher@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::ORMatcher@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::PackageArchitectureMatchesSpecification@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::PackageIsNewInstall@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::PackageMatcher@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::PackageNameMatchesFnmatch@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::PackageNameMatchesRegEx@Base" 1.1~exp4 - (c++)"typeinfo name for APT::CacheFilter::TrueMatcher@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::ANDMatcher@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::FalseMatcher@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::Matcher@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::NOTMatcher@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::ORMatcher@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::PackageArchitectureMatchesSpecification@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::PackageIsNewInstall@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::PackageMatcher@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::PackageNameMatchesFnmatch@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::PackageNameMatchesRegEx@Base" 1.1~exp4 - (c++)"vtable for APT::CacheFilter::TrueMatcher@Base" 1.1~exp4 -### cacheset redesign (API, but not ABI compatible) -# (c++|optional=inline)"APT::PackageContainerInterface::FromCommandLine(APT::PackageContainerInterface*, pkgCacheFile&, char const**, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::PackageContainerInterface::FromModifierCommandLine(unsigned short&, APT::PackageContainerInterface*, pkgCacheFile&, char const*, std::__cxx11::list > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::PackageContainerInterface::FromName(pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::PackageContainerInterface::FromTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::PackageContainerInterface::FromRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::VersionContainerInterface::FromString(APT::VersionContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&, bool)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::VersionContainerInterface::FromPackage(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++|optional=inline)"APT::VersionContainerInterface::FromCommandLine(APT::VersionContainerInterface*, pkgCacheFile&, char const**, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++)"APT::PackageContainerInterface::FromString(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&, APT::CacheSetHelper&)@Base" 0.8.16~exp9 -# (c++)"APT::PackageContainerInterface::FromGroup(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.9.7 -# (c++)"APT::PackageContainerInterface::FromFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@Base" 0.9.11 - (c++)"APT::CacheSetHelper::canNotFindFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::canNotFindPackage(APT::CacheSetHelper::PkgSelector, APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::canNotFindVersion(APT::CacheSetHelper::VerSelector, APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::canNotGetCandInstVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::canNotGetInstCandVer(pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::canNotGetVersion(APT::CacheSetHelper::VerSelector, pkgCacheFile&, pkgCache::PkgIterator const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFrom(APT::CacheSetHelper::PkgSelector, APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromCommandLine(APT::PackageContainerInterface*, pkgCacheFile&, char const**)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromModifierCommandLine(unsigned short&, APT::PackageContainerInterface*, pkgCacheFile&, char const*, std::__cxx11::list > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromName(pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromPackageName(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromString(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::PackageFromTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::showFnmatchSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::showPackageSelection(pkgCache::PkgIterator const&, APT::CacheSetHelper::PkgSelector, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::CacheSetHelper::showVersionSelection(pkgCache::PkgIterator const&, pkgCache::VerIterator const&, APT::CacheSetHelper::VerSelector, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"APT::VersionContainerInterface::FromCommandLine(APT::VersionContainerInterface*, pkgCacheFile&, char const**, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&)@Base" 1.1~exp4 - (c++)"APT::VersionContainerInterface::FromPackage(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&)@Base" 1.1~exp4 - (c++)"APT::VersionContainerInterface::FromString(APT::VersionContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&, bool)@Base" 1.1~exp4 -### all the hashes are belong to us -# (c++|optional=inline)"Hashes::AddFD(int, unsigned long long, bool, bool, bool, bool)@Base" 0.8.16~exp6 -# (c++|optional=inline)"Hashes::AddFD(FileFd&, unsigned long long, bool, bool, bool, bool)@Base" 0.8.16~exp9 -# (c++|optional=inline)"pkgRecords::Parser::MD5Hash()@Base" 0.8.0 -# (c++|optional=inline)"pkgRecords::Parser::SHA1Hash()@Base" 0.8.0 -# (c++|optional=inline)"pkgRecords::Parser::SHA256Hash()@Base" 0.8.0 -# (c++|optional=inline)"pkgRecords::Parser::SHA512Hash()@Base" 0.8.16~exp6 - (c++)"Hashes::AddFD(FileFd&, unsigned long long, unsigned int)@Base" 1.1~exp1 - (c++)"Hashes::AddFD(int, unsigned long long, unsigned int)@Base" 1.1~exp1 - (c++)"Hashes::Add(unsigned char const*, unsigned long long, unsigned int)@Base" 1.1~exp1 - (c++)"Hashes::GetHashStringList()@Base" 1.1~exp1 - (c++)"Hashes::Hashes()@Base" 1.1~exp1 - (c++)"Hashes::~Hashes()@Base" 1.1~exp1 - (c++)"HashStringList::find(char const*) const@Base" 1.1~exp1 - (c++)"HashStringList::operator==(HashStringList const&) const@Base" 1.1~exp1 - (c++)"HashStringList::operator!=(HashStringList const&) const@Base" 1.1~exp1 - (c++)"HashStringList::push_back(HashString const&)@Base" 1.1~exp1 - (c++)"HashStringList::supported(char const*)@Base" 1.1~exp1 - (c++)"HashStringList::usable() const@Base" 1.1~exp1 - (c++)"HashStringList::VerifyFile(std::__cxx11::basic_string, std::allocator >) const@Base" 1.1~exp1 - (c++)"HashString::operator==(HashString const&) const@Base" 1.1~exp1 - (c++)"HashString::operator!=(HashString const&) const@Base" 1.1~exp1 - (c++)"pkgAcqArchive::IsTrusted() const@Base" 1.1~exp1 - (c++)"pkgAcqFile::Custom600Headers[abi:cxx11]() const@Base" 1.1~exp1 - (c++)"pkgAcqMethod::DropPrivsOrDie()@Base" 1.1~exp1 - (c++)"pkgAcquire::Item::Custom600Headers[abi:cxx11]() const@Base" 1.1~exp1 - (c++)"pkgAcquire::Item::IsTrusted() const@Base" 1.1~exp1 - (c++)"pkgRecords::Parser::Hashes() const@Base" 1.1~exp1 - (c++)"pkgRecords::Parser::LongDesc(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp1 - (c++)"pkgRecords::Parser::ShortDesc(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp1 - (c++)"typeinfo for Hashes@Base" 1.1~exp1 - (c++)"typeinfo name for Hashes@Base" 1.1~exp1 - (c++)"vtable for Hashes@Base" 1.1~exp1 -### more transactional update - (c++)"pkgAcquire::GetLock(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcquire::Item::Dequeue()@Base" 1.1~exp4 - (c++)"pkgAcquire::Item::QueueURI(pkgAcquire::ItemDesc&)@Base" 1.1~exp4 - (c++)"pkgAcquire::Item::SetActiveSubprocess(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgAcquire::Setup(pkgAcquireStatus*, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp4 - (c++)"pkgArchiveCleaner::Erase(char const*, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, stat&)@Base" 1.1~exp4 - (c++)"pkgDepCache::MarkAndSweep()@Base" 1.1~exp4 - (c++)"pkgDepCache::MarkAndSweep(pkgDepCache::InRootSetFunc&)@Base" 1.1~exp4 -### mixed stuff - (c++)"GetListOfFilesInDir(std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 0.8.16~exp13 - (c++)"pkgCache::DepIterator::IsIgnorable(pkgCache::PkgIterator const&) const@Base" 0.8.16~exp10 - (c++)"pkgCache::DepIterator::IsIgnorable(pkgCache::PrvIterator const&) const@Base" 0.8.16~exp10 - (c++)"FileFd::Write(int, void const*, unsigned long long)@Base" 0.8.16~exp14 - (c++)"_strrstrip(char*)@Base" 0.9.7.9~exp2 - (c++)"SplitClearSignedFile(std::__cxx11::basic_string, std::allocator > const&, FileFd*, std::vector, std::allocator >, std::allocator, std::allocator > > >*, FileFd*)@Base" 0.9.7.9~exp2 - (c++)"OpenMaybeClearSignedFile(std::__cxx11::basic_string, std::allocator > const&, FileFd&)@Base" 0.9.7.9~exp2 - (c++)"SigVerify::RunGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&)@Base" 0.9.7.9~exp2 - (c++)"Configuration::Dump(std::basic_ostream >&, char const*, char const*, bool)@Base" 0.9.3 - (c++)"AcquireUpdate(pkgAcquire&, int, bool, bool)@Base" 0.9.3 - (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::PackageArchitectureMatchesSpecification(std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 0.9.7 - (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::~PackageArchitectureMatchesSpecification()@Base" 0.9.7 - (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::operator()(pkgCache::PkgIterator const&)@Base" 0.9.7 - (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::operator()(char const* const&)@Base" 0.9.7 - (c++)"APT::Configuration::checkLanguage(std::__cxx11::basic_string, std::allocator >, bool)@Base" 0.9.7.5 - (c++)"pkgCdrom::DropTranslation(std::vector, std::allocator >, std::allocator, std::allocator > > >&)@Base" 0.9.7.5 - (c++)"pkgCache::DepIterator::IsSatisfied(pkgCache::PrvIterator const&) const@Base" 0.9.8 - (c++)"pkgCache::DepIterator::IsSatisfied(pkgCache::VerIterator const&) const@Base" 0.9.8 - (c++)"operator<<(std::basic_ostream >&, GlobalError::Item)@Base" 0.9.9 - (c++)"pkgDepCache::IsDeleteOkProtectInstallRequests(pkgCache::PkgIterator const&, bool, unsigned long, bool)@Base" 0.9.9.1 - (c++)"pkgDepCache::IsInstallOkMultiArchSameVersionSynced(pkgCache::PkgIterator const&, bool, unsigned long, bool)@Base" 0.9.9.1 - (c++)"pkgDPkgPM::SendPkgsInfo(_IO_FILE*, unsigned int const&)@Base" 0.9.9.1 - (c++)"pkgCache::VerIterator::MultiArchType() const@Base" 0.9.9.1 - (c++)"AutoDetectProxy(URI&)@Base" 0.9.10 - (c++)"CommandLine::GetCommand(CommandLine::Dispatch const*, unsigned int, char const* const*)@Base" 0.9.11 - (c++)"CommandLine::MakeArgs(char, char const*, char const*, unsigned long)@Base" 0.9.11 - (c++)"Configuration::Clear()@Base" 0.9.11 - (c++)"Glob(std::__cxx11::basic_string, std::allocator > const&, int)@Base" 0.9.11 - (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::operator()(pkgCache::GrpIterator const&)@Base" 0.9.11 - (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::operator()(pkgCache::PkgIterator const&)@Base" 0.9.11 - (c++)"pkgTagSection::pkgTagSection()@Base" 0.9.11 - (c++)"strv_length(char const**)@Base" 0.9.11 - (c++)"StringSplit(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, unsigned int)@Base" 0.9.11.3 - (c++)"pkgAcquire::Item::RenameOnError(pkgAcquire::Item::RenameOnErrorState)@Base" 0.9.12 - (c++)"APT::String::Endswith(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 0.9.13.1 - (c++)"ExecFork(std::set, std::allocator >)@Base" 0.9.13.1 - (c++)"MergeKeepFdsFromConfiguration(std::set, std::allocator >&)@Base" 0.9.13.1 - (c++)"HashString::FromFile(std::__cxx11::basic_string, std::allocator >)@Base" 0.9.13.1 - (c++)"HashString::GetHashForFile(std::__cxx11::basic_string, std::allocator >) const@Base" 0.9.13.1 - (c++)"GetTempDir[abi:cxx11]()@Base" 0.9.14.2 - (c++)"APT::Configuration::getBuildProfiles[abi:cxx11]()@Base" 0.9.16 - (c++)"APT::Configuration::getBuildProfilesString[abi:cxx11]()@Base" 0.9.16 - (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&)@Base" 0.9.16 - (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&)@Base" 0.9.16 - (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&, bool const&, bool const&)@Base" 0.9.16 - (c++)"Rename(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@Base" 0.9.16 - (c++)"pkgDepCache::IsInstallOkDependenciesSatisfiableByCandidates(pkgCache::PkgIterator const&, bool, unsigned long, bool)@Base" 1.0 - (c++)"APT::Progress::PackageManagerFancy::GetTerminalSize()@Base" 1.0 - (c++)"APT::Progress::PackageManagerFancy::GetTextProgressStr[abi:cxx11](float, int)@Base" 1.0 - (c++)"pkgCdromStatus::GetOpProgress()@Base" 1.0 - (c++)"pkgCdromStatus::SetTotal(int)@Base" 1.0 - (c++)"EDSP::ExecuteSolver(char const*, int*, int*, bool)@Base" 1.0.4 - (c++)"pkgPackageManager::EarlyRemove(pkgCache::PkgIterator, pkgCache::DepIterator const*)@Base" 1.0.4 - (c++)"pkgSrcRecords::Step()@Base" 1.0.4 - (c++)"pkgDPkgPM::SetupSlavePtyMagic()@Base" 1.0.8 - (c++)"HashStringList::find(char const*) const@Base" 1.0.9.4 - (c++)"HashStringList::operator==(HashStringList const&) const@Base" 1.0.9.4 - (c++)"HashStringList::operator!=(HashStringList const&) const@Base" 1.0.9.4 - (c++)"HashStringList::push_back(HashString const&)@Base" 1.0.9.4 - (c++)"HashStringList::supported(char const*)@Base" 1.0.9.4 - (c++)"HashStringList::VerifyFile(std::__cxx11::basic_string, std::allocator >) const@Base" 1.0.9.4 - (c++)"HashString::operator==(HashString const&) const@Base" 1.0.9.4 - (c++)"HashString::operator!=(HashString const&) const@Base" 1.0.9.4 - (c++)"pkgSrcRecords::Parser::Files2(std::vector >&)@Base" 1.0.9.4 - (c++)"APT::Progress::PackageManager::PackageManager()@Base" 1.1~exp1 - (c++)"pkgDPkgPM::Go(APT::Progress::PackageManager*)@Base" 1.1~exp1 - (c++)"pkgPackageManager::DoInstall(APT::Progress::PackageManager*)@Base" 1.1~exp1 - (c++)"pkgPackageManager::DoInstallPostFork(APT::Progress::PackageManager*)@Base" 1.1~exp1 - (c++)"pkgPackageManager::Go(APT::Progress::PackageManager*)@Base" 1.1~exp1 - (c++)"pkgTagFile::Init(FileFd*, unsigned long long)@Base" 1.1~exp1 - (c++)"pkgTagSection::Count() const@Base" 1.1~exp1 - (c++)"pkgTagSection::Exists(char const*) const@Base" 1.1~exp1 - (c++)"pkgTagSection::FindB(char const*, bool const&) const@Base" 1.1~exp1 - (c++)"pkgTagSection::Scan(char const*, unsigned long, bool)@Base" 1.1~exp1 - (c++)"StartsWithGPGClearTextSignature(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp1 - (c++)"Popen(char const**, FileFd&, int&, FileFd::OpenMode)@Base" 1.1~exp1 - (c++)"APT::String::Startswith(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp2 - (c++)"APT::Upgrade::Upgrade(pkgDepCache&, int, OpProgress*)@Base" 1.1~exp4 - (c++)"pkgProblemResolver::Resolve(bool, OpProgress*)@Base" 1.1~exp4 - (c++)"pkgProblemResolver::ResolveByKeep(OpProgress*)@Base" 1.1~exp4 - (c++)"DropPrivileges()@Base" 1.1~exp4 - (c++)"FileFd::FileFd(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned long)@Base" 1.1~exp4 - (c++)"metaIndex::metaIndex(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, char const*)@Base" 1.1~exp9 - (c++)"pkgTagSection::Get(char const*&, char const*&, unsigned int) const@Base" 1.1~exp9 -### ABI 5 changed so much (+ abicxx11 transition) - (c++)"APT::CacheSetHelper::CacheSetHelper(bool, GlobalError::MsgType)@Base" 1.1~exp9 - (c++)"APT::Configuration::getArchitectures[abi:cxx11](bool const&)@Base" 1.1~exp9 - (c++)"APT::Configuration::getCompressionTypes[abi:cxx11](bool const&)@Base" 1.1~exp9 - (c++)"APT::Configuration::getLanguages[abi:cxx11](bool const&, bool const&, char const**)@Base" 1.1~exp9 - (c++)"APT::PackageContainerInterface::operator=(APT::PackageContainerInterface const&)@Base" 1.1~exp9 - (c++)"APT::PackageContainerInterface::PackageContainerInterface(APT::CacheSetHelper::PkgSelector)@Base" 1.1~exp9 - (c++)"APT::PackageContainerInterface::~PackageContainerInterface()@Base" 1.1~exp9 - (c++)"APT::PackageContainerInterface::PackageContainerInterface()@Base" 1.1~exp9 - (c++)"APT::PackageContainer > >::~PackageContainer()@Base" 1.1~exp9 - (c++)"APT::PackageContainer > >::size() const@Base" 1.1~exp9 - (c++)"APT::PackageContainer, std::allocator > >::~PackageContainer()@Base" 1.1~exp9 - (c++)"APT::PackageContainer, std::allocator > >::size() const@Base" 1.1~exp9 - (c++)"APT::PackageUniverse::empty() const@Base" 1.1~exp9 - (c++)"APT::PackageUniverse::~PackageUniverse()@Base" 1.1~exp9 - (c++)"APT::PackageUniverse::PackageUniverse(pkgCache*)@Base" 1.1~exp9 - (c++)"APT::PackageUniverse::PackageUniverse(pkgCacheFile*)@Base" 1.1~exp9 - (c++)"APT::PackageUniverse::size() const@Base" 1.1~exp9 - (c++)"APT::Progress::PackageManagerText::PackageManagerText()@Base" 1.1~exp9 - (c++)"APT::VersionContainerInterface::FromDependency(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::DepIterator const&, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&)@Base" 1.1~exp9 - (c++)"APT::VersionContainerInterface::operator=(APT::VersionContainerInterface const&)@Base" 1.1~exp9 - (c++)"APT::VersionContainerInterface::~VersionContainerInterface()@Base" 1.1~exp9 - (c++)"APT::VersionContainerInterface::VersionContainerInterface()@Base" 1.1~exp9 - (c++)"APT::VersionContainer > >::size() const@Base" 1.1~exp9 - (c++)"APT::VersionContainer > >::~VersionContainer()@Base" 1.1~exp9 - (c++)"ChangeOwnerAndPermissionOfFile(char const*, char const*, char const*, char const*, unsigned int)@Base" 1.1~exp9 - (c++)"CommandLine::CommandLine()@Base" 1.1~exp9 - (c++)"Configuration::FindVector(char const*, std::__cxx11::basic_string, std::allocator > const&, bool) const@Base" 1.1~exp9 - (c++)"debDebianSourceDirIndex::GetType() const@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::~debDebPkgFileIndex()@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::debDebPkgFileIndex(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::FindInCache(pkgCache&) const@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::GetArchitecture[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::GetComponent[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::GetContent(std::basic_ostream >&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::GetIndexFlags() const@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::GetType() const@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::HasPackages() const@Base" 1.1~exp9 - (c++)"debDebPkgFileIndex::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"debDscFileIndex::CreateSrcParser() const@Base" 1.1~exp9 - (c++)"debDscFileIndex::~debDscFileIndex()@Base" 1.1~exp9 - (c++)"debDscFileIndex::debDscFileIndex(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"debDscFileIndex::GetType() const@Base" 1.1~exp9 - (c++)"debDscFileIndex::HasPackages() const@Base" 1.1~exp9 - (c++)"debPackagesIndex::ArchiveInfo[abi:cxx11](pkgCache::VerIterator const&) const@Base" 1.1~exp9 - (c++)"debPackagesIndex::~debPackagesIndex()@Base" 1.1~exp9 - (c++)"debPackagesIndex::debPackagesIndex(IndexTarget const&, bool)@Base" 1.1~exp9 - (c++)"debPackagesIndex::GetIndexFlags() const@Base" 1.1~exp9 - (c++)"debPackagesIndex::GetType() const@Base" 1.1~exp9 - (c++)"debPackagesIndex::HasPackages() const@Base" 1.1~exp9 - (c++)"debSourcesIndex::CreateSrcParser() const@Base" 1.1~exp9 - (c++)"debSourcesIndex::~debSourcesIndex()@Base" 1.1~exp9 - (c++)"debSourcesIndex::debSourcesIndex(IndexTarget const&, bool)@Base" 1.1~exp9 - (c++)"debSourcesIndex::GetIndexFlags() const@Base" 1.1~exp9 - (c++)"debSourcesIndex::GetType() const@Base" 1.1~exp9 - (c++)"debSourcesIndex::HasPackages() const@Base" 1.1~exp9 - (c++)"debSourcesIndex::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"debSourcesIndex::SourceInfo[abi:cxx11](pkgSrcRecords::Parser const&, pkgSrcRecords::File const&) const@Base" 1.1~exp9 - (c++)"debStatusIndex::~debStatusIndex()@Base" 1.1~exp9 - (c++)"debStatusIndex::debStatusIndex(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"debStatusIndex::Exists() const@Base" 1.1~exp9 - (c++)"debStatusIndex::GetArchitecture[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"debStatusIndex::GetComponent[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"debStatusIndex::GetIndexFlags() const@Base" 1.1~exp9 - (c++)"debStatusIndex::GetType() const@Base" 1.1~exp9 - (c++)"debStatusIndex::HasPackages() const@Base" 1.1~exp9 - (c++)"debTranslationsIndex::~debTranslationsIndex()@Base" 1.1~exp9 - (c++)"debTranslationsIndex::debTranslationsIndex(IndexTarget const&)@Base" 1.1~exp9 - (c++)"debTranslationsIndex::GetArchitecture[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"debTranslationsIndex::GetIndexFlags() const@Base" 1.1~exp9 - (c++)"debTranslationsIndex::GetType() const@Base" 1.1~exp9 - (c++)"debTranslationsIndex::HasPackages() const@Base" 1.1~exp9 - (c++)"debTranslationsIndex::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"ExecGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&)@Base" 1.1~exp9 - (c++)"ExecGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&, int*, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"FileFd::FileFd()@Base" 1.1~exp9 - (c++)"FileFd::FileFd(int, bool)@Base" 1.1~exp9 - (c++)"FileFd::FileFd(int, unsigned int, FileFd::CompressMode)@Base" 1.1~exp9 - (c++)"FileFd::FileFd(std::__cxx11::basic_string, std::allocator >, unsigned int, FileFd::CompressMode, unsigned long)@Base" 1.1~exp9 - (c++)"GetTempFile(std::__cxx11::basic_string, std::allocator > const&, bool, FileFd*)@Base" 1.1~exp9 - (c++)"Hashes::AddFD(FileFd&, unsigned long long)@Base" 1.1~exp9 - (c++)"Hashes::AddFD(int, unsigned long long)@Base" 1.1~exp9 - (c++)"Hashes::Add(unsigned char const*, unsigned long long)@Base" 1.1~exp9 - (c++)"Hashes::Hashes(HashStringList const&)@Base" 1.1~exp9 - (c++)"Hashes::Hashes(unsigned int)@Base" 1.1~exp9 - (c++)"HashStringList::FileSize() const@Base" 1.1~exp9 - (c++)"HashStringList::FileSize(unsigned long long)@Base" 1.1~exp9 - (c++)"IndexCopy::IndexCopy()@Base" 1.1~exp9 - (c++)"IndexTarget::Format(std::__cxx11::basic_string, std::allocator >) const@Base" 1.1~exp9 - (c++)"IndexTarget::~IndexTarget()@Base" 1.1~exp9 - (c++)"IndexTarget::IndexTarget(IndexTarget const&)@Base" 1.1~exp9 - (c++)"IndexTarget::IndexTarget(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool, bool, std::map, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > > const&)@Base" 1.1~exp9 - (c++)"IndexTarget::Option[abi:cxx11](IndexTarget::OptionKeys) const@Base" 1.1~exp9 - (c++)"metaIndex::CheckDist(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 - (c++)"metaIndex::Describe[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"metaIndex::Exists(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 - (c++)"metaIndex::FindInCache(pkgCache&, bool) const@Base" 1.1~exp9 - (c++)"metaIndex::GetCodename[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"metaIndex::GetDate() const@Base" 1.1~exp9 - (c++)"metaIndex::GetExpectedDist[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"metaIndex::GetLoadedSuccessfully() const@Base" 1.1~exp9 - (c++)"metaIndex::GetSignedBy[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"metaIndex::GetSuite[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"metaIndex::GetSupportsAcquireByHash() const@Base" 1.1~exp9 - (c++)"metaIndex::GetTrusted() const@Base" 1.1~exp9 - (c++)"metaIndex::GetValidUntil() const@Base" 1.1~exp9 - (c++)"metaIndex::Lookup(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 - (c++)"metaIndex::MetaKeys[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"metaIndex::swapLoad(metaIndex*)@Base" 1.1~exp9 - (c++)"PackageCopy::PackageCopy()@Base" 1.1~exp9 - (c++)"PackageCopy::RewriteEntry(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgAcqArchive::DescURI[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgAcqArchive::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 - (c++)"pkgAcqArchive::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 - (c++)"pkgAcqArchive::GetExpectedHashes() const@Base" 1.1~exp9 - (c++)"pkgAcqArchive::GetFinalFilename[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgAcqArchive::HashesRequired() const@Base" 1.1~exp9 - (c++)"pkgAcqArchive::ShortDesc[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::DescURI[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::GetExpectedHashes() const@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::HashesRequired() const@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::~pkgAcqChangelog()@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::pkgAcqChangelog(pkgAcquire*, pkgCache::RlsFileIterator const&, char const*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::pkgAcqChangelog(pkgAcquire*, pkgCache::VerIterator const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::pkgAcqChangelog(pkgAcquire*, std::__cxx11::basic_string, std::allocator > const&, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::URI[abi:cxx11](pkgCache::RlsFileIterator const&, char const*, char const*, char const*)@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::URI[abi:cxx11](pkgCache::VerIterator const&)@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::URI(std::__cxx11::basic_string, std::allocator > const&, char const*, char const*, char const*)@Base" 1.1~exp9 - (c++)"pkgAcqChangelog::URITemplate[abi:cxx11](pkgCache::RlsFileIterator const&)@Base" 1.1~exp9 - (c++)"pkgAcqFile::DescURI[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgAcqFile::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 - (c++)"pkgAcqFile::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 - (c++)"pkgAcqFile::GetExpectedHashes() const@Base" 1.1~exp9 - (c++)"pkgAcqFile::HashesRequired() const@Base" 1.1~exp9 - (c++)"pkgAcqFile::pkgAcqFile(pkgAcquire*, std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, unsigned long long, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 1.1~exp9 - (c++)"pkgAcqMethod::FetchItem::FetchItem()@Base" 1.1~exp9 - (c++)"pkgAcqMethod::FetchItem::~FetchItem()@Base" 1.1~exp9 - (c++)"pkgAcqMethod::FetchResult::~FetchResult()@Base" 1.1~exp9 - (c++)"pkgAcqMethod::URIAcquire(std::__cxx11::basic_string, std::allocator > const&, pkgAcqMethod::FetchItem*)@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::GetFinalFilename[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::GetItemDesc()@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::GetOwner() const@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::HashesRequired() const@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::HashSum[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::Item(pkgAcquire*)@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::Rename(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::ReportMirrorFailure(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::ShortDesc[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::Start(std::__cxx11::basic_string, std::allocator > const&, unsigned long long)@Base" 1.1~exp9 - (c++)"pkgAcquire::Item::VerifyDone(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@Base" 1.1~exp9 - (c++)"pkgAcquire::Queue::QItem::Custom600Headers[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgAcquire::Queue::QItem::GetExpectedHashes() const@Base" 1.1~exp9 - (c++)"pkgAcquire::Queue::QItem::GetMaximumSize() const@Base" 1.1~exp9 - (c++)"pkgAcquire::Queue::QItem::SyncDestinationFiles() const@Base" 1.1~exp9 - (c++)"pkgAcquire::Queue::Queue(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire*)@Base" 1.1~exp9 - (c++)"pkgAcquire::UriIterator::UriIterator(pkgAcquire::Queue*)@Base" 1.1~exp9 - (c++)"pkgArchiveCleaner::pkgArchiveCleaner()@Base" 1.1~exp9 - (c++)"pkgCache::DepIterator::IsImplicit() const@Base" 1.1~exp9 - (c++)"pkgCacheFile::pkgCacheFile(pkgDepCache*)@Base" 1.1~exp9 - (c++)"pkgCache::PkgIterator::FullName[abi:cxx11](bool const&) const@Base" 1.1~exp9 - (c++)"pkgCache::RlsFileIterator::IsOk()@Base" 1.1~exp9 - (c++)"pkgCache::RlsFileIterator::RelStr[abi:cxx11]()@Base" 1.1~exp9 - (c++)"pkgCdrom::~pkgCdrom()@Base" 1.1~exp9 - (c++)"pkgCdrom::pkgCdrom()@Base" 1.1~exp9 - (c++)"pkgCdromStatus::~pkgCdromStatus()@Base" 1.1~exp9 - (c++)"pkgCdromStatus::pkgCdromStatus()@Base" 1.1~exp9 - (c++)"pkgDebianIndexFile::FindInCache(pkgCache&) const@Base" 1.1~exp9 - (c++)"pkgDebianIndexFile::~pkgDebianIndexFile()@Base" 1.1~exp9 - (c++)"pkgDebianIndexFile::pkgDebianIndexFile(bool)@Base" 1.1~exp9 - (c++)"pkgDebianIndexRealFile::ArchiveURI(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 - (c++)"pkgDebianIndexRealFile::Describe[abi:cxx11](bool) const@Base" 1.1~exp9 - (c++)"pkgDebianIndexRealFile::Exists() const@Base" 1.1~exp9 - (c++)"pkgDebianIndexRealFile::GetProgressDescription[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgDebianIndexRealFile::IndexFileName[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgDebianIndexRealFile::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgDebianIndexRealFile::~pkgDebianIndexRealFile()@Base" 1.1~exp9 - (c++)"pkgDebianIndexRealFile::pkgDebianIndexRealFile(std::__cxx11::basic_string, std::allocator > const&, bool)@Base" 1.1~exp9 - (c++)"pkgDebianIndexRealFile::Size() const@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::ArchiveURI(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::Describe[abi:cxx11](bool) const@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::Exists() const@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::GetArchitecture[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::GetComponent[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::GetProgressDescription[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::IndexFileName[abi:cxx11]() const@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::~pkgDebianIndexTargetFile()@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::pkgDebianIndexTargetFile(IndexTarget const&, bool)@Base" 1.1~exp9 - (c++)"pkgDebianIndexTargetFile::Size() const@Base" 1.1~exp9 - (c++)"pkgDepCache::CheckDep(pkgCache::DepIterator const&, int, pkgCache::PkgIterator&)@Base" 1.1~exp9 - (c++)"pkgDepCache::DependencyState(pkgCache::DepIterator const&)@Base" 1.1~exp9 - (c++)"pkgDepCache::Policy::IsImportantDep(pkgCache::DepIterator const&) const@Base" 1.1~exp9 - (c++)"pkgDepCache::UpdateVerState(pkgCache::PkgIterator const&)@Base" 1.1~exp9 - (c++)"pkgDepCache::VersionState(pkgCache::DepIterator, unsigned char, unsigned char, unsigned char) const@Base" 1.1~exp9 - (c++)"pkgIndexFile::ArchiveInfo[abi:cxx11](pkgCache::VerIterator const&) const@Base" 1.1~exp9 - (c++)"pkgIndexFile::ArchiveURI(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 - (c++)"pkgIndexFile::~pkgIndexFile()@Base" 1.1~exp9 - (c++)"pkgIndexFile::pkgIndexFile(bool)@Base" 1.1~exp9 - (c++)"pkgIndexFile::SourceInfo[abi:cxx11](pkgSrcRecords::Parser const&, pkgSrcRecords::File const&) const@Base" 1.1~exp9 - (c++)"pkgIndexFile::Type::CreatePkgParser(pkgCache::PkgFileIterator const&) const@Base" 1.1~exp9 - (c++)"pkgIndexFile::Type::CreateSrcPkgParser(std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 - (c++)"pkgRecords::Parser::~Parser()@Base" 1.1~exp9 - (c++)"pkgRecords::Parser::Parser()@Base" 1.1~exp9 - (c++)"pkgSourceList::AddVolatileFile(pkgIndexFile*)@Base" 1.1~exp9 - (c++)"pkgSourceList::GetVolatileFiles() const@Base" 1.1~exp9 - (c++)"pkgSourceList::ReadAppend(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgSourceList::ReadSourceDir(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgSourceList::Read(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgSourceList::Type::ParseLine(std::vector >&, char const*, unsigned int, std::__cxx11::basic_string, std::allocator > const&) const@Base" 1.1~exp9 - (c++)"pkgSourceList::Type::ParseStanza(std::vector >&, pkgTagSection&, unsigned int, FileFd&)@Base" 1.1~exp9 - (c++)"pkgSourceList::Type::~Type()@Base" 1.1~exp9 - (c++)"pkgSourceList::Type::Type(char const*, char const*)@Base" 1.1~exp9 - (c++)"pkgSrcRecords::Parser::~Parser()@Base" 1.1~exp9 - (c++)"pkgSrcRecords::Parser::Parser(pkgIndexFile const*)@Base" 1.1~exp9 - (c++)"pkgSystem::~pkgSystem()@Base" 1.1~exp9 - (c++)"pkgSystem::pkgSystem(char const*, pkgVersioningSystem*)@Base" 1.1~exp9 - (c++)"pkgTagSection::FindFlag(char const*, unsigned char&, unsigned char) const@Base" 1.1~exp9 - (c++)"pkgTagSection::FindFlag(unsigned char&, unsigned char, char const*, char const*)@Base" 1.1~exp9 - (c++)"pkgTagSection::FindRawS[abi:cxx11](char const*) const@Base" 1.1~exp9 - (c++)"pkgTagSection::Tag::Remove(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgTagSection::Tag::Rename(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgTagSection::Tag::Rewrite(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"pkgTagSection::Tag::~Tag()@Base" 1.1~exp9 - (c++)"pkgTagSection::Write(FileFd&, char const* const*, std::vector > const&) const@Base" 1.1~exp9 - (c++)"pkgUserTagSection::~pkgUserTagSection()@Base" 1.1~exp9 - (c++)"pkgUserTagSection::TrimRecord(bool, char const*&)@Base" 1.1~exp9 - (c++)"pkgVersioningSystem::~pkgVersioningSystem()@Base" 1.1~exp9 - (c++)"SigVerify::~SigVerify()@Base" 1.1~exp9 - (c++)"SigVerify::SigVerify()@Base" 1.1~exp9 - (c++)"SourceCopy::RewriteEntry(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"SourceCopy::SourceCopy()@Base" 1.1~exp9 - (c++)"TranslationsCopy::~TranslationsCopy()@Base" 1.1~exp9 - (c++)"TranslationsCopy::TranslationsCopy()@Base" 1.1~exp9 - (c++)"typeinfo for APT::PackageUniverse@Base" 1.1~exp9 - (c++)"typeinfo for debDebianSourceDirIndex@Base" 1.1~exp9 - (c++)"typeinfo for debDebPkgFileIndex@Base" 1.1~exp9 - (c++)"typeinfo for debDscFileIndex@Base" 1.1~exp9 - (c++)"typeinfo for debPackagesIndex@Base" 1.1~exp9 - (c++)"typeinfo for debSourcesIndex@Base" 1.1~exp9 - (c++)"typeinfo for debStatusIndex@Base" 1.1~exp9 - (c++)"typeinfo for debTranslationsIndex@Base" 1.1~exp9 - (c++)"typeinfo for pkgAcqChangelog@Base" 1.1~exp9 - (c++)"typeinfo for pkgAcqMethod::FetchItem@Base" 1.1~exp9 - (c++)"typeinfo for pkgAcqMethod::FetchResult@Base" 1.1~exp9 - (c++)"typeinfo for pkgCdrom@Base" 1.1~exp9 - (c++)"typeinfo for pkgCdromStatus@Base" 1.1~exp9 - (c++)"typeinfo for pkgDebianIndexFile@Base" 1.1~exp9 - (c++)"typeinfo for pkgDebianIndexRealFile@Base" 1.1~exp9 - (c++)"typeinfo for pkgDebianIndexTargetFile@Base" 1.1~exp9 - (c++)"typeinfo for pkgDepCache::ActionGroup@Base" 1.1~exp9 - (c++)"typeinfo for pkgOrderList@Base" 1.1~exp9 - (c++)"typeinfo for pkgProblemResolver@Base" 1.1~exp9 - (c++)"typeinfo for pkgRecords@Base" 1.1~exp9 - (c++)"typeinfo for pkgSourceList@Base" 1.1~exp9 - (c++)"typeinfo for pkgUserTagSection@Base" 1.1~exp9 - (c++)"typeinfo for SigVerify@Base" 1.1~exp9 - (c++)"typeinfo for TranslationsCopy@Base" 1.1~exp9 - (c++)"typeinfo name for APT::PackageUniverse@Base" 1.1~exp9 - (c++)"typeinfo name for debDebianSourceDirIndex@Base" 1.1~exp9 - (c++)"typeinfo name for debDebPkgFileIndex@Base" 1.1~exp9 - (c++)"typeinfo name for debDscFileIndex@Base" 1.1~exp9 - (c++)"typeinfo name for debPackagesIndex@Base" 1.1~exp9 - (c++)"typeinfo name for debSourcesIndex@Base" 1.1~exp9 - (c++)"typeinfo name for debStatusIndex@Base" 1.1~exp9 - (c++)"typeinfo name for debTranslationsIndex@Base" 1.1~exp9 - (c++)"typeinfo name for pkgAcqChangelog@Base" 1.1~exp9 - (c++)"typeinfo name for pkgAcqMethod::FetchItem@Base" 1.1~exp9 - (c++)"typeinfo name for pkgAcqMethod::FetchResult@Base" 1.1~exp9 - (c++)"typeinfo name for pkgCdrom@Base" 1.1~exp9 - (c++)"typeinfo name for pkgCdromStatus@Base" 1.1~exp9 - (c++)"typeinfo name for pkgDebianIndexFile@Base" 1.1~exp9 - (c++)"typeinfo name for pkgDebianIndexRealFile@Base" 1.1~exp9 - (c++)"typeinfo name for pkgDebianIndexTargetFile@Base" 1.1~exp9 - (c++)"typeinfo name for pkgDepCache::ActionGroup@Base" 1.1~exp9 - (c++)"typeinfo name for pkgOrderList@Base" 1.1~exp9 - (c++)"typeinfo name for pkgProblemResolver@Base" 1.1~exp9 - (c++)"typeinfo name for pkgRecords@Base" 1.1~exp9 - (c++)"typeinfo name for pkgSourceList@Base" 1.1~exp9 - (c++)"typeinfo name for pkgUserTagSection@Base" 1.1~exp9 - (c++)"typeinfo name for SigVerify@Base" 1.1~exp9 - (c++)"typeinfo name for TranslationsCopy@Base" 1.1~exp9 - (c++)"URI::ArchiveOnly(std::__cxx11::basic_string, std::allocator > const&)@Base" 1.1~exp9 - (c++)"void std::vector >::emplace_back(APT::Configuration::Compressor&&)@Base" 1.1~exp9 - (c++)"void std::vector >::emplace_back(char const*&&)@Base" 1.1~exp9 - (c++)"void std::vector >::emplace_back(pkgCache::GrpIterator*&&)@Base" 1.1~exp9 - (c++)"void std::vector >::emplace_back(pkgCache::PkgIterator*&&)@Base" 1.1~exp9 - (c++)"void std::vector >::emplace_back(pkgCache::RlsFileIterator*&&)@Base" 1.1~exp9 - (c++)"void std::vector >::emplace_back(pkgCache::VerIterator*&&)@Base" 1.1~exp9 - (c++)"void std::vector >::emplace_back(pkgDPkgPM::Item&&)@Base" 1.1~exp9 - (c++)"void std::vector >::emplace_back(pkgIndexFile*&&)@Base" 1.1~exp9 - (c++)"void std::vector >::emplace_back(pkgTagSection::Tag&&)@Base" 1.1~exp9 - (c++)"void std::vector, std::allocator >, std::allocator, std::allocator > > >::emplace_back, std::allocator > >(std::__cxx11::basic_string, std::allocator >&&)@Base" 1.1~exp9 - (c++)"vtable for APT::PackageUniverse@Base" 1.1~exp9 - (c++)"vtable for debDebianSourceDirIndex@Base" 1.1~exp9 - (c++)"vtable for debDebPkgFileIndex@Base" 1.1~exp9 - (c++)"vtable for debDscFileIndex@Base" 1.1~exp9 - (c++)"vtable for debPackagesIndex@Base" 1.1~exp9 - (c++)"vtable for debSourcesIndex@Base" 1.1~exp9 - (c++)"vtable for debStatusIndex@Base" 1.1~exp9 - (c++)"vtable for debTranslationsIndex@Base" 1.1~exp9 - (c++)"vtable for pkgAcqChangelog@Base" 1.1~exp9 - (c++)"vtable for pkgAcqMethod::FetchItem@Base" 1.1~exp9 - (c++)"vtable for pkgAcqMethod::FetchResult@Base" 1.1~exp9 - (c++)"vtable for pkgCdrom@Base" 1.1~exp9 - (c++)"vtable for pkgCdromStatus@Base" 1.1~exp9 - (c++)"vtable for pkgDebianIndexFile@Base" 1.1~exp9 - (c++)"vtable for pkgDebianIndexRealFile@Base" 1.1~exp9 - (c++)"vtable for pkgDebianIndexTargetFile@Base" 1.1~exp9 - (c++)"vtable for pkgDepCache::ActionGroup@Base" 1.1~exp9 - (c++)"vtable for pkgOrderList@Base" 1.1~exp9 - (c++)"vtable for pkgProblemResolver@Base" 1.1~exp9 - (c++)"vtable for pkgRecords@Base" 1.1~exp9 - (c++)"vtable for pkgSourceList@Base" 1.1~exp9 - (c++)"vtable for pkgUserTagSection@Base" 1.1~exp9 - (c++)"vtable for SigVerify@Base" 1.1~exp9 - (c++)"vtable for TranslationsCopy@Base" 1.1~exp9 -### try to ignore std:: template instances - (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@Base$" 0.8.0 - (c++|regex|optional=std)"^(void |)std::[^ ]+<.+ >::(_|~).+\(.*\)@Base$" 0.8.0 - (c++|regex|optional=std)"^std::[^ ]+<.+ >::(append|insert|reserve|operator[^ ]+)\(.*\)@Base$" 0.8.0 - (c++|regex|optional=std)"^(void |DiffInfo\* |)std::_.*@Base$" 0.8.0 - (c++|regex|optional=std)"^__gnu_cxx::__[^ ]+<.*@Base$" 0.8.0 - (c++|optional=std)"std::ctype::do_widen(char) const@Base" 1.0.3 diff --git a/debian/libapt-pkg5.0.install.in b/debian/libapt-pkg5.0.install.in new file mode 100644 index 000000000..56bed39d3 --- /dev/null +++ b/debian/libapt-pkg5.0.install.in @@ -0,0 +1,2 @@ +bin/libapt-pkg*.so.* usr/lib/@DEB_HOST_MULTIARCH@/ +usr/share/locale/*/*/libapt-pkg*.mo diff --git a/debian/libapt-pkg5.0.symbols b/debian/libapt-pkg5.0.symbols new file mode 100644 index 000000000..20deaed77 --- /dev/null +++ b/debian/libapt-pkg5.0.symbols @@ -0,0 +1,1503 @@ +libapt-pkg.so.5.0 libapt-pkg5.0 #MINVER# +* Build-Depends-Package: libapt-pkg-dev + TFRewritePackageOrder@APTPKG_5.0 0.8.0 + TFRewriteSourceOrder@APTPKG_5.0 0.8.0 + (c++)"FileExists(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"IdentCdrom(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int)@APTPKG_5.0" 0.8.0 + (c++)"ListUpdate(pkgAcquireStatus&, pkgSourceList&, int)@APTPKG_5.0" 0.8.0 + (c++)"MountCdrom(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"ParseCWord(char const*&, std::__cxx11::basic_string, std::allocator >&)@APTPKG_5.0" 0.8.0 + (c++)"ReadPinDir(pkgPolicy&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"RunScripts(char const*)@APTPKG_5.0" 0.8.0 + (c++)"SafeGetCWD[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"QuoteString(std::__cxx11::basic_string, std::allocator > const&, char const*)@APTPKG_5.0" 0.8.0 + (c++)"ReadPinFile(pkgPolicy&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"RegexChoice(RxChoiceList*, char const**, char const**)@APTPKG_5.0" 0.8.0 + (c++)"SetNonBlock(int, bool)@APTPKG_5.0" 0.8.0 + (c++)"flExtension(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"Base64Encode(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"ReadMessages(int, std::vector, std::allocator >, std::allocator, std::allocator > > >&)@APTPKG_5.0" 0.8.0 + (c++)"SetCloseExec(int, bool)@APTPKG_5.0" 0.8.0 + (c++)"StringToBool(std::__cxx11::basic_string, std::allocator > const&, int)@APTPKG_5.0" 0.8.0 + (c++)"UnmountCdrom(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"_GetErrorObj()@APTPKG_5.0" 0.8.0 + (c++)"Base256ToNum(char const*, unsigned long long&, unsigned int)@APTPKG_5.0" 1.0.5 + (c++)"pkgFixBroken(pkgDepCache&)@APTPKG_5.0" 0.8.0 + (c++)"DeQuoteString(__gnu_cxx::__normal_iterator, std::allocator > > const&, __gnu_cxx::__normal_iterator, std::allocator > > const&)@APTPKG_5.0" 0.8.0 + (c++)"DeQuoteString(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"OutputInDepth[abi:cxx11](unsigned long, char const*)@APTPKG_5.0" 0.8.0 + (c++)"ReadConfigDir(Configuration&, std::__cxx11::basic_string, std::allocator > const&, bool const&, unsigned int const&)@APTPKG_5.0" 0.8.0 + (c++)"URItoFileName(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"UTF8ToCodeset(char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >*)@APTPKG_5.0" 0.8.0 + (c++)"pkgInitConfig(Configuration&)@APTPKG_5.0" 0.8.0 + (c++)"pkgInitSystem(Configuration&, pkgSystem*&)@APTPKG_5.0" 0.8.0 + (c++)"safe_snprintf(char*, char*, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"stringcasecmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"stringcasecmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >)@APTPKG_5.0" 0.8.0 + (c++)"stringcasecmp(char const*, char const*, char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"tolower_ascii(int)@APTPKG_5.0" 0.8.0 + (c++)"ParseQuoteWord(char const*&, std::__cxx11::basic_string, std::allocator >&)@APTPKG_5.0" 0.8.0 + (c++)"ReadConfigFile(Configuration&, std::__cxx11::basic_string, std::allocator > const&, bool const&, unsigned int const&)@APTPKG_5.0" 0.8.0 + (c++)"TokSplitString(char, char*, char**, unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"maybe_add_auth(URI&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgApplyStatus(pkgDepCache&)@APTPKG_5.0" 0.8.0 + (c++)"CheckDomainList(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"CreateDirectory(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"DirectoryExists(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"VectorizeString(std::__cxx11::basic_string, std::allocator > const&, char const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgPrioSortList(pkgCache&, pkgCache::Version**)@APTPKG_5.0" 0.8.0 + (c++)"pkgMakeStatusCache(pkgSourceList&, OpProgress&, MMap**, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgMinimizeUpgrade(pkgDepCache&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAllUpgrade(pkgDepCache&)@APTPKG_5.0" 0.8.0 + (c++)"pkgDistUpgrade(pkgDepCache&)@APTPKG_5.0" 0.8.0 + (c++)"GetListOfFilesInDir(std::__cxx11::basic_string, std::allocator > const&, std::vector, std::allocator >, std::allocator, std::allocator > > > const&, bool const&)@APTPKG_5.0" 0.8.0 + (c++)"GetListOfFilesInDir(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool const&, bool const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgMakeOnlyStatusCache(OpProgress&, DynamicMMap**)@APTPKG_5.0" 0.8.0 + (c++)"WaitFd(int, bool, unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"GetLock(std::__cxx11::basic_string, std::allocator >, bool)@APTPKG_5.0" 0.8.0 + (c++)"Hex2Num(std::__cxx11::basic_string, std::allocator > const&, unsigned char*, unsigned int)@APTPKG_5.0" 0.8.0 + (c++)"CopyFile(FileFd&, FileFd&)@APTPKG_5.0" 0.8.0 + (c++)"ExecFork()@APTPKG_5.0" 0.8.0 + (c++)"ExecWait(int, char const*, bool)@APTPKG_5.0" 0.8.0 + (c++)"StrToNum(char const*, unsigned long&, unsigned int, unsigned int)@APTPKG_5.0" 0.8.0 + (c++)"SubstVar(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"SubstVar(std::__cxx11::basic_string, std::allocator >, SubstVar const*)@APTPKG_5.0" 0.8.0 + (c++)"flNoLink(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"flNotDir(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"ioprintf(std::basic_ostream >&, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"IsMounted(std::__cxx11::basic_string, std::allocator >&)@APTPKG_5.0" 0.8.0 + (c++)"LookupTag(std::__cxx11::basic_string, std::allocator > const&, char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"SizeToStr[abi:cxx11](double)@APTPKG_5.0" 0.8.0 + (c++)"TFRewrite(_IO_FILE*, pkgTagSection const&, char const**, TFRewriteData*)@APTPKG_5.0" 0.8.0 + (c++)"TimeToStr[abi:cxx11](unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"_strstrip(char*)@APTPKG_5.0" 0.8.0 + (c++)"flCombine(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"flNotFile(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"stringcmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"stringcmp(__gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >, __gnu_cxx::__normal_iterator, std::allocator > >)@APTPKG_5.0" 0.8.0 + (c++)"stringcmp(char const*, char const*, char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"strprintf(std::__cxx11::basic_string, std::allocator >&, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"HashString::SupportedHashes()@APTPKG_5.0" 0.8.0 + (c++)"HashString::_SupportedHashes@APTPKG_5.0" 0.8.0 + (c++)"HashString::HashString(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"HashString::HashString(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"HashString::HashString()@APTPKG_5.0" 0.8.0 + (c++)"HashString::~HashString()@APTPKG_5.0" 0.8.0 + (c++)"OpProgress::CheckChange(float)@APTPKG_5.0" 0.8.0 + (c++)"OpProgress::Done()@APTPKG_5.0" 0.8.0 + (c++)"OpProgress::Update()@APTPKG_5.0" 0.8.0 + (c++)"OpProgress::OpProgress()@APTPKG_5.0" 0.8.0 + (c++)"OpProgress::~OpProgress()@APTPKG_5.0" 0.8.0 + (c++)"SourceCopy::GetFileName()@APTPKG_5.0" 0.8.0 + (c++)"SourceCopy::Type()@APTPKG_5.0" 0.8.0 + (c++)"SourceCopy::~SourceCopy()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqFile::~pkgAcqFile()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::WorkerStep(pkgAcquire::Worker*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::FetchNeeded()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::TotalNeeded()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::MethodConfig::MethodConfig()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::PartialPresent()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Add(pkgAcquire::Item*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Add(pkgAcquire::Worker*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Run(int)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Bump()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Item::Finished()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Item::~Item()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Clean(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Queue::Bump()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Queue::Cycle()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Queue::Dequeue(pkgAcquire::Item*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Queue::Enqueue(pkgAcquire::ItemDesc&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Queue::Startup()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Queue::FindItem(std::__cxx11::basic_string, std::allocator >, pkgAcquire::Worker*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Queue::ItemDone(pkgAcquire::Queue::QItem*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Queue::Shutdown(bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Queue::~Queue()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Remove(pkgAcquire::Item*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Remove(pkgAcquire::Worker*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::RunFds(fd_set*, fd_set*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::SetFds(int&, fd_set*, fd_set*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::UriEnd()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::OutFdReady()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::MediaChange(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::RunMessages()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::Capabilities(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::ReadMessages()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::MethodFailure()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::SendConfiguration()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::Pulse()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::Start()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::ItemDone()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::Construct()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::InFdReady()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::QueueItem(pkgAcquire::Queue::QItem*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::Worker(pkgAcquire::MethodConfig*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::Worker(pkgAcquire::Queue*, pkgAcquire::MethodConfig*, pkgAcquireStatus*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Worker::~Worker()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Dequeue(pkgAcquire::Item*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Enqueue(pkgAcquire::ItemDesc&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::Shutdown()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::UriBegin()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::GetConfig(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::QueueName(std::__cxx11::basic_string, std::allocator >, pkgAcquire::MethodConfig const*&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::pkgAcquire(pkgAcquireStatus*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::pkgAcquire()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquire::~pkgAcquire()@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::Lookup(pkgCache::VerFileIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::Lookup(pkgCache::DescFileIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::Parser::Maintainer[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::Parser::Name[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::Parser::GetRec(char const*&, char const*&)@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::Parser::FileName[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::Parser::Homepage[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::Parser::SourcePkg[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::Parser::SourceVer[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::pkgRecords(pkgCache&)@APTPKG_5.0" 0.8.0 + (c++)"pkgRecords::~pkgRecords()@APTPKG_5.0" 0.8.0 + (c++)"pkgTagFile::Step(pkgTagSection&)@APTPKG_5.0" 0.8.0 + (c++)"pkgTagFile::~pkgTagFile()@APTPKG_5.0" 0.8.0 + (c++)"CdromDevice::~CdromDevice()@APTPKG_5.0" 0.8.0 + (c++)"CommandLine::DispatchArg(CommandLine::Dispatch*, bool)@APTPKG_5.0" 0.8.0 + (c++)"CommandLine::SaveInConfig(unsigned int const&, char const* const*)@APTPKG_5.0" 0.8.0 + (c++)"CommandLine::Parse(int, char const**)@APTPKG_5.0" 0.8.0 + (c++)"CommandLine::HandleOpt(int&, int, char const**, char const*&, CommandLine::Args*, bool)@APTPKG_5.0" 0.8.0 + (c++)"CommandLine::CommandLine(CommandLine::Args*, Configuration*)@APTPKG_5.0" 0.8.0 + (c++)"CommandLine::~CommandLine()@APTPKG_5.0" 0.8.0 + (c++)"DynamicMMap::WriteString(char const*, unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"DynamicMMap::Grow()@APTPKG_5.0" 0.8.0 + (c++)"DynamicMMap::Allocate(unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"DynamicMMap::DynamicMMap(FileFd&, unsigned long, unsigned long const&, unsigned long const&, unsigned long const&)@APTPKG_5.0" 0.8.0 + (c++)"DynamicMMap::DynamicMMap(unsigned long, unsigned long const&, unsigned long const&, unsigned long const&)@APTPKG_5.0" 0.8.0 + (c++)"DynamicMMap::~DynamicMMap()@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::DumpErrors(std::basic_ostream >&, GlobalError::MsgType const&, bool const&)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::PopMessage(std::__cxx11::basic_string, std::allocator >&)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::InsertErrno(GlobalError::MsgType const&, char const*, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::PushToStack()@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::RevertToStack()@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::MergeWithStack()@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::Debug(char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::Errno(char const*, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::Error(char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::Fatal(char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::DebugE(char const*, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::FatalE(char const*, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::Insert(GlobalError::MsgType const&, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::Notice(char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::Discard()@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::NoticeE(char const*, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::Warning(char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::WarningE(char const*, char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::GlobalError()@APTPKG_5.0" 0.8.0 + (c++)"PackageCopy::GetFileName()@APTPKG_5.0" 0.8.0 + (c++)"PackageCopy::Type()@APTPKG_5.0" 0.8.0 + (c++)"PackageCopy::~PackageCopy()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::IsDeleteOk(pkgCache::PkgIterator const&, bool, unsigned long, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::MarkDelete(pkgCache::PkgIterator const&, bool, unsigned long, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::StateCache::StripEpoch(char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::StateCache::Update(pkgCache::PkgIterator, pkgCache&)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::ActionGroup::release()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::ActionGroup::ActionGroup(pkgDepCache&)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::ActionGroup::~ActionGroup()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::IsInstallOk(pkgCache::PkgIterator const&, bool, unsigned long, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::MarkInstall(pkgCache::PkgIterator const&, bool, unsigned long, bool, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::SetReInstall(pkgCache::PkgIterator const&, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::BuildGroupOrs(pkgCache::VerIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::InRootSetFunc::InRootSet(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::InRootSetFunc::~InRootSetFunc()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::readStateFile(OpProgress*)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::GetRootSetFunc()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::writeStateFile(OpProgress*, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::DefaultRootSetFunc::InRootSet(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::MarkFollowsSuggests()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::MarkFollowsRecommends()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::Init(OpProgress*)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::Policy::GetCandidateVer(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::Policy::~Policy()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::Update(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::Update(OpProgress*)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::Update(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::MarkAuto(pkgCache::PkgIterator const&, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::MarkKeep(pkgCache::PkgIterator const&, bool, bool, unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::MarkRequired(pkgDepCache::InRootSetFunc&)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::Sweep()@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::pkgDepCache(pkgCache*, pkgDepCache::Policy*)@APTPKG_5.0" 0.8.0 + (c++)"pkgDepCache::~pkgDepCache()@APTPKG_5.0" 0.8.0 + (c++)"pkgSimulate::Policy::GetCandidateVer(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgSimulate::Policy::~Policy()@APTPKG_5.0" 0.8.0 + (c++)"pkgSimulate::Remove(pkgCache::PkgIterator, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgSimulate::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgSimulate::Configure(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgSimulate::pkgSimulate(pkgDepCache*)@APTPKG_5.0" 0.8.0 + (c++)"pkgSimulate::~pkgSimulate()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::FetchResult::TakeHashes(Hashes&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::FetchResult::FetchResult()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::Configuration(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::Log(char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::Run(bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::Exit()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::Fail(std::__cxx11::basic_string, std::allocator >, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::Fail(bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::Fetch(pkgAcqMethod::FetchItem*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::Status(char const*, ...)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::URIDone(pkgAcqMethod::FetchResult&, pkgAcqMethod::FetchResult*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::Redirect(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::URIStart(pkgAcqMethod::FetchResult&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::MediaFail(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::pkgAcqMethod(char const*, unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqMethod::~pkgAcqMethod()@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheFile::BuildCaches(OpProgress*, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheFile::BuildPolicy(OpProgress*)@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheFile::BuildDepCache(OpProgress*)@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheFile::BuildSourceList(OpProgress*)@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheFile::Open(OpProgress*, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheFile::Close()@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheFile::pkgCacheFile()@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheFile::~pkgCacheFile()@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::LanguageCode[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::CheckLanguageCode(char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::TranslationsAvailable()@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::Type::GlobalList@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::Type::GlobalListLen@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::Type::GetType(char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::Type::Type()@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::VisitRDeps(bool (pkgOrderList::*)(pkgCache::DepIterator), pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::OrderUnpack(std::__cxx11::basic_string, std::allocator >*)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::DepConfigure(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::DepUnPackDep(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::DepUnPackPre(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::DepUnPackCrit(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::DepUnPackPreD(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::OrderCompareA(void const*, void const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::OrderCompareB(void const*, void const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::OrderCritical()@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::VisitProvides(pkgCache::DepIterator, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::OrderConfigure()@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::VisitRProvides(bool (pkgOrderList::*)(pkgCache::DepIterator), pkgCache::VerIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::Me@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::DoRun()@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::Score(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::AddLoop(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::FileCmp(pkgCache::PkgIterator, pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::CheckDep(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::DepRemove(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::IsMissing(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::VisitDeps(bool (pkgOrderList::*)(pkgCache::DepIterator), pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::WipeFlags(unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::pkgOrderList(pkgDepCache*)@APTPKG_5.0" 0.8.0 + (c++)"pkgOrderList::~pkgOrderList()@APTPKG_5.0" 0.8.0 + (c++)"Configuration::MatchAgainstConfig::MatchAgainstConfig(char const*)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::MatchAgainstConfig::~MatchAgainstConfig()@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Set(char const*, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Set(char const*, int const&)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Dump(std::basic_ostream >&)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Clear(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Clear(std::__cxx11::basic_string, std::allocator > const&, int const&)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Clear(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::CndSet(char const*, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Lookup(char const*, bool const&)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Lookup(Configuration::Item*, char const*, unsigned long const&, bool const&)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Configuration(Configuration::Item const*)@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Configuration()@APTPKG_5.0" 0.8.0 + (c++)"Configuration::~Configuration()@APTPKG_5.0" 0.8.0 + (c++)"WeakPointable::~WeakPointable()@APTPKG_5.0" 0.8.0 + (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&, bool const&)@APTPKG_5.0" 0.8.0 + (c++)"debListParser::ConvertRelation(char const*, unsigned int&)@APTPKG_5.0" 0.8.0 + (c++)"debListParser::GetPrio(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqArchive::Finished()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqArchive::QueueNext()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqArchive::pkgAcqArchive(pkgAcquire*, pkgSourceList*, pkgRecords*, pkgCache::VerIterator const&, std::__cxx11::basic_string, std::allocator >&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcqArchive::~pkgAcqArchive()@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::Type::GlobalList@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::Type::GlobalListLen@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::Type::GetType(char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::ReadMainList()@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::Reset()@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::pkgSourceList()@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::~pkgSourceList()@APTPKG_5.0" 0.8.0 + (c++)"pkgSrcRecords::File::~File()@APTPKG_5.0" 0.8.0 + (c++)"pkgSrcRecords::Find(char const*, bool const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgSrcRecords::Parser::BuildDepRec::~BuildDepRec()@APTPKG_5.0" 0.8.0 + (c++)"pkgSrcRecords::Parser::BuildDepType(unsigned char const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgSrcRecords::Restart()@APTPKG_5.0" 0.8.0 + (c++)"pkgSrcRecords::pkgSrcRecords(pkgSourceList&)@APTPKG_5.0" 0.8.0 + (c++)"pkgSrcRecords::~pkgSrcRecords()@APTPKG_5.0" 0.8.0 + (c++)"pkgTagSection::TrimRecord(bool, char const*&)@APTPKG_5.0" 0.8.0 + (c++)"pkgTagSection::Trim()@APTPKG_5.0" 0.8.0 + (c++)"OpTextProgress::Done()@APTPKG_5.0" 0.8.0 + (c++)"OpTextProgress::Write(char const*)@APTPKG_5.0" 0.8.0 + (c++)"OpTextProgress::Update()@APTPKG_5.0" 0.8.0 + (c++)"OpTextProgress::OpTextProgress(Configuration&)@APTPKG_5.0" 0.8.0 + (c++)"OpTextProgress::~OpTextProgress()@APTPKG_5.0" 0.8.0 + (c++)"pkgVersionMatch::ExpressionMatches(char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgVersionMatch::ExpressionMatches(std::__cxx11::basic_string, std::allocator > const&, char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgVersionMatch::Find(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgVersionMatch::MatchVer(char const*, std::__cxx11::basic_string, std::allocator >, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgVersionMatch::FileMatch(pkgCache::PkgFileIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgVersionMatch::pkgVersionMatch(std::__cxx11::basic_string, std::allocator >, pkgVersionMatch::MatchType)@APTPKG_5.0" 0.8.0 + (c++)"pkgVersionMatch::~pkgVersionMatch()@APTPKG_5.0" 0.8.0 + (c++)"TranslationsCopy::CopyTranslations(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, pkgCdromStatus*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquireStatus::Done(pkgAcquire::ItemDesc&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquireStatus::Fail(pkgAcquire::ItemDesc&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquireStatus::Stop()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquireStatus::Fetch(pkgAcquire::ItemDesc&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquireStatus::Pulse(pkgAcquire*)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquireStatus::Start()@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquireStatus::IMSHit(pkgAcquire::ItemDesc&)@APTPKG_5.0" 0.8.0 + (c++)"pkgAcquireStatus::pkgAcquireStatus()@APTPKG_5.0" 0.8.0 + (c++)"pkgArchiveCleaner::Go(std::__cxx11::basic_string, std::allocator >, pkgCache&)@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheGenerator::MakeStatusCache(pkgSourceList&, OpProgress*, MMap**, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgCacheGenerator::MakeOnlyStatusCache(OpProgress*, DynamicMMap**)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::FixMissing()@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::EarlyRemove(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::GetArchives(pkgAcquire*, pkgSourceList*, pkgRecords*)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::SmartRemove(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::SmartUnPack(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::ConfigureAll()@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::ImmediateAdd(pkgCache::PkgIterator, bool, unsigned int const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::OrderInstall()@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::DepAlwaysTrue(pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::CheckRConflicts(pkgCache::PkgIterator, pkgCache::DepIterator, char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::CreateOrderList()@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::DoInstallPostFork(int)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::Go(int)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::Reset()@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::Remove(pkgCache::PkgIterator, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::Configure(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::DoInstall(int)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::pkgPackageManager(pkgDepCache*)@APTPKG_5.0" 0.8.0 + (c++)"pkgPackageManager::~pkgPackageManager()@APTPKG_5.0" 0.8.0 + (c++)"pkgProblemResolver::InstallProtect()@APTPKG_5.0" 0.8.0 + (c++)"pkgProblemResolver::This@APTPKG_5.0" 0.8.0 + (c++)"pkgProblemResolver::pkgProblemResolver(pkgDepCache*)@APTPKG_5.0" 0.8.0 + (c++)"pkgProblemResolver::~pkgProblemResolver()@APTPKG_5.0" 0.8.0 + (c++)"debVersioningSystem::CmpFragment(char const*, char const*, char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"debVersioningSystem::DoCmpVersion(char const*, char const*, char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"debVersioningSystem::DoCmpReleaseVer(char const*, char const*, char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"debVersioningSystem::UpstreamVersion[abi:cxx11](char const*)@APTPKG_5.0" 0.8.0 + (c++)"debVersioningSystem::CheckDep(char const*, int, char const*)@APTPKG_5.0" 0.8.0 + (c++)"debVersioningSystem::debVersioningSystem()@APTPKG_5.0" 0.8.0 + (c++)"debVersioningSystem::~debVersioningSystem()@APTPKG_5.0" 0.8.0 + (c++)"pkgUdevCdromDevices::Scan()@APTPKG_5.0" 0.8.0 + (c++)"pkgUdevCdromDevices::Dlopen()@APTPKG_5.0" 0.8.0 + (c++)"pkgUdevCdromDevices::pkgUdevCdromDevices()@APTPKG_5.0" 0.8.0 + (c++)"pkgUdevCdromDevices::~pkgUdevCdromDevices()@APTPKG_5.0" 0.8.0 + (c++)"pkgVersioningSystem::GlobalList@APTPKG_5.0" 0.8.0 + (c++)"pkgVersioningSystem::GlobalListLen@APTPKG_5.0" 0.8.0 + (c++)"pkgVersioningSystem::TestCompatibility(pkgVersioningSystem const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgVersioningSystem::GetVS(char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgVersioningSystem::pkgVersioningSystem()@APTPKG_5.0" 0.8.0 + (c++)"APT::CacheFilter::PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"APT::CacheFilter::PackageNameMatchesRegEx::~PackageNameMatchesRegEx()@APTPKG_5.0" 0.8.0 + (c++)"APT::CacheFilter::PackageNameMatchesRegEx::operator()(pkgCache::GrpIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"APT::CacheFilter::PackageNameMatchesRegEx::operator()(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"APT::Configuration::checkArchitecture(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"APT::CacheSetHelper::canNotFindPkgName(pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"APT::CacheSetHelper::canNotFindNewestVer(pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"APT::CacheSetHelper::canNotFindCandidateVer(pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"APT::CacheSetHelper::canNotFindInstalledVer(pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"APT::CacheSetHelper::~CacheSetHelper()@APTPKG_5.0" 0.8.0 + (c++)"URI::NoUserPassword(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"URI::CopyFrom(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"URI::SiteOnly(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"URI::~URI()@APTPKG_5.0" 0.8.0 + (c++)"URI::operator std::__cxx11::basic_string, std::allocator >[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"MMap::Map(FileFd&)@APTPKG_5.0" 0.8.0 + (c++)"MMap::Sync(unsigned long, unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"MMap::Sync()@APTPKG_5.0" 0.8.0 + (c++)"MMap::Close(bool)@APTPKG_5.0" 0.8.0 + (c++)"MMap::MMap(FileFd&, unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"MMap::MMap(unsigned long)@APTPKG_5.0" 0.8.0 + (c++)"MMap::~MMap()@APTPKG_5.0" 0.8.0 + (c++)"FileFd::Size()@APTPKG_5.0" 0.8.0 + (c++)"FileFd::Sync()@APTPKG_5.0" 0.8.0 + (c++)"FileFd::Tell()@APTPKG_5.0" 0.8.0 + (c++)"FileFd::Close()@APTPKG_5.0" 0.8.0 + (c++)"FileFd::~FileFd()@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::CompTypeDeb(unsigned char)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::DepIterator::GlobOr(pkgCache::DepIterator&, pkgCache::DepIterator&)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::DepIterator::operator++()@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::GrpIterator::operator++()@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::PkgIterator::operator++()@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::PkgFileIterator::IsOk()@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::PkgFileIterator::RelStr[abi:cxx11]()@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::ReMap(bool const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::Header::Header()@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::DepType(unsigned char)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::FindGrp(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::FindPkg(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::FindPkg(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::CompType(unsigned char)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::Priority(unsigned char)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::pkgCache(MMap*, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::~pkgCache()@APTPKG_5.0" 0.8.0 + (c++)"pkgCdrom::DropRepeats(std::vector, std::allocator >, std::allocator, std::allocator > > >&, char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgCdrom::FindPackages(std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::__cxx11::basic_string, std::allocator >&, pkgCdromStatus*, unsigned int)@APTPKG_5.0" 0.8.0 + (c++)"pkgCdrom::WriteDatabase(Configuration&)@APTPKG_5.0" 0.8.0 + (c++)"pkgCdrom::DropBinaryArch(std::vector, std::allocator >, std::allocator, std::allocator > > >&)@APTPKG_5.0" 0.8.0 + (c++)"pkgCdrom::WriteSourceList(std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgCdrom::ReduceSourcelist(std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&)@APTPKG_5.0" 0.8.0 + (c++)"pkgCdrom::Add(pkgCdromStatus*)@APTPKG_5.0" 0.8.0 + (c++)"pkgCdrom::Ident(std::__cxx11::basic_string, std::allocator >&, pkgCdromStatus*)@APTPKG_5.0" 0.8.0 + (c++)"pkgCdrom::Score(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"IndexCopy::CopyPackages(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, pkgCdromStatus*)@APTPKG_5.0" 0.8.0 + (c++)"IndexCopy::ReconstructChop(unsigned long&, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"IndexCopy::ReconstructPrefix(std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"IndexCopy::ConvertToSourceList(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&)@APTPKG_5.0" 0.8.0 + (c++)"IndexCopy::ChopDirs(std::__cxx11::basic_string, std::allocator >, unsigned int)@APTPKG_5.0" 0.8.0 + (c++)"IndexCopy::GrabFirst(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >&, unsigned int)@APTPKG_5.0" 0.8.0 + (c++)"SigVerify::CopyAndVerify(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::vector, std::allocator >, std::allocator, std::allocator > > >&, std::vector, std::allocator >, std::allocator, std::allocator > > >, std::vector, std::allocator >, std::allocator, std::allocator > > >)@APTPKG_5.0" 0.8.0 + (c++)"SigVerify::RunGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&, int*)@APTPKG_5.0" 0.8.0 + (c++)"debSystem::Initialize(Configuration&)@APTPKG_5.0" 0.8.0 + (c++)"debSystem::AddStatusFiles(std::vector >&)@APTPKG_5.0" 0.8.0 + (c++)"debSystem::ArchiveSupported(char const*)@APTPKG_5.0" 0.8.0 + (c++)"debSystem::Lock()@APTPKG_5.0" 0.8.0 + (c++)"debSystem::Score(Configuration const&)@APTPKG_5.0" 0.8.0 + (c++)"debSystem::UnLock(bool)@APTPKG_5.0" 0.8.0 + (c++)"debSystem::debSystem()@APTPKG_5.0" 0.8.0 + (c++)"debSystem::~debSystem()@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::SendV2Pkgs(_IO_FILE*)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::DoTerminalPty(int)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::WriteHistoryTag(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::WriteApportReport(char const*, char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::RunScriptsWithPkgs(char const*)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::Go(int)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::Reset()@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::Remove(pkgCache::PkgIterator, bool)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::DoStdin(int)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::Install(pkgCache::PkgIterator, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::OpenLog()@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::CloseLog()@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::Configure(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::pkgDPkgPM(pkgDepCache*)@APTPKG_5.0" 0.8.0 + (c++)"pkgDPkgPM::~pkgDPkgPM()@APTPKG_5.0" 0.8.0 + (c++)"pkgPolicy::GetPriority(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgPolicy::InitDefaults()@APTPKG_5.0" 0.8.0 + (c++)"pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgPolicy::PkgPin::~PkgPin()@APTPKG_5.0" 0.8.0 + (c++)"pkgPolicy::GetMatch(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgPolicy::CreatePin(pkgVersionMatch::MatchType, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, short)@APTPKG_5.0" 0.8.0 + (c++)"pkgPolicy::pkgPolicy(pkgCache*)@APTPKG_5.0" 0.8.0 + (c++)"pkgPolicy::~pkgPolicy()@APTPKG_5.0" 0.8.0 + (c++)"pkgSystem::GlobalList@APTPKG_5.0" 0.8.0 + (c++)"pkgSystem::Initialize(Configuration&)@APTPKG_5.0" 0.8.0 + (c++)"pkgSystem::GlobalListLen@APTPKG_5.0" 0.8.0 + (c++)"pkgSystem::Score(Configuration const&)@APTPKG_5.0" 0.8.0 + (c++)"pkgSystem::GetSystem(char const*)@APTPKG_5.0" 0.8.0 + (c++)"HashString::VerifyFile(std::__cxx11::basic_string, std::allocator >) const@APTPKG_5.0" 0.8.0 + (c++)"HashString::empty() const@APTPKG_5.0" 0.8.0 + (c++)"HashString::toStr[abi:cxx11]() const@APTPKG_5.0" 0.8.0 + (c++)"CommandLine::FileSize() const@APTPKG_5.0" 0.8.0 + (c++)"GlobalError::empty(GlobalError::MsgType const&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::FindInCache(pkgCache&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::CreateSrcParser() const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::MatchAgainstConfig::Match(char const*) const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Find[abi:cxx11](char const*, char const*) const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Item::FullTag[abi:cxx11](Configuration::Item const*) const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::FindB(char const*, bool const&) const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::FindI(char const*, int const&) const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::Exists(char const*) const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::FindAny[abi:cxx11](char const*, char const*) const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::FindDir[abi:cxx11](char const*, char const*) const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::FindFile[abi:cxx11](char const*, char const*) const@APTPKG_5.0" 0.8.0 + (c++)"Configuration::ExistsAny(char const*) const@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::GetIndexes(pkgAcquire*, bool) const@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::Type::FixupURI(std::__cxx11::basic_string, std::allocator >&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgSourceList::FindIndex(pkgCache::PkgFileIterator, pkgIndexFile*&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgTagSection::Find(char const*, char const*&, char const*&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgTagSection::Find(char const*, unsigned int&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgTagSection::FindI(char const*, long) const@APTPKG_5.0" 0.8.0 + (c++)"pkgTagSection::FindS[abi:cxx11](char const*) const@APTPKG_5.0" 0.8.0 + (c++)"pkgTagSection::FindULL(char const*, unsigned long long const&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgTagSection::FindFlag(char const*, unsigned long&, unsigned long) const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::DepIterator::AllTargets() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::DepIterator::IsCritical() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::DepIterator::SmartTargetPkg(pkgCache::PkgIterator&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::GrpIterator::FindPreferredPkg(bool const&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::GrpIterator::FindPkg(std::__cxx11::basic_string, std::allocator >) const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::GrpIterator::NextPkg(pkgCache::PkgIterator const&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::PkgIterator::CurVersion() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::PkgIterator::CandVersion() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::PkgIterator::State() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::VerIterator::CompareVer(pkgCache::VerIterator const&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::VerIterator::NewestFile() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::VerIterator::Downloadable() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::VerIterator::TranslatedDescription() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::VerIterator::RelStr[abi:cxx11]() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::VerIterator::Automatic() const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::sHash(char const*) const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::sHash(std::__cxx11::basic_string, std::allocator > const&) const@APTPKG_5.0" 0.8.0 + (c++)"pkgCache::Header::CheckSizes(pkgCache::Header&) const@APTPKG_5.0" 0.8.0 + (c++)"debSystem::CreatePM(pkgDepCache*) const@APTPKG_5.0" 0.8.0 + (c++)"debSystem::FindIndex(pkgCache::PkgFileIterator, pkgIndexFile*&) const@APTPKG_5.0" 0.8.0 + (c++)"metaIndex::GetURI[abi:cxx11]() const@APTPKG_5.0" 0.8.0 + (c++)"metaIndex::GetDist[abi:cxx11]() const@APTPKG_5.0" 0.8.0 + (c++)"metaIndex::GetType() const@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for OpProgress@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for SourceCopy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgAcqFile@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgAcquire@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for DynamicMMap@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for PackageCopy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgDepCache@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgSimulate@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgAcqMethod@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgCacheFile@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgIndexFile@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for WeakPointable@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgAcqArchive@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgTagSection@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for OpTextProgress@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgAcquireStatus@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgPackageManager@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for debVersioningSystem@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgUdevCdromDevices@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgVersioningSystem@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for MMap@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for FileFd@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgCache@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for IndexCopy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for debSystem@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for metaIndex@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgDPkgPM@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgPolicy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgSystem@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgAcquire::Item@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgRecords::Parser@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgDepCache::InRootSetFunc@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgDepCache::DefaultRootSetFunc@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgDepCache::Policy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgSimulate::Policy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgIndexFile::Type@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for Configuration::MatchAgainstConfig@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgSourceList::Type@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgSrcRecords::Parser@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for APT::CacheSetHelper@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgCache::Namespace@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for OpProgress@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for SourceCopy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgAcqFile@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgAcquire@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for DynamicMMap@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for PackageCopy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgDepCache@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgSimulate@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgAcqMethod@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgCacheFile@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgIndexFile@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for WeakPointable@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgAcqArchive@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgTagSection@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for OpTextProgress@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgAcquireStatus@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgPackageManager@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for debVersioningSystem@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgUdevCdromDevices@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgVersioningSystem@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for MMap@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for FileFd@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgCache@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for IndexCopy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for debSystem@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for metaIndex@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgDPkgPM@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgPolicy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgSystem@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgAcquire::Item@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgRecords::Parser@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgDepCache::InRootSetFunc@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgDepCache::DefaultRootSetFunc@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgDepCache::Policy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgSimulate::Policy@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgIndexFile::Type@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for Configuration::MatchAgainstConfig@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgSourceList::Type@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgSrcRecords::Parser@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for APT::CacheSetHelper@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgCache::Namespace@APTPKG_5.0" 0.8.0 + (c++)"vtable for OpProgress@APTPKG_5.0" 0.8.0 + (c++)"vtable for SourceCopy@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgAcqFile@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgAcquire@APTPKG_5.0" 0.8.0 + (c++)"vtable for DynamicMMap@APTPKG_5.0" 0.8.0 + (c++)"vtable for PackageCopy@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgDepCache@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgSimulate@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgAcqMethod@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgCacheFile@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgIndexFile@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgAcqArchive@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgTagSection@APTPKG_5.0" 0.8.0 + (c++)"vtable for OpTextProgress@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgAcquireStatus@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgPackageManager@APTPKG_5.0" 0.8.0 + (c++)"vtable for debVersioningSystem@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgUdevCdromDevices@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgVersioningSystem@APTPKG_5.0" 0.8.0 + (c++)"vtable for MMap@APTPKG_5.0" 0.8.0 + (c++)"vtable for FileFd@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgCache@APTPKG_5.0" 0.8.0 + (c++)"vtable for IndexCopy@APTPKG_5.0" 0.8.0 + (c++)"vtable for debSystem@APTPKG_5.0" 0.8.0 + (c++)"vtable for metaIndex@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgDPkgPM@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgPolicy@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgSystem@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgAcquire::Item@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgRecords::Parser@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgDepCache::InRootSetFunc@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgDepCache::DefaultRootSetFunc@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgDepCache::Policy@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgSimulate::Policy@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgIndexFile::Type@APTPKG_5.0" 0.8.0 + (c++)"vtable for Configuration::MatchAgainstConfig@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgSourceList::Type@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgSrcRecords::Parser@APTPKG_5.0" 0.8.0 + (c++)"vtable for APT::CacheSetHelper@APTPKG_5.0" 0.8.0 + (c++)"non-virtual thunk to pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc()@APTPKG_5.0" 0.8.0 + (c++)"operator<<(std::basic_ostream >&, pkgCache::DepIterator)@APTPKG_5.0" 0.8.0 + (c++)"operator<<(std::basic_ostream >&, pkgCache::PkgIterator)@APTPKG_5.0" 0.8.0 + _config@APTPKG_5.0 0.8.0 + _system@APTPKG_5.0 0.8.0 + debSys@APTPKG_5.0 0.8.0 + debVS@APTPKG_5.0 0.8.0 + pkgLibVersion@APTPKG_5.0 0.8.0 + pkgVersion@APTPKG_5.0 0.8.0 + (c++)"pkgAcquireStatus::~pkgAcquireStatus()@APTPKG_5.0" 0.8.0 + (c++)"IndexCopy::~IndexCopy()@APTPKG_5.0" 0.8.0 + (c++)"pkgIndexFile::Type::~Type()@APTPKG_5.0" 0.8.0 + (c++)"pkgArchiveCleaner::~pkgArchiveCleaner()@APTPKG_5.0" 0.8.0 + (c++)"typeinfo for pkgArchiveCleaner@APTPKG_5.0" 0.8.0 + (c++)"typeinfo name for pkgArchiveCleaner@APTPKG_5.0" 0.8.0 + (c++)"vtable for pkgArchiveCleaner@APTPKG_5.0" 0.8.0 +### architecture specific: va_list + (arch=armel armhf|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, std::__va_list&) const@APTPKG_5.0" 0.8.15~exp1 + (arch=i386 hurd-i386 kfreebsd-i386 ppc64|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, char*&) const@APTPKG_5.0" 0.8.15~exp1 + (arch=hppa ia64 mips mipsel sparc sparc64|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, void*&) const@APTPKG_5.0" 0.8.15~exp1 + (arch=amd64 kfreebsd-amd64 powerpc powerpcspe s390 s390x x32|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __va_list_tag (&) [1]) const@APTPKG_5.0" 0.8.15~exp1 + (arch=sh4|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __builtin_va_list&) const@APTPKG_5.0" 0.8.15~exp1 + (arch=alpha|c++)"pkgAcqMethod::PrintStatus(char const*, char const*, __va_list_tag&) const@APTPKG_5.0" 0.8.15~exp1 +### architecture specific: va_list & size_t + (arch=i386 hurd-i386 kfreebsd-i386|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, char*&, unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=armel armhf|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, std::__va_list&, unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=alpha|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag&, unsigned long&)@APTPKG_5.0" 0.8.11.4 + (arch=powerpc powerpcspe x32|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=amd64 kfreebsd-amd64 s390 s390x|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __va_list_tag (&) [1], unsigned long&)@APTPKG_5.0" 0.8.11.4 + (arch=hppa mips mipsel sparc|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=ia64 sparc64|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, void*&, unsigned long&)@APTPKG_5.0" 0.8.11.4 + (arch=sh4|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, __builtin_va_list&, unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=ppc64|c++)"GlobalError::Insert(GlobalError::MsgType, char const*, char*&, unsigned long&)@APTPKG_5.0" 0.8.11.4 + (arch=i386 hurd-i386 kfreebsd-i386|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=armel armhf|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, std::__va_list&, int, unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=alpha|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag&, int, unsigned long&)@APTPKG_5.0" 0.8.11.4 + (arch=powerpc powerpcspe x32|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=amd64 kfreebsd-amd64 s390 s390x|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __va_list_tag (&) [1], int, unsigned long&)@APTPKG_5.0" 0.8.11.4 + (arch=hppa mips mipsel sparc|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=ia64 sparc64|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, void*&, int, unsigned long&)@APTPKG_5.0" 0.8.11.4 1 + (arch=sh4|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, __builtin_va_list&, int, unsigned int&)@APTPKG_5.0" 0.8.11.4 + (arch=ppc64|c++)"GlobalError::InsertErrno(GlobalError::MsgType, char const*, char const*, char*&, int, unsigned long&)@APTPKG_5.0" 0.8.11.4 +### architecture specific: size_t + (arch=i386 armel armhf hppa hurd-i386 kfreebsd-i386 mips mipsel powerpc powerpcspe sh4 sparc x32|c++)"_strtabexpand(char*, unsigned int)@APTPKG_5.0" 0.8.0 + (arch=alpha amd64 ia64 kfreebsd-amd64 s390 s390x sparc64 ppc64|c++)"_strtabexpand(char*, unsigned long)@APTPKG_5.0" 0.8.0 +### architecture specific: time_t + (arch=!x32|c++)"TimeRFC1123[abi:cxx11](long)@APTPKG_5.0" 0.8.0 + (arch=x32|c++)"TimeRFC1123(long long)@APTPKG_5.0" 0.8.0 + (arch=!x32|c++)"FTPMDTMStrToTime(char const*, long&)@APTPKG_5.0" 0.8.0 + (arch=x32|c++)"FTPMDTMStrToTime(char const*, long long&)@APTPKG_5.0" 0.8.0 + (arch=!x32|c++)"StrToTime(std::__cxx11::basic_string, std::allocator > const&, long&)@APTPKG_5.0" 0.8.0 + (arch=x32|c++)"StrToTime(std::__cxx11::basic_string, std::allocator > const&, long long&)@APTPKG_5.0" 0.8.0 + (arch=!x32|c++)"RFC1123StrToTime(char const*, long&)@APTPKG_5.0" 0.8.0 + (arch=x32|c++)"RFC1123StrToTime(char const*, long long&)@APTPKG_5.0" 0.8.0 +### + (c++)"CreateAPTDirectoryIfNeeded(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.2 + (c++)"FileFd::FileSize()@APTPKG_5.0" 0.8.8 + (c++)"Base256ToNum(char const*, unsigned long&, unsigned int)@APTPKG_5.0" 0.8.11 + (c++)"pkgDepCache::SetCandidateRelease(pkgCache::VerIterator, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::list, std::allocator > >&)@APTPKG_5.0" 0.8.11 + (c++)"pkgDepCache::SetCandidateRelease(pkgCache::VerIterator, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.11 + (c++)"RealFileExists(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.11 + (c++)"StripEpoch(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.11 + (c++)"pkgTagSection::FindFlag(unsigned long&, unsigned long, char const*, char const*)@APTPKG_5.0" 0.8.11 + (c++)"FindMountPointForDevice[abi:cxx11](char const*)@APTPKG_5.0" 0.8.12 + (c++)"pkgUdevCdromDevices::ScanForRemovable(bool)@APTPKG_5.0" 0.8.12 + (c++)"APT::Configuration::Compressor::Compressor(char const*, char const*, char const*, char const*, char const*, unsigned short)@APTPKG_5.0" 0.8.12 + (c++)"APT::Configuration::Compressor::~Compressor()@APTPKG_5.0" 0.8.12 + (c++)"APT::Configuration::getCompressors(bool)@APTPKG_5.0" 0.8.12 + (c++)"APT::Configuration::getCompressorExtensions[abi:cxx11]()@APTPKG_5.0" 0.8.12 + (c++)"pkgCache::DepIterator::IsNegative() const@APTPKG_5.0" 0.8.15~exp1 + (c++)"Configuration::CndSet(char const*, int)@APTPKG_5.0" 0.8.15.3 + (c++)"pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator)@APTPKG_5.0" 0.8.15.3 + (c++)"DeEscapeString(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.15.4 + (c++)"GetModificationTime(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.15.6 + (c++)"pkgSourceList::GetLastModifiedTime()@APTPKG_5.0" 0.8.15.6 + (c++)"pkgCacheFile::RemoveCaches()@APTPKG_5.0" 0.8.15.7 + (c++)"pkgOrderList::VisitNode(pkgCache::PkgIterator, char const*)@APTPKG_5.0" 0.8.15.7 +### external dependency resolver ### + (c++)"EDSP::WriteError(char const*, std::__cxx11::basic_string, std::allocator > const&, _IO_FILE*)@APTPKG_5.0" 0.8.16~exp2 + (c++)"EDSP::ReadRequest(int, std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > >&, std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > >&, bool&, bool&, bool&)@APTPKG_5.0" 0.8.16~exp2 + (c++)"EDSP::ApplyRequest(std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > > const&, std::__cxx11::list, std::allocator >, std::allocator, std::allocator > > > const&, pkgDepCache&)@APTPKG_5.0" 0.8.16~exp2 + (c++)"EDSP::ReadResponse(int, pkgDepCache&, OpProgress*)@APTPKG_5.0" 0.8.16~exp2 + (c++)"EDSP::WriteRequest(pkgDepCache&, _IO_FILE*, bool, bool, bool, OpProgress*)@APTPKG_5.0" 0.8.16~exp2 + (c++)"EDSP::ExecuteSolver(char const*, int*, int*)@APTPKG_5.0" 0.8.16~exp2 + (c++)"EDSP::WriteProgress(unsigned short, char const*, _IO_FILE*)@APTPKG_5.0" 0.8.16~exp2 + (c++)"EDSP::WriteScenario(pkgDepCache&, _IO_FILE*, OpProgress*)@APTPKG_5.0" 0.8.16~exp2 + (c++)"EDSP::WriteSolution(pkgDepCache&, _IO_FILE*)@APTPKG_5.0" 0.8.16~exp2 + (c++)"EDSP::ResolveExternal(char const*, pkgDepCache&, bool, bool, bool, OpProgress*)@APTPKG_5.0" 0.8.16~exp2 + (c++)"pkgDepCache::Policy::GetPriority(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgDepCache::Policy::GetPriority(pkgCache::PkgFileIterator const&)@APTPKG_5.0" 0.8.16~exp6 +### generalisation of checksums (with lfs) -- mostly api-compatible available (without sha512 in previous versions) + (c++)"AddCRC16(unsigned short, void const*, unsigned long long)@APTPKG_5.0" 0.8.16~exp2 + (c++)"MD5Summation::Add(unsigned char const*, unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"MD5Summation::Result()@APTPKG_5.0" 0.8.16~exp2 + (c++)"MD5Summation::MD5Summation()@APTPKG_5.0" 0.8.16~exp2 + (c++)"SHA1Summation::SHA1Summation()@APTPKG_5.0" 0.8.16~exp2 + (c++)"SHA1Summation::Add(unsigned char const*, unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"SHA1Summation::Result()@APTPKG_5.0" 0.8.16~exp2 + (c++)"SHA256Summation::Add(unsigned char const*, unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"SHA512Summation::Add(unsigned char const*, unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"SummationImplementation::AddFD(int, unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for MD5Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for SHA1Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for SHA256Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for SHA512Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for SHA2SummationBase@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for SummationImplementation@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for MD5Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for SHA1Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for SHA256Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for SHA512Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for SHA2SummationBase@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for SummationImplementation@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for MD5Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for SHA1Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for SHA256Summation@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for SHA512Summation@APTPKG_5.0" 0.8.16~exp6 +### large file support - available in older api-compatible versions without lfs ### + (c++)"StrToNum(char const*, unsigned long long&, unsigned int, unsigned int)@APTPKG_5.0" 0.8.16~exp6 + (c++)"OpProgress::SubProgress(unsigned long long, std::__cxx11::basic_string, std::allocator > const&, float)@APTPKG_5.0" 0.8.16~exp6 + (c++)"OpProgress::OverallProgress(unsigned long long, unsigned long long, unsigned long long, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.16~exp6 + (c++)"OpProgress::Progress(unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"SourceCopy::GetFile(std::__cxx11::basic_string, std::allocator >&, unsigned long long&)@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgAcquire::UriIterator::~UriIterator()@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgAcquire::MethodConfig::~MethodConfig()@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgRecords::Parser::RecordField[abi:cxx11](char const*)@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgTagFile::Jump(pkgTagSection&, unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgTagFile::Offset()@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgTagFile::pkgTagFile(FileFd*, unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"DynamicMMap::RawAllocate(unsigned long long, unsigned long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"PackageCopy::GetFile(std::__cxx11::basic_string, std::allocator >&, unsigned long long&)@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgTagSection::~pkgTagSection()@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgAcquireStatus::Fetched(unsigned long long, unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"FileFd::Read(void*, unsigned long long, unsigned long long*)@APTPKG_5.0" 0.8.16~exp6 + (c++)"FileFd::Seek(unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"FileFd::Skip(unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"FileFd::Write(void const*, unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"FileFd::Truncate(unsigned long long)@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgPolicy::GetPriority(pkgCache::PkgFileIterator const&)@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for pkgTagFile@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for pkgSrcRecords@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for pkgAcquire::UriIterator@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for pkgAcquire::MethodConfig@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for pkgAcquire::Queue@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo for pkgAcquire::Worker@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for pkgTagFile@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for pkgSrcRecords@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for pkgAcquire::UriIterator@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for pkgAcquire::MethodConfig@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for pkgAcquire::Queue@APTPKG_5.0" 0.8.16~exp6 + (c++)"typeinfo name for pkgAcquire::Worker@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for pkgTagFile@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for pkgSrcRecords@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for pkgAcquire::UriIterator@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for pkgAcquire::MethodConfig@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for pkgAcquire::Queue@APTPKG_5.0" 0.8.16~exp6 + (c++)"vtable for pkgAcquire::Worker@APTPKG_5.0" 0.8.16~exp6 +### remove deprecated parameter + (c++)"pkgDepCache::SetCandidateVersion(pkgCache::VerIterator)@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgDepCache::AddSizes(pkgCache::PkgIterator const&, bool)@APTPKG_5.0" 0.8.16~exp6 + (c++)"pkgDepCache::AddStates(pkgCache::PkgIterator const&, bool)@APTPKG_5.0" 0.8.16~exp6 +### used internally by public interfaces - if you use them directly, you can keep the pieces + (c++|optional=internal|regex)"^SHA256_.*@APTPKG_5.0$" 0.8.16~exp2 + (c++|optional=internal|regex)"^SHA384_.*@APTPKG_5.0$" 0.8.16~exp2 + (c++|optional=internal|regex)"^SHA512_.*@APTPKG_5.0$" 0.8.16~exp2 +### orderlist rework: the touched methods are protected + (c++)"SigINT(int)@APTPKG_5.0" 0.8.16~exp14 + (c++)"pkgPackageManager::SigINTStop@APTPKG_5.0" 0.8.16~exp14 + (c++)"pkgPackageManager::SmartUnPack(pkgCache::PkgIterator, bool, int)@APTPKG_5.0" 0.8.16~exp14 + (c++)"pkgPackageManager::SmartConfigure(pkgCache::PkgIterator, int)@APTPKG_5.0" 0.8.16~exp14 +### FileFd rework: supporting different on-the-fly (de)compressing needs more parameter (abi), but the api is stable + (c++)"FileFd::OpenDescriptor(int, unsigned int, FileFd::CompressMode, bool)@APTPKG_5.0" 0.8.16~exp9 + (c++)"FileFd::OpenDescriptor(int, unsigned int, APT::Configuration::Compressor const&, bool)@APTPKG_5.0" 0.8.16~exp9 + (c++)"FileFd::ModificationTime()@APTPKG_5.0" 0.8.16~exp9 + (c++)"FileFd::Open(std::__cxx11::basic_string, std::allocator >, unsigned int, FileFd::CompressMode, unsigned long)@APTPKG_5.0" 0.8.16~exp9 + (c++)"FileFd::Open(std::__cxx11::basic_string, std::allocator >, unsigned int, APT::Configuration::Compressor const&, unsigned long)@APTPKG_5.0" 0.8.16~exp9 + (c++)"FileFd::ReadLine(char*, unsigned long long)@APTPKG_5.0" 0.8.16~exp9 + (c++)"SummationImplementation::AddFD(FileFd&, unsigned long long)@APTPKG_5.0" 0.8.16~exp9 + (c++|optional=deprecated,previous-inline)"FileFd::gzFd()@APTPKG_5.0" 0.8.0 +### CacheSet rework: making them real containers breaks bigtime the API (for the CacheSetHelper) + (c++)"APT::PackageContainer, std::allocator > >::empty() const@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::PackageContainer > >::empty() const@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::VersionContainer > >::empty() const@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::canNotFindTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::canNotFindRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::canNotFindAllVer(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::canNotFindPackage(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::showTaskSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::showRegExSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const&, pkgCache::VerIterator, std::__cxx11::basic_string, std::allocator > const&, bool)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::canNotFindCandInstVer(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::CacheSetHelper::canNotFindInstCandVer(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::PackageContainer, std::allocator > >::clear()@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::PackageContainer, std::allocator > >::insert(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::PackageContainer > >::clear()@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::PackageContainer > >::insert(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::VersionContainer > >::clear()@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::VersionContainer > >::insert(pkgCache::VerIterator const&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::VersionContainerInterface::getCandidateVer(pkgCacheFile&, pkgCache::PkgIterator const&, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::VersionContainerInterface::getInstalledVer(pkgCacheFile&, pkgCache::PkgIterator const&, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"APT::VersionContainerInterface::FromModifierCommandLine(unsigned short&, APT::VersionContainerInterface*, pkgCacheFile&, char const*, std::__cxx11::list > const&, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 + (c++)"EDSP::WriteLimitedScenario(pkgDepCache&, _IO_FILE*, APT::PackageContainer, std::allocator > > const&, OpProgress*)@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo for APT::PackageContainer, std::allocator > >@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo for APT::PackageContainer > >@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo for APT::VersionContainer > >@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo for APT::PackageContainerInterface@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo for APT::VersionContainerInterface@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo name for APT::PackageContainer, std::allocator > >@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo name for APT::PackageContainer > >@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo name for APT::VersionContainer > >@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo name for APT::PackageContainerInterface@APTPKG_5.0" 0.8.16~exp9 + (c++)"typeinfo name for APT::VersionContainerInterface@APTPKG_5.0" 0.8.16~exp9 + (c++)"vtable for APT::PackageContainer, std::allocator > >@APTPKG_5.0" 0.8.16~exp9 + (c++)"vtable for APT::PackageContainer > >@APTPKG_5.0" 0.8.16~exp9 + (c++)"vtable for APT::VersionContainer > >@APTPKG_5.0" 0.8.16~exp9 + (c++)"vtable for APT::PackageContainerInterface@APTPKG_5.0" 0.8.16~exp9 + (c++)"vtable for APT::VersionContainerInterface@APTPKG_5.0" 0.8.16~exp9 +### rework of the packagemanager rework + (c++)"APT::Progress::PackageManager::ConffilePrompt(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::Error(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerFancy::HandleSIGWINCH(int)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerFancy::~PackageManagerFancy()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerFancy::PackageManagerFancy()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerFancy::SetupTerminalScrollArea(int)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerFancy::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerFancy::Stop()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::fork()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::GetPulseInterval()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::~PackageManager()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::ConffilePrompt(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::Error(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::~PackageManagerProgressDeb822Fd()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::PackageManagerProgressDeb822Fd(int)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::StartDpkg()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::Stop()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressDeb822Fd::WriteToStatusFd(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFactory()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::ConffilePrompt(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::Error(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::~PackageManagerProgressFd()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::PackageManagerProgressFd(int)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::StartDpkg()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::Stop()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerProgressFd::WriteToStatusFd(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::Pulse()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::StartDpkg()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManager::Stop()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerText::~PackageManagerText()@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerText::StatusChanged(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned int, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::String::Strip(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.9.13~exp1 + (c++)"pkgDPkgPM::BuildPackagesProgressMap()@APTPKG_5.0" 0.9.13~exp1 + (c++)"pkgDPkgPM::DoDpkgStatusFd(int)@APTPKG_5.0" 0.9.13~exp1 + (c++)"pkgDPkgPM::ProcessDpkgStatusLine(char*)@APTPKG_5.0" 0.9.13~exp1 + (c++)"pkgDPkgPM::StartPtyMagic()@APTPKG_5.0" 0.9.13~exp1 + (c++)"pkgDPkgPM::StopPtyMagic()@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo for APT::Progress::PackageManager@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo for APT::Progress::PackageManagerFancy@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo for APT::Progress::PackageManagerProgressDeb822Fd@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo for APT::Progress::PackageManagerProgressFd@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo for APT::Progress::PackageManagerText@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo name for APT::Progress::PackageManager@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo name for APT::Progress::PackageManagerFancy@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo name for APT::Progress::PackageManagerProgressDeb822Fd@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo name for APT::Progress::PackageManagerProgressFd@APTPKG_5.0" 0.9.13~exp1 + (c++)"typeinfo name for APT::Progress::PackageManagerText@APTPKG_5.0" 0.9.13~exp1 + (c++)"vtable for APT::Progress::PackageManager@APTPKG_5.0" 0.9.13~exp1 + (c++)"vtable for APT::Progress::PackageManagerFancy@APTPKG_5.0" 0.9.13~exp1 + (c++)"vtable for APT::Progress::PackageManagerProgressDeb822Fd@APTPKG_5.0" 0.9.13~exp1 + (c++)"vtable for APT::Progress::PackageManagerProgressFd@APTPKG_5.0" 0.9.13~exp1 + (c++)"vtable for APT::Progress::PackageManagerText@APTPKG_5.0" 0.9.13~exp1 + (c++)"APT::Progress::PackageManagerFancy::instances@APTPKG_5.0" 0.9.14.2 + (c++)"APT::Progress::PackageManagerFancy::Start(int)@APTPKG_5.0" 0.9.14.2 + (c++)"APT::Progress::PackageManager::Start(int)@APTPKG_5.0" 0.9.14.2 +### install foo.deb support + (c++)"flAbsPath(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 1.1~exp1 + (c++)"metaIndex::~metaIndex()@APTPKG_5.0" 1.1~exp1 +### CacheFilter functors + (c++)"APT::CacheFilter::ANDMatcher::AND(APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher(APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::ANDMatcher()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::~ANDMatcher()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::operator()(pkgCache::GrpIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::operator()(pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ANDMatcher::operator()(pkgCache::VerIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::FalseMatcher::~FalseMatcher()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::FalseMatcher::operator()(pkgCache::GrpIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::FalseMatcher::operator()(pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::FalseMatcher::operator()(pkgCache::VerIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::Matcher::~Matcher()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::NOTMatcher::NOTMatcher(APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::NOTMatcher::~NOTMatcher()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::NOTMatcher::operator()(pkgCache::GrpIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::NOTMatcher::operator()(pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::NOTMatcher::operator()(pkgCache::VerIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::operator()(pkgCache::GrpIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::operator()(pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::operator()(pkgCache::VerIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::OR(APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*, APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::ORMatcher(APT::CacheFilter::Matcher*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::~ORMatcher()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::ORMatcher::ORMatcher()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::PackageIsNewInstall::operator()(pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::PackageIsNewInstall::~PackageIsNewInstall()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::PackageIsNewInstall::PackageIsNewInstall(pkgCacheFile*)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::PackageMatcher::operator()(pkgCache::GrpIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::PackageMatcher::operator()(pkgCache::VerIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::PackageMatcher::~PackageMatcher()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::~PackageNameMatchesFnmatch()@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::PackageNameMatchesFnmatch(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::TrueMatcher::operator()(pkgCache::GrpIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::TrueMatcher::operator()(pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::TrueMatcher::operator()(pkgCache::VerIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheFilter::TrueMatcher::~TrueMatcher()@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::ANDMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::FalseMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::Matcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::NOTMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::ORMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::PackageArchitectureMatchesSpecification@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::PackageIsNewInstall@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::PackageMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::PackageNameMatchesFnmatch@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::PackageNameMatchesRegEx@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo for APT::CacheFilter::TrueMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::ANDMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::FalseMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::Matcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::NOTMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::ORMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::PackageArchitectureMatchesSpecification@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::PackageIsNewInstall@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::PackageMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::PackageNameMatchesFnmatch@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::PackageNameMatchesRegEx@APTPKG_5.0" 1.1~exp4 + (c++)"typeinfo name for APT::CacheFilter::TrueMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::ANDMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::FalseMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::Matcher@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::NOTMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::ORMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::PackageArchitectureMatchesSpecification@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::PackageIsNewInstall@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::PackageMatcher@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::PackageNameMatchesFnmatch@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::PackageNameMatchesRegEx@APTPKG_5.0" 1.1~exp4 + (c++)"vtable for APT::CacheFilter::TrueMatcher@APTPKG_5.0" 1.1~exp4 +### cacheset redesign (API, but not ABI compatible) +# (c++|optional=inline)"APT::PackageContainerInterface::FromCommandLine(APT::PackageContainerInterface*, pkgCacheFile&, char const**, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 +# (c++|optional=inline)"APT::PackageContainerInterface::FromModifierCommandLine(unsigned short&, APT::PackageContainerInterface*, pkgCacheFile&, char const*, std::__cxx11::list > const&, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 +# (c++|optional=inline)"APT::PackageContainerInterface::FromName(pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 +# (c++|optional=inline)"APT::PackageContainerInterface::FromTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 +# (c++|optional=inline)"APT::PackageContainerInterface::FromRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 +# (c++|optional=inline)"APT::VersionContainerInterface::FromString(APT::VersionContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&, bool)@APTPKG_5.0" 0.8.16~exp9 +# (c++|optional=inline)"APT::VersionContainerInterface::FromPackage(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 +# (c++|optional=inline)"APT::VersionContainerInterface::FromCommandLine(APT::VersionContainerInterface*, pkgCacheFile&, char const**, APT::VersionContainerInterface::Version const&, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 +# (c++)"APT::PackageContainerInterface::FromString(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&, APT::CacheSetHelper&)@APTPKG_5.0" 0.8.16~exp9 +# (c++)"APT::PackageContainerInterface::FromGroup(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@APTPKG_5.0" 0.9.7 +# (c++)"APT::PackageContainerInterface::FromFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper&)@APTPKG_5.0" 0.9.11 + (c++)"APT::CacheSetHelper::canNotFindFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::canNotFindPackage(APT::CacheSetHelper::PkgSelector, APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::canNotFindVersion(APT::CacheSetHelper::VerSelector, APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::canNotGetCandInstVer(pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::canNotGetInstCandVer(pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::canNotGetVersion(APT::CacheSetHelper::VerSelector, pkgCacheFile&, pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFrom(APT::CacheSetHelper::PkgSelector, APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromCommandLine(APT::PackageContainerInterface*, pkgCacheFile&, char const**)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromFnmatch(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromModifierCommandLine(unsigned short&, APT::PackageContainerInterface*, pkgCacheFile&, char const*, std::__cxx11::list > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromName(pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromPackageName(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromRegEx(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromString(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::PackageFromTask(APT::PackageContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::showFnmatchSelection(pkgCache::PkgIterator const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::showPackageSelection(pkgCache::PkgIterator const&, APT::CacheSetHelper::PkgSelector, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::CacheSetHelper::showVersionSelection(pkgCache::PkgIterator const&, pkgCache::VerIterator const&, APT::CacheSetHelper::VerSelector, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::VersionContainerInterface::FromCommandLine(APT::VersionContainerInterface*, pkgCacheFile&, char const**, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::VersionContainerInterface::FromPackage(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::PkgIterator const&, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&)@APTPKG_5.0" 1.1~exp4 + (c++)"APT::VersionContainerInterface::FromString(APT::VersionContainerInterface*, pkgCacheFile&, std::__cxx11::basic_string, std::allocator >, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&, bool)@APTPKG_5.0" 1.1~exp4 +### all the hashes are belong to us +# (c++|optional=inline)"Hashes::AddFD(int, unsigned long long, bool, bool, bool, bool)@APTPKG_5.0" 0.8.16~exp6 +# (c++|optional=inline)"Hashes::AddFD(FileFd&, unsigned long long, bool, bool, bool, bool)@APTPKG_5.0" 0.8.16~exp9 +# (c++|optional=inline)"pkgRecords::Parser::MD5Hash()@APTPKG_5.0" 0.8.0 +# (c++|optional=inline)"pkgRecords::Parser::SHA1Hash()@APTPKG_5.0" 0.8.0 +# (c++|optional=inline)"pkgRecords::Parser::SHA256Hash()@APTPKG_5.0" 0.8.0 +# (c++|optional=inline)"pkgRecords::Parser::SHA512Hash()@APTPKG_5.0" 0.8.16~exp6 + (c++)"Hashes::AddFD(FileFd&, unsigned long long, unsigned int)@APTPKG_5.0" 1.1~exp1 + (c++)"Hashes::AddFD(int, unsigned long long, unsigned int)@APTPKG_5.0" 1.1~exp1 + (c++)"Hashes::Add(unsigned char const*, unsigned long long, unsigned int)@APTPKG_5.0" 1.1~exp1 + (c++)"Hashes::GetHashStringList()@APTPKG_5.0" 1.1~exp1 + (c++)"Hashes::Hashes()@APTPKG_5.0" 1.1~exp1 + (c++)"Hashes::~Hashes()@APTPKG_5.0" 1.1~exp1 + (c++)"HashStringList::find(char const*) const@APTPKG_5.0" 1.1~exp1 + (c++)"HashStringList::operator==(HashStringList const&) const@APTPKG_5.0" 1.1~exp1 + (c++)"HashStringList::operator!=(HashStringList const&) const@APTPKG_5.0" 1.1~exp1 + (c++)"HashStringList::push_back(HashString const&)@APTPKG_5.0" 1.1~exp1 + (c++)"HashStringList::supported(char const*)@APTPKG_5.0" 1.1~exp1 + (c++)"HashStringList::usable() const@APTPKG_5.0" 1.1~exp1 + (c++)"HashStringList::VerifyFile(std::__cxx11::basic_string, std::allocator >) const@APTPKG_5.0" 1.1~exp1 + (c++)"HashString::operator==(HashString const&) const@APTPKG_5.0" 1.1~exp1 + (c++)"HashString::operator!=(HashString const&) const@APTPKG_5.0" 1.1~exp1 + (c++)"pkgAcqArchive::IsTrusted() const@APTPKG_5.0" 1.1~exp1 + (c++)"pkgAcqFile::Custom600Headers[abi:cxx11]() const@APTPKG_5.0" 1.1~exp1 + (c++)"pkgAcqMethod::DropPrivsOrDie()@APTPKG_5.0" 1.1~exp1 + (c++)"pkgAcquire::Item::Custom600Headers[abi:cxx11]() const@APTPKG_5.0" 1.1~exp1 + (c++)"pkgAcquire::Item::IsTrusted() const@APTPKG_5.0" 1.1~exp1 + (c++)"pkgRecords::Parser::Hashes() const@APTPKG_5.0" 1.1~exp1 + (c++)"pkgRecords::Parser::LongDesc(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp1 + (c++)"pkgRecords::Parser::ShortDesc(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp1 + (c++)"typeinfo for Hashes@APTPKG_5.0" 1.1~exp1 + (c++)"typeinfo name for Hashes@APTPKG_5.0" 1.1~exp1 + (c++)"vtable for Hashes@APTPKG_5.0" 1.1~exp1 +### more transactional update + (c++)"pkgAcquire::GetLock(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"pkgAcquire::Item::Dequeue()@APTPKG_5.0" 1.1~exp4 + (c++)"pkgAcquire::Item::QueueURI(pkgAcquire::ItemDesc&)@APTPKG_5.0" 1.1~exp4 + (c++)"pkgAcquire::Item::SetActiveSubprocess(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"pkgAcquire::Setup(pkgAcquireStatus*, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp4 + (c++)"pkgArchiveCleaner::Erase(char const*, std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >, stat&)@APTPKG_5.0" 1.1~exp4 + (c++)"pkgDepCache::MarkAndSweep()@APTPKG_5.0" 1.1~exp4 + (c++)"pkgDepCache::MarkAndSweep(pkgDepCache::InRootSetFunc&)@APTPKG_5.0" 1.1~exp4 +### mixed stuff + (c++)"GetListOfFilesInDir(std::__cxx11::basic_string, std::allocator > const&, bool)@APTPKG_5.0" 0.8.16~exp13 + (c++)"pkgCache::DepIterator::IsIgnorable(pkgCache::PkgIterator const&) const@APTPKG_5.0" 0.8.16~exp10 + (c++)"pkgCache::DepIterator::IsIgnorable(pkgCache::PrvIterator const&) const@APTPKG_5.0" 0.8.16~exp10 + (c++)"FileFd::Write(int, void const*, unsigned long long)@APTPKG_5.0" 0.8.16~exp14 + (c++)"_strrstrip(char*)@APTPKG_5.0" 0.9.7.9~exp2 + (c++)"SplitClearSignedFile(std::__cxx11::basic_string, std::allocator > const&, FileFd*, std::vector, std::allocator >, std::allocator, std::allocator > > >*, FileFd*)@APTPKG_5.0" 0.9.7.9~exp2 + (c++)"OpenMaybeClearSignedFile(std::__cxx11::basic_string, std::allocator > const&, FileFd&)@APTPKG_5.0" 0.9.7.9~exp2 + (c++)"SigVerify::RunGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&)@APTPKG_5.0" 0.9.7.9~exp2 + (c++)"Configuration::Dump(std::basic_ostream >&, char const*, char const*, bool)@APTPKG_5.0" 0.9.3 + (c++)"AcquireUpdate(pkgAcquire&, int, bool, bool)@APTPKG_5.0" 0.9.3 + (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::PackageArchitectureMatchesSpecification(std::__cxx11::basic_string, std::allocator > const&, bool)@APTPKG_5.0" 0.9.7 + (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::~PackageArchitectureMatchesSpecification()@APTPKG_5.0" 0.9.7 + (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::operator()(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.9.7 + (c++)"APT::CacheFilter::PackageArchitectureMatchesSpecification::operator()(char const* const&)@APTPKG_5.0" 0.9.7 + (c++)"APT::Configuration::checkLanguage(std::__cxx11::basic_string, std::allocator >, bool)@APTPKG_5.0" 0.9.7.5 + (c++)"pkgCdrom::DropTranslation(std::vector, std::allocator >, std::allocator, std::allocator > > >&)@APTPKG_5.0" 0.9.7.5 + (c++)"pkgCache::DepIterator::IsSatisfied(pkgCache::PrvIterator const&) const@APTPKG_5.0" 0.9.8 + (c++)"pkgCache::DepIterator::IsSatisfied(pkgCache::VerIterator const&) const@APTPKG_5.0" 0.9.8 + (c++)"operator<<(std::basic_ostream >&, GlobalError::Item)@APTPKG_5.0" 0.9.9 + (c++)"pkgDepCache::IsDeleteOkProtectInstallRequests(pkgCache::PkgIterator const&, bool, unsigned long, bool)@APTPKG_5.0" 0.9.9.1 + (c++)"pkgDepCache::IsInstallOkMultiArchSameVersionSynced(pkgCache::PkgIterator const&, bool, unsigned long, bool)@APTPKG_5.0" 0.9.9.1 + (c++)"pkgDPkgPM::SendPkgsInfo(_IO_FILE*, unsigned int const&)@APTPKG_5.0" 0.9.9.1 + (c++)"pkgCache::VerIterator::MultiArchType() const@APTPKG_5.0" 0.9.9.1 + (c++)"AutoDetectProxy(URI&)@APTPKG_5.0" 0.9.10 + (c++)"CommandLine::GetCommand(CommandLine::Dispatch const*, unsigned int, char const* const*)@APTPKG_5.0" 0.9.11 + (c++)"CommandLine::MakeArgs(char, char const*, char const*, unsigned long)@APTPKG_5.0" 0.9.11 + (c++)"Configuration::Clear()@APTPKG_5.0" 0.9.11 + (c++)"Glob(std::__cxx11::basic_string, std::allocator > const&, int)@APTPKG_5.0" 0.9.11 + (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::operator()(pkgCache::GrpIterator const&)@APTPKG_5.0" 0.9.11 + (c++)"APT::CacheFilter::PackageNameMatchesFnmatch::operator()(pkgCache::PkgIterator const&)@APTPKG_5.0" 0.9.11 + (c++)"pkgTagSection::pkgTagSection()@APTPKG_5.0" 0.9.11 + (c++)"strv_length(char const**)@APTPKG_5.0" 0.9.11 + (c++)"StringSplit(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, unsigned int)@APTPKG_5.0" 0.9.11.3 + (c++)"pkgAcquire::Item::RenameOnError(pkgAcquire::Item::RenameOnErrorState)@APTPKG_5.0" 0.9.12 + (c++)"APT::String::Endswith(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 0.9.13.1 + (c++)"ExecFork(std::set, std::allocator >)@APTPKG_5.0" 0.9.13.1 + (c++)"MergeKeepFdsFromConfiguration(std::set, std::allocator >&)@APTPKG_5.0" 0.9.13.1 + (c++)"HashString::FromFile(std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.13.1 + (c++)"HashString::GetHashForFile(std::__cxx11::basic_string, std::allocator >) const@APTPKG_5.0" 0.9.13.1 + (c++)"GetTempDir[abi:cxx11]()@APTPKG_5.0" 0.9.14.2 + (c++)"APT::Configuration::getBuildProfiles[abi:cxx11]()@APTPKG_5.0" 0.9.16 + (c++)"APT::Configuration::getBuildProfilesString[abi:cxx11]()@APTPKG_5.0" 0.9.16 + (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&)@APTPKG_5.0" 0.9.16 + (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&)@APTPKG_5.0" 0.9.16 + (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string, std::allocator >&, std::__cxx11::basic_string, std::allocator >&, unsigned int&, bool const&, bool const&, bool const&)@APTPKG_5.0" 0.9.16 + (c++)"Rename(std::__cxx11::basic_string, std::allocator >, std::__cxx11::basic_string, std::allocator >)@APTPKG_5.0" 0.9.16 + (c++)"pkgDepCache::IsInstallOkDependenciesSatisfiableByCandidates(pkgCache::PkgIterator const&, bool, unsigned long, bool)@APTPKG_5.0" 1.0 + (c++)"APT::Progress::PackageManagerFancy::GetTerminalSize()@APTPKG_5.0" 1.0 + (c++)"APT::Progress::PackageManagerFancy::GetTextProgressStr[abi:cxx11](float, int)@APTPKG_5.0" 1.0 + (c++)"pkgCdromStatus::GetOpProgress()@APTPKG_5.0" 1.0 + (c++)"pkgCdromStatus::SetTotal(int)@APTPKG_5.0" 1.0 + (c++)"EDSP::ExecuteSolver(char const*, int*, int*, bool)@APTPKG_5.0" 1.0.4 + (c++)"pkgPackageManager::EarlyRemove(pkgCache::PkgIterator, pkgCache::DepIterator const*)@APTPKG_5.0" 1.0.4 + (c++)"pkgSrcRecords::Step()@APTPKG_5.0" 1.0.4 + (c++)"pkgDPkgPM::SetupSlavePtyMagic()@APTPKG_5.0" 1.0.8 + (c++)"HashStringList::find(char const*) const@APTPKG_5.0" 1.0.9.4 + (c++)"HashStringList::operator==(HashStringList const&) const@APTPKG_5.0" 1.0.9.4 + (c++)"HashStringList::operator!=(HashStringList const&) const@APTPKG_5.0" 1.0.9.4 + (c++)"HashStringList::push_back(HashString const&)@APTPKG_5.0" 1.0.9.4 + (c++)"HashStringList::supported(char const*)@APTPKG_5.0" 1.0.9.4 + (c++)"HashStringList::VerifyFile(std::__cxx11::basic_string, std::allocator >) const@APTPKG_5.0" 1.0.9.4 + (c++)"HashString::operator==(HashString const&) const@APTPKG_5.0" 1.0.9.4 + (c++)"HashString::operator!=(HashString const&) const@APTPKG_5.0" 1.0.9.4 + (c++)"pkgSrcRecords::Parser::Files2(std::vector >&)@APTPKG_5.0" 1.0.9.4 + (c++)"APT::Progress::PackageManager::PackageManager()@APTPKG_5.0" 1.1~exp1 + (c++)"pkgDPkgPM::Go(APT::Progress::PackageManager*)@APTPKG_5.0" 1.1~exp1 + (c++)"pkgPackageManager::DoInstall(APT::Progress::PackageManager*)@APTPKG_5.0" 1.1~exp1 + (c++)"pkgPackageManager::DoInstallPostFork(APT::Progress::PackageManager*)@APTPKG_5.0" 1.1~exp1 + (c++)"pkgPackageManager::Go(APT::Progress::PackageManager*)@APTPKG_5.0" 1.1~exp1 + (c++)"pkgTagFile::Init(FileFd*, unsigned long long)@APTPKG_5.0" 1.1~exp1 + (c++)"pkgTagSection::Count() const@APTPKG_5.0" 1.1~exp1 + (c++)"pkgTagSection::Exists(char const*) const@APTPKG_5.0" 1.1~exp1 + (c++)"pkgTagSection::FindB(char const*, bool const&) const@APTPKG_5.0" 1.1~exp1 + (c++)"pkgTagSection::Scan(char const*, unsigned long, bool)@APTPKG_5.0" 1.1~exp1 + (c++)"StartsWithGPGClearTextSignature(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp1 + (c++)"Popen(char const**, FileFd&, int&, FileFd::OpenMode)@APTPKG_5.0" 1.1~exp1 + (c++)"APT::String::Startswith(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp2 + (c++)"APT::Upgrade::Upgrade(pkgDepCache&, int, OpProgress*)@APTPKG_5.0" 1.1~exp4 + (c++)"pkgProblemResolver::Resolve(bool, OpProgress*)@APTPKG_5.0" 1.1~exp4 + (c++)"pkgProblemResolver::ResolveByKeep(OpProgress*)@APTPKG_5.0" 1.1~exp4 + (c++)"DropPrivileges()@APTPKG_5.0" 1.1~exp4 + (c++)"FileFd::FileFd(std::__cxx11::basic_string, std::allocator >, unsigned int, unsigned long)@APTPKG_5.0" 1.1~exp4 + (c++)"metaIndex::metaIndex(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, char const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgTagSection::Get(char const*&, char const*&, unsigned int) const@APTPKG_5.0" 1.1~exp9 +### ABI 5 changed so much (+ abicxx11 transition) + (c++)"APT::CacheSetHelper::CacheSetHelper(bool, GlobalError::MsgType)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::Configuration::getArchitectures[abi:cxx11](bool const&)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::Configuration::getCompressionTypes[abi:cxx11](bool const&)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::Configuration::getLanguages[abi:cxx11](bool const&, bool const&, char const**)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageContainerInterface::operator=(APT::PackageContainerInterface const&)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageContainerInterface::PackageContainerInterface(APT::CacheSetHelper::PkgSelector)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageContainerInterface::~PackageContainerInterface()@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageContainerInterface::PackageContainerInterface()@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageContainer > >::~PackageContainer()@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageContainer > >::size() const@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageContainer, std::allocator > >::~PackageContainer()@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageContainer, std::allocator > >::size() const@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageUniverse::empty() const@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageUniverse::~PackageUniverse()@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageUniverse::PackageUniverse(pkgCache*)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageUniverse::PackageUniverse(pkgCacheFile*)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::PackageUniverse::size() const@APTPKG_5.0" 1.1~exp9 + (c++)"APT::Progress::PackageManagerText::PackageManagerText()@APTPKG_5.0" 1.1~exp9 + (c++)"APT::VersionContainerInterface::FromDependency(APT::VersionContainerInterface*, pkgCacheFile&, pkgCache::DepIterator const&, APT::CacheSetHelper::VerSelector, APT::CacheSetHelper&)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::VersionContainerInterface::operator=(APT::VersionContainerInterface const&)@APTPKG_5.0" 1.1~exp9 + (c++)"APT::VersionContainerInterface::~VersionContainerInterface()@APTPKG_5.0" 1.1~exp9 + (c++)"APT::VersionContainerInterface::VersionContainerInterface()@APTPKG_5.0" 1.1~exp9 + (c++)"APT::VersionContainer > >::size() const@APTPKG_5.0" 1.1~exp9 + (c++)"APT::VersionContainer > >::~VersionContainer()@APTPKG_5.0" 1.1~exp9 + (c++)"ChangeOwnerAndPermissionOfFile(char const*, char const*, char const*, char const*, unsigned int)@APTPKG_5.0" 1.1~exp9 + (c++)"CommandLine::CommandLine()@APTPKG_5.0" 1.1~exp9 + (c++)"Configuration::FindVector(char const*, std::__cxx11::basic_string, std::allocator > const&, bool) const@APTPKG_5.0" 1.1~exp9 + (c++)"debDebianSourceDirIndex::GetType() const@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::~debDebPkgFileIndex()@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::debDebPkgFileIndex(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::FindInCache(pkgCache&) const@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetArchitecture[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetComponent[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetContent(std::basic_ostream >&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetIndexFlags() const@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::GetType() const@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::HasPackages() const@APTPKG_5.0" 1.1~exp9 + (c++)"debDebPkgFileIndex::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"debDscFileIndex::CreateSrcParser() const@APTPKG_5.0" 1.1~exp9 + (c++)"debDscFileIndex::~debDscFileIndex()@APTPKG_5.0" 1.1~exp9 + (c++)"debDscFileIndex::debDscFileIndex(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"debDscFileIndex::GetType() const@APTPKG_5.0" 1.1~exp9 + (c++)"debDscFileIndex::HasPackages() const@APTPKG_5.0" 1.1~exp9 + (c++)"debPackagesIndex::ArchiveInfo[abi:cxx11](pkgCache::VerIterator const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"debPackagesIndex::~debPackagesIndex()@APTPKG_5.0" 1.1~exp9 + (c++)"debPackagesIndex::debPackagesIndex(IndexTarget const&, bool)@APTPKG_5.0" 1.1~exp9 + (c++)"debPackagesIndex::GetIndexFlags() const@APTPKG_5.0" 1.1~exp9 + (c++)"debPackagesIndex::GetType() const@APTPKG_5.0" 1.1~exp9 + (c++)"debPackagesIndex::HasPackages() const@APTPKG_5.0" 1.1~exp9 + (c++)"debSourcesIndex::CreateSrcParser() const@APTPKG_5.0" 1.1~exp9 + (c++)"debSourcesIndex::~debSourcesIndex()@APTPKG_5.0" 1.1~exp9 + (c++)"debSourcesIndex::debSourcesIndex(IndexTarget const&, bool)@APTPKG_5.0" 1.1~exp9 + (c++)"debSourcesIndex::GetIndexFlags() const@APTPKG_5.0" 1.1~exp9 + (c++)"debSourcesIndex::GetType() const@APTPKG_5.0" 1.1~exp9 + (c++)"debSourcesIndex::HasPackages() const@APTPKG_5.0" 1.1~exp9 + (c++)"debSourcesIndex::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"debSourcesIndex::SourceInfo[abi:cxx11](pkgSrcRecords::Parser const&, pkgSrcRecords::File const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"debStatusIndex::~debStatusIndex()@APTPKG_5.0" 1.1~exp9 + (c++)"debStatusIndex::debStatusIndex(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"debStatusIndex::Exists() const@APTPKG_5.0" 1.1~exp9 + (c++)"debStatusIndex::GetArchitecture[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"debStatusIndex::GetComponent[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"debStatusIndex::GetIndexFlags() const@APTPKG_5.0" 1.1~exp9 + (c++)"debStatusIndex::GetType() const@APTPKG_5.0" 1.1~exp9 + (c++)"debStatusIndex::HasPackages() const@APTPKG_5.0" 1.1~exp9 + (c++)"debTranslationsIndex::~debTranslationsIndex()@APTPKG_5.0" 1.1~exp9 + (c++)"debTranslationsIndex::debTranslationsIndex(IndexTarget const&)@APTPKG_5.0" 1.1~exp9 + (c++)"debTranslationsIndex::GetArchitecture[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"debTranslationsIndex::GetIndexFlags() const@APTPKG_5.0" 1.1~exp9 + (c++)"debTranslationsIndex::GetType() const@APTPKG_5.0" 1.1~exp9 + (c++)"debTranslationsIndex::HasPackages() const@APTPKG_5.0" 1.1~exp9 + (c++)"debTranslationsIndex::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"ExecGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&)@APTPKG_5.0" 1.1~exp9 + (c++)"ExecGPGV(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int const&, int*, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"FileFd::FileFd()@APTPKG_5.0" 1.1~exp9 + (c++)"FileFd::FileFd(int, bool)@APTPKG_5.0" 1.1~exp9 + (c++)"FileFd::FileFd(int, unsigned int, FileFd::CompressMode)@APTPKG_5.0" 1.1~exp9 + (c++)"FileFd::FileFd(std::__cxx11::basic_string, std::allocator >, unsigned int, FileFd::CompressMode, unsigned long)@APTPKG_5.0" 1.1~exp9 + (c++)"GetTempFile(std::__cxx11::basic_string, std::allocator > const&, bool, FileFd*)@APTPKG_5.0" 1.1~exp9 + (c++)"Hashes::AddFD(FileFd&, unsigned long long)@APTPKG_5.0" 1.1~exp9 + (c++)"Hashes::AddFD(int, unsigned long long)@APTPKG_5.0" 1.1~exp9 + (c++)"Hashes::Add(unsigned char const*, unsigned long long)@APTPKG_5.0" 1.1~exp9 + (c++)"Hashes::Hashes(HashStringList const&)@APTPKG_5.0" 1.1~exp9 + (c++)"Hashes::Hashes(unsigned int)@APTPKG_5.0" 1.1~exp9 + (c++)"HashStringList::FileSize() const@APTPKG_5.0" 1.1~exp9 + (c++)"HashStringList::FileSize(unsigned long long)@APTPKG_5.0" 1.1~exp9 + (c++)"IndexCopy::IndexCopy()@APTPKG_5.0" 1.1~exp9 + (c++)"IndexTarget::Format(std::__cxx11::basic_string, std::allocator >) const@APTPKG_5.0" 1.1~exp9 + (c++)"IndexTarget::~IndexTarget()@APTPKG_5.0" 1.1~exp9 + (c++)"IndexTarget::IndexTarget(IndexTarget const&)@APTPKG_5.0" 1.1~exp9 + (c++)"IndexTarget::IndexTarget(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool, bool, std::map, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"IndexTarget::Option[abi:cxx11](IndexTarget::OptionKeys) const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::CheckDist(std::__cxx11::basic_string, std::allocator > const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::Describe[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::Exists(std::__cxx11::basic_string, std::allocator > const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::FindInCache(pkgCache&, bool) const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::GetCodename[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::GetDate() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::GetExpectedDist[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::GetLoadedSuccessfully() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::GetSignedBy[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::GetSuite[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::GetSupportsAcquireByHash() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::GetTrusted() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::GetValidUntil() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::Lookup(std::__cxx11::basic_string, std::allocator > const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::MetaKeys[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"metaIndex::swapLoad(metaIndex*)@APTPKG_5.0" 1.1~exp9 + (c++)"PackageCopy::PackageCopy()@APTPKG_5.0" 1.1~exp9 + (c++)"PackageCopy::RewriteEntry(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqArchive::DescURI[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqArchive::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqArchive::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqArchive::GetExpectedHashes() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqArchive::GetFinalFilename[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqArchive::HashesRequired() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqArchive::ShortDesc[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::DescURI[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::GetExpectedHashes() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::HashesRequired() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::~pkgAcqChangelog()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::pkgAcqChangelog(pkgAcquire*, pkgCache::RlsFileIterator const&, char const*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::pkgAcqChangelog(pkgAcquire*, pkgCache::VerIterator const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::pkgAcqChangelog(pkgAcquire*, std::__cxx11::basic_string, std::allocator > const&, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::URI[abi:cxx11](pkgCache::RlsFileIterator const&, char const*, char const*, char const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::URI[abi:cxx11](pkgCache::VerIterator const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::URI(std::__cxx11::basic_string, std::allocator > const&, char const*, char const*, char const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqChangelog::URITemplate[abi:cxx11](pkgCache::RlsFileIterator const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqFile::DescURI[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqFile::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqFile::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqFile::GetExpectedHashes() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqFile::HashesRequired() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqFile::pkgAcqFile(pkgAcquire*, std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, unsigned long long, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, bool)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqMethod::FetchItem::FetchItem()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqMethod::FetchItem::~FetchItem()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqMethod::FetchResult::~FetchResult()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcqMethod::URIAcquire(std::__cxx11::basic_string, std::allocator > const&, pkgAcqMethod::FetchItem*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::Done(std::__cxx11::basic_string, std::allocator > const&, HashStringList const&, pkgAcquire::MethodConfig const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::Failed(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::GetFinalFilename[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::GetItemDesc()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::GetOwner() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::HashesRequired() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::HashSum[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::Item(pkgAcquire*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::Rename(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::ReportMirrorFailure(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::ShortDesc[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::Start(std::__cxx11::basic_string, std::allocator > const&, unsigned long long)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Item::VerifyDone(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire::MethodConfig const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Queue::QItem::Custom600Headers[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Queue::QItem::GetExpectedHashes() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Queue::QItem::GetMaximumSize() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Queue::QItem::SyncDestinationFiles() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::Queue::Queue(std::__cxx11::basic_string, std::allocator > const&, pkgAcquire*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgAcquire::UriIterator::UriIterator(pkgAcquire::Queue*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgArchiveCleaner::pkgArchiveCleaner()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgCache::DepIterator::IsImplicit() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgCacheFile::pkgCacheFile(pkgDepCache*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgCache::PkgIterator::FullName[abi:cxx11](bool const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgCache::RlsFileIterator::IsOk()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgCache::RlsFileIterator::RelStr[abi:cxx11]()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgCdrom::~pkgCdrom()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgCdrom::pkgCdrom()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgCdromStatus::~pkgCdromStatus()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgCdromStatus::pkgCdromStatus()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexFile::FindInCache(pkgCache&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexFile::~pkgDebianIndexFile()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexFile::pkgDebianIndexFile(bool)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::ArchiveURI(std::__cxx11::basic_string, std::allocator > const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::Describe[abi:cxx11](bool) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::Exists() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::GetProgressDescription[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::IndexFileName[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::~pkgDebianIndexRealFile()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::pkgDebianIndexRealFile(std::__cxx11::basic_string, std::allocator > const&, bool)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexRealFile::Size() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::ArchiveURI(std::__cxx11::basic_string, std::allocator > const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::Describe[abi:cxx11](bool) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::Exists() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::GetArchitecture[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::GetComponent[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::GetProgressDescription[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::IndexFileName[abi:cxx11]() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::OpenListFile(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::~pkgDebianIndexTargetFile()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::pkgDebianIndexTargetFile(IndexTarget const&, bool)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDebianIndexTargetFile::Size() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDepCache::CheckDep(pkgCache::DepIterator const&, int, pkgCache::PkgIterator&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDepCache::DependencyState(pkgCache::DepIterator const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDepCache::Policy::IsImportantDep(pkgCache::DepIterator const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDepCache::UpdateVerState(pkgCache::PkgIterator const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgDepCache::VersionState(pkgCache::DepIterator, unsigned char, unsigned char, unsigned char) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgIndexFile::ArchiveInfo[abi:cxx11](pkgCache::VerIterator const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgIndexFile::ArchiveURI(std::__cxx11::basic_string, std::allocator > const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgIndexFile::~pkgIndexFile()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgIndexFile::pkgIndexFile(bool)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgIndexFile::SourceInfo[abi:cxx11](pkgSrcRecords::Parser const&, pkgSrcRecords::File const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgIndexFile::Type::CreatePkgParser(pkgCache::PkgFileIterator const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgIndexFile::Type::CreateSrcPkgParser(std::__cxx11::basic_string, std::allocator > const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgRecords::Parser::~Parser()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgRecords::Parser::Parser()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSourceList::AddVolatileFile(pkgIndexFile*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSourceList::GetVolatileFiles() const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSourceList::ReadAppend(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSourceList::ReadSourceDir(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSourceList::Read(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSourceList::Type::ParseLine(std::vector >&, char const*, unsigned int, std::__cxx11::basic_string, std::allocator > const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSourceList::Type::ParseStanza(std::vector >&, pkgTagSection&, unsigned int, FileFd&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSourceList::Type::~Type()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSourceList::Type::Type(char const*, char const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSrcRecords::Parser::~Parser()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSrcRecords::Parser::Parser(pkgIndexFile const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSystem::~pkgSystem()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgSystem::pkgSystem(char const*, pkgVersioningSystem*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgTagSection::FindFlag(char const*, unsigned char&, unsigned char) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgTagSection::FindFlag(unsigned char&, unsigned char, char const*, char const*)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgTagSection::FindRawS[abi:cxx11](char const*) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgTagSection::Tag::Remove(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgTagSection::Tag::Rename(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgTagSection::Tag::Rewrite(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgTagSection::Tag::~Tag()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgTagSection::Write(FileFd&, char const* const*, std::vector > const&) const@APTPKG_5.0" 1.1~exp9 + (c++)"pkgUserTagSection::~pkgUserTagSection()@APTPKG_5.0" 1.1~exp9 + (c++)"pkgUserTagSection::TrimRecord(bool, char const*&)@APTPKG_5.0" 1.1~exp9 + (c++)"pkgVersioningSystem::~pkgVersioningSystem()@APTPKG_5.0" 1.1~exp9 + (c++)"SigVerify::~SigVerify()@APTPKG_5.0" 1.1~exp9 + (c++)"SigVerify::SigVerify()@APTPKG_5.0" 1.1~exp9 + (c++)"SourceCopy::RewriteEntry(FileFd&, std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"SourceCopy::SourceCopy()@APTPKG_5.0" 1.1~exp9 + (c++)"TranslationsCopy::~TranslationsCopy()@APTPKG_5.0" 1.1~exp9 + (c++)"TranslationsCopy::TranslationsCopy()@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for APT::PackageUniverse@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for debDebianSourceDirIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for debDebPkgFileIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for debDscFileIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for debPackagesIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for debSourcesIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for debStatusIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for debTranslationsIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgAcqChangelog@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgAcqMethod::FetchItem@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgAcqMethod::FetchResult@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgCdrom@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgCdromStatus@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgDebianIndexFile@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgDebianIndexRealFile@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgDebianIndexTargetFile@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgDepCache::ActionGroup@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgOrderList@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgProblemResolver@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgRecords@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgSourceList@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for pkgUserTagSection@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for SigVerify@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo for TranslationsCopy@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for APT::PackageUniverse@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for debDebianSourceDirIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for debDebPkgFileIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for debDscFileIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for debPackagesIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for debSourcesIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for debStatusIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for debTranslationsIndex@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgAcqChangelog@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgAcqMethod::FetchItem@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgAcqMethod::FetchResult@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgCdrom@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgCdromStatus@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgDebianIndexFile@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgDebianIndexRealFile@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgDebianIndexTargetFile@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgDepCache::ActionGroup@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgOrderList@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgProblemResolver@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgRecords@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgSourceList@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for pkgUserTagSection@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for SigVerify@APTPKG_5.0" 1.1~exp9 + (c++)"typeinfo name for TranslationsCopy@APTPKG_5.0" 1.1~exp9 + (c++)"URI::ArchiveOnly(std::__cxx11::basic_string, std::allocator > const&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector >::emplace_back(APT::Configuration::Compressor&&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector >::emplace_back(char const*&&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgCache::GrpIterator*&&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgCache::PkgIterator*&&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgCache::RlsFileIterator*&&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgCache::VerIterator*&&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgDPkgPM::Item&&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgIndexFile*&&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector >::emplace_back(pkgTagSection::Tag&&)@APTPKG_5.0" 1.1~exp9 + (c++)"void std::vector, std::allocator >, std::allocator, std::allocator > > >::emplace_back, std::allocator > >(std::__cxx11::basic_string, std::allocator >&&)@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for APT::PackageUniverse@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for debDebianSourceDirIndex@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for debDebPkgFileIndex@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for debDscFileIndex@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for debPackagesIndex@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for debSourcesIndex@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for debStatusIndex@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for debTranslationsIndex@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgAcqChangelog@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgAcqMethod::FetchItem@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgAcqMethod::FetchResult@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgCdrom@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgCdromStatus@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgDebianIndexFile@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgDebianIndexRealFile@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgDebianIndexTargetFile@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgDepCache::ActionGroup@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgOrderList@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgProblemResolver@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgRecords@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgSourceList@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for pkgUserTagSection@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for SigVerify@APTPKG_5.0" 1.1~exp9 + (c++)"vtable for TranslationsCopy@APTPKG_5.0" 1.1~exp9 +### symbol versioning: + APTPKG_5.0@APTPKG_5.0 1.1~exp9 +### try to ignore std:: template instances + (c++|regex|optional=std)"^std::vector<.+ >::(vector|push_back|erase|_[^ ]+)\(.+\)( const|)@APTPKG_5.0$" 0.8.0 + (c++|regex|optional=std)"^(void |)std::[^ ]+<.+ >::(_|~).+\(.*\)@APTPKG_5.0$" 0.8.0 + (c++|regex|optional=std)"^std::[^ ]+<.+ >::(append|insert|reserve|operator[^ ]+)\(.*\)@APTPKG_5.0$" 0.8.0 + (c++|regex|optional=std)"^(void |DiffInfo\* |)std::_.*@APTPKG_5.0$" 0.8.0 + (c++|regex|optional=std)"^__gnu_cxx::__[^ ]+<.*@APTPKG_5.0$" 0.8.0 + (c++|optional=std)"std::ctype::do_widen(char) const@APTPKG_5.0" 1.0.3 diff --git a/prepare-release b/prepare-release index 8a3743ad7..734dc5f32 100755 --- a/prepare-release +++ b/prepare-release @@ -15,13 +15,14 @@ LIBAPTINSTVERSION="$(egrep '^MAJOR=' apt-inst/makefile |cut -d '=' -f 2)" librarysymbolsfromfile() { local MISSING="$(grep '^+#MISSING' "$1")" + local SYMVER="$2" echo '=== Missing optional symbols:' echo -n "$MISSING" | grep '|optional=' || true echo '=== Missing required symbols:' echo -n "$MISSING" | grep -v '|optional=' || true echo '=== New symbols:' grep '^+ ' "$1" | cut -d' ' -f 2 | cut -d'@' -f 1 | c++filt | while read line; do - echo " (c++)\"${line}@Base\" $VERSION" + echo " (c++)\"${line}@${SYMVER}\" $VERSION" done | sort -u } @@ -109,7 +110,7 @@ elif [ "$1" = 'library' ]; then echo "Checking $1 in version $2" local tmpfile=$(mktemp) dpkg-gensymbols -p${1}${2} -ebuild/bin/${1}.so.${2} -Idebian/${1}${2}.symbols -O/dev/null 2> /dev/null > $tmpfile || true - librarysymbolsfromfile "$tmpfile" + librarysymbolsfromfile "$tmpfile" "$(echo "${1}" | cut -c 4- | tr -d '-' | tr 'a-z' 'A-Z')_${2}" rm -f $tmpfile } librarysymbols 'libapt-pkg' "${LIBAPTPKGVERSION}" @@ -117,7 +118,7 @@ elif [ "$1" = 'library' ]; then librarysymbols 'libapt-inst' "${LIBAPTINSTVERSION}" elif [ "$1" = 'buildlog' ]; then while [ -n "$2" ]; do - librarysymbolsfromfile "$2" + librarysymbolsfromfile "$2" 'UNKNOWN' shift done elif [ "$1" = 'travis-ci' ]; then -- cgit v1.2.3 From 22df31be37d56c07ed029f5a4d5041f21070d2d6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Aug 2015 11:31:28 +0200 Subject: no value for MultiArch field is 'no', not 'none' Git-Dch: Ignore --- apt-pkg/deb/deblistparser.cc | 6 +++--- apt-pkg/pkgcache.h | 2 +- cmdline/apt-get.cc | 4 ++-- test/integration/test-bug-632221-cross-dependency-satisfaction | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index a908057d7..489d0434e 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -95,14 +95,14 @@ unsigned char debListParser::ParseMultiArch(bool const showErrors) /*{{{*/ unsigned char MA; string const MultiArch = Section.FindS("Multi-Arch"); if (MultiArch.empty() == true || MultiArch == "no") - MA = pkgCache::Version::None; + MA = pkgCache::Version::No; else if (MultiArch == "same") { if (ArchitectureAll() == true) { if (showErrors == true) _error->Warning("Architecture: all package '%s' can't be Multi-Arch: same", Section.FindS("Package").c_str()); - MA = pkgCache::Version::None; + MA = pkgCache::Version::No; } else MA = pkgCache::Version::Same; @@ -116,7 +116,7 @@ unsigned char debListParser::ParseMultiArch(bool const showErrors) /*{{{*/ if (showErrors == true) _error->Warning("Unknown Multi-Arch type '%s' for package '%s'", MultiArch.c_str(), Section.FindS("Package").c_str()); - MA = pkgCache::Version::None; + MA = pkgCache::Version::No; } if (ArchitectureAll() == true) diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 8a726085e..62c734283 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -599,7 +599,7 @@ struct pkgCache::Version map_stringitem_t SourceVerStr; /** \brief Multi-Arch capabilities of a package version */ - enum VerMultiArch { None = 0, /*!< is the default and doesn't trigger special behaviour */ + enum VerMultiArch { No = 0, /*!< is the default and doesn't trigger special behaviour */ All = (1<<0), /*!< will cause that Ver.Arch() will report "all" */ Foreign = (1<<1), /*!< can satisfy dependencies in another architecture */ Same = (1<<2), /*!< can be co-installed with itself from other architectures */ diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index d515a0f4f..918942505 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1172,12 +1172,12 @@ static bool DoBuildDep(CommandLine &CmdL) for (; Ver != verlist.end(); ++Ver) { forbidden.clear(); - if (Ver->MultiArch == pkgCache::Version::None || Ver->MultiArch == pkgCache::Version::All) + if (Ver->MultiArch == pkgCache::Version::No || Ver->MultiArch == pkgCache::Version::All) { if (colon == string::npos) Pkg = Ver.ParentPkg().Group().FindPkg(hostArch); else if (strcmp(D->Package.c_str() + colon, ":any") == 0) - forbidden = "Multi-Arch: none"; + forbidden = "Multi-Arch: no"; else if (strcmp(D->Package.c_str() + colon, ":native") == 0) Pkg = Ver.ParentPkg().Group().FindPkg("native"); } diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index 12704e5de..6444c6110 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -23,7 +23,7 @@ insertpackage 'unstable' 'linux-stuff' 'amd64,armel' '1.0' insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [any-armel] | linux-stuff [ linux-any]' -insertsource 'unstable' 'forbidden-none' 'any' '1' 'Build-Depends: amdboot:any' +insertsource 'unstable' 'forbidden-no' 'any' '1' 'Build-Depends: amdboot:any' insertsource 'unstable' 'forbidden-same' 'any' '1' 'Build-Depends: libc6:any' insertsource 'unstable' 'forbidden-foreign' 'any' '1' 'Build-Depends: doxygen:any' @@ -37,7 +37,7 @@ setupaptarchive testfailureequal "Reading package lists... Building dependency tree... -E: Build-Depends dependency for forbidden-none can't be satisfied because amdboot:any is not allowed on 'Multi-Arch: none' packages" aptget build-dep forbidden-none -s -a armel +E: Build-Depends dependency for forbidden-no can't be satisfied because amdboot:any is not allowed on 'Multi-Arch: no' packages" aptget build-dep forbidden-no -s -a armel testfailureequal "Reading package lists... Building dependency tree... E: Build-Depends dependency for forbidden-same can't be satisfied because libc6:any is not allowed on 'Multi-Arch: same' packages" aptget build-dep forbidden-same -s -a armel -- cgit v1.2.3 From 7c2cc4a7bc999c8e07fba607354bfaa3b09118f9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Aug 2015 14:44:14 +0200 Subject: move APT::Never-MarkAuto-Sections handling to MarkDelete Having the handling in MarkInstall means that it just effects installation of the metapackage, but if the dependencies change the new dependencies aren't protected (and the old dependencies are still protected for no 'reason'). Having it in MarkDelete means that if a metapackage is sheduled for removal all its currently installed dependencies are marked as manual, which helps against both as in this case there is no new/old and additionally if a user decides the installation of a metapackage was wrong he can just remove it explicitely avoid the manual marking entirely. --- apt-pkg/depcache.cc | 44 +++++++++++++---- test/integration/framework | 11 +++++ test/integration/test-apt-never-markauto-sections | 60 ++++++++--------------- 3 files changed, 66 insertions(+), 49 deletions(-) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index e466cba28..99e694a06 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -836,6 +836,41 @@ bool pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge, ActionGroup group(*this); + if (FromUser == false) + { + VerIterator const PV = P.InstVerIter(*this); + if (PV.end() == false) + { + // removed metapackages mark their dependencies as manual to prevent in "desktop depends browser, texteditor" + // the removal of browser to suggest the removal of desktop and texteditor. + // We ignore the auto-bit here as we can't deal with metapackage cascardes otherwise. + // We do not check for or-groups here as we don't know which package takes care of + // providing the feature the user likes e.g.: browser1 | browser2 | browser3 + // Temporary removals are effected by this as well, which is bad, but unlikely in practice + bool const PinNeverMarkAutoSection = (PV->Section != 0 && ConfigValueInSubTree("APT::Never-MarkAuto-Sections", PV.Section())); + if (PinNeverMarkAutoSection) + { + for (DepIterator D = PV.DependsList(); D.end() != true; ++D) + { + if (D.IsMultiArchImplicit() == true || D.IsNegative() == true || IsImportantDep(D) == false) + continue; + + pkgCacheFile CacheFile(this); + APT::VersionList verlist = APT::VersionList::FromDependency(CacheFile, D, APT::CacheSetHelper::INSTALLED); + for (auto const &V : verlist) + { + PkgIterator const DP = V.ParentPkg(); + if(DebugAutoInstall == true) + std::clog << OutputInDepth(Depth) << "Setting " << DP.FullName(false) << " NOT as auto-installed (direct " + << D.DepType() << " of " << Pkg.FullName(false) << " which is in APT::Never-MarkAuto-Sections)" << std::endl; + + MarkAuto(DP, false); + } + } + } + } + } + if (DebugMarker == true) std::clog << OutputInDepth(Depth) << (rPurge ? "MarkPurge " : "MarkDelete ") << Pkg << " FU=" << FromUser << std::endl; @@ -1096,7 +1131,6 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, VerIterator const PV = P.InstVerIter(*this); if (unlikely(PV.end() == true)) return false; - bool const PinNeverMarkAutoSection = (PV->Section != 0 && ConfigValueInSubTree("APT::Never-MarkAuto-Sections", PV.Section())); DepIterator Dep = PV.DependsList(); for (; Dep.end() != true;) @@ -1210,14 +1244,6 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, verlist.erase(InstVer); continue; } - // now check if we should consider it a automatic dependency or not - if(InstPkg->CurrentVer == 0 && PinNeverMarkAutoSection) - { - if(DebugAutoInstall == true) - std::clog << OutputInDepth(Depth) << "Setting NOT as auto-installed (direct " - << Start.DepType() << " of pkg in APT::Never-MarkAuto-Sections)" << std::endl; - MarkAuto(InstPkg, false); - } break; } while(true); continue; diff --git a/test/integration/framework b/test/integration/framework index 2f08c5fdc..2efe7439e 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1324,6 +1324,17 @@ testmarkedauto() { fi aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail } +testmarkedmanual() { + local COMPAREFILE="${TMPWORKINGDIRECTORY}/rootdir/tmp/testmarkedmanual.comparefile" + if [ -n "$1" ]; then + msgtest 'Test for correctly marked as manually installed' "$*" + while [ -n "$1" ]; do echo "$1"; shift; done | sort > $COMPAREFILE + else + msgtest 'Test for correctly marked as manually installed' 'no package' + echo -n > $COMPAREFILE + fi + aptmark showmanual 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail +} msgfailoutput() { local MSG="$1" diff --git a/test/integration/test-apt-never-markauto-sections b/test/integration/test-apt-never-markauto-sections index 6c88c69fa..a469b4c15 100755 --- a/test/integration/test-apt-never-markauto-sections +++ b/test/integration/test-apt-never-markauto-sections @@ -9,22 +9,6 @@ configarchitecture 'amd64' 'i386' aptconfig dump --no-empty --format '%v%n' APT::Never-MarkAuto-Sections > nevermarkauto.sections testsuccess grep '^metapackages$' nevermarkauto.sections -# this is a very crude regression test, not a "this is how it should be" test: -# In theory mydesktop-core and texteditor should be marked as manual, but -# texteditor is installed as a dependency of bad-texteditor, not of -# mydesktop-core and mydesktop-core is removed while bad-texteditor is -# installed losing the manual bit as the problem resolver will later decide to -# drop bad-texteditor and re-instate mydesktop-core which is considered an -# auto-install at that point (in theory the never-auto handling should be -# copied to this place – as to the many other places dependencies are resolved -# 'by hand' instead of via MarkInstall AutoInst… -# -# Both could be fixed if apt would figure out early that installing -# bad-texteditor is a bad idea and eventually it should (as mydesktop-core is -# a direct descendant of mydesktop which was a user-request mydesktop-core should -# be as protected from removal as mydesktop is), but this is hard in the general case -# as with more or-groups and provides you can produce 'legal' examples for this. - buildsimplenativepackage 'mydesktop' 'all' '1' 'unstable' 'Depends: mydesktop-core, foreignpkg Recommends: notavailable' '' 'metapackages' buildsimplenativepackage 'mydesktop-core' 'amd64' '1' 'unstable' 'Depends: bad-texteditor | texteditor, browser (>= 42), nosection, foreignpkg @@ -45,21 +29,21 @@ testequal 'dpkg' aptmark showmanual testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -testequal 'browser -dpkg -foreignpkg:i386 -mydesktop -nosection' aptmark showmanual -testmarkedauto 'mydesktop-core' 'texteditor' +testmarkedmanual 'dpkg' 'mydesktop' +testmarkedauto 'mydesktop-core' 'foreignpkg:i386' 'texteditor' 'browser' 'nosection' +# if the remove is from a user, don't do manual-bit passing testequal 'Reading package lists... Building dependency tree... Reading state information... The following packages will be REMOVED: - mydesktop mydesktop-core texteditor -0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. + browser foreignpkg:i386 mydesktop mydesktop-core nosection texteditor +0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded. Remv mydesktop [1] Remv mydesktop-core [1] +Remv browser [42] +Remv foreignpkg:i386 [1] +Remv nosection [1] Remv texteditor [1]' aptget autoremove mydesktop -s testequal 'Reading package lists... @@ -70,37 +54,33 @@ The following packages will be REMOVED: 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. Remv mydesktop [1] Remv mydesktop-core [1] -Remv texteditor [1]' aptget autoremove texteditor -s +Remv texteditor [1]' aptget autoremove texteditor -s #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 testsuccess aptget autoremove texteditor -y testdpkgnotinstalled mydesktop mydesktop-core texteditor testdpkginstalled browser -testequal 'browser -dpkg -foreignpkg:i386 -nosection' aptmark showmanual +testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection' testmarkedauto # test that installed/upgraded auto-pkgs are not set to manual testsuccess aptget install browser=41 -y --force-yes -testequal 'browser -dpkg -foreignpkg:i386 -nosection' aptmark showmanual +testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection' testmarkedauto testsuccess aptmark auto browser testmarkedauto 'browser' testsuccess aptmark auto nosection testmarkedauto 'browser' 'nosection' -testequal 'dpkg -foreignpkg:i386' aptmark showmanual +testmarkedmanual 'dpkg' 'foreignpkg:i386' + +# nosection should be auto, not manual, but is marked as such by the resolver +# removing mydesktop-core temporally… the resolver should be figuring out here +# that there is no point of removing mydesktop-core as its an unavoidable +# dependency of the user-requested mydesktop -testsuccess aptget install mydesktop -y +testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 -testequal 'dpkg -foreignpkg:i386 -mydesktop' aptmark showmanual -testmarkedauto 'browser' 'nosection' 'mydesktop-core' 'texteditor' +testmarkedmanual 'dpkg' 'foreignpkg:i386' 'mydesktop' 'nosection' +testmarkedauto 'browser' 'mydesktop-core' 'texteditor' -- cgit v1.2.3 From 5f4495e342e94a75b17ceed2fa05d689f050df7b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Aug 2015 16:08:21 +0200 Subject: move manual-bit from 'oldlibs' pkg to its dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit oldlibs used to be in APT::Never-MarkAuto-Sections so that old transition packages can be removed without causing the then (autoinstalled) renamed package to be autoremoved. It isn't ideal through as ideally you want the oldlibs package to be removed after nothing depends on it anymore regardless of if you have once installed it by hand or not – and if you had the package talking over (the dependencies) should carry the manual bit now as they are the real deal now. As an added bonus if the package has no dependencies because it is an oldlibs without a direct replacement you should move away from (like lib1 and lib2 are currently in the archive, but there will hopefully only be lib2 in the release) you get a lib1 marked as auto. If the user still needs the oldlibs package for some reason all he has to do is mark it as manual once as this move is only performed if a installed package changes its section from a not-Move-Autobit-Sections to a Move-Autobit-Sections. --- apt-pkg/depcache.cc | 28 +++++++++++++++++++ debian/apt.conf.autoremove | 4 +++ .../test-apt-move-and-forget-manual-sections | 31 ++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100755 test/integration/test-apt-move-and-forget-manual-sections diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 99e694a06..02f61bf13 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1128,9 +1128,26 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, if (DebugMarker == true) std::clog << OutputInDepth(Depth) << "MarkInstall " << Pkg << " FU=" << FromUser << std::endl; + bool MoveAutoBitToDependencies = false; VerIterator const PV = P.InstVerIter(*this); if (unlikely(PV.end() == true)) return false; + else if (PV->Section != 0 && (P.Flags & Flag::Auto) != Flag::Auto) + { + VerIterator const CurVer = Pkg.CurrentVer(); + if (CurVer.end() == false && CurVer->Section != 0 && strcmp(CurVer.Section(), PV.Section()) != 0) + { + bool const CurVerInMoveSection = ConfigValueInSubTree("APT::Move-Autobit-Sections", CurVer.Section()); + bool const InstVerInMoveSection = ConfigValueInSubTree("APT::Move-Autobit-Sections", PV.Section()); + MoveAutoBitToDependencies = (CurVerInMoveSection == false && InstVerInMoveSection == true); + if (MoveAutoBitToDependencies == true) + { + if(DebugAutoInstall == true) + std::clog << OutputInDepth(Depth) << "Setting " << Pkg.FullName(false) << " as auto-installed, moving manual to its dependencies" << std::endl; + MarkAuto(Pkg, true); + } + } + } DepIterator Dep = PV.DependsList(); for (; Dep.end() != true;) @@ -1244,6 +1261,17 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, verlist.erase(InstVer); continue; } + + // now check if we should consider it a automatic dependency or not + if(InstPkg->CurrentVer == 0 && MoveAutoBitToDependencies) + { + if(DebugAutoInstall == true) + std::clog << OutputInDepth(Depth) << "Setting " << InstPkg.FullName(false) << " NOT as auto-installed (direct " + << Start.DepType() << " of " << Pkg.FullName(false) << " which is manual and in APT::Move-Autobit-Sections)" << std::endl; + MarkAuto(InstPkg, false); + } + + break; } while(true); continue; diff --git a/debian/apt.conf.autoremove b/debian/apt.conf.autoremove index fc02350ae..3c4843e3d 100644 --- a/debian/apt.conf.autoremove +++ b/debian/apt.conf.autoremove @@ -32,6 +32,10 @@ APT "restricted/metapackages"; "universe/metapackages"; "multiverse/metapackages"; + }; + + Move-Autobit-Sections + { "oldlibs"; "restricted/oldlibs"; "universe/oldlibs"; diff --git a/test/integration/test-apt-move-and-forget-manual-sections b/test/integration/test-apt-move-and-forget-manual-sections new file mode 100755 index 000000000..845444f53 --- /dev/null +++ b/test/integration/test-apt-move-and-forget-manual-sections @@ -0,0 +1,31 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +aptconfig dump --no-empty --format '%v%n' APT::Move-Autobit-Sections > move-autobit.sections +testsuccess grep '^oldlibs$' move-autobit.sections + +buildsimplenativepackage 'libabc' 'amd64' '1' 'stable' '' '' 'libs' +buildsimplenativepackage 'libabc' 'amd64' '2' 'unstable' 'Depends: libdef' '' 'oldlibs' +buildsimplenativepackage 'libdef' 'amd64' '1' 'unstable' '' '' 'libs' +setupaptarchive + +testmarkedauto +testmarkedmanual + +testsuccess aptget install libabc/stable -y +testdpkginstalled 'libabc' +testdpkgnotinstalled 'libdef' + +testmarkedmanual 'libabc' +testmarkedauto + +testsuccess aptget dist-upgrade -y +testdpkginstalled 'libabc' 'libdef' + +testmarkedauto 'libabc' +testmarkedmanual 'libdef' -- cgit v1.2.3 From 50bac72818c722ea4d3490fd1d2e91685265c51d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Aug 2015 17:47:49 +0200 Subject: initialize PinVers to a nullptr This makes test-bug-254770-segfault-if-cache-not-buildable happy. Git-Dch: Ignore --- apt-pkg/policy.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 170da7c63..47b0f47fb 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -45,7 +45,8 @@ using namespace std; // --------------------------------------------------------------------- /* Set the defaults for operation. The default mode with no loaded policy file matches the V0 policy engine. */ -pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner), d(NULL) +pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(nullptr), VerPins(nullptr), + PFPriority(nullptr), Cache(Owner), d(NULL) { if (Owner == 0) return; -- cgit v1.2.3 From 9b7d159f7c323a16b26c365d7fa1e2886f5ef278 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 10:20:58 +0200 Subject: Replace INT_MIN with std::numeric_limits::min This should fix travis compilation errors. Gbp-Dch: ignore --- apt-pkg/policy.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 47b0f47fb..ea6621e13 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -374,7 +374,7 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver) return VerPins[Ver->ID].Priority; - int priority = INT_MIN; + int priority = std::numeric_limits::min(); for (pkgCache::VerFileIterator file = Ver.FileList(); file.end() == false; file++) { /* If this is the status file, and the current version is not the @@ -390,7 +390,7 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver) } } - return priority == INT_MIN ? 0 : priority; + return priority == std::numeric_limits::min() ? 0 : priority; } APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgFileIterator const &File) { -- cgit v1.2.3 From 1d203ce78e6f80792e8c1f99701ff1b1daca534c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 10:21:29 +0200 Subject: Simply ignore cruft in the status files, do not treat it as prio 0 This was broken in case all other sources were < 0. --- apt-pkg/policy.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index ea6621e13..c12d8699b 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -383,8 +383,7 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver) out bogus entries that may be due to config-file states, or other. */ if (file.File().Flagged(pkgCache::Flag::NotSource) && Ver.ParentPkg().CurrentVer() != Ver) { - if (priority < 0) - priority = 0; + // Ignore } else if (GetPriority(file.File()) > priority) { priority = GetPriority(file.File()); } -- cgit v1.2.3 From c9d715346cae0bd53264d7c25d5af79ca6365707 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 11:05:57 +0200 Subject: Fix an obscure warning from GCC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It complained about the previous code: apt-pkg/sourcelist.cc: In destructor ‘pkgSourceList::~pkgSourceList()’: apt-pkg/sourcelist.cc:278:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] for (pkgIndexFile * const File : VolatileFiles) ^ There really cannot be an overflow, though. Rewriting it like this seems to fix it. --- apt-pkg/sourcelist.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 46e51f592..3e714667c 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -275,8 +275,8 @@ pkgSourceList::~pkgSourceList() for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I) delete *I; SrcList.clear(); - for (pkgIndexFile * const File : VolatileFiles) - delete File; + for (auto F = VolatileFiles.begin(); F != VolatileFiles.end(); ++F) + delete (*F); VolatileFiles.clear(); } /*}}}*/ -- cgit v1.2.3 From f4c63831e6b0306b03b88527ac2ed165c31cb94c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 11:48:51 +0200 Subject: apt-get: Do not include apt-pkg/indexrecords.h It's gone. Gbp-Dch: ignore --- cmdline/apt-get.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 918942505..b0e646833 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3 From 350d30d24fee9a1aa5fedc7a30e7416999653417 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 11:49:21 +0200 Subject: Drop C++11 elements from headers --- apt-pkg/cacheiterators.h | 4 ++-- apt-pkg/pkgcachegen.cc | 3 ++- apt-pkg/pkgcachegen.h | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 1063d6f9e..f8321079a 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -329,8 +329,8 @@ class pkgCache::DepIterator : public Iterator { DependencyProxy const * operator->() const { return this; } DependencyProxy * operator->() { return this; } }; - inline DependencyProxy operator->() const {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };} - inline DependencyProxy operator->() {return { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };} + inline DependencyProxy operator->() const {return (DependencyProxy) { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };} + inline DependencyProxy operator->() {return (DependencyProxy) { S2->Version, S2->Package, S->ID, S2->Type, S2->CompareOp, S->ParentVer, S->DependencyData, S->NextRevDepends, S->NextDepends, S2->NextData };} void ReMap(void const * const oldMap, void const * const newMap) { Iterator::ReMap(oldMap, newMap); diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 07a21d27f..ef7afda94 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -42,7 +42,8 @@ #include #include - /*}}}*/ + +template using Dynamic = pkgCacheGenerator::Dynamic; /*}}}*/ typedef std::vector::iterator FileIterator; template std::vector pkgCacheGenerator::Dynamic::toReMap; diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 97b91ba9f..46fccdaa5 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -135,7 +135,6 @@ class APT_HIDDEN pkgCacheListParser { pkgCacheGenerator *Owner; friend class pkgCacheGenerator; - template using Dynamic = pkgCacheGenerator::Dynamic; // Some cache items pkgCache::VerIterator OldDepVer; -- cgit v1.2.3 From f01090067bbc50312c8ac74714027da3a2f00e20 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 12:01:11 +0200 Subject: Re-introduce None as a deprecated alias for No Gbp-Dch: ignore --- apt-pkg/pkgcache.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 62c734283..e59697c28 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -606,6 +606,10 @@ struct pkgCache::Version Allowed = (1<<3), /*!< other packages are allowed to depend on thispkg:any */ AllForeign = All | Foreign, AllAllowed = All | Allowed }; + + /** \brief deprecated variant of No */ + static const APT_DEPRECATED VerMultiArch None = No; + /** \brief stores the MultiArch capabilities of this version Flags used are defined in pkgCache::Version::VerMultiArch -- cgit v1.2.3 From a0a4d1433a42d581697adacb1c3c095df4b23a56 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 12:02:39 +0200 Subject: Make QItem a subclass of DescItem CurrentItem previously was a DescItem, so let's make QItem a DescItem to not break things. --- apt-pkg/acquire.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index aa581dfb8..0d2b21233 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -419,23 +419,15 @@ class pkgAcquire::Queue protected: /** \brief A single item placed in this queue. */ - struct QItem : public WeakPointable + struct QItem : public ItemDesc { /** \brief The next item in the queue. */ QItem *Next; /** \brief The worker associated with this item, if any. */ pkgAcquire::Worker *Worker; - /** \brief The URI from which to download this item. */ - std::string URI; - /** \brief A description of this item. */ - std::string Description; - /** \brief A shorter description of this item. */ - std::string ShortDesc; /** \brief The underlying items interested in the download */ std::vector Owners; - // both, backward compatibility and easy access as syncing is interal - Item * Owner; typedef std::vector::const_iterator owner_iterator; -- cgit v1.2.3 From be4d908fb5d56f8a331bb88e878a6fb8d82a77a6 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 25 May 2015 16:45:05 +0200 Subject: ExecFork: Use /proc/self/fd to determine which files to close This significantly reduces the number of files that have to be closed and seems to be faster, despite the additional reads. On systems where /proc/self/fd is not available, we fallback to the old code that closes all file descriptors >= 3. Closes: #764204 --- apt-pkg/contrib/fileutl.cc | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 3b2e06431..4cc8112af 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -800,12 +800,26 @@ pid_t ExecFork(std::set KeepFDs) signal(SIGCONT,SIG_DFL); signal(SIGTSTP,SIG_DFL); - long ScOpenMax = sysconf(_SC_OPEN_MAX); - // Close all of our FDs - just in case - for (int K = 3; K != ScOpenMax; K++) + DIR *dir = opendir("/proc/self/fd"); + if (dir != NULL) { - if(KeepFDs.find(K) == KeepFDs.end()) - fcntl(K,F_SETFD,FD_CLOEXEC); + struct dirent *ent; + while ((ent = readdir(dir))) + { + int fd = atoi(ent->d_name); + // If fd > 0, it was a fd number and not . or .. + if (fd >= 3 && KeepFDs.find(fd) == KeepFDs.end()) + fcntl(fd,F_SETFD,FD_CLOEXEC); + } + closedir(dir); + } else { + long ScOpenMax = sysconf(_SC_OPEN_MAX); + // Close all of our FDs - just in case + for (int K = 3; K != ScOpenMax; K++) + { + if(KeepFDs.find(K) == KeepFDs.end()) + fcntl(K,F_SETFD,FD_CLOEXEC); + } } } -- cgit v1.2.3 From 743e0c4eabbacf639aac3c9a924ec3185e49aa2d Mon Sep 17 00:00:00 2001 From: Zhou Mo Date: Mon, 15 Jun 2015 01:39:31 +0000 Subject: po: update zh_CN translation slightly --- po/zh_CN.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index 1f92d6269..eaa78c0b2 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -636,15 +636,15 @@ msgid "" " This APT helper has Super Meep Powers.\n" msgstr "" "用法: apt-helper [选项] 命令\n" -" apt-helper [选项] download-file uri target-path\n" +" apt-helper [选项] download-file URI 目标路径\n" "\n" -"apt-helper 是一个 apt 的内部帮助程序\n" +"apt-helper 是一个 apt 的内部助手\n" "\n" "命令:\n" -" download-file - 将uri指定的文件下载到指定目标目录\n" +" download-file - 将 URI 指定的文件下载到目标路径\n" " auto-detect-proxy - 用 apt.conf 检测代理设置\n" "\n" -" This APT helper has Super Meep Powers.\n" +" 本 APT 助手具有超级喵力。\n" #: cmdline/apt-mark.cc:65 #, c-format -- cgit v1.2.3 From acb03142f0b2b78607e9c45febf79e8d765c8f60 Mon Sep 17 00:00:00 2001 From: Zhou Mo Date: Mon, 22 Jun 2015 14:38:32 +0000 Subject: po: Update Simplified Chinese programs translation * fix a wrong translation. * update some translations. --- po/zh_CN.po | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index eaa78c0b2..7e0bcd406 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -4,7 +4,7 @@ # Tchaikov , 2005, 2007. # Carlos Z.F. Liu , 2004, 2006. # Aron Xu , 2009, 2010. -# Zhou Mo , 2014. +# Zhou Mo , 2014, 2015. # msgid "" msgstr "" @@ -55,7 +55,7 @@ msgstr " 缺失:" #: cmdline/apt-cache.cc:368 msgid "Total distinct versions: " -msgstr "按版本共计:" +msgstr "按不同的版本共计:" #: cmdline/apt-cache.cc:370 msgid "Total distinct descriptions: " @@ -108,12 +108,12 @@ msgstr "您必须明确地给出至少一个表达式" #: cmdline/apt-cache.cc:1505 msgid "This command is deprecated. Please use 'apt-mark showauto' instead." -msgstr "该命令已废弃。请使用‘apt-mark showauto’代替。" +msgstr "该命令已废弃。请使用‘apt-mark showauto’。" #: cmdline/apt-cache.cc:1600 apt-pkg/cacheset.cc:653 #, c-format msgid "Unable to locate package %s" -msgstr "未发现软件包 %s" +msgstr "无法定位软件包 %s" #: cmdline/apt-cache.cc:1630 msgid "Package files:" @@ -138,7 +138,7 @@ msgstr " 已安装:" #: cmdline/apt-cache.cc:1672 msgid " Candidate: " -msgstr " 候选软件包:" +msgstr " 候选:" #: cmdline/apt-cache.cc:1690 cmdline/apt-cache.cc:1698 msgid "(none)" @@ -160,7 +160,7 @@ msgstr " 版本列表:" #: cmdline/apt-sortpkgs.cc:149 #, c-format msgid "%s %s for %s compiled on %s %s\n" -msgstr "%s %s,用于 %s 构架,编译于 %s %s\n" +msgstr "%s %s,用于 %s 体系结构,编译于 %s %s\n" #: cmdline/apt-cache.cc:1834 msgid "" @@ -202,8 +202,8 @@ msgstr "" "    apt-cache [选项] showpkg 软件包1 [软件包2 ...]\n" "    apt-cache [选项] showsrc 软件包1 [软件包2 ...]\n" "\n" -"apt-cache 是一个底层的工具,可以用来\n" -"在 APT 的二进制缓存文件中查询信息\n" +"apt-cache 是一个底层的工具,它可以在 APT 的\n" +"二进制缓存文件中查询信息\n" "\n" "命令:\n" " gencaches - 同时生成软件包和源代码包的缓存\n" @@ -262,7 +262,7 @@ msgstr "请对您的盘片套件中的其它盘片重复相同的操作。" #: cmdline/apt-config.cc:48 msgid "Arguments not in pairs" -msgstr "参数没有成对" +msgstr "参数不成对" #: cmdline/apt-config.cc:89 msgid "" @@ -320,24 +320,24 @@ msgstr "找不到 %2$s 软件包的 %1$s 版本" #: cmdline/apt-get.cc:445 #, c-format msgid "Couldn't find package %s" -msgstr "无法找到软件包 %s" +msgstr "找不到软件包 %s" #: cmdline/apt-get.cc:450 cmdline/apt-mark.cc:78 #: apt-private/private-install.cc:863 #, c-format msgid "%s set to manually installed.\n" -msgstr "%s 被设置为手动安装。\n" +msgstr "%s 已设置为手动安装。\n" #: cmdline/apt-get.cc:452 cmdline/apt-mark.cc:80 #, c-format msgid "%s set to automatically installed.\n" -msgstr "%s 被设置为手动安装。\n" +msgstr "%s 已设置为自动安装。\n" #: cmdline/apt-get.cc:460 cmdline/apt-mark.cc:124 msgid "" "This command is deprecated. Please use 'apt-mark auto' and 'apt-mark manual' " "instead." -msgstr "该命令已废弃。请用‘apt-mark auto’或‘apt-mark manual’替代。" +msgstr "该命令已废弃。请用‘apt-mark auto’或‘apt-mark manual’。" #: cmdline/apt-get.cc:529 cmdline/apt-get.cc:537 msgid "Internal error, problem resolver broke stuff" -- cgit v1.2.3 From df9732cd9823fe0860e6428694e552fff6b1b63b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 14:10:17 +0200 Subject: Merge changelog entries from sid-gcc5 --- debian/changelog | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7414b5c61..c1d91f99c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -234,6 +234,62 @@ apt (1.1~exp1) experimental; urgency=low -- Michael Vogt Thu, 19 Jun 2014 12:01:48 +0200 +apt (1.0.10.1) unstable; urgency=medium + + * hide first pdiff merge failure debug message (Closes: 793444) + * mark again deps of pkgs in APT::Never-MarkAuto-Sections as manual. + Thanks to Raphaël Hertzog and Adam Conrad for detailed reports and + initial patches (Closes: 793360) (LP: #1479207) + * explicitly build-dep on g++ (>= 4:5.2) for gcc5 transition + + -- David Kalnischkies Mon, 03 Aug 2015 07:29:40 +0200 + +apt (1.0.10) unstable; urgency=medium + + [ Zhou Mo ] + * po: update zh_CN translation slightly + * po: Update Simplified Chinese programs translation + + [ Mert Dirik ] + * Turkish translation update for apt (Closes: #789491) + + [ Yuri Kozlov ] + * Russian program translation update (Closes: 789709) + + [ Milo Casagrande ] + * Italian program translation update (Closes: 782122) + + [ Beatrice Torracca ] + * Italian manpage translation update (Closes: 776702) + + [ Julian Andres Klode ] + * ExecFork: Use /proc/self/fd to determine which files to close + (Closes: #764204) + + [ Michael Vogt ] + * Prepare new 1.0.10 release with gcc5 abi transition + + [ David Kalnischkies ] + * stop depending on copy-on-write for std::string + * bump next-abi check above gcc5-abi bump + * update symbols file to use gcc5 abi mangling + + -- David Kalnischkies Sat, 25 Jul 2015 12:11:08 +0200 + +apt (1.0.9.10) unstable; urgency=medium + + [ Michael Vogt ] + * Fix crash in pkgDPkgPM::WriteApportReport(() (LP: #1436626) + * Move sysconf(_SC_OPEN_MAX); out of the for() loop to avoid unneeded + syscalls + * Fix endless loop in apt-get update that can cause disk fillup + (LP: #1445239) + + [ Helmut Grohne ] + * parse arch-qualified Provides correctly (Closes: 777071) + + -- Michael Vogt Fri, 22 May 2015 17:38:31 +0200 + apt (1.0.9.9) unstable; urgency=medium [ David Kalnischkies ] -- cgit v1.2.3 From 17a2487fc69a86508f2319068296463698590d2b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 14:37:29 +0200 Subject: Bump apt-inst SONAME to 2.0 to adjust for the ABI break in apt-pkg --- apt-inst/makefile | 2 +- debian/control | 2 +- debian/libapt-inst1.6.install.in | 2 -- debian/libapt-inst1.6.symbols | 72 ---------------------------------------- debian/libapt-inst2.0.install.in | 2 ++ debian/libapt-inst2.0.symbols | 72 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 76 insertions(+), 76 deletions(-) delete mode 100644 debian/libapt-inst1.6.install.in delete mode 100644 debian/libapt-inst1.6.symbols create mode 100644 debian/libapt-inst2.0.install.in create mode 100644 debian/libapt-inst2.0.symbols diff --git a/apt-inst/makefile b/apt-inst/makefile index e4a3ae702..2883cbcb0 100644 --- a/apt-inst/makefile +++ b/apt-inst/makefile @@ -14,7 +14,7 @@ include ../buildlib/libversion.mak # The library name LIBRARY=apt-inst -MAJOR=1.6 +MAJOR=2.0 MINOR=0 SLIBS=$(PTHREADLIB) -lapt-pkg APT_DOMAIN:=libapt-inst$(MAJOR) diff --git a/debian/control b/debian/control index 37b9e215b..521400bb2 100644 --- a/debian/control +++ b/debian/control @@ -62,7 +62,7 @@ Description: package management runtime library http, rsh as well as an interface to add more transports like https (apt-transport-https) and debtorrent (apt-transport-debtorrent). -Package: libapt-inst1.6 +Package: libapt-inst2.0 Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} diff --git a/debian/libapt-inst1.6.install.in b/debian/libapt-inst1.6.install.in deleted file mode 100644 index 8bcce2c28..000000000 --- a/debian/libapt-inst1.6.install.in +++ /dev/null @@ -1,2 +0,0 @@ -bin/libapt-inst*.so.* usr/lib/@DEB_HOST_MULTIARCH@/ -usr/share/locale/*/*/libapt-inst*.mo diff --git a/debian/libapt-inst1.6.symbols b/debian/libapt-inst1.6.symbols deleted file mode 100644 index 87d9984e7..000000000 --- a/debian/libapt-inst1.6.symbols +++ /dev/null @@ -1,72 +0,0 @@ -libapt-inst.so.1.6 libapt-inst1.6 #MINVER# -* Build-Depends-Package: libapt-pkg-dev - (c++)"ExtractTar::Done(bool)@APTINST_1.6" 0.8.0 - (c++)"ExtractTar::Go(pkgDirStream&)@APTINST_1.6" 0.8.0 - (c++)"ExtractTar::StartGzip()@APTINST_1.6" 0.8.0 - (c++)"ExtractTar::ExtractTar(FileFd&, unsigned long long, std::__cxx11::basic_string, std::allocator >)@APTINST_1.6" 1.0.5 - (c++)"ExtractTar::~ExtractTar()@APTINST_1.6" 0.8.0 - (c++)"debDebFile::GotoMember(char const*)@APTINST_1.6" 0.8.0 - (c++)"debDebFile::CheckMember(char const*)@APTINST_1.6" 0.8.0 - (c++)"debDebFile::ControlExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0 - (c++)"debDebFile::ControlExtract::~ControlExtract()@APTINST_1.6" 0.8.0 - (c++)"debDebFile::ExtractTarMember(pkgDirStream&, char const*)@APTINST_1.6" 0.9.15.4 - (c++)"debDebFile::ExtractArchive(pkgDirStream&)@APTINST_1.6" 0.8.0 - (c++)"debDebFile::MemControlExtract::TakeControl(void const*, unsigned long long)@APTINST_1.6" 1.0.5 - (c++)"debDebFile::MemControlExtract::Read(debDebFile&)@APTINST_1.6" 0.8.0 - (c++)"debDebFile::MemControlExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0 - (c++)"debDebFile::MemControlExtract::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@APTINST_1.6" 1.0.5 - (c++)"debDebFile::MemControlExtract::~MemControlExtract()@APTINST_1.6" 0.8.0 - (c++)"debDebFile::debDebFile(FileFd&)@APTINST_1.6" 0.8.0 - (c++)"pkgExtract::FinishedFile(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0 - (c++)"pkgExtract::CheckDirReplace(std::__cxx11::basic_string, std::allocator >, unsigned int)@APTINST_1.6" 0.8.0 - (c++)"pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator, bool)@APTINST_1.6" 0.8.0 - (c++)"pkgExtract::Fail(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0 - (c++)"pkgExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0 - (c++)"pkgExtract::Aborted()@APTINST_1.6" 0.8.0 - (c++)"pkgExtract::Finished()@APTINST_1.6" 0.8.0 - (c++)"pkgExtract::pkgExtract(pkgFLCache&, pkgCache::VerIterator)@APTINST_1.6" 0.8.0 - (c++)"pkgExtract::~pkgExtract()@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::TreeLookup(unsigned int*, char const*, char const*, unsigned long, unsigned int*, bool)@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::AddConfFile(char const*, char const*, pkgFLCache::PkgIterator const&, unsigned char const*)@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::AddDiversion(pkgFLCache::PkgIterator const&, char const*, char const*)@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::BeginDiverLoad()@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::FinishDiverLoad()@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::GetPkg(char const*, char const*, bool)@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::Header::Header()@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::GetNode(char const*, char const*, unsigned int, bool, bool)@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::DropNode(unsigned int)@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::HashNode(pkgFLCache::NodeIterator const&)@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::PrintTree(unsigned int, unsigned long)@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::pkgFLCache(DynamicMMap&)@APTINST_1.6" 0.8.0 - (c++)"pkgDirStream::FinishedFile(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0 - (c++)"pkgDirStream::Fail(pkgDirStream::Item&, int)@APTINST_1.6" 0.8.0 - (c++)"pkgDirStream::DoItem(pkgDirStream::Item&, int&)@APTINST_1.6" 0.8.0 - (c++)"pkgDirStream::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@APTINST_1.6" 1.0.5 - (c++)"pkgDirStream::~pkgDirStream()@APTINST_1.6" 0.8.0 - (c++)"ARArchive::LoadHeaders()@APTINST_1.6" 0.8.0 - (c++)"ARArchive::ARArchive(FileFd&)@APTINST_1.6" 0.8.0 - (c++)"ARArchive::~ARArchive()@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::NodeIterator::RealPackage() const@APTINST_1.6" 0.8.0 - (c++)"pkgFLCache::Header::CheckSizes(pkgFLCache::Header&) const@APTINST_1.6" 0.8.0 - (c++)"ARArchive::FindMember(char const*) const@APTINST_1.6" 0.8.0 - (c++)"typeinfo for ExtractTar@APTINST_1.6" 0.8.0 - (c++)"typeinfo for pkgExtract@APTINST_1.6" 0.8.0 - (c++)"typeinfo for pkgDirStream@APTINST_1.6" 0.8.0 - (c++)"typeinfo for debDebFile::ControlExtract@APTINST_1.6" 0.8.0 - (c++)"typeinfo for debDebFile::MemControlExtract@APTINST_1.6" 0.8.0 - (c++)"typeinfo name for ExtractTar@APTINST_1.6" 0.8.0 - (c++)"typeinfo name for pkgExtract@APTINST_1.6" 0.8.0 - (c++)"typeinfo name for pkgDirStream@APTINST_1.6" 0.8.0 - (c++)"typeinfo name for debDebFile::ControlExtract@APTINST_1.6" 0.8.0 - (c++)"typeinfo name for debDebFile::MemControlExtract@APTINST_1.6" 0.8.0 - (c++)"vtable for ExtractTar@APTINST_1.6" 0.8.0 - (c++)"vtable for pkgExtract@APTINST_1.6" 0.8.0 - (c++)"vtable for pkgDirStream@APTINST_1.6" 0.8.0 - (c++)"vtable for debDebFile::ControlExtract@APTINST_1.6" 0.8.0 - (c++)"vtable for debDebFile::MemControlExtract@APTINST_1.6" 0.8.0 -### gcc artefacts - (c++|optional=std)"std::vector >::~vector()@APTINST_1.6" 0.8.12 -### symbol versioning - APTINST_1.6@APTINST_1.6 1.1~exp9 -### try to ignore std:: template instances - (c++|optional=std)"std::ctype::do_widen(char) const@APTINST_1.6" 1.0.3 diff --git a/debian/libapt-inst2.0.install.in b/debian/libapt-inst2.0.install.in new file mode 100644 index 000000000..8bcce2c28 --- /dev/null +++ b/debian/libapt-inst2.0.install.in @@ -0,0 +1,2 @@ +bin/libapt-inst*.so.* usr/lib/@DEB_HOST_MULTIARCH@/ +usr/share/locale/*/*/libapt-inst*.mo diff --git a/debian/libapt-inst2.0.symbols b/debian/libapt-inst2.0.symbols new file mode 100644 index 000000000..11d0d872d --- /dev/null +++ b/debian/libapt-inst2.0.symbols @@ -0,0 +1,72 @@ +libapt-inst.so.2.0 libapt-inst2.0 #MINVER# +* Build-Depends-Package: libapt-pkg-dev + (c++)"ExtractTar::Done(bool)@APTINST_2.0" 0.8.0 + (c++)"ExtractTar::Go(pkgDirStream&)@APTINST_2.0" 0.8.0 + (c++)"ExtractTar::StartGzip()@APTINST_2.0" 0.8.0 + (c++)"ExtractTar::ExtractTar(FileFd&, unsigned long long, std::__cxx11::basic_string, std::allocator >)@APTINST_2.0" 1.0.5 + (c++)"ExtractTar::~ExtractTar()@APTINST_2.0" 0.8.0 + (c++)"debDebFile::GotoMember(char const*)@APTINST_2.0" 0.8.0 + (c++)"debDebFile::CheckMember(char const*)@APTINST_2.0" 0.8.0 + (c++)"debDebFile::ControlExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_2.0" 0.8.0 + (c++)"debDebFile::ControlExtract::~ControlExtract()@APTINST_2.0" 0.8.0 + (c++)"debDebFile::ExtractTarMember(pkgDirStream&, char const*)@APTINST_2.0" 0.9.15.4 + (c++)"debDebFile::ExtractArchive(pkgDirStream&)@APTINST_2.0" 0.8.0 + (c++)"debDebFile::MemControlExtract::TakeControl(void const*, unsigned long long)@APTINST_2.0" 1.0.5 + (c++)"debDebFile::MemControlExtract::Read(debDebFile&)@APTINST_2.0" 0.8.0 + (c++)"debDebFile::MemControlExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_2.0" 0.8.0 + (c++)"debDebFile::MemControlExtract::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@APTINST_2.0" 1.0.5 + (c++)"debDebFile::MemControlExtract::~MemControlExtract()@APTINST_2.0" 0.8.0 + (c++)"debDebFile::debDebFile(FileFd&)@APTINST_2.0" 0.8.0 + (c++)"pkgExtract::FinishedFile(pkgDirStream::Item&, int)@APTINST_2.0" 0.8.0 + (c++)"pkgExtract::CheckDirReplace(std::__cxx11::basic_string, std::allocator >, unsigned int)@APTINST_2.0" 0.8.0 + (c++)"pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator, bool)@APTINST_2.0" 0.8.0 + (c++)"pkgExtract::Fail(pkgDirStream::Item&, int)@APTINST_2.0" 0.8.0 + (c++)"pkgExtract::DoItem(pkgDirStream::Item&, int&)@APTINST_2.0" 0.8.0 + (c++)"pkgExtract::Aborted()@APTINST_2.0" 0.8.0 + (c++)"pkgExtract::Finished()@APTINST_2.0" 0.8.0 + (c++)"pkgExtract::pkgExtract(pkgFLCache&, pkgCache::VerIterator)@APTINST_2.0" 0.8.0 + (c++)"pkgExtract::~pkgExtract()@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::TreeLookup(unsigned int*, char const*, char const*, unsigned long, unsigned int*, bool)@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::AddConfFile(char const*, char const*, pkgFLCache::PkgIterator const&, unsigned char const*)@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::AddDiversion(pkgFLCache::PkgIterator const&, char const*, char const*)@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::BeginDiverLoad()@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::FinishDiverLoad()@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::GetPkg(char const*, char const*, bool)@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::Header::Header()@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::GetNode(char const*, char const*, unsigned int, bool, bool)@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::DropNode(unsigned int)@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::HashNode(pkgFLCache::NodeIterator const&)@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::PrintTree(unsigned int, unsigned long)@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::pkgFLCache(DynamicMMap&)@APTINST_2.0" 0.8.0 + (c++)"pkgDirStream::FinishedFile(pkgDirStream::Item&, int)@APTINST_2.0" 0.8.0 + (c++)"pkgDirStream::Fail(pkgDirStream::Item&, int)@APTINST_2.0" 0.8.0 + (c++)"pkgDirStream::DoItem(pkgDirStream::Item&, int&)@APTINST_2.0" 0.8.0 + (c++)"pkgDirStream::Process(pkgDirStream::Item&, unsigned char const*, unsigned long long, unsigned long long)@APTINST_2.0" 1.0.5 + (c++)"pkgDirStream::~pkgDirStream()@APTINST_2.0" 0.8.0 + (c++)"ARArchive::LoadHeaders()@APTINST_2.0" 0.8.0 + (c++)"ARArchive::ARArchive(FileFd&)@APTINST_2.0" 0.8.0 + (c++)"ARArchive::~ARArchive()@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::NodeIterator::RealPackage() const@APTINST_2.0" 0.8.0 + (c++)"pkgFLCache::Header::CheckSizes(pkgFLCache::Header&) const@APTINST_2.0" 0.8.0 + (c++)"ARArchive::FindMember(char const*) const@APTINST_2.0" 0.8.0 + (c++)"typeinfo for ExtractTar@APTINST_2.0" 0.8.0 + (c++)"typeinfo for pkgExtract@APTINST_2.0" 0.8.0 + (c++)"typeinfo for pkgDirStream@APTINST_2.0" 0.8.0 + (c++)"typeinfo for debDebFile::ControlExtract@APTINST_2.0" 0.8.0 + (c++)"typeinfo for debDebFile::MemControlExtract@APTINST_2.0" 0.8.0 + (c++)"typeinfo name for ExtractTar@APTINST_2.0" 0.8.0 + (c++)"typeinfo name for pkgExtract@APTINST_2.0" 0.8.0 + (c++)"typeinfo name for pkgDirStream@APTINST_2.0" 0.8.0 + (c++)"typeinfo name for debDebFile::ControlExtract@APTINST_2.0" 0.8.0 + (c++)"typeinfo name for debDebFile::MemControlExtract@APTINST_2.0" 0.8.0 + (c++)"vtable for ExtractTar@APTINST_2.0" 0.8.0 + (c++)"vtable for pkgExtract@APTINST_2.0" 0.8.0 + (c++)"vtable for pkgDirStream@APTINST_2.0" 0.8.0 + (c++)"vtable for debDebFile::ControlExtract@APTINST_2.0" 0.8.0 + (c++)"vtable for debDebFile::MemControlExtract@APTINST_2.0" 0.8.0 +### gcc artefacts + (c++|optional=std)"std::vector >::~vector()@APTINST_2.0" 0.8.12 +### symbol versioning + APTINST_2.0@APTINST_2.0 1.1~exp9 +### try to ignore std:: template instances + (c++|optional=std)"std::ctype::do_widen(char) const@APTINST_2.0" 1.0.3 -- cgit v1.2.3 From 6d7122b5356c0b4d8f51aafdfc1c232392fca695 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 15:58:03 +0200 Subject: Annotate more methods with APT_OVERRIDE Gbp-Dch: ignore Reported-By: g++ -Wsuggest-override Thanks: g++ -Wsuggest-override --- apt-pkg/cachefilter.h | 2 +- apt-pkg/contrib/sha2.h | 2 +- apt-pkg/deb/debindexfile.h | 18 +++++++++--------- apt-pkg/deb/debversion.h | 4 ++-- apt-pkg/edsp/edspindexfile.h | 2 +- apt-private/private-list.cc | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apt-pkg/cachefilter.h b/apt-pkg/cachefilter.h index 2719154c1..9970b5b22 100644 --- a/apt-pkg/cachefilter.h +++ b/apt-pkg/cachefilter.h @@ -29,7 +29,7 @@ public: class PackageMatcher : public Matcher { public: - virtual bool operator() (pkgCache::PkgIterator const &Pkg) = 0; + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE = 0; virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE { return (*this)(Ver.ParentPkg()); } virtual bool operator() (pkgCache::GrpIterator const &/*Grp*/) APT_OVERRIDE { return false; } virtual ~PackageMatcher(); diff --git a/apt-pkg/contrib/sha2.h b/apt-pkg/contrib/sha2.h index 70e8384f2..8b4bdd439 100644 --- a/apt-pkg/contrib/sha2.h +++ b/apt-pkg/contrib/sha2.h @@ -34,7 +34,7 @@ class SHA2SummationBase : public SummationImplementation protected: bool Done; public: - bool Add(const unsigned char *inbuf, unsigned long long len) = 0; + bool Add(const unsigned char *inbuf, unsigned long long len) APT_OVERRIDE = 0; void Result(); }; diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 02708b558..dc75a01ab 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -36,7 +36,7 @@ protected: public: - virtual const Type *GetType() const APT_CONST; + virtual const Type *GetType() const APT_OVERRIDE APT_CONST; // Interface for the Cache Generator virtual bool HasPackages() const APT_OVERRIDE {return true;}; @@ -51,10 +51,10 @@ class debPackagesIndex : public pkgDebianIndexTargetFile { void * const d; protected: - virtual uint8_t GetIndexFlags() const; + virtual uint8_t GetIndexFlags() const APT_OVERRIDE; public: - virtual const Type *GetType() const APT_CONST; + virtual const Type *GetType() const APT_OVERRIDE APT_CONST; // Stuff for accessing files on remote items virtual std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const APT_OVERRIDE; @@ -77,7 +77,7 @@ protected: public: - virtual const Type *GetType() const APT_CONST; + virtual const Type *GetType() const APT_OVERRIDE APT_CONST; // Interface for the Cache Generator virtual bool HasPackages() const APT_OVERRIDE; @@ -89,13 +89,13 @@ public: class debSourcesIndex : public pkgDebianIndexTargetFile { void * const d; - virtual uint8_t GetIndexFlags() const; + virtual uint8_t GetIndexFlags() const APT_OVERRIDE; virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; public: - virtual const Type *GetType() const APT_CONST; + virtual const Type *GetType() const APT_OVERRIDE APT_CONST; // Stuff for accessing files on remote items virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, @@ -124,7 +124,7 @@ protected: APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; public: - virtual const Type *GetType() const APT_CONST; + virtual const Type *GetType() const APT_OVERRIDE APT_CONST; /** get the control (file) content of the deb file * @@ -148,7 +148,7 @@ class debDscFileIndex : public pkgDebianIndexRealFile { void * const d; public: - virtual const Type *GetType() const APT_CONST; + virtual const Type *GetType() const APT_OVERRIDE APT_CONST; virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; virtual bool HasPackages() const APT_OVERRIDE {return false;}; @@ -159,7 +159,7 @@ class debDscFileIndex : public pkgDebianIndexRealFile class debDebianSourceDirIndex : public debDscFileIndex { public: - virtual const Type *GetType() const APT_CONST; + virtual const Type *GetType() const APT_OVERRIDE APT_CONST; }; #endif diff --git a/apt-pkg/deb/debversion.h b/apt-pkg/deb/debversion.h index 6d7eca7c1..db70c8797 100644 --- a/apt-pkg/deb/debversion.h +++ b/apt-pkg/deb/debversion.h @@ -24,8 +24,8 @@ class debVersioningSystem : public pkgVersioningSystem // Compare versions.. virtual int DoCmpVersion(const char *A,const char *Aend, - const char *B,const char *Bend) APT_PURE; - virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) APT_PURE; + const char *B,const char *Bend) APT_OVERRIDE APT_PURE; + virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) APT_OVERRIDE APT_PURE; virtual APT_PURE int DoCmpReleaseVer(const char *A,const char *Aend, const char *B,const char *Bend) APT_OVERRIDE { diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h index edf799023..4548bff3c 100644 --- a/apt-pkg/edsp/edspindexfile.h +++ b/apt-pkg/edsp/edspindexfile.h @@ -31,7 +31,7 @@ protected: virtual std::string GetArchitecture() const APT_OVERRIDE; public: - virtual const Type *GetType() const APT_CONST; + virtual const Type *GetType() const APT_OVERRIDE APT_CONST; virtual bool Exists() const APT_OVERRIDE; virtual bool HasPackages() const APT_OVERRIDE; diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc index aa3a2c24b..c4d5e8bc3 100644 --- a/apt-private/private-list.cc +++ b/apt-private/private-list.cc @@ -59,7 +59,7 @@ class PackageNameMatcher : public Matcher for(J=filters.begin(); J != filters.end(); ++J) delete *J; } - virtual bool operator () (const pkgCache::PkgIterator &P) + virtual bool operator () (const pkgCache::PkgIterator &P) APT_OVERRIDE { for(J=filters.begin(); J != filters.end(); ++J) { -- cgit v1.2.3 From d51c70b771362c77186d58378bb7bfe15750390a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 19:40:22 +0200 Subject: debian/gbp.conf: Set multimaint-merge = True Gbp-Dch: ignore --- debian/gbp.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/gbp.conf b/debian/gbp.conf index 135522d40..6bad84301 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -4,4 +4,5 @@ postbuild = ./prepare-release post-build debian-branch = debian/experimental debian-tag = %(version)s export-dir = ../build-area -sign-tags = True \ No newline at end of file +sign-tags = True +multimaint-merge = True -- cgit v1.2.3 From 24e688506641021d9bc0e1bd68601e188261ba5e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 11 Aug 2015 20:02:02 +0200 Subject: debian/control: Rename libapt-pkg4.15 -> libapt-pkg5.0 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 521400bb2..bd7232834 100644 --- a/debian/control +++ b/debian/control @@ -39,7 +39,7 @@ Description: commandline package manager * apt-config as an interface to the configuration settings * apt-key as an interface to manage authentication keys -Package: libapt-pkg4.15 +Package: libapt-pkg5.0 Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} -- cgit v1.2.3 From f9be02d7c94cba689e9d323b03be7cabbac2a874 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Aug 2015 11:10:16 +0200 Subject: apt.cron.daily: Reference 10periodic instead of 02periodic LP: #1332106 --- debian/apt.cron.daily | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily index ee0761bfb..61d6aa6f0 100644 --- a/debian/apt.cron.daily +++ b/debian/apt.cron.daily @@ -3,7 +3,7 @@ # # This file understands the following apt configuration variables: # Values here are the default. -# Create /etc/apt/apt.conf.d/02periodic file to set your preference. +# Create /etc/apt/apt.conf.d/10periodic file to set your preference. # # Dir "/"; # - RootDir for all configuration files -- cgit v1.2.3 From 4ef2f35c35b5519040b4efebf2cca4527feacd29 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Aug 2015 11:39:49 +0200 Subject: Makefile: Add a make fast command for development This excludes dselect, po, and doc. --- Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6e1edbd5f..0393b424f 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ endif .PHONY: default default: startup all -.PHONY: headers library clean veryclean all binary program doc test update-po +.PHONY: fast headers library clean veryclean all binary program doc test update-po all headers library clean veryclean binary program doc manpages docbook test update-po startup dirs: $(MAKE) -C vendor $@ $(MAKE) -C apt-pkg $@ @@ -23,6 +23,16 @@ all headers library clean veryclean binary program doc manpages docbook test upd $(MAKE) -C po $@ $(MAKE) -C test $@ +fast: + $(MAKE) -C vendor all + $(MAKE) -C apt-pkg all + $(MAKE) -C apt-inst all + $(MAKE) -C apt-private all + $(MAKE) -C methods all + $(MAKE) -C cmdline all + $(MAKE) -C ftparchive all + $(MAKE) -C test all + all headers library clean veryclean binary program doc manpages docbook test update-po: startup dirs dirs: startup -- cgit v1.2.3 From 3261271e8e813b883917f0f57031ffcecbce6e20 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 10 Aug 2015 19:00:16 +0200 Subject: travis: add ppa:ubuntu-toolschain-r/test as source for gcc-5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes travis-ci able to run our tests again. Sometimes. If it doesn't spontaneously fails with internal gcc errors… Git-Dch: Ignore --- .travis.yml | 6 +++++- test/integration/framework | 13 +++++++++++-- test/integration/test-apt-update-filesize-mismatch | 2 +- test/integration/test-apt-update-hashsum-mismatch | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b449aeba5..a20018a79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,9 @@ language: cpp before_install: + - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - sudo apt-get update -q +install: - sudo ./prepare-release travis-ci -script: make && make test && test/integration/run-tests + - export CC=gcc-5 + - export CXX=g++-5 +script: make -j1 && make test && test/integration/run-tests diff --git a/test/integration/framework b/test/integration/framework index 2efe7439e..b443f2a7b 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1377,8 +1377,17 @@ testsuccess() { if expr match "$1" '^apt.*' >/dev/null; then if grep -q -E ' runtime error: ' "$OUTPUT"; then msgfailoutput 'compiler detected undefined behavior' "$OUTPUT" "$@" - elif grep -q -E '^[WE]: ' "$OUTPUT"; then - msgfailoutput 'successful run, but output contains warnings/errors' "$OUTPUT" "$@" + elif grep -E '^[WE]: ' "$OUTPUT" > "${TMPWORKINGDIRECTORY}/rootdir/tmp/checkforwarnings.output" 2>&1; then + if [ "$IGNORE_PTY_NOT_MOUNTED" = '1' ]; then + if echo 'E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)' \ + | cmp - "${TMPWORKINGDIRECTORY}/rootdir/tmp/checkforwarnings.output" >/dev/null 2>&1; then + msgpass + else + msgfailoutput 'successful run, but output contains warnings/errors' "$OUTPUT" "$@" + fi + else + msgfailoutput 'successful run, but output contains warnings/errors' "$OUTPUT" "$@" + fi else msgpass fi diff --git a/test/integration/test-apt-update-filesize-mismatch b/test/integration/test-apt-update-filesize-mismatch index f78b83b5f..a23c03c3f 100755 --- a/test/integration/test-apt-update-filesize-mismatch +++ b/test/integration/test-apt-update-filesize-mismatch @@ -40,7 +40,7 @@ for get in $(sed -n 's#^GET /\([^ ]\+\.gz\) HTTP.\+$#\1#p' aptarchive/webserver. testfailure aptget update -o Debug::pkgAcquire::Worker=1 cp rootdir/tmp/testfailure.output rootdir/tmp/update.output - testsuccess grep -E "$(basename -s '.gz' "$COMPRESSFILE").*Hash Sum mismatch" rootdir/tmp/update.output + testsuccess grep -E "$(basename "$COMPRESSFILE" '.gz').*Hash Sum mismatch" rootdir/tmp/update.output testfailure aptcache show foo testfailure aptget install foo -s diff --git a/test/integration/test-apt-update-hashsum-mismatch b/test/integration/test-apt-update-hashsum-mismatch index c2c5b3887..4627f7afd 100755 --- a/test/integration/test-apt-update-hashsum-mismatch +++ b/test/integration/test-apt-update-hashsum-mismatch @@ -35,7 +35,7 @@ for get in $(sed -n 's#^GET /\([^ ]\+\.gz\) HTTP.\+$#\1#p' aptarchive/webserver. testfailure aptget update cp rootdir/tmp/testfailure.output rootdir/tmp/update.output - testsuccess grep -E "$(basename -s '.gz' "$get").*Hash Sum mismatch" rootdir/tmp/update.output + testsuccess grep -E "$(basename "$get" '.gz').*Hash Sum mismatch" rootdir/tmp/update.output testfailure aptcache show foo testfailure aptget install foo -s -- cgit v1.2.3 From 26677b9c25b318c291d778eec758a06471fcba26 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 11 Aug 2015 17:41:27 +0200 Subject: po-fixups: fill Project-Id-Version and Encoding correctly Closes: 612996 --- doc/po/es.po | 2 +- doc/po/fr.po | 2 +- doc/po/it.po | 2 +- doc/po/ja.po | 2 +- doc/po/pl.po | 2 +- doc/po/pt.po | 2 +- doc/po/pt_BR.po | 2 +- po/ar.po | 2 +- po/cs.po | 2 +- po/cy.po | 2 +- po/dz.po | 2 +- po/el.po | 2 +- po/eu.po | 2 +- po/fr.po | 2 +- po/gl.po | 2 +- po/hu.po | 2 +- po/it.po | 2 +- po/km.po | 2 +- po/ko.po | 2 +- po/ku.po | 2 +- po/lt.po | 2 +- po/mr.po | 2 +- po/ne.po | 2 +- po/nn.po | 2 +- po/pt.po | 2 +- po/pt_BR.po | 2 +- po/ro.po | 2 +- po/sk.po | 2 +- po/sv.po | 2 +- po/th.po | 2 +- po/tl.po | 2 +- po/tr.po | 2 +- po/uk.po | 2 +- po/zh_TW.po | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/doc/po/es.po b/doc/po/es.po index 590ae4aeb..31b22ed00 100644 --- a/doc/po/es.po +++ b/doc/po/es.po @@ -36,7 +36,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt 0.9.7.1\n" +"Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2014-11-06 09:45+0100\n" "PO-Revision-Date: 2014-07-04 01:31+0200\n" diff --git a/doc/po/fr.po b/doc/po/fr.po index 85869a2b7..0c9e3a346 100644 --- a/doc/po/fr.po +++ b/doc/po/fr.po @@ -9,7 +9,7 @@ # Jean-Pierre Giraud , 2014. msgid "" msgstr "" -"Project-Id-Version: \n" +"Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2014-11-15 17:26+0100\n" diff --git a/doc/po/it.po b/doc/po/it.po index 28e97f14b..fabe6c544 100644 --- a/doc/po/it.po +++ b/doc/po/it.po @@ -8,7 +8,7 @@ # Beatrice Torracca , 2012, 2014, 2015. msgid "" msgstr "" -"Project-Id-Version: \n" +"Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-10 09:48+0100\n" "PO-Revision-Date: 2015-01-27 14:11+0200\n" diff --git a/doc/po/ja.po b/doc/po/ja.po index 3e0712125..f504436c0 100644 --- a/doc/po/ja.po +++ b/doc/po/ja.po @@ -6,7 +6,7 @@ # KURASAWA Nozomu, 2003-2006, 2009-2012. msgid "" msgstr "" -"Project-Id-Version: apt 1.0.6\n" +"Project-Id-Version: apt-doc 1.0.6\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2014-11-06 09:45+0100\n" "PO-Revision-Date: 2014-07-10 19:52+0900\n" diff --git a/doc/po/pl.po b/doc/po/pl.po index 481d85af6..2b9114c6e 100644 --- a/doc/po/pl.po +++ b/doc/po/pl.po @@ -9,7 +9,7 @@ # Robert Luberda 2000-2004, 2010, 2012. msgid "" msgstr "" -"Project-Id-Version: apt 0.9.7.3\n" +"Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2014-11-06 09:45+0100\n" "PO-Revision-Date: 2014-07-04 02:13+0200\n" diff --git a/doc/po/pt.po b/doc/po/pt.po index 3aefcc2a9..82d470426 100644 --- a/doc/po/pt.po +++ b/doc/po/pt.po @@ -5,7 +5,7 @@ # Américo Monteiro , 2009 - 2014. msgid "" msgstr "" -"Project-Id-Version: apt 1.0.7\n" +"Project-Id-Version: apt-doc 1.0.7\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2014-11-06 09:45+0100\n" "PO-Revision-Date: 2014-08-29 00:34+0100\n" diff --git a/doc/po/pt_BR.po b/doc/po/pt_BR.po index 88b479e75..44e2f17f8 100644 --- a/doc/po/pt_BR.po +++ b/doc/po/pt_BR.po @@ -7,7 +7,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt-doc 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2014-11-06 09:45+0100\n" "PO-Revision-Date: 2004-09-20 17:02+0000\n" diff --git a/po/ar.po b/po/ar.po index 8c1622d91..9bf40386f 100644 --- a/po/ar.po +++ b/po/ar.po @@ -4,7 +4,7 @@ # Ossama M. Khayat , 2005, 2006. msgid "" msgstr "" -"Project-Id-Version: apt_po\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2006-10-20 21:28+0300\n" diff --git a/po/cs.po b/po/cs.po index 4de2b7006..2c732fc29 100644 --- a/po/cs.po +++ b/po/cs.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2014-10-05 06:09+0200\n" diff --git a/po/cy.po b/po/cy.po index db9ec0bbc..7d2d6366e 100644 --- a/po/cy.po +++ b/po/cy.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: APT\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2005-06-06 13:46+0100\n" diff --git a/po/dz.po b/po/dz.po index e27ea6a90..12b6499f1 100644 --- a/po/dz.po +++ b/po/dz.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt_po.pot\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2006-09-19 09:49+0530\n" diff --git a/po/el.po b/po/el.po index b2370c6ad..bc3a784b9 100644 --- a/po/el.po +++ b/po/el.po @@ -14,7 +14,7 @@ # Θανάσης Νάτσης , 2012. msgid "" msgstr "" -"Project-Id-Version: apt_po_el\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2008-08-26 18:25+0300\n" diff --git a/po/eu.po b/po/eu.po index 528c6cc51..9e1647035 100644 --- a/po/eu.po +++ b/po/eu.po @@ -5,7 +5,7 @@ # Piarres Beobide , 2005, 2006, 2007, 2008, 2009. msgid "" msgstr "" -"Project-Id-Version: apt_po_eu\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2009-05-17 00:41+0200\n" diff --git a/po/fr.po b/po/fr.po index 0a437907f..0e3ae69b1 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ # Julien Patriarca , 2013. msgid "" msgstr "" -"Project-Id-Version: fr\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2013-12-15 16:45+0100\n" diff --git a/po/gl.po b/po/gl.po index 9ec10122b..9ad26c4e7 100644 --- a/po/gl.po +++ b/po/gl.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt_po_gl\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2011-05-12 15:28+0100\n" diff --git a/po/hu.po b/po/hu.po index fcf53f727..9475a9f42 100644 --- a/po/hu.po +++ b/po/hu.po @@ -5,7 +5,7 @@ # Gabor Kelemen , 2004, 2005, 2011, 2012. msgid "" msgstr "" -"Project-Id-Version: apt trunk\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2012-06-25 17:09+0200\n" diff --git a/po/it.po b/po/it.po index 6d9793c55..ca7a11027 100644 --- a/po/it.po +++ b/po/it.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-04-11 08:08+0200\n" "PO-Revision-Date: 2015-04-07 16:51+0100\n" diff --git a/po/km.po b/po/km.po index 8ae605510..263c30dea 100644 --- a/po/km.po +++ b/po/km.po @@ -8,7 +8,7 @@ # Khoem Sokhem , 2006. msgid "" msgstr "" -"Project-Id-Version: apt_po_km\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2006-10-10 09:48+0700\n" diff --git a/po/ko.po b/po/ko.po index e5b08fdec..969736cca 100644 --- a/po/ko.po +++ b/po/ko.po @@ -3,7 +3,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2010-08-30 02:31+0900\n" diff --git a/po/ku.po b/po/ku.po index 3b2d6ed12..f66836634 100644 --- a/po/ku.po +++ b/po/ku.po @@ -6,7 +6,7 @@ # Erdal Ronahi , 2008. msgid "" msgstr "" -"Project-Id-Version: apt-ku\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2008-05-08 12:48+0200\n" diff --git a/po/lt.po b/po/lt.po index 6d0365183..67ff3c8fb 100644 --- a/po/lt.po +++ b/po/lt.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2008-08-02 01:47-0400\n" diff --git a/po/mr.po b/po/mr.po index 31bdb63c9..69c133592 100644 --- a/po/mr.po +++ b/po/mr.po @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2008-11-20 23:27+0530\n" diff --git a/po/ne.po b/po/ne.po index b5fb2c6fc..83ffc1d37 100644 --- a/po/ne.po +++ b/po/ne.po @@ -4,7 +4,7 @@ # Shiva Pokharel , 2006. msgid "" msgstr "" -"Project-Id-Version: apt_po\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2006-06-12 14:35+0545\n" diff --git a/po/nn.po b/po/nn.po index 5c8c39967..1f079e98a 100644 --- a/po/nn.po +++ b/po/nn.po @@ -7,7 +7,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt_nn\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2005-02-14 23:30+0100\n" diff --git a/po/pt.po b/po/pt.po index 0e106a7d1..28b8be563 100644 --- a/po/pt.po +++ b/po/pt.po @@ -5,7 +5,7 @@ # Miguel Figueiredo , 2005-2012. msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2012-06-29 15:45+0100\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index c50792b79..ad8c325c4 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ # Felipe Augusto van de Wiel (faw) , 2006-2008. msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2008-11-17 02:33-0200\n" diff --git a/po/ro.po b/po/ro.po index 7b94bd3d8..68628517b 100644 --- a/po/ro.po +++ b/po/ro.po @@ -5,7 +5,7 @@ # Eddy Petrișor , 2008. msgid "" msgstr "" -"Project-Id-Version: ro\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2008-11-15 02:21+0200\n" diff --git a/po/sk.po b/po/sk.po index 0aeb167ea..776b139c1 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2012-06-28 20:49+0100\n" diff --git a/po/sv.po b/po/sv.po index bdf00ff65..7e7801f84 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,7 +7,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2010-08-24 21:18+0100\n" diff --git a/po/th.po b/po/th.po index c016205c5..731b1de46 100644 --- a/po/th.po +++ b/po/th.po @@ -6,7 +6,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2014-12-12 13:00+0700\n" diff --git a/po/tl.po b/po/tl.po index be3371704..d6e1059e8 100644 --- a/po/tl.po +++ b/po/tl.po @@ -8,7 +8,7 @@ # msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2007-03-29 21:36+0800\n" diff --git a/po/tr.po b/po/tr.po index 8b8691a55..5a5c4fcd5 100644 --- a/po/tr.po +++ b/po/tr.po @@ -6,7 +6,7 @@ # Rosetta Contributors, 2009. msgid "" msgstr "" -"Project-Id-Version: apt\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-04-13 07:23+0200\n" "PO-Revision-Date: 2015-06-21 16:54+0200\n" diff --git a/po/uk.po b/po/uk.po index 514403641..1494413e9 100644 --- a/po/uk.po +++ b/po/uk.po @@ -10,7 +10,7 @@ # binary = двійковий msgid "" msgstr "" -"Project-Id-Version: apt-all\n" +"Project-Id-Version: apt 1.0.5\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2012-09-25 20:19+0300\n" diff --git a/po/zh_TW.po b/po/zh_TW.po index f37e5e0ed..6b78c8340 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -6,7 +6,7 @@ # $Id: zh_TW.po,v 1.11 2004/04/30 04:50:38 mdz Exp $ msgid "" msgstr "" -"Project-Id-Version: 0.5.4\n" +"Project-Id-Version: apt 0.5.4\n" "Report-Msgid-Bugs-To: APT Development Team \n" "POT-Creation-Date: 2015-03-09 02:17+0100\n" "PO-Revision-Date: 2009-01-28 10:41+0800\n" -- cgit v1.2.3 From c7872a2c857bc54febb09721f5256786a15c002d Mon Sep 17 00:00:00 2001 From: Daniel Hartwig Date: Tue, 11 Aug 2015 17:59:13 +0200 Subject: support setting a port for rsh:// in sources.list [Commiter comment: Untested, but looks and compiles fine, so what could possibly go wrong] Closes: 624727 --- methods/rsh.cc | 22 ++++++++++++++++++++-- methods/rsh.h | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/methods/rsh.cc b/methods/rsh.cc index 52349c61c..7ef2f7c7a 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -84,7 +84,7 @@ bool RSHConn::Open() if (Process != -1) return true; - if (Connect(ServerName.Host,ServerName.User) == false) + if (Connect(ServerName.Host,ServerName.Port,ServerName.User) == false) return false; return true; @@ -93,8 +93,15 @@ bool RSHConn::Open() // RSHConn::Connect - Fire up rsh and connect /*{{{*/ // --------------------------------------------------------------------- /* */ -bool RSHConn::Connect(std::string Host, std::string User) +bool RSHConn::Connect(std::string Host, unsigned int Port, std::string User) { + char *PortStr = NULL; + if (Port != 0) + { + if (asprintf (&PortStr, "%d", Port) == -1 || PortStr == NULL) + return _error->Errno("asprintf", _("Failed")); + } + // Create the pipes int Pipes[4] = {-1,-1,-1,-1}; if (pipe(Pipes) != 0 || pipe(Pipes+2) != 0) @@ -140,6 +147,10 @@ bool RSHConn::Connect(std::string Host, std::string User) Args[i++] = "-l"; Args[i++] = User.c_str(); } + if (PortStr != NULL) { + Args[i++] = "-p"; + Args[i++] = PortStr; + } if (Host.empty() == false) { Args[i++] = Host.c_str(); } @@ -149,6 +160,9 @@ bool RSHConn::Connect(std::string Host, std::string User) exit(100); } + if (PortStr != NULL) + free(PortStr); + ReadFd = Pipes[0]; WriteFd = Pipes[3]; SetNonBlock(Pipes[0],true); @@ -157,6 +171,10 @@ bool RSHConn::Connect(std::string Host, std::string User) close(Pipes[2]); return true; +} +bool RSHConn::Connect(std::string Host, std::string User) +{ + return Connect(Host, 0, User); } /*}}}*/ // RSHConn::ReadLine - Very simple buffered read with timeout /*{{{*/ diff --git a/methods/rsh.h b/methods/rsh.h index 34492971c..e6839711b 100644 --- a/methods/rsh.h +++ b/methods/rsh.h @@ -36,6 +36,7 @@ class RSHConn // Raw connection IO bool WriteMsg(std::string &Text,bool Sync,const char *Fmt,...); bool Connect(std::string Host, std::string User); + bool Connect(std::string Host, unsigned int Port, std::string User); bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;}; // Connection control -- cgit v1.2.3 From 35bf76cf3035761c8721e51250bbeb5f4facf8ee Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 11 Aug 2015 19:24:24 +0200 Subject: remove Dir:: scope limit of RootDir in the documentation RootDir doesn't only effect Dir-scope but all FindDir directories, so document it accordingly. Closes: 659387 --- doc/apt.conf.5.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 103d0622c..6b5ebf2d7 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -690,7 +690,7 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; The configuration item RootDir has a special - meaning. If set, all paths in Dir:: will be + meaning. If set, all paths will be relative to RootDir, even paths that are specified absolutely. So, for instance, if RootDir is set to @@ -699,6 +699,7 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; /var/lib/dpkg/status, then the status file will be looked up in /tmp/staging/var/lib/dpkg/status. + If you want to prefix only relative paths, set Dir instead. -- cgit v1.2.3 From ad42ed4698c88e04bc242fb579f5b3e6fd9a0ee4 Mon Sep 17 00:00:00 2001 From: Daniel Hartwig Date: Tue, 11 Aug 2015 19:56:31 +0200 Subject: replace direct calls to egrep with grep -E MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rest of the initial patch is not needed or incorrect in our usage. Big changes for the dselect scripts seem unneeded as well as those are hardly used by anyone anymore… [commit message written by commiter] Closes: 255577 Thanks: David Weinehall for initial patch --- buildlib/libversion.mak | 6 +++--- dselect/install | 2 +- prepare-release | 2 +- test/integration/test-apt-download-progress | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/buildlib/libversion.mak b/buildlib/libversion.mak index deb3da377..1b1855be3 100644 --- a/buildlib/libversion.mak +++ b/buildlib/libversion.mak @@ -4,11 +4,11 @@ # with each non-ABI break to the lib, please increase RELEASE. # The versionnumber is extracted from apt-pkg/macros.h - see also there. LIBAPTPKG_MAJOR=$(shell awk -v ORS='.' '/^\#define APT_PKG_M/ {print $$3}' $(BASE)/apt-pkg/contrib/macros.h | sed 's/\.$$//') -LIBAPTPKG_RELEASE=$(shell grep -E '^\#define APT_PKG_RELEASE' $(BASE)/apt-pkg/contrib/macros.h | cut -d ' ' -f 3) +LIBAPTPKG_RELEASE=$(shell grep '^\#define APT_PKG_RELEASE' $(BASE)/apt-pkg/contrib/macros.h | cut -d ' ' -f 3) # Version number of libapt-inst # Please increase MAJOR with each ABI break, # with each non-ABI break to the lib, please increase MINOR. # The versionnumber is extracted from apt-inst/makefile - see also there. -LIBAPTINST_MAJOR=$(shell egrep '^MAJOR=' $(BASE)/apt-inst/makefile |cut -d '=' -f 2) -LIBAPTINST_MINOR=$(shell egrep '^MINOR=' $(BASE)/apt-inst/makefile |cut -d '=' -f 2) +LIBAPTINST_MAJOR=$(shell grep '^MAJOR=' $(BASE)/apt-inst/makefile |cut -d '=' -f 2) +LIBAPTINST_MINOR=$(shell grep '^MINOR=' $(BASE)/apt-inst/makefile |cut -d '=' -f 2) diff --git a/dselect/install b/dselect/install index 7104ee280..ef8de9b73 100755 --- a/dselect/install +++ b/dselect/install @@ -65,7 +65,7 @@ fi # Finished OK if [ $RES -eq 0 ]; then - if [ $(ls $ARCHIVES $ARCHIVES/partial | egrep -v "^lock$|^partial$" | wc -l) \ + if [ $(ls $ARCHIVES $ARCHIVES/partial | grep -E -v "^lock$|^partial$" | wc -l) \ -eq 0 ]; then exit 0 fi diff --git a/prepare-release b/prepare-release index 734dc5f32..91f65028d 100755 --- a/prepare-release +++ b/prepare-release @@ -11,7 +11,7 @@ VERSION=$(dpkg-parsechangelog | sed -n -e '/^Version:/s/^Version: //p') DISTRIBUTION=$(dpkg-parsechangelog | sed -n -e '/^Distribution:/s/^Distribution: //p') LIBAPTPKGVERSION="$(awk -v ORS='.' '/^\#define APT_PKG_M/ {print $3}' apt-pkg/contrib/macros.h | sed 's/\.$//')" -LIBAPTINSTVERSION="$(egrep '^MAJOR=' apt-inst/makefile |cut -d '=' -f 2)" +LIBAPTINSTVERSION="$(grep '^MAJOR=' apt-inst/makefile |cut -d '=' -f 2)" librarysymbolsfromfile() { local MISSING="$(grep '^+#MISSING' "$1")" diff --git a/test/integration/test-apt-download-progress b/test/integration/test-apt-download-progress index 7caeca971..bf6a412ad 100755 --- a/test/integration/test-apt-download-progress +++ b/test/integration/test-apt-download-progress @@ -13,7 +13,7 @@ changetohttpswebserver assertprogress() { T="$1" testsuccess grep "dlstatus:1:0:Retrieving file 1 of 1" "$T" - if ! egrep -q "dlstatus:1:[1-9][0-9](\..*)?:Retrieving file 1 of 1" "$T"; then + if ! grep -E -q "dlstatus:1:[1-9][0-9](\..*)?:Retrieving file 1 of 1" "$T"; then cat "$T" msgfail "Failed to detect download progress" fi -- cgit v1.2.3 From 94171725b18be91ddcc2530c5fe5f40e78d041c1 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Tue, 11 Aug 2015 20:08:43 +0200 Subject: Replace all "press enter" occurrences with "press [Enter]" Thanks: Andre Felipe Machado for initial patch Closes: 414848 --- apt-pkg/acquire-worker.cc | 2 +- apt-private/acqprogress.cc | 2 +- cmdline/apt-cdrom.cc | 2 +- dselect/install | 10 +++++----- dselect/update | 2 +- po/apt-all.pot | 8 ++++---- test/integration/test-apt-cdrom | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 2c84020fe..e9ef4e9ac 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -538,7 +538,7 @@ bool pkgAcquire::Worker::MediaChange(string Message) ostringstream msg,status; ioprintf(msg,_("Please insert the disc labeled: " "'%s' " - "in the drive '%s' and press enter."), + "in the drive '%s' and press [Enter]."), Media.c_str(),Drive.c_str()); status << "media-change: " // message << Media << ":" // media diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc index f6c3d1204..62b2c13d0 100644 --- a/apt-private/acqprogress.cc +++ b/apt-private/acqprogress.cc @@ -296,7 +296,7 @@ bool AcqTextStatus::MediaChange(std::string Media, std::string Drive) clearLastLine(); ioprintf(out,_("Media change: please insert the disc labeled\n" " '%s'\n" - "in the drive '%s' and press enter\n"), + "in the drive '%s' and press [Enter]\n"), Media.c_str(),Drive.c_str()); char C = 0; diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index c0541d196..dcc784746 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -89,7 +89,7 @@ void pkgCdromTextStatus::Update(string text, int /*current*/) bool pkgCdromTextStatus::ChangeCdrom() { - Prompt(_("Please insert a Disc in the drive and press enter")); + Prompt(_("Please insert a Disc in the drive and press [Enter]")); return true; } diff --git a/dselect/install b/dselect/install index ef8de9b73..75f0c0fc4 100755 --- a/dselect/install +++ b/dselect/install @@ -49,7 +49,7 @@ yesno() { if [ "$WAIT" = "true" ]; then $APTGET $DSELECT_UPGRADE_OPTS $OPTS "$APT_OPT0" "$APT_OPT1" -d dselect-upgrade - echo $"Press enter to continue." && read RES + echo $"Press [Enter] to continue." && read RES $APTGET $DSELECT_UPGRADE_OPTS $OPTS "$APT_OPT0" "$APT_OPT1" dselect-upgrade RES=$? else @@ -81,18 +81,18 @@ if [ $RES -eq 0 ]; then case $(echo $CLEAN | tr '[:upper:]' '[:lower:]') in auto) $APTGET "$APT_OPT0" "$APT_OPT1" autoclean && - echo $"Press enter to continue." && read RES && exit 0; + echo $"Press [Enter] to continue." && read RES && exit 0; ;; always) $APTGET "$APT_OPT0" "$APT_OPT1" clean && - echo $"Press enter to continue." && read RES && exit 0; + echo $"Press [Enter] to continue." && read RES && exit 0; ;; prompt) exec 3>&1 echo -n $"Do you want to erase any previously downloaded .deb files?" if [ $(yesno "" y) = y ]; then $APTGET "$APT_OPT0" "$APT_OPT1" clean && - echo $"Press enter to continue." && read RES && exit 0; + echo $"Press [Enter] to continue." && read RES && exit 0; fi ;; *) @@ -103,7 +103,7 @@ else echo $"will be configured. This may result in duplicate errors" echo $"or errors caused by missing dependencies. This is OK, only the errors" echo $"above this message are important. Please fix them and run [I]nstall again" - echo $"Press enter to continue." + echo $"Press [Enter] to continue." read RES && $DPKG "$DPKG_OPTS" --configure -a exit 100 fi diff --git a/dselect/update b/dselect/update index 487fbf226..0ab317ee4 100755 --- a/dselect/update +++ b/dselect/update @@ -42,7 +42,7 @@ then fi if [ x$PROMPT = "xtrue" ]; then - echo $"Press enter to continue." && read RES; + echo $"Press [Enter] to continue." && read RES; fi exit $STATUS diff --git a/po/apt-all.pot b/po/apt-all.pot index e2d09401b..4a70213f4 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -200,7 +200,7 @@ msgid "Please provide a name for this Disc, such as 'Debian 5.0.3 Disk 1'" msgstr "" #: cmdline/apt-cdrom.cc:92 -msgid "Please insert a Disc in the drive and press enter" +msgid "Please insert a Disc in the drive and press [Enter]" msgstr "" #: cmdline/apt-cdrom.cc:140 @@ -1563,7 +1563,7 @@ msgstr "" msgid "" "Media change: please insert the disc labeled\n" " '%s'\n" -"in the drive '%s' and press enter\n" +"in the drive '%s' and press [Enter]\n" msgstr "" #. Only warn if there are no sources.list.d. @@ -1623,7 +1623,7 @@ msgstr "" #: dselect/install:52 dselect/install:84 dselect/install:88 dselect/install:95 #: dselect/install:106 dselect/update:45 -msgid "Press enter to continue." +msgid "Press [Enter] to continue." msgstr "" #: dselect/install:92 @@ -2057,7 +2057,7 @@ msgstr "" #: apt-pkg/acquire-worker.cc:485 #, c-format -msgid "Please insert the disc labeled: '%s' in the drive '%s' and press enter." +msgid "Please insert the disc labeled: '%s' in the drive '%s' and press [Enter]." msgstr "" #: apt-pkg/cachefile.cc:94 diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 108805daa..ce31b5934 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -38,7 +38,7 @@ aptautotest_aptcdromlog_add() { aptautotest_aptget_update "$@"; } CDROM_PRE="Using CD-ROM mount point $(readlink -f ./rootdir/media)/cdrom/ Unmounting CD-ROM... Waiting for disc... -Please insert a Disc in the drive and press enter +Please insert a Disc in the drive and press [Enter] Mounting CD-ROM... Scanning disc for index files..." CDROM_POST="This disc is called: -- cgit v1.2.3 From 29efb9dda712554a2f05eb0475e3cd0a6b8a90fb Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 11 Aug 2015 22:07:18 +0200 Subject: document VERSION 2 (and 3) pre-install-pkgs hook interface [Commiter: Patch adapted to apply to current version of the manpage and added/moved a few words about Version 3 to make it fit better] Closes: 627188 --- doc/apt.conf.5.xml | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 6b5ebf2d7..d5e185757 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -775,10 +775,34 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; install to the commands, one per line on the requested file descriptor, defaulting to standard input. - Version 2 of this protocol dumps more information, including the - protocol version, the APT configuration space and the packages, files - and versions being changed. Version 3 adds the architecture and MultiArch - flag to each version being dumped. + Version 2 of this protocol sends more information through the requested + file descriptor: a line with the text VERSION 2, + the APT configuration space, and a list of package actions with filename + and version information. + + Each configuration directive line has the form + key=value. Special characters (equal signs, newlines, + nonprintable characters, quotation marks, and percent signs in + key and newlines, nonprintable characters, and percent + signs in value) are %-encoded. Lists are represented + by multiple key::=value lines with the same key. The + configuration section ends with a blank line. + + Package action lines consist of five fields in Version 2: old version, direction + of version change (< for upgrades, > for downgrades, = for no + change), new version, action. The version fields are "-" for no version + at all (for example when installing a package for the first time; no + version is treated as earlier than any real version, so that is an + upgrade, indicated as - < 1.23.4). The action field + is "**CONFIGURE**" if the package is being configured, "**REMOVE**" if it + is being removed, or the filename of a .deb file if it is being + unpacked. + + In Version 3 after each version field follows the architecture + of this version, which is "-" if there is no version, and a field showing + the MultiArch type "same", foreign", "allowed" or "none". Note that "none" + is an incorrect typename which is just kept to remain compatible, it + should be read as "no" and users are encouraged to support both. The version of the protocol to be used for the command cmd can be chosen by setting -- cgit v1.2.3 From a4256c6bb57dbb59767824133a9a42eceeadc522 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 14 Oct 2014 13:52:33 +0200 Subject: Do not set unhonored DPKG_NO_TSTP variable for dpkg Support for that variable was removed in dpkg in 1.15.6, in commit 6f037003e8b96878b485efb7cbd1f846e3bf4e97. Closes: #765366 --- apt-pkg/deb/dpkgpm.cc | 3 --- doc/dpkg-tech.dbk | 10 +--------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index c578cc338..644e4d8e4 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1545,9 +1545,6 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) _exit(100); } - /* No Job Control Stop Env is a magic dpkg var that prevents it - from using sigstop */ - putenv((char *)"DPKG_NO_TSTP=yes"); execvp(Args[0], (char**) &Args[0]); cerr << "Could not exec dpkg!" << endl; _exit(100); diff --git a/doc/dpkg-tech.dbk b/doc/dpkg-tech.dbk index 2584cf640..f95716cf4 100644 --- a/doc/dpkg-tech.dbk +++ b/doc/dpkg-tech.dbk @@ -404,15 +404,7 @@ As yet unwritten. You can refer to the other manuals for now. See -DPKG_NO_TSTP - if set to a non-null value, this variable causes dpkg to run a -child shell process instead of sending itself a SIGTSTP, when the user selects -to background the dpkg process when it asks about conffiles. - - - - -SHELL - used to determine which shell to run in the case when DPKG_NO_TSTP -is set. +SHELL - used to determine which shell to run. -- cgit v1.2.3 From 1d6afdd9b174c360936bbaf994ae7dc03a086128 Mon Sep 17 00:00:00 2001 From: Tomas Pospisek Date: Tue, 27 Jan 2015 14:10:38 +0100 Subject: document APT::Periodic::RandomSleep The documentation in the patch is from https://help.ubuntu.com/community/AutomaticSecurityUpdates That page is licensed under Creative Commons Attribution-ShareAlike 3.0. Because I'm unsure how that license meshes with apt's license I've not copied the text but formulated the same information freely in my own words. The original text was contributed by Chris Bainbridge [1][3] and Kees Cook [2]. Thanks to them. [1] https://help.ubuntu.com/community/AutomaticSecurityUpdates?action=diff&rev1=40&rev2=41 [2] https://help.ubuntu.com/community/AutomaticSecurityUpdates?action=diff&rev1=38&rev2=39 [3] https://help.ubuntu.com/community/AutomaticSecurityUpdates?action=diff&rev1=37&rev2=38 Closes: 776380 Thanks: Chris Bainbridge and Kees Cook for initial text --- debian/apt.cron.daily | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily index 61d6aa6f0..765dd4ae4 100644 --- a/debian/apt.cron.daily +++ b/debian/apt.cron.daily @@ -68,6 +68,19 @@ # 1: progress report (actually any string) # 2: + command outputs (remove -qq, remove 2>/dev/null, add -d) # 3: + trace on +# +# APT::Periodic::RandomSleep "1800"; +# - The apt cron job will delay its execution by a random +# time span between zero and 'APT::Periodic::RandomSleep' +# seconds. +# This is done because otherwise everyone would access the +# mirror servers at the same time and put them collectively +# under very high strain. +# You can set this to '0' if you are using a local mirror and +# do not care about the load spikes. +# Note that sleeping in the apt job will be delaying the +# execution of all subsequent cron.daily jobs. +# check_stamp() { -- cgit v1.2.3 From 14c50b58e938cf78ce2d32d4ec39979f7575c543 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Date: Sun, 26 Apr 2015 09:58:05 +0200 Subject: use a=experimental instead n=experimental in pin documentation Closes: 783343 --- doc/apt_preferences.5.xml | 2 +- doc/po/apt-doc.pot | 2 +- doc/po/de.po | 4 ++-- doc/po/es.po | 4 ++-- doc/po/fr.po | 4 ++-- doc/po/it.po | 4 ++-- doc/po/ja.po | 4 ++-- doc/po/pl.po | 4 ++-- doc/po/pt.po | 4 ++-- doc/po/pt_BR.po | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index 16e6a7aa0..5ea59bf9c 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -267,7 +267,7 @@ expression surrounded by slashes). Package: gnome* /kde/ -Pin: release n=experimental +Pin: release a=experimental Pin-Priority: 500 diff --git a/doc/po/apt-doc.pot b/doc/po/apt-doc.pot index 98c2b66b5..fc3b5a6c6 100644 --- a/doc/po/apt-doc.pot +++ b/doc/po/apt-doc.pot @@ -4241,7 +4241,7 @@ msgstr "" #, no-wrap msgid "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" msgstr "" diff --git a/doc/po/de.po b/doc/po/de.po index 4eb458d17..12d6a4c4d 100644 --- a/doc/po/de.po +++ b/doc/po/de.po @@ -6071,11 +6071,11 @@ msgstr "" #, no-wrap msgid "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" msgstr "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" #. type: Content of: diff --git a/doc/po/es.po b/doc/po/es.po index 31b22ed00..9ace0bd4f 100644 --- a/doc/po/es.po +++ b/doc/po/es.po @@ -6126,11 +6126,11 @@ msgstr "" #, no-wrap msgid "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" msgstr "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" #. type: Content of: diff --git a/doc/po/fr.po b/doc/po/fr.po index 0c9e3a346..8d7c29f37 100644 --- a/doc/po/fr.po +++ b/doc/po/fr.po @@ -6045,11 +6045,11 @@ msgstr "" #, no-wrap msgid "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" msgstr "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" #. type: Content of: diff --git a/doc/po/it.po b/doc/po/it.po index fabe6c544..21d5611ea 100644 --- a/doc/po/it.po +++ b/doc/po/it.po @@ -6072,11 +6072,11 @@ msgstr "" #, no-wrap msgid "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" msgstr "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" #. type: Content of: diff --git a/doc/po/ja.po b/doc/po/ja.po index f504436c0..5d6c183cb 100644 --- a/doc/po/ja.po +++ b/doc/po/ja.po @@ -5812,11 +5812,11 @@ msgstr "" #, no-wrap msgid "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" msgstr "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" #. type: Content of: diff --git a/doc/po/pl.po b/doc/po/pl.po index 2b9114c6e..3d89db060 100644 --- a/doc/po/pl.po +++ b/doc/po/pl.po @@ -5509,11 +5509,11 @@ msgstr "" #, no-wrap msgid "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" msgstr "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" #. type: Content of: diff --git a/doc/po/pt.po b/doc/po/pt.po index 82d470426..dc91fddca 100644 --- a/doc/po/pt.po +++ b/doc/po/pt.po @@ -6007,11 +6007,11 @@ msgstr "" #, no-wrap msgid "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" msgstr "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" #. type: Content of: diff --git a/doc/po/pt_BR.po b/doc/po/pt_BR.po index 44e2f17f8..b6bd0fe09 100644 --- a/doc/po/pt_BR.po +++ b/doc/po/pt_BR.po @@ -4393,7 +4393,7 @@ msgstr "" #, fuzzy, no-wrap msgid "" "Package: gnome* /kde/\n" -"Pin: release n=experimental\n" +"Pin: release a=experimental\n" "Pin-Priority: 500\n" msgstr "" "\n" -- cgit v1.2.3 From 10b39ae62db1f0d15a208a286cc86aff06c2fb69 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Aug 2015 13:07:56 +0200 Subject: Add a parameter ConsiderFiles to GetPriority(VerIterator) This allows us to exclude files from being considered for the priority, so it will return only specific-version matches. --- apt-pkg/policy.cc | 5 +++-- apt-pkg/policy.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index c12d8699b..bf6ec0ff7 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -368,11 +368,12 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgIterator const &Pkg) return Pins[Pkg->ID].Priority; return 0; } -APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver) +APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver, bool considerFiles) { if (VerPins[Ver->ID].Type != pkgVersionMatch::None) return VerPins[Ver->ID].Priority; - + if (!considerFiles) + return 0; int priority = std::numeric_limits::min(); for (pkgCache::VerFileIterator file = Ver.FileList(); file.end() == false; file++) diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index b3e1ec6b1..5be6657e9 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -80,7 +80,7 @@ class pkgPolicy : public pkgDepCache::Policy // Things for the cache interface. virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; virtual signed short GetPriority(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; - virtual signed short GetPriority(pkgCache::VerIterator const &Pkg); + virtual signed short GetPriority(pkgCache::VerIterator const &Pkg, bool ConsiderFiles = true); virtual signed short GetPriority(pkgCache::PkgFileIterator const &File) APT_OVERRIDE; bool InitDefaults(); -- cgit v1.2.3 From e595c45791716891b7b21292926f9913b333009d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Aug 2015 13:08:51 +0200 Subject: apt-cache: Modify policy output to use per-version pins Also optionally enable old output by setting APT::Policy=0. --- cmdline/apt-cache.cc | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index e61914298..b9da85b34 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1667,19 +1667,33 @@ static bool Policy(CommandLine &CmdL) pkgCache::PkgIterator I = Cache->PkgBegin(); for (;I.end() != true; ++I) { - if (Plcy->GetPriority(I) == 0) + // Old code for debugging + if (_config->FindI("APT::Policy", 1) < 1) { + if (Plcy->GetPriority(I) == 0) + continue; + + // Print the package name and the version we are forcing to + cout << " " << I.FullName(true) << " -> "; + + pkgCache::VerIterator V = Plcy->GetMatch(I); + if (V.end() == true) + cout << _("(not found)") << endl; + else + cout << V.VerStr() << endl; + continue; + } + // New code + for (pkgCache::VerIterator V = I.VersionList(); !V.end(); V++) { + auto Prio = Plcy->GetPriority(V, false); + if (Prio == 0) + continue; - // Print the package name and the version we are forcing to - cout << " " << I.FullName(true) << " -> "; - - pkgCache::VerIterator V = Plcy->GetMatch(I); - if (V.end() == true) - cout << _("(not found)") << endl; - else - cout << V.VerStr() << endl; - } - + // Print the package name and the version we are forcing to + cout << " " << I.FullName(true) << " -> "; + cout << V.VerStr() << _(" with priority ") << Prio << endl; + } + } return true; } @@ -1715,7 +1729,7 @@ static bool Policy(CommandLine &CmdL) cout << V.VerStr() << endl; // Pinned version - if (Plcy->GetPriority(Pkg) != 0) + if (_config->FindI("APT::Policy", 1) < 1 && Plcy->GetPriority(Pkg) != 0) { cout << _(" Package pin: "); V = Plcy->GetMatch(Pkg); @@ -1733,7 +1747,10 @@ static bool Policy(CommandLine &CmdL) cout << " *** " << V.VerStr(); else cout << " " << V.VerStr(); - cout << " " << Plcy->GetPriority(V) << endl; + if (_config->FindI("APT::Policy", 1) < 1) + cout << " " << Plcy->GetPriority(Pkg) << endl; + else + cout << " " << Plcy->GetPriority(V) << endl; for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; ++VF) { // Locate the associated index files so we can derive a description -- cgit v1.2.3 From 32cc424bf5e99c101cfa350e18127cbcafddd8a9 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Aug 2015 13:10:32 +0200 Subject: Only make Upgradable() return true for packages with a candidate If there is no candidate, the package should not be considered upgradeable. LP: #896689 --- apt-pkg/depcache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index aa281f695..6a1d6f8b3 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -250,7 +250,7 @@ class pkgDepCache : protected pkgCache::Namespace inline bool Keep() const {return Mode == ModeKeep;}; inline bool Protect() const {return (iFlags & Protected) == Protected;}; inline bool Upgrade() const {return Status > 0 && Mode == ModeInstall;}; - inline bool Upgradable() const {return Status >= 1;}; + inline bool Upgradable() const {return Status >= 1 && CandidateVer != NULL;}; inline bool Downgrade() const {return Status < 0 && Mode == ModeInstall;}; inline bool Held() const {return Status != 0 && Keep();}; inline bool NowBroken() const {return (DepState & DepNowMin) != DepNowMin;}; -- cgit v1.2.3 From f3f06cae53d8ed5742f47de46d9f9808cfc5ec29 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Aug 2015 18:01:24 +0200 Subject: apt-cache: Improve translateability of the "with priority" thing Gbp-Dch: ignore --- cmdline/apt-cache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index b9da85b34..a2c445401 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1689,9 +1689,9 @@ static bool Policy(CommandLine &CmdL) if (Prio == 0) continue; + cout << " "; // Print the package name and the version we are forcing to - cout << " " << I.FullName(true) << " -> "; - cout << V.VerStr() << _(" with priority ") << Prio << endl; + ioprintf(cout, _("%s -> %s with priority %d\n"), I.FullName(true).c_str(), V.VerStr(), Prio); } } return true; -- cgit v1.2.3 From 809aa216c630f1cc61b0c3b9d992d4a3be14be3c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Aug 2015 20:44:40 +0200 Subject: policy: Be more strict about parsing pin files, and document prio 0 Treat invalid pin priorities and overflows as an error. Closes: #429912 --- apt-pkg/policy.cc | 13 ++++++++++--- apt-pkg/tagfile.cc | 9 ++++++++- doc/apt_preferences.5.xml | 4 ++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index bf6ec0ff7..76c36b71b 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -478,11 +478,18 @@ bool ReadPinFile(pkgPolicy &Plcy,string File) } for (; Word != End && isspace(*Word) != 0; Word++); - short int priority = Tags.FindI("Pin-Priority", 0); + int priority = Tags.FindI("Pin-Priority", 0); + if (priority < std::numeric_limits::min() || + priority > std::numeric_limits::max() || + _error->PendingError()) { + return _error->Error(_("%s: Value %s is outside the range of valid pin priorities (%d to %d)"), + File.c_str(), Tags.FindS("Pin-Priority").c_str(), + std::numeric_limits::min(), + std::numeric_limits::max()); + } if (priority == 0) { - _error->Warning(_("No priority (or zero) specified for pin")); - continue; + return _error->Error(_("No priority (or zero) specified for pin")); } istringstream s(Name); diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 253b1b7a3..8acecd735 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -533,9 +533,16 @@ signed int pkgTagSection::FindI(const char *Tag,signed long Default) const return Default; strncpy(S,Start,Stop-Start); S[Stop - Start] = 0; - + + errno = 0; char *End; signed long Result = strtol(S,&End,10); + if (errno == ERANGE) + _error->Errno("strtol", _("Cannot convert %s to integer"), S); + if (Result < std::numeric_limits::min() || Result > std::numeric_limits::max()) { + errno = ERANGE; + _error->Errno("", _("Cannot convert %s to integer"), S); + } if (S == End) return Default; return Result; diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index 16e6a7aa0..5703203b0 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -339,6 +339,10 @@ only if there is no installed version of the package P < 0 prevents the version from being installed + +P = 0 +has undefined behaviour, do not use it. + -- cgit v1.2.3 From 85b9b32933eaeda6119d7a0224b5070ab8230c6b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Aug 2015 20:46:00 +0200 Subject: apt_preferences(5): Re-document how priorities are calculated The old text did not match either the old or the new implementation, so let's rewrite it to explain the new implementation. Closes: #554773 --- doc/apt_preferences.5.xml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index 5703203b0..81e0bd220 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -346,11 +346,14 @@ only if there is no installed version of the package -If any specific-form records match an available package version then the -first such record determines the priority of the package version. -Failing that, -if any general-form records match an available package version then the -first such record determines the priority of the package version. + +The first specific-form record matching an available package version determines +the priority of the package version. +Failing that, the priority of the package is defined as the maximum of all +priorities defined by generic-form records matching the version. +Records defined using patterns in the Pin field other than "*" are treated like +specific-form records. + For example, suppose the APT preferences file contains the three records presented earlier: -- cgit v1.2.3 From a1dfe33790edda246a23a5c5d3c432cd8429e848 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Aug 2015 23:44:33 +0200 Subject: Drop the Section field from pkgCache::Package again This somehow got back, we don't really know why. Emulate the Section() method in the PkgIterator by looking at the section of the head of the VersionList. --- apt-pkg/cacheiterators.h | 8 +++----- apt-pkg/pkgcache.h | 6 ------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index f8321079a..48547e564 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -157,11 +157,7 @@ class pkgCache::PkgIterator: public Iterator { inline const char *Name() const { return Group().Name(); } // Versions have sections - and packages can have different versions with different sections // so this interface is broken by design. Run as fast as you can to Version.Section(). - APT_DEPRECATED inline const char *Section() const { - APT_IGNORE_DEPRECATED_PUSH - return S->Section == 0?0:Owner->StrP + S->Section; - APT_IGNORE_DEPRECATED_POP - } + APT_DEPRECATED inline const char *Section() const; inline bool Purge() const {return S->CurrentState == pkgCache::State::Purge || (S->CurrentVer == 0 && S->CurrentState == pkgCache::State::NotInstalled);} inline const char *Arch() const {return S->Arch == 0?0:Owner->StrP + S->Arch;} @@ -518,5 +514,7 @@ inline pkgCache::VerFileIterator pkgCache::VerIterator::FileList() const {return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);} inline pkgCache::DescFileIterator pkgCache::DescIterator::FileList() const {return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);} +APT_DEPRECATED inline const char * pkgCache::PkgIterator::Section() const + {return S->VersionList == 0 ? 0 : VersionList().Section();} /*}}}*/ #endif diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index e59697c28..ff250b532 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -429,12 +429,6 @@ struct pkgCache::Package map_pointer_t VersionList; // Version /** \brief index to the installed version */ map_pointer_t CurrentVer; // Version - /** \brief indicates nothing (consistently) - This field used to contain ONE section the package belongs to, - if those differs between versions it is a RANDOM one. - The Section() method tries to reproduce it, but the only sane - thing to do is use the Section field from the version! */ - APT_DEPRECATED map_ptrloc Section; // StringItem /** \brief index of the group this package belongs to */ map_pointer_t Group; // Group the Package belongs to -- cgit v1.2.3 From bb08e2046e18014e01d54606784936c25dff84b8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 13 Aug 2015 10:31:50 +0200 Subject: Fix integration tests for the removal of the Package pin output This should make them work again. --- test/integration/test-bug-543966-downgrade-below-1000-pin | 11 ++++------- test/integration/test-policy-pinning | 6 +----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/test/integration/test-bug-543966-downgrade-below-1000-pin b/test/integration/test-bug-543966-downgrade-below-1000-pin index ede9ad6aa..435b6876e 100755 --- a/test/integration/test-bug-543966-downgrade-below-1000-pin +++ b/test/integration/test-bug-543966-downgrade-below-1000-pin @@ -33,20 +33,17 @@ Pin-Priority: $2" > rootdir/etc/apt/preferences testpinning() { - local PKGPIN='' local PKGPINPRIO='' local REPPINPRIO='' if [ "$1" != '*' ]; then PKGPINPRIO='' REPPINPRIO=' 500' - PKGPIN='Package pin: 5.0.0 - ' fi writepin "$1" '99' testsuccessequal "base-files: Installed: 5.0.0-1 Candidate: 5.0.0-1 - ${PKGPIN}Version table: + Version table: *** 5.0.0-1 100 100 $STATUS 5.0.0 ${PKGPINPRIO:-99} @@ -56,7 +53,7 @@ testpinning() { testsuccessequal "base-files: Installed: 5.0.0-1 Candidate: 5.0.0-1 - ${PKGPIN}Version table: + Version table: *** 5.0.0-1 100 100 $STATUS 5.0.0 ${PKGPINPRIO:-100} @@ -66,7 +63,7 @@ testpinning() { testsuccessequal "base-files: Installed: 5.0.0-1 Candidate: 5.0.0-1 - ${PKGPIN}Version table: + Version table: *** 5.0.0-1 100 100 $STATUS 5.0.0 ${PKGPINPRIO:-999} @@ -76,7 +73,7 @@ testpinning() { testsuccessequal "base-files: Installed: 5.0.0-1 Candidate: 5.0.0 - ${PKGPIN}Version table: + Version table: *** 5.0.0-1 100 100 $STATUS 5.0.0 ${PKGPINPRIO:-1000} diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index c4f478efc..1c8d92bcc 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -89,10 +89,6 @@ testequalpolicycoolstuff() { local AB="$3" local AS="$4" local PB="$5" - local PINVERSION="$6" - if [ -n "$PINVERSION" ]; then - PINVERSION="Package pin: $PINVERSION - " fi local IS="" local IB="" @@ -118,7 +114,7 @@ testequalpolicycoolstuff() { testsuccessequal "coolstuff: Installed: $INSTALLED Candidate: $CANDIDATE - ${PINVERSION}Version table:${BPO2ARCHIVE} + Version table:${BPO2ARCHIVE} $IB 2.0~bpo1 $PB ${BPO1ARCHIVE}$SB $IS 1.0 $AS -- cgit v1.2.3 From eb8ef1bb77a8fe2909a861fff3255ef6330c8ed5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 13 Aug 2015 10:48:22 +0200 Subject: Remove an invalid fi from a testcase Gbp-Dch: ignore --- test/integration/test-policy-pinning | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index 1c8d92bcc..d54e1bc36 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -89,7 +89,6 @@ testequalpolicycoolstuff() { local AB="$3" local AS="$4" local PB="$5" - fi local IS="" local IB="" local SB="" -- cgit v1.2.3 From 47c37a1bfc2f2f372bf057bf68bde0b3b6f0ec8f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 13 Aug 2015 10:43:49 +0200 Subject: C++11: Switch from auto_ptr to unique_ptr This is nicer --- apt-pkg/depcache.cc | 2 +- ftparchive/writer.cc | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 02f61bf13..92b073908 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -2010,7 +2010,7 @@ bool pkgDepCache::MarkAndSweep(InRootSetFunc &rootFunc) } bool pkgDepCache::MarkAndSweep() { - std::auto_ptr f(GetRootSetFunc()); + std::unique_ptr f(GetRootSetFunc()); if(f.get() != NULL) return MarkAndSweep(*f.get()); else diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 1bc926d21..7f09a3758 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -420,7 +420,7 @@ bool PackagesWriter::DoPackage(string FileName) Architecture = Arch; else Architecture = Tags.FindS("Architecture"); - auto_ptr OverItem(Over.GetItem(Package,Architecture)); + unique_ptr OverItem(Over.GetItem(Package,Architecture)); if (Package.empty() == true) return _error->Error(_("Archive had no package field")); @@ -434,7 +434,7 @@ bool PackagesWriter::DoPackage(string FileName) ioprintf(c1out, _(" %s has no override entry\n"), Package.c_str()); } - OverItem = auto_ptr(new Override::Item); + OverItem = unique_ptr(new Override::Item); OverItem->FieldOverride["Section"] = Tags.FindS("Section"); OverItem->Priority = Tags.FindS("Priority"); } @@ -660,7 +660,7 @@ bool SourcesWriter::DoPackage(string FileName) string BestPrio; string Bins = Tags.FindS("Binary"); char Buffer[Bins.length() + 1]; - auto_ptr OverItem(0); + unique_ptr OverItem(nullptr); if (Bins.empty() == false) { strcpy(Buffer,Bins.c_str()); @@ -673,7 +673,7 @@ bool SourcesWriter::DoPackage(string FileName) unsigned char BestPrioV = pkgCache::State::Extra; for (unsigned I = 0; BinList[I] != 0; I++) { - auto_ptr Itm(BOver.GetItem(BinList[I])); + unique_ptr Itm(BOver.GetItem(BinList[I])); if (Itm.get() == 0) continue; @@ -685,7 +685,7 @@ bool SourcesWriter::DoPackage(string FileName) } if (OverItem.get() == 0) - OverItem = Itm; + OverItem = std::move(Itm); } } @@ -698,23 +698,23 @@ bool SourcesWriter::DoPackage(string FileName) ioprintf(c1out, _(" %s has no override entry\n"), Tags.FindS("Source").c_str()); } - OverItem = auto_ptr(new Override::Item); + OverItem.reset(new Override::Item); } struct stat St; if (stat(FileName.c_str(), &St) != 0) return _error->Errno("fstat","Failed to stat %s",FileName.c_str()); - auto_ptr SOverItem(SOver.GetItem(Tags.FindS("Source"))); - // const auto_ptr autoSOverItem(SOverItem); + unique_ptr SOverItem(SOver.GetItem(Tags.FindS("Source"))); + // const unique_ptr autoSOverItem(SOverItem); if (SOverItem.get() == 0) { ioprintf(c1out, _(" %s has no source override entry\n"), Tags.FindS("Source").c_str()); - SOverItem = auto_ptr(BOver.GetItem(Tags.FindS("Source"))); + SOverItem = unique_ptr(BOver.GetItem(Tags.FindS("Source"))); if (SOverItem.get() == 0) { ioprintf(c1out, _(" %s has no binary override entry either\n"), Tags.FindS("Source").c_str()); - SOverItem = auto_ptr(new Override::Item); + SOverItem = unique_ptr(new Override::Item); *SOverItem = *OverItem; } } -- cgit v1.2.3 From 6c413b188618b9fcb5368b60971dfa5d45b3cd74 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 13 Aug 2015 10:49:31 +0200 Subject: Mark SPtr as deprecated, and convert users to std::unique_ptr Switch to std::unique_ptr, as this is safer than SPtr. --- apt-pkg/contrib/sptr.h | 2 +- apt-pkg/pkgcachegen.cc | 28 ++++++++++++++-------------- apt-private/private-install.cc | 10 +++++----- cmdline/apt-get.cc | 6 +++--- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/apt-pkg/contrib/sptr.h b/apt-pkg/contrib/sptr.h index e2e811b1d..5cf118b84 100644 --- a/apt-pkg/contrib/sptr.h +++ b/apt-pkg/contrib/sptr.h @@ -22,7 +22,7 @@ #define SMART_POINTER_H template -class SPtr +class APT_DEPRECATED SPtr { public: T *Ptr; diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index ef7afda94..a9de20878 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1250,8 +1250,8 @@ static bool CheckValidity(const string &CacheFile, // Map it FileFd CacheF(CacheFile,FileFd::ReadOnly); - SPtr Map = new MMap(CacheF,0); - pkgCache Cache(Map); + std::unique_ptr Map(new MMap(CacheF,0)); + pkgCache Cache(Map.get()); if (_error->PendingError() == true || Map->Size() == 0) { if (Debug == true) @@ -1342,7 +1342,7 @@ static bool CheckValidity(const string &CacheFile, } if (OutMap != 0) - *OutMap = Map.UnGuard(); + *OutMap = Map.release(); return true; } /*}}}*/ @@ -1483,16 +1483,16 @@ static bool writeBackMMapToFile(pkgCacheGenerator * const Gen, DynamicMMap * con return true; } static bool loadBackMMapFromFile(std::unique_ptr &Gen, - SPtr &Map, OpProgress * const Progress, std::string const &FileName) + std::unique_ptr &Map, OpProgress * const Progress, std::string const &FileName) { - Map = CreateDynamicMMap(NULL, 0); + Map.reset(CreateDynamicMMap(NULL, 0)); FileFd CacheF(FileName, FileFd::ReadOnly); map_pointer_t const alloc = Map->RawAllocate(CacheF.Size()); if ((alloc == 0 && _error->PendingError()) || CacheF.Read((unsigned char *)Map->Data() + alloc, CacheF.Size()) == false) return false; - Gen.reset(new pkgCacheGenerator(Map.Get(),Progress)); + Gen.reset(new pkgCacheGenerator(Map.get(),Progress)); return true; } APT_DEPRECATED bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, @@ -1578,7 +1578,7 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress } // At this point we know we need to construct something, so get storage ready - SPtr Map = CreateDynamicMMap(NULL, 0); + std::unique_ptr Map(CreateDynamicMMap(NULL, 0)); if (Debug == true) std::clog << "Open memory Map (not filebased)" << std::endl; @@ -1599,7 +1599,7 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress { if (Debug == true) std::clog << "srcpkgcache.bin is NOT valid - rebuild" << std::endl; - Gen.reset(new pkgCacheGenerator(Map.Get(),Progress)); + Gen.reset(new pkgCacheGenerator(Map.get(),Progress)); TotalSize += ComputeSize(&List, Files.begin(),Files.end()); if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, &List, @@ -1607,7 +1607,7 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress return false; if (Writeable == true && SrcCacheFile.empty() == false) - if (writeBackMMapToFile(Gen.get(), Map.Get(), SrcCacheFile) == false) + if (writeBackMMapToFile(Gen.get(), Map.get(), SrcCacheFile) == false) return false; } @@ -1620,7 +1620,7 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress return false; if (Writeable == true && CacheFile.empty() == false) - if (writeBackMMapToFile(Gen.get(), Map.Get(), CacheFile) == false) + if (writeBackMMapToFile(Gen.get(), Map.get(), CacheFile) == false) return false; } @@ -1644,7 +1644,7 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress } if (OutMap != nullptr) - *OutMap = Map.UnGuard(); + *OutMap = Map.release(); if (Debug == true) std::clog << "Everything is ready for shipping" << std::endl; @@ -1662,7 +1662,7 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O if (_system->AddStatusFiles(Files) == false) return false; - SPtr Map = CreateDynamicMMap(NULL, 0); + std::unique_ptr Map(CreateDynamicMMap(NULL, 0)); map_filesize_t CurrentSize = 0; map_filesize_t TotalSize = 0; @@ -1671,7 +1671,7 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O // Build the status cache if (Progress != NULL) Progress->OverallProgress(0,1,1,_("Reading package lists")); - pkgCacheGenerator Gen(Map.Get(),Progress); + pkgCacheGenerator Gen(Map.get(),Progress); if (_error->PendingError() == true) return false; if (BuildCache(Gen,Progress,CurrentSize,TotalSize, NULL, @@ -1680,7 +1680,7 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O if (_error->PendingError() == true) return false; - *OutMap = Map.UnGuard(); + *OutMap = Map.release(); return true; } diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 074874903..d2b4bed51 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -128,7 +128,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) pkgSourceList *List = Cache.GetSourceList(); // Create the package manager and prepare to download - SPtr PM= _system->CreatePM(Cache); + std::unique_ptr PM(_system->CreatePM(Cache)); if (PM->GetArchives(&Fetcher,List,&Recs) == false || _error->PendingError() == true) return false; @@ -492,9 +492,9 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, if (Cache->BrokenCount() != 0) BrokenFix = true; - SPtr Fix; + std::unique_ptr Fix(nullptr); if (_config->FindB("APT::Get::CallResolver", true) == true) - Fix = new pkgProblemResolver(Cache); + Fix.reset(new pkgProblemResolver(Cache)); unsigned short fallback = MOD_INSTALL; if (strcasecmp(CmdL.FileList[0],"remove") == 0) @@ -526,8 +526,8 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, } - TryToInstall InstallAction(Cache, Fix, BrokenFix); - TryToRemove RemoveAction(Cache, Fix); + TryToInstall InstallAction(Cache, Fix.get(), BrokenFix); + TryToRemove RemoveAction(Cache, Fix.get()); // new scope for the ActionGroup { diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index b0e646833..0b79c507a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1000,7 +1000,7 @@ static bool DoBuildDep(CommandLine &CmdL) { string Src; pkgSrcRecords::Parser *Last = 0; - SPtr LastOwner; + std::unique_ptr LastOwner; // an unpacked debian source tree using APT::String::Startswith; @@ -1012,7 +1012,7 @@ static bool DoBuildDep(CommandLine &CmdL) std::string TypeName = "Debian control file"; pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str()); if(Type != NULL) - LastOwner = Last = Type->CreateSrcPkgParser(*I); + LastOwner.reset(Last = Type->CreateSrcPkgParser(*I)); } // if its a local file (e.g. .dsc) use this else if (FileExists(*I)) @@ -1023,7 +1023,7 @@ static bool DoBuildDep(CommandLine &CmdL) string TypeName = "Debian " + flExtension(*I) + " file"; pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str()); if(Type != NULL) - LastOwner = Last = Type->CreateSrcPkgParser(*I); + LastOwner.reset(Last = Type->CreateSrcPkgParser(*I)); } else { // normal case, search the cache for the source file Last = FindSrc(*I,SrcRecs,Src,Cache); -- cgit v1.2.3 From 98cc7fd2c1d397623960baf69ae3cec04a87a23e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 13 Aug 2015 11:28:32 +0200 Subject: Deprecate SPtrArray and convert everyone to unique_ptr More standardization --- apt-pkg/algorithms.cc | 24 ++++++++++++------------ apt-pkg/contrib/fileutl.cc | 7 ++++--- apt-pkg/contrib/sptr.h | 2 +- apt-pkg/depcache.cc | 4 ++-- apt-pkg/orderlist.cc | 22 +++++++++++----------- apt-pkg/packagemanager.cc | 24 ++++++++++++------------ apt-pkg/pkgcachegen.cc | 8 ++++---- apt-pkg/policy.cc | 4 ++-- cmdline/apt-cache.cc | 6 +++--- cmdline/apt-get.cc | 2 +- 10 files changed, 52 insertions(+), 51 deletions(-) diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 747b73e05..446afa08d 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -476,8 +476,8 @@ void pkgProblemResolver::MakeScores() } // Copy the scores to advoid additive looping - SPtrArray OldScores = new int[Size]; - memcpy(OldScores,Scores,sizeof(*Scores)*Size); + std::unique_ptr OldScores(new int[Size]); + memcpy(OldScores.get(),Scores,sizeof(*Scores)*Size); /* Now we cause 1 level of dependency inheritance, that is we add the score of the packages that depend on the target Package. This @@ -702,17 +702,17 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) operates from highest score to lowest. This prevents problems when high score packages cause the removal of lower score packages that would cause the removal of even lower score packages. */ - SPtrArray PList = new pkgCache::Package *[Size]; - pkgCache::Package **PEnd = PList; + std::unique_ptr PList(new pkgCache::Package *[Size]); + pkgCache::Package **PEnd = PList.get(); for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I) *PEnd++ = I; This = this; - qsort(PList,PEnd - PList,sizeof(*PList),&ScoreSort); + qsort(PList.get(),PEnd - PList.get(),sizeof(PList[0]),&ScoreSort); if (_config->FindB("Debug::pkgProblemResolver::ShowScores",false) == true) { clog << "Show Scores" << endl; - for (pkgCache::Package **K = PList; K != PEnd; K++) + for (pkgCache::Package **K = PList.get(); K != PEnd; K++) if (Scores[(*K)->ID] != 0) { pkgCache::PkgIterator Pkg(Cache,*K); @@ -734,7 +734,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) for (int Counter = 0; Counter != 10 && Change == true; Counter++) { Change = false; - for (pkgCache::Package **K = PList; K != PEnd; K++) + for (pkgCache::Package **K = PList.get(); K != PEnd; K++) { pkgCache::PkgIterator I(Cache,*K); @@ -845,8 +845,8 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) /* Look across the version list. If there are no possible targets then we keep the package and bail. This is necessary if a package has a dep on another package that can't be found */ - SPtrArray VList = Start.AllTargets(); - if (*VList == 0 && (Flags[I->ID] & Protected) != Protected && + std::unique_ptr VList(Start.AllTargets()); + if (VList[0] == 0 && (Flags[I->ID] & Protected) != Protected && Start.IsNegative() == false && Cache[I].NowBroken() == false) { @@ -863,7 +863,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) } bool Done = false; - for (pkgCache::Version **V = VList; *V != 0; V++) + for (pkgCache::Version **V = VList.get(); *V != 0; V++) { pkgCache::VerIterator Ver(Cache,*V); pkgCache::PkgIterator Pkg = Ver.ParentPkg(); @@ -1233,8 +1233,8 @@ bool pkgProblemResolver::ResolveByKeepInternal() clog << "Package " << I.FullName(false) << " " << Start << endl; // Look at all the possible provides on this package - SPtrArray VList = Start.AllTargets(); - for (pkgCache::Version **V = VList; *V != 0; V++) + std::unique_ptr VList(Start.AllTargets()); + for (pkgCache::Version **V = VList.get(); *V != 0; V++) { pkgCache::VerIterator Ver(Cache,*V); pkgCache::PkgIterator Pkg = Ver.ParentPkg(); diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 4cc8112af..a6af27b00 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -52,6 +52,7 @@ #include #include +#include #ifdef HAVE_ZLIB #include @@ -159,7 +160,7 @@ bool CopyFile(FileFd &From,FileFd &To) return false; // Buffered copy between fds - SPtrArray Buf = new unsigned char[64000]; + std::unique_ptr Buf(new unsigned char[64000]); unsigned long long Size = From.Size(); while (Size != 0) { @@ -167,8 +168,8 @@ bool CopyFile(FileFd &From,FileFd &To) if (Size > 64000) ToRead = 64000; - if (From.Read(Buf,ToRead) == false || - To.Write(Buf,ToRead) == false) + if (From.Read(Buf.get(),ToRead) == false || + To.Write(Buf.get(),ToRead) == false) return false; Size -= ToRead; diff --git a/apt-pkg/contrib/sptr.h b/apt-pkg/contrib/sptr.h index 5cf118b84..92f4cdec8 100644 --- a/apt-pkg/contrib/sptr.h +++ b/apt-pkg/contrib/sptr.h @@ -43,7 +43,7 @@ class APT_DEPRECATED SPtr }; template -class SPtrArray +class APT_DEPRECATED SPtrArray { public: T *Ptr; diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 92b073908..367605826 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1281,9 +1281,9 @@ bool pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, Otherwise we remove the offender if needed */ else if (Start.IsNegative() == true && Start->Type != pkgCache::Dep::Obsoletes) { - SPtrArray List = Start.AllTargets(); + std::unique_ptr List(Start.AllTargets()); pkgCache::PkgIterator TrgPkg = Start.TargetPkg(); - for (Version **I = List; *I != 0; I++) + for (Version **I = List.get(); *I != 0; I++) { VerIterator Ver(*this,*I); PkgIterator Pkg = Ver.ParentPkg(); diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index edbdd09ab..dae37e8f8 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -142,9 +142,9 @@ bool pkgOrderList::DoRun() { // Temp list unsigned long Size = Cache.Head().PackageCount; - SPtrArray NList = new Package *[Size]; - SPtrArray AfterList = new Package *[Size]; - AfterEnd = AfterList; + std::unique_ptr NList(new Package *[Size]); + std::unique_ptr AfterList(new Package *[Size]); + AfterEnd = AfterList.get(); Depth = 0; WipeFlags(Added | AddPending | Loop | InList); @@ -154,7 +154,7 @@ bool pkgOrderList::DoRun() // Rebuild the main list into the temp list. iterator OldEnd = End; - End = NList; + End = NList.get(); for (iterator I = List; I != OldEnd; ++I) if (VisitNode(PkgIterator(Cache,*I), "DoRun") == false) { @@ -163,12 +163,12 @@ bool pkgOrderList::DoRun() } // Copy the after list to the end of the main list - for (Package **I = AfterList; I != AfterEnd; I++) + for (Package **I = AfterList.get(); I != AfterEnd; I++) *End++ = *I; // Swap the main list to the new list delete [] List; - List = NList.UnGuard(); + List = NList.release(); return true; } /*}}}*/ @@ -512,8 +512,8 @@ bool pkgOrderList::VisitRProvides(DepFunc F,VerIterator Ver) against it! */ bool pkgOrderList::VisitProvides(DepIterator D,bool Critical) { - SPtrArray List = D.AllTargets(); - for (Version **I = List; *I != 0; ++I) + std::unique_ptr List(D.AllTargets()); + for (Version **I = List.get(); *I != 0; ++I) { VerIterator Ver(Cache,*I); PkgIterator Pkg = Ver.ParentPkg(); @@ -541,7 +541,7 @@ bool pkgOrderList::VisitProvides(DepIterator D,bool Critical) } if (D.IsNegative() == false) return true; - for (Version **I = List; *I != 0; ++I) + for (Version **I = List.get(); *I != 0; ++I) { VerIterator Ver(Cache,*I); PkgIterator Pkg = Ver.ParentPkg(); @@ -1075,9 +1075,9 @@ void pkgOrderList::WipeFlags(unsigned long F) this fails to produce a suitable result. */ bool pkgOrderList::CheckDep(DepIterator D) { - SPtrArray List = D.AllTargets(); + std::unique_ptr List(D.AllTargets()); bool Hit = false; - for (Version **I = List; *I != 0; I++) + for (Version **I = List.get(); *I != 0; I++) { VerIterator Ver(Cache,*I); PkgIterator Pkg = Ver.ParentPkg(); diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 78142ab13..dcae01126 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -390,9 +390,9 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth) // to do anything at all for (DepIterator Cur = Start; true; ++Cur) { - SPtrArray VList = Cur.AllTargets(); + std::unique_ptr VList(Cur.AllTargets()); - for (Version **I = VList; *I != 0; ++I) + for (Version **I = VList.get(); *I != 0; ++I) { VerIterator Ver(Cache,*I); PkgIterator DepPkg = Ver.ParentPkg(); @@ -440,9 +440,9 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth) // probably due to loops. for (DepIterator Cur = Start; true; ++Cur) { - SPtrArray VList = Cur.AllTargets(); + std::unique_ptr VList(Cur.AllTargets()); - for (Version **I = VList; *I != 0; ++I) + for (Version **I = VList.get(); *I != 0; ++I) { VerIterator Ver(Cache,*I); PkgIterator DepPkg = Ver.ParentPkg(); @@ -515,9 +515,9 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth) // Search for dependencies which are unpacked but aren't configured yet (maybe loops) for (DepIterator Cur = Start; true; ++Cur) { - SPtrArray VList = Cur.AllTargets(); + std::unique_ptr VList(Cur.AllTargets()); - for (Version **I = VList; *I != 0; ++I) + for (Version **I = VList.get(); *I != 0; ++I) { VerIterator Ver(Cache,*I); PkgIterator DepPkg = Ver.ParentPkg(); @@ -726,8 +726,8 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c // Look for easy targets: packages that are already okay for (DepIterator Cur = Start; Bad == true; ++Cur) { - SPtrArray VList = Cur.AllTargets(); - for (Version **I = VList; *I != 0; ++I) + std::unique_ptr VList(Cur.AllTargets()); + for (Version **I = VList.get(); *I != 0; ++I) { VerIterator Ver(Cache,*I); PkgIterator Pkg = Ver.ParentPkg(); @@ -750,8 +750,8 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c // Look for something that could be configured. for (DepIterator Cur = Start; Bad == true && Cur.end() == false; ++Cur) { - SPtrArray VList = Cur.AllTargets(); - for (Version **I = VList; *I != 0; ++I) + std::unique_ptr VList(Cur.AllTargets()); + for (Version **I = VList.get(); *I != 0; ++I) { VerIterator Ver(Cache,*I); PkgIterator DepPkg = Ver.ParentPkg(); @@ -806,8 +806,8 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c End->Type == pkgCache::Dep::Obsoletes || End->Type == pkgCache::Dep::DpkgBreaks) { - SPtrArray VList = End.AllTargets(); - for (Version **I = VList; *I != 0; ++I) + std::unique_ptr VList(End.AllTargets()); + for (Version **I = VList.get(); *I != 0; ++I) { VerIterator Ver(Cache,*I); PkgIterator ConflictPkg = Ver.ParentPkg(); diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index a9de20878..68175a24a 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1260,8 +1260,8 @@ static bool CheckValidity(const string &CacheFile, return false; } - SPtrArray RlsVisited = new bool[Cache.HeaderP->ReleaseFileCount]; - memset(RlsVisited,0,sizeof(*RlsVisited)*Cache.HeaderP->ReleaseFileCount); + std::unique_ptr RlsVisited(new bool[Cache.HeaderP->ReleaseFileCount]); + memset(RlsVisited.get(),0,sizeof(RlsVisited[0])*Cache.HeaderP->ReleaseFileCount); std::vector Files; for (pkgSourceList::const_iterator i = List.begin(); i != List.end(); ++i) { @@ -1295,8 +1295,8 @@ static bool CheckValidity(const string &CacheFile, /* Now we check every index file, see if it is in the cache, verify the IMS data and check that it is on the disk too.. */ - SPtrArray Visited = new bool[Cache.HeaderP->PackageFileCount]; - memset(Visited,0,sizeof(*Visited)*Cache.HeaderP->PackageFileCount); + std::unique_ptr Visited(new bool[Cache.HeaderP->PackageFileCount]); + memset(Visited.get(),0,sizeof(Visited[0])*Cache.HeaderP->PackageFileCount); for (std::vector::const_reverse_iterator PkgFile = Files.rbegin(); PkgFile != Files.rend(); ++PkgFile) { if (Debug == true) diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 76c36b71b..4711372bc 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -100,8 +100,8 @@ bool pkgPolicy::InitDefaults() } // Apply the defaults.. - SPtrArray Fixed = new bool[Cache->HeaderP->PackageFileCount]; - memset(Fixed,0,sizeof(*Fixed)*Cache->HeaderP->PackageFileCount); + std::unique_ptr Fixed(new bool[Cache->HeaderP->PackageFileCount]); + memset(Fixed.get(),0,sizeof(Fixed[0])*Cache->HeaderP->PackageFileCount); StatusOverride = false; for (vector::const_iterator I = Defaults.begin(); I != Defaults.end(); ++I) { diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index a2c445401..117a44292 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -749,9 +749,9 @@ static bool ShowDepends(CommandLine &CmdL, bool const RevDepends) } // Display all solutions - SPtrArray List = D.AllTargets(); - pkgPrioSortList(*Cache,List); - for (pkgCache::Version **I = List; *I != 0; I++) + std::unique_ptr List(D.AllTargets()); + pkgPrioSortList(*Cache,List.get()); + for (pkgCache::Version **I = List.get(); *I != 0; I++) { pkgCache::VerIterator V(*Cache,*I); if (V != Cache->VerP + V.ParentPkg()->VersionList || diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0b79c507a..61ed41164 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -701,7 +701,7 @@ static bool DoSource(CommandLine &CmdL) AcqTextStatus Stat(std::cout, ScreenWidth,_config->FindI("quiet",0)); pkgAcquire Fetcher(&Stat); - SPtrArray Dsc = new DscFile[CmdL.FileSize()]; + std::unique_ptr Dsc(new DscFile[CmdL.FileSize()]); // insert all downloaded uris into this set to avoid downloading them // twice -- cgit v1.2.3 From 5a3264396f9b167fa99fb6e375ae8b978d829a39 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 24 Sep 2014 22:18:16 +0200 Subject: Use setresuid() and setresgid() where available --- apt-pkg/contrib/fileutl.cc | 16 +++++++++++++--- buildlib/config.h.in | 4 +++- configure.ac | 4 +++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index a6af27b00..1be782bac 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -2252,22 +2252,32 @@ bool DropPrivileges() /*{{{*/ return _error->Error("No user %s, can not drop rights", toUser.c_str()); // Do not change the order here, it might break things + // Get rid of all our supplementary groups first if (setgroups(1, &pw->pw_gid)) return _error->Errno("setgroups", "Failed to setgroups"); + // Now change the group ids to the new user +#ifdef HAVE_SETRESGID + if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) != 0) + return _error->Errno("setresgid", "Failed to set new group ids"); +#else if (setegid(pw->pw_gid) != 0) return _error->Errno("setegid", "Failed to setegid"); if (setgid(pw->pw_gid) != 0) return _error->Errno("setgid", "Failed to setgid"); +#endif + // Change the user ids to the new user +#ifdef HAVE_SETRESUID + if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) != 0) + return _error->Errno("setresuid", "Failed to set new user ids"); +#else if (setuid(pw->pw_uid) != 0) return _error->Errno("setuid", "Failed to setuid"); - - // the seteuid() is probably uneeded (at least thats what the linux - // man-page says about setuid(2)) but we cargo culted it anyway if (seteuid(pw->pw_uid) != 0) return _error->Errno("seteuid", "Failed to seteuid"); +#endif // Verify that the user has only a single group, and the correct one gid_t groups[1]; diff --git a/buildlib/config.h.in b/buildlib/config.h.in index 66ab33c2b..c6b1ee669 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -28,9 +28,11 @@ /* If there is no socklen_t, define this for the netdb shim */ #undef NEED_SOCKLEN_T_DEFINE -/* We need the getresuid() function */ +/* Check for getresuid() function and similar ones */ #undef HAVE_GETRESUID #undef HAVE_GETRESGID +#undef HAVE_SETRESUID +#undef HAVE_SETRESGID /* Define to the size of the filesize containing structures */ #undef _FILE_OFFSET_BITS diff --git a/configure.ac b/configure.ac index 2221833a1..feba7be61 100644 --- a/configure.ac +++ b/configure.ac @@ -174,9 +174,11 @@ AC_EGREP_HEADER(h_errno, netdb.h, [AC_MSG_RESULT(normal)], dnl check for setuid checking function -AC_CHECK_FUNCS(getresuid getresgid) +AC_CHECK_FUNCS(getresuid getresgid setresuid setresgid) AC_SUBST(HAVE_GETRESUID) AC_SUBST(HAVE_GETRESGID) +AC_SUBST(HAVE_SETRESUID) +AC_SUBST(HAVE_SETRESGID) dnl Check for doxygen AC_PATH_PROG(DOXYGEN, doxygen) -- cgit v1.2.3 From df7c9fd2224c1de4a155796e292fb919f559a674 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 13 Aug 2015 21:14:00 +0200 Subject: Accept --upgradeable as synonym for --upgradable It's a tiny diff, so why not? But no need to document it. Closes: #787846 --- apt-private/private-cmndline.cc | 1 + doc/apt.8.xml | 3 ++- doc/po/apt-doc.pot | 3 ++- doc/po/de.po | 4 ++-- doc/po/es.po | 2 +- doc/po/fr.po | 2 +- doc/po/it.po | 4 ++-- doc/po/ja.po | 4 ++-- doc/po/pl.po | 2 +- doc/po/pt.po | 2 +- doc/po/pt_BR.po | 2 +- 11 files changed, 16 insertions(+), 13 deletions(-) diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index cfdc13259..fa8416824 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -242,6 +242,7 @@ static bool addArgumentsAPT(std::vector &Args, char const * c if (CmdMatches("list")) { addArg(0,"installed","APT::Cmd::Installed",0); + addArg(0,"upgradeable","APT::Cmd::Upgradable",0); addArg(0,"upgradable","APT::Cmd::Upgradable",0); addArg(0,"manual-installed","APT::Cmd::Manual-Installed",0); addArg('v', "verbose", "APT::Cmd::List-Include-Summary", 0); diff --git a/doc/apt.8.xml b/doc/apt.8.xml index 29bf96751..e00b6417a 100644 --- a/doc/apt.8.xml +++ b/doc/apt.8.xml @@ -44,7 +44,8 @@ display a list of packages. It supports shell pattern for matching package names and the following options: , - , + , + , are supported. diff --git a/doc/po/apt-doc.pot b/doc/po/apt-doc.pot index 98c2b66b5..509b5da34 100644 --- a/doc/po/apt-doc.pot +++ b/doc/po/apt-doc.pot @@ -531,7 +531,8 @@ msgid "" "list is used to display a list of packages. It supports " "shell pattern for matching package names and the following options: " ", , " -" are supported." +", are " +"supported." msgstr "" #. type: Content of: diff --git a/doc/po/de.po b/doc/po/de.po index 4eb458d17..bc8d8c899 100644 --- a/doc/po/de.po +++ b/doc/po/de.po @@ -662,13 +662,13 @@ msgstr "" msgid "" "list is used to display a list of packages. It supports " "shell pattern for matching package names and the following options: " -", , , , , are supported." msgstr "" "list wird benutzt, um eine Paketliste anzuzeigen. Es " "unterstützt Shell-Muster zur Beschränkung auf passende Paketnamen. Die " "folgenden Optionen werden unterstützt: , " -", ." +", , ." #. type: Content of: #: apt.8.xml:54 diff --git a/doc/po/es.po b/doc/po/es.po index 590ae4aeb..5cba392d4 100644 --- a/doc/po/es.po +++ b/doc/po/es.po @@ -742,7 +742,7 @@ msgstr "" msgid "" "list is used to display a list of packages. It supports " "shell pattern for matching package names and the following options: " -", , , , , are supported." msgstr "" diff --git a/doc/po/fr.po b/doc/po/fr.po index 85869a2b7..66f5e39c3 100644 --- a/doc/po/fr.po +++ b/doc/po/fr.po @@ -658,7 +658,7 @@ msgstr "" msgid "" "list is used to display a list of packages. It supports " "shell pattern for matching package names and the following options: " -", , , , , are supported." msgstr "" "La commande list est utilisée pour afficher une liste de " diff --git a/doc/po/it.po b/doc/po/it.po index 28e97f14b..21fbebd93 100644 --- a/doc/po/it.po +++ b/doc/po/it.po @@ -710,13 +710,13 @@ msgstr "" msgid "" "list is used to display a list of packages. It supports " "shell pattern for matching package names and the following options: " -", , , , , are supported." msgstr "" "list viene usato per visualizzare un elenco di pacchetti. " "Permette l'uso dei modelli di shell per la corrispondenza con nomi di " "pacchetto e sono gestite le seguenti opzioni: , " -", ." +", , ." #. type: Content of: #: apt.8.xml:54 diff --git a/doc/po/ja.po b/doc/po/ja.po index 3e0712125..ba72f0d02 100644 --- a/doc/po/ja.po +++ b/doc/po/ja.po @@ -704,12 +704,12 @@ msgstr "" msgid "" "list is used to display a list of packages. It supports " "shell pattern for matching package names and the following options: " -", , , , , are supported." msgstr "" "パッケージ一覧を表示するには list を使います。パッケージ名" "のマッチングにシェルパターン、そしてオプション を" +"option>、 , を" "サポートしています。" #. type: Content of: diff --git a/doc/po/pl.po b/doc/po/pl.po index 481d85af6..8081be57b 100644 --- a/doc/po/pl.po +++ b/doc/po/pl.po @@ -700,7 +700,7 @@ msgstr "" msgid "" "list is used to display a list of packages. It supports " "shell pattern for matching package names and the following options: " -", , , , , are supported." msgstr "" diff --git a/doc/po/pt.po b/doc/po/pt.po index 3aefcc2a9..702cae479 100644 --- a/doc/po/pt.po +++ b/doc/po/pt.po @@ -707,7 +707,7 @@ msgstr "" msgid "" "list is used to display a list of packages. It supports " "shell pattern for matching package names and the following options: " -", , , , , are supported." msgstr "" "list é usado para mostrar uma lista de pacotes. Suporta " diff --git a/doc/po/pt_BR.po b/doc/po/pt_BR.po index 88b479e75..5f03f7dac 100644 --- a/doc/po/pt_BR.po +++ b/doc/po/pt_BR.po @@ -523,7 +523,7 @@ msgstr "" msgid "" "list is used to display a list of packages. It supports " "shell pattern for matching package names and the following options: " -", , , , , are supported." msgstr "" -- cgit v1.2.3 From dd14b7a562c54bb9ce551da1f8a80c78da5a4b6e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 10:02:08 +0200 Subject: po/fr.po: Remove the unbreakable space before ! in the confirm string This was probably really annoying for French people wanting to remove essential packages, sorry about that. Closes: #727680 --- po/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/fr.po b/po/fr.po index 0a437907f..2d28ab42b 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1507,7 +1507,7 @@ msgstr "" #. careful with hard to type or special characters (like non-breaking spaces) #: apt-private/private-install.cc:195 msgid "Yes, do as I say!" -msgstr "Oui, faites ce que je vous dis !" +msgstr "Oui, faites ce que je vous dis !" #: apt-private/private-install.cc:197 #, c-format -- cgit v1.2.3 From b381a482eab0fc7b65b63cf0512ef1f97d775e34 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 11:49:45 +0200 Subject: Replace --force-yes by various options starting with --allow This enables more fine grained control over such exceptions. --- apt-private/private-cmndline.cc | 3 + apt-private/private-download.cc | 6 +- apt-private/private-install.cc | 43 ++++++---- doc/apt-get.8.xml | 26 +++++- test/integration/test-allow | 98 ++++++++++++++++++++++ .../integration/test-apt-get-update-unauth-warning | 2 +- test/integration/test-apt-never-markauto-sections | 2 +- test/integration/test-apt-update-nofallback | 2 +- test/integration/test-apt-update-rollback | 4 +- ...bug-712116-dpkg-pre-install-pkgs-hook-multiarch | 2 +- test/integration/test-releasefile-verification | 4 +- 11 files changed, 167 insertions(+), 25 deletions(-) create mode 100755 test/integration/test-allow diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index fa8416824..487349c8c 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -202,6 +202,9 @@ static bool addArgumentsAPTGet(std::vector &Args, char const addArg(0,"ignore-hold","APT::Ignore-Hold",0); addArg(0,"upgrade","APT::Get::upgrade",0); addArg(0,"only-upgrade","APT::Get::Only-Upgrade",0); + addArg(0,"allow-change-held-packages","APT::Get::allow-change-held-packages",CommandLine::Boolean); + addArg(0,"allow-remove-essential","APT::Get::allow-remove-essential",CommandLine::Boolean); + addArg(0,"allow-downgrades","APT::Get::allow-downgrades",CommandLine::Boolean); addArg(0,"force-yes","APT::Get::force-yes",0); addArg(0,"print-uris","APT::Get::Print-URIs",0); addArg(0,"trivial-only","APT::Get::Trivial-Only",0); diff --git a/apt-private/private-download.cc b/apt-private/private-download.cc index 099146187..18a9b1fbc 100644 --- a/apt-private/private-download.cc +++ b/apt-private/private-download.cc @@ -114,10 +114,12 @@ bool AuthPrompt(std::vector const &UntrustedList, bool const Prompt return true; } - else if (_config->FindB("APT::Get::Force-Yes",false) == true) + else if (_config->FindB("APT::Get::Force-Yes",false) == true) { + _error->Warning(_("--force-yes is deprecated, use one of the options starting with --allow instead.")); return true; + } - return _error->Error(_("There are problems and -y was used without --force-yes")); + return _error->Error(_("There were unauthenticated packages and -y was used without --allow-unauthenticated")); } /*}}}*/ bool AcquireRun(pkgAcquire &Fetcher, int const PulseInterval, bool * const Failure, bool * const TransientNetworkFailure)/*{{{*/ diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index d2b4bed51..96e33f7de 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -58,7 +58,8 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) } } - bool Fail = false; + bool Hold = false; + bool Downgrade = false; bool Essential = false; // Show all the various warning indicators @@ -66,13 +67,17 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) ShowNew(c1out,Cache); if (ShwKept == true) ShowKept(c1out,Cache); - Fail |= !ShowHold(c1out,Cache); + Hold = !ShowHold(c1out,Cache); if (_config->FindB("APT::Get::Show-Upgraded",true) == true) ShowUpgraded(c1out,Cache); - Fail |= !ShowDowngraded(c1out,Cache); + Downgrade = !ShowDowngraded(c1out,Cache); + if (_config->FindB("APT::Get::Download-Only",false) == false) Essential = !ShowEssential(c1out,Cache); - Fail |= Essential; + + // All kinds of failures + bool Fail = (Essential || Downgrade || Hold); + Stats(c1out,Cache); // Sanity check @@ -89,7 +94,25 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) // No remove flag if (Cache->DelCount() != 0 && _config->FindB("APT::Get::Remove",true) == false) return _error->Error(_("Packages need to be removed but remove is disabled.")); - + + // Fail safe check + if (_config->FindI("quiet",0) >= 2 || + _config->FindB("APT::Get::Assume-Yes",false) == true) + { + if (_config->FindB("APT::Get::Force-Yes",false) == true) { + _error->Warning(_("--force-yes is deprecated, use one of the options starting with --allow instead.")); + } + + if (Fail == true && _config->FindB("APT::Get::Force-Yes",false) == false) { + if (Essential == true && _config->FindB("APT::Get::allow-remove-essential", false) == false) + return _error->Error(_("Essential packages were removed and -y was used without --allow-remove-essential.")); + if (Downgrade == true && _config->FindB("APT::Get::allow-downgrades", false) == false) + return _error->Error(_("Packages were downgraded and -y was used without --allow-downgrades.")); + if (Hold == true && _config->FindB("APT::Get::allow-change-held-packages", false) == false) + return _error->Error(_("Held packages were changed and -y was used without --allow-change-held-packages.")); + } + } + // Run the simulator .. if (_config->FindB("APT::Get::Simulate") == true) { @@ -173,15 +196,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) if (CheckFreeSpaceBeforeDownload(_config->FindDir("Dir::Cache::Archives"), (FetchBytes - FetchPBytes)) == false) return false; - // Fail safe check - if (_config->FindI("quiet",0) >= 2 || - _config->FindB("APT::Get::Assume-Yes",false) == true) - { - if (Fail == true && _config->FindB("APT::Get::Force-Yes",false) == false) - return _error->Error(_("There are problems and -y was used without --force-yes")); - } - - if (Essential == true && Safety == true) + if (Essential == true && Safety == true && _config->FindB("APT::Get::allow-remove-essential", false) == false) { if (_config->FindB("APT::Get::Trivial-Only",false) == true) return _error->Error(_("Trivial Only specified but this is not a trivial operation.")); diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index 81a9036c4..76a53aec2 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -429,12 +429,36 @@ Configuration Item: APT::Get::Only-Upgrade. + + This is a dangerous option that will cause apt to continue + without prompting if it is doing downgrades. It + should not be used except in very special situations. Using + it can potentially destroy your system! + Configuration Item: APT::Get::allow-downgrades. Introduced in APT 1.1. + + + + Force yes; this is a dangerous option that will cause apt to continue + without prompting if it is removing essentials. It + should not be used except in very special situations. Using + it can potentially destroy your system! + Configuration Item: APT::Get::allow-remove-essential. Introduced in APT 1.1. + + + + Force yes; this is a dangerous option that will cause apt to continue + without prompting if it is changing held packages. It + should not be used except in very special situations. Using + it can potentially destroy your system! + Configuration Item: APT::Get::allow-change-held-packages. Introduced in APT 1.1. + + Force yes; this is a dangerous option that will cause apt to continue without prompting if it is doing something potentially harmful. It should not be used except in very special situations. Using force-yes can potentially destroy your system! - Configuration Item: APT::Get::force-yes. + Configuration Item: APT::Get::force-yes. This is deprecated and replaced by , , in 1.1. diff --git a/test/integration/test-allow b/test/integration/test-allow new file mode 100755 index 000000000..3d773ee95 --- /dev/null +++ b/test/integration/test-allow @@ -0,0 +1,98 @@ +#!/bin/sh +# +# Test for --allow-remove-essential and friends replacing --force-yes +# +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +insertpackage 'unstable' 'downgrade' 'all' '1' +insertinstalledpackage 'downgrade' 'all' '2' + +insertpackage 'unstable' 'hold' 'all' '2' +insertinstalledpackage 'hold' 'all' '1' + +insertinstalledpackage 'essential' 'all' '1' 'Essential: yes' + +setupaptarchive + +testsuccess aptmark hold hold + +# Test --allow-remove--essential + +testfailureequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + essential +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + essential +0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded. +E: Essential packages were removed and -y was used without --allow-remove-essential.' aptget remove essential -y -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + essential +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + essential +0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded. +Remv essential [1]' aptget remove essential -y --allow-remove-essential -s + +# Test --allow-change-held-packages (should not influence dist-upgrade, but an install) + +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + hold +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.' aptget dist-upgrade --allow-change-held-packages -s + +testfailureequal 'Reading package lists... +Building dependency tree... +The following held packages will be changed: + hold +The following packages will be upgraded: + hold +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +E: Held packages were changed and -y was used without --allow-change-held-packages.' aptget install hold -y -s + +testfailureequal 'Reading package lists... +Building dependency tree... +The following held packages will be changed: + hold +The following packages will be upgraded: + hold +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +E: Held packages were changed and -y was used without --allow-change-held-packages.' aptget install hold -y -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following held packages will be changed: + hold +The following packages will be upgraded: + hold +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst hold [1] (2 unstable [all]) +Conf hold (2 unstable [all])' aptget install hold -y -s --allow-change-held-packages + +# Test --allow-downgrades + +testfailureequal 'Reading package lists... +Building dependency tree... +The following packages will be DOWNGRADED: + downgrade +0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 1 not upgraded. +E: Packages were downgraded and -y was used without --allow-downgrades.' aptget install downgrade=1 -y -s + +testsuccessequal 'Reading package lists... +Building dependency tree... +The following packages will be DOWNGRADED: + downgrade +0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 1 not upgraded. +Inst downgrade [2] (1 unstable [all]) +Conf downgrade (1 unstable [all])' aptget install downgrade=1 --allow-downgrades -y -s diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index bc8e6d3ea..4c45f8f26 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -81,4 +81,4 @@ W: The repository 'file:$APTARCHIVE unstable Release' does not have a Release fi # ensure we can not install the package testfailureequal "WARNING: The following packages cannot be authenticated! foo -E: There are problems and -y was used without --force-yes" aptget install -qq -y foo +E: There were unauthenticated packages and -y was used without --allow-unauthenticated" aptget install -qq -y foo diff --git a/test/integration/test-apt-never-markauto-sections b/test/integration/test-apt-never-markauto-sections index a469b4c15..9f490a1bd 100755 --- a/test/integration/test-apt-never-markauto-sections +++ b/test/integration/test-apt-never-markauto-sections @@ -65,7 +65,7 @@ testmarkedauto # test that installed/upgraded auto-pkgs are not set to manual -testsuccess aptget install browser=41 -y --force-yes +testsuccess aptget install browser=41 -y --allow-downgrades testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection' testmarkedauto diff --git a/test/integration/test-apt-update-nofallback b/test/integration/test-apt-update-nofallback index 2f4ddc016..6e9db2cae 100755 --- a/test/integration/test-apt-update-nofallback +++ b/test/integration/test-apt-update-nofallback @@ -101,7 +101,7 @@ test_from_inrelease_to_unsigned_with_override() # but that the individual packages are still considered untrusted testfailureequal "WARNING: The following packages cannot be authenticated! evil -E: There are problems and -y was used without --force-yes" aptget install -qq -y evil +E: There were unauthenticated packages and -y was used without --allow-unauthenticated" aptget install -qq -y evil } test_cve_2012_0214() diff --git a/test/integration/test-apt-update-rollback b/test/integration/test-apt-update-rollback index 646484e7b..503b81985 100755 --- a/test/integration/test-apt-update-rollback +++ b/test/integration/test-apt-update-rollback @@ -120,7 +120,7 @@ test_unauthenticated_to_invalid_inrelease() { listcurrentlistsdirectory > lists.before testfailureequal "WARNING: The following packages cannot be authenticated! old -E: There are problems and -y was used without --force-yes" aptget install -qq -y old +E: There were unauthenticated packages and -y was used without --allow-unauthenticated" aptget install -qq -y old # go to authenticated but not correct add_new_package '+1hour' @@ -133,7 +133,7 @@ E: Some index files failed to download. They have been ignored, or old ones used testfailure ls rootdir/var/lib/apt/lists/*_InRelease testfailureequal "WARNING: The following packages cannot be authenticated! old -E: There are problems and -y was used without --force-yes" aptget install -qq -y old +E: There were unauthenticated packages and -y was used without --allow-unauthenticated" aptget install -qq -y old } test_inrelease_to_unauth_inrelease() { diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch index 62355a6b5..93a33d30f 100755 --- a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -48,7 +48,7 @@ DPkg::Tools::options::\"./${hook}-v${1}.sh\"::Version \"$1\";" > rootdir/etc/apt observehook() { rm -f ${hook}-v2.list ${hook}-v3.list msgtest 'Observe hooks while' "$*" - testsuccess --nomsg aptget "$@" -y --force-yes + testsuccess --nomsg aptget "$@" -y --allow-downgrades } testrun() { diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index 06701c623..c4d1455eb 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -69,7 +69,7 @@ The following NEW packages will be installed: After this operation, 5370 kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! apt -E: There are problems and -y was used without --force-yes' aptget install apt -dy +E: There were unauthenticated packages and -y was used without --allow-unauthenticated' aptget install apt -dy } failaptnew() { @@ -83,7 +83,7 @@ The following NEW packages will be installed: After this operation, 5808 kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! apt -E: There are problems and -y was used without --force-yes' aptget install apt -dy +E: There were unauthenticated packages and -y was used without --allow-unauthenticated' aptget install apt -dy } # fake our downloadable file -- cgit v1.2.3 From e916a815e18b497aecd535ae14dc5034aa6a384f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 13:44:28 +0200 Subject: Add integration test for Pin-Priority range checks Gbp-Dch: ignore --- test/integration/test-policy-pinning | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index d54e1bc36..ea266e934 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -246,3 +246,63 @@ aptgetupdate testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 500 100 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 990 100 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t stable testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 100 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t backports + + +tmppath=$(readlink -f .) + +# Check 16-bit integers +echo "Package: coolstuff +Pin: release n=backports +Pin-Priority: 32767 +" > rootdir/etc/apt/preferences + +testsuccess aptget install -s coolstuff -o PinPriority=32767 + +echo "Package: coolstuff +Pin: release n=backports +Pin-Priority: -32768 +" > rootdir/etc/apt/preferences +testsuccess aptget install -s coolstuff -o PinPriority=-32768 + + +# Check for 32-bit integers +echo "Package: coolstuff +Pin: release n=backports +Pin-Priority: 32768 +" > rootdir/etc/apt/preferences + +testfailureequal "Reading package lists... +E: ${tmppath}/rootdir/etc/apt/preferences: Value 32768 is outside the range of valid pin priorities (-32768 to 32767)" \ + aptget install -s coolstuff -o PinPriority=32768 + + +echo "Package: coolstuff +Pin: release n=backports +Pin-Priority: -32769 +" > rootdir/etc/apt/preferences + +testfailureequal "Reading package lists... +E: ${tmppath}/rootdir/etc/apt/preferences: Value -32769 is outside the range of valid pin priorities (-32768 to 32767)" \ + aptget install -s coolstuff -o PinPriority=-32769 + +# Check for 64-bit integers + +echo "Package: coolstuff +Pin: release n=backports +Pin-Priority: 2147483648 +" > rootdir/etc/apt/preferences + +testfailureequal "Reading package lists... +E: Cannot convert 2147483648 to integer - (34: Numerical result out of range) +E: ${tmppath}/rootdir/etc/apt/preferences: Value 2147483648 is outside the range of valid pin priorities (-32768 to 32767)" \ + aptget install -s coolstuff -o PinPriority=2147483648 + +# Check for 0 +echo "Package: coolstuff +Pin: release n=backports +Pin-Priority: 0 +" > rootdir/etc/apt/preferences + +testfailureequal "Reading package lists... +E: No priority (or zero) specified for pin" \ + aptget install -s coolstuff -o PinPriority=0 -- cgit v1.2.3 From adfa4116e7176b71d215dc0d03465331750d9dfa Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 13:53:30 +0200 Subject: Replace UINT_MAX with std::numeric_limits::max() Gbp-Dch: ignore --- ftparchive/apt-ftparchive.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index cf667483c..6f0fb1ac4 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -135,7 +135,7 @@ void PackageMap::GetGeneral(Configuration &Setup,Configuration &Block) PathPrefix = Block.Find("PathPrefix"); if (Block.FindB("External-Links",true) == false) - DeLinkLimit = Setup.FindI("Default::DeLinkLimit",UINT_MAX); + DeLinkLimit = Setup.FindI("Default::DeLinkLimit", std::numeric_limits::max()); else DeLinkLimit = 0; @@ -871,7 +871,8 @@ static bool DoGenerateContents(Configuration &Setup, that describe the debs it indexes. Since the package files contain hashes of the .debs this means they have not changed either so the contents must be up to date. */ - unsigned long MaxContentsChange = Setup.FindI("Default::MaxContentsChange",UINT_MAX)*1024; + unsigned long MaxContentsChange = Setup.FindI("Default::MaxContentsChange", + std::numeric_limits::max())*1024; for (vector::iterator I = PkgList.begin(); I != PkgList.end(); ++I) { // This record is not relevant -- cgit v1.2.3 From 2e38192cec76b3b98fe8aeb5a9a1e0fa3573d3a4 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 14:42:08 +0200 Subject: Mention that source order only matter per version Closes: #617445 --- doc/sources.list.5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sources.list.5.xml b/doc/sources.list.5.xml index 3bc8a94ac..e27eddb0e 100644 --- a/doc/sources.list.5.xml +++ b/doc/sources.list.5.xml @@ -36,7 +36,7 @@ designed to support any number of active sources and a variety of source media. The files list one source per line (one line style) or contain multiline stanzas defining one or more sources per stanza (deb822 style), with the - most preferred source listed first. The information available from the + most preferred source listed first (in case a single version is available from more than one source). The information available from the configured sources is acquired by apt-get update (or by an equivalent command from another APT front-end). -- cgit v1.2.3 From b7bbde252027fb582cc1050e42ef5831275289fa Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 14:51:02 +0200 Subject: Say "in combination with the other options" if an option is not understood Closes: #762758 --- apt-pkg/contrib/cmndline.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc index ff8b09ebc..87255e996 100644 --- a/apt-pkg/contrib/cmndline.cc +++ b/apt-pkg/contrib/cmndline.cc @@ -149,7 +149,7 @@ bool CommandLine::Parse(int argc,const char **argv) { Opt = (const char*) memchr(Opt, '-', OptEnd - Opt); if (Opt == NULL) - return _error->Error(_("Command line option %s is not understood"),argv[I]); + return _error->Error(_("Command line option %s is not understood in combination with the other options"),argv[I]); Opt++; for (A = ArgList; A->end() == false && @@ -158,7 +158,7 @@ bool CommandLine::Parse(int argc,const char **argv) // Failed again.. if (A->end() == true && OptEnd - Opt != 1) - return _error->Error(_("Command line option %s is not understood"),argv[I]); + return _error->Error(_("Command line option %s is not understood in combination with the other options"),argv[I]); // The option could be a single letter option prefixed by a no-.. if (A->end() == true) @@ -166,7 +166,7 @@ bool CommandLine::Parse(int argc,const char **argv) for (A = ArgList; A->end() == false && A->ShortOpt != *Opt; A++); if (A->end() == true) - return _error->Error(_("Command line option %s is not understood"),argv[I]); + return _error->Error(_("Command line option %s is not understood in combination with the other options"),argv[I]); } // The option is not boolean -- cgit v1.2.3 From 714c23a791971037518ccc07c497fe3c6451f82c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 15:07:28 +0200 Subject: apt-cache: Show an error if stats gets any arguments Closes: #153161 --- cmdline/apt-cache.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 117a44292..a03224986 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -310,10 +310,15 @@ static void ShowHashTableStats(std::string Type, // Stats - Dump some nice statistics /*{{{*/ // --------------------------------------------------------------------- /* */ -static bool Stats(CommandLine &) +static bool Stats(CommandLine &CmdL) { pkgCacheFile CacheFile; pkgCache *Cache = CacheFile.GetPkgCache(); + + if (CmdL.FileSize() > 1) { + _error->Error(_("apt-cache stats does not take any arguments")); + return false; + } if (unlikely(Cache == NULL)) return false; -- cgit v1.2.3 From 5fba9462b635c95d2cb329a388d469bd50889974 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 16:57:02 +0200 Subject: apt-cache(8): Mention that --names-only search provides Closes: #618017 --- doc/apt-cache.8.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/apt-cache.8.xml b/doc/apt-cache.8.xml index e20f66770..ac3aaa37a 100644 --- a/doc/apt-cache.8.xml +++ b/doc/apt-cache.8.xml @@ -172,7 +172,7 @@ Reverse Provides: If is given then output identical to show is produced for each matched package, and if is given then the long description - is not searched, only the package name is. + is not searched, only the package name and provided packages are. Separate arguments can be used to specify multiple search patterns that are and'ed together. @@ -319,7 +319,7 @@ Reverse Provides: - Only search on the package names, not the long descriptions. + Only search on the package and provided package names, not the long descriptions. Configuration Item: APT::Cache::NamesOnly. -- cgit v1.2.3 From 1bdfd2c9de1126522fee08007908a05af32ee8b1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 17:22:30 +0200 Subject: apt_preferences(5): Correct default pin assignment documentation This was broken, as higher pins were also assigned to versions that are installed. Closes: #623706 --- doc/apt_preferences.5.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index 28b795d43..cad57f6b8 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -115,12 +115,12 @@ from archives which in their Release files are marked as "N priority 500 -to the versions that are not installed and do not belong to the target release. +to the versions that do not belong to the target release. priority 990 -to the versions that are not installed and belong to the target release. +to the versions that belong to the target release. -- cgit v1.2.3 From c38847ebbbab115b01dd1421dee55d5a50d404f1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 17:26:48 +0200 Subject: apt_preferences(5): Mention overlapping of pin matches --- doc/apt_preferences.5.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index cad57f6b8..be6f12f6a 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -123,6 +123,9 @@ from archives which in their Release files are marked as "N to the versions that belong to the target release. + +The highest of those priorities whose description matches the version is assigned to the +version. If the target release has not been specified then APT simply assigns -- cgit v1.2.3 From f66738d7fb8978eaa30a179ae4f3bcc4ca7aa58f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 18:27:24 +0200 Subject: Make auto-remove and auto-clean aliases for the versions without - Some people type them instead of autoremove and autoclean, so make them happy. Closes: #274159 Makes-Happy: Ansgar --- apt-private/private-cmndline.cc | 4 ++-- apt-private/private-install.cc | 3 ++- cmdline/apt-get.cc | 2 ++ doc/apt-get.8.xml | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 487349c8c..3a1564b23 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -169,14 +169,14 @@ static bool addArgumentsAPTGet(std::vector &Args, char const addArg(0,"format","APT::Get::IndexTargets::Format", CommandLine::HasArg); addArg(0,"release-info","APT::Get::IndexTargets::ReleaseInfo", 0); } - else if (CmdMatches("clean", "autoclean", "check", "download", "changelog") || + else if (CmdMatches("clean", "autoclean", "auto-clean", "check", "download", "changelog") || CmdMatches("markauto", "unmarkauto")) // deprecated commands ; else if (CmdMatches("moo")) addArg(0, "color", "APT::Moo::Color", 0); if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade", - "dselect-upgrade", "autoremove", "clean", "autoclean", "check", + "dselect-upgrade", "autoremove", "auto-remove", "clean", "autoclean", "auto-clean", "check", "build-dep", "full-upgrade", "source")) { addArg('s', "simulate", "APT::Get::Simulate", 0); diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 96e33f7de..e61c4ca51 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -519,7 +519,8 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, _config->Set("APT::Get::Purge", true); fallback = MOD_REMOVE; } - else if (strcasecmp(CmdL.FileList[0], "autoremove") == 0) + else if (strcasecmp(CmdL.FileList[0], "autoremove") == 0 || + strcasecmp(CmdL.FileList[0], "auto-remove") == 0) { _config->Set("APT::Get::AutomaticRemove", "true"); fallback = MOD_REMOVE; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 61ed41164..80e344740 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1643,6 +1643,7 @@ int main(int argc,const char *argv[]) /*{{{*/ {"remove",&DoInstall}, {"purge",&DoInstall}, {"autoremove",&DoInstall}, + {"auto-remove",&DoInstall}, {"markauto",&DoMarkAuto}, {"unmarkauto",&DoMarkAuto}, {"dist-upgrade",&DoDistUpgrade}, @@ -1650,6 +1651,7 @@ int main(int argc,const char *argv[]) /*{{{*/ {"build-dep",&DoBuildDep}, {"clean",&DoClean}, {"autoclean",&DoAutoClean}, + {"auto-clean",&DoAutoClean}, {"check",&DoCheck}, {"source",&DoSource}, {"download",&DoDownload}, diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index 76a53aec2..785b4e9a8 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -214,7 +214,7 @@ &cachedir;/archives/partial/. - + (and the alias since 1.1) Like clean, autoclean clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely @@ -224,7 +224,7 @@ erased if it is set to off. - + (and the alias since 1.1) autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed. -- cgit v1.2.3 From f8043f219f077b1cfc6c5ad2263c4caa4709a00d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 14 Aug 2015 19:44:25 +0200 Subject: Make apt compile with clang++ again This allows us to run the clang static analyzer and to run the testsuite with the clang MemorySanitizer. --- apt-pkg/aptconfiguration.cc | 2 +- apt-pkg/srcrecords.cc | 2 +- methods/ftp.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 01b85a74e..7e20a7d61 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -222,7 +222,7 @@ std::vector const Configuration::getLanguages(bool const &All, // get the environment language codes: LC_MESSAGES (and later LANGUAGE) // we extract both, a long and a short code and then we will // check if we actually need both (rare) or if the short is enough - string const envMsg = string(Locale == 0 ? std::setlocale(LC_MESSAGES, NULL) : *Locale); + string const envMsg = string(Locale == 0 ? ::setlocale(LC_MESSAGES, NULL) : *Locale); size_t const lenShort = (envMsg.find('_') != string::npos) ? envMsg.find('_') : 2; size_t const lenLong = (envMsg.find_first_of(".@") != string::npos) ? envMsg.find_first_of(".@") : (lenShort + 3); diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index e3ffa9ab0..942f11569 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -31,7 +31,7 @@ // SrcRecords::pkgSrcRecords - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Open all the source index files */ -pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : d(NULL), Files(0), Current(0) +pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : d(NULL), Files(0) { for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); ++I) { diff --git a/methods/ftp.cc b/methods/ftp.cc index 5fee20f23..1a9a1c4eb 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -745,7 +745,7 @@ bool FTPConn::CreateDataFd() } // Bind and listen - if (bind(DataListenFd,BindAddr->ai_addr,BindAddr->ai_addrlen) < 0) + if (::bind(DataListenFd,BindAddr->ai_addr,BindAddr->ai_addrlen) < 0) { freeaddrinfo(BindAddr); return _error->Errno("bind",_("Could not bind a socket")); -- cgit v1.2.3 From 825220b5aef6db9dfb8a34c41a3ac7c3ce477be2 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 20:35:18 +0200 Subject: apt: Add autoremove and auto-remove commands --- cmdline/apt.cc | 3 +++ doc/apt.8.xml | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/cmdline/apt.cc b/cmdline/apt.cc index 2f7eddb61..92db34cfa 100644 --- a/cmdline/apt.cc +++ b/cmdline/apt.cc @@ -55,6 +55,7 @@ static bool ShowHelp(CommandLine &) "\n" " install - install packages\n" " remove - remove packages\n" + " autoremove - Remove automatically all unused packages\n" "\n" " upgrade - upgrade the system by installing/upgrading packages\n" " full-upgrade - upgrade the system by removing/installing/upgrading packages\n" @@ -76,6 +77,8 @@ int main(int argc, const char *argv[]) /*{{{*/ // package stuff {"install",&DoInstall}, {"remove", &DoInstall}, + {"autoremove", &DoInstall}, + {"auto-remove", &DoInstall}, {"purge", &DoInstall}, // system wide stuff diff --git a/doc/apt.8.xml b/doc/apt.8.xml index e00b6417a..18b97f547 100644 --- a/doc/apt.8.xml +++ b/doc/apt.8.xml @@ -86,6 +86,11 @@ installed instead of removed. + (and the alias since 1.1) + autoremove is used to remove packages that were automatically + installed to satisfy dependencies for other packages and are now no longer needed. + + edit-sources lets you edit your sources.list file and provides basic sanity checks. -- cgit v1.2.3 From ee75963e1e1658e203a059ce5868ff2444025e9c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 21:05:50 +0200 Subject: changelog: Replace reenable by re-enable everywhere Thanks: Lintian --- debian/changelog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index c1d91f99c..f9bb815da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,7 +10,7 @@ apt (1.1~exp8) experimental; urgency=medium * Bump ABI to 4.15 [ David Kalnischkies ] - * reenable support for -s (and co) in apt-get source (Closes: 742578) + * re-enable support for -s (and co) in apt-get source (Closes: 742578) * run acquire transactions only once * aborted reverify restores file owner and permission * test if TMPDIR is accessible before using (Closes: 765951) @@ -189,7 +189,7 @@ apt (1.1~exp1) experimental; urgency=low * use 'best' hash for source authentication (LP: 1098738) * use HashStringList in the acquire system * deal with hashes in ftparchive more dynamic as well - * reenable pipelining via hashsum reordering support + * re-enable pipelining via hashsum reordering support * parse and retrieve multiple Descriptions in one record * improve pkgTagSection scanning and parsing * invalid cache if architecture set doesn't match (Closes: 745036) @@ -1017,7 +1017,7 @@ apt (0.9.14.3~exp2) experimental; urgency=medium * correct IndexDiff vs DiffIndex in Debug output [ David Kalnischkies ] - * reenable unlimited pdiff files download + * re-enable unlimited pdiff files download * integrate Anthonys rred with POC for client-side merge [ Michael Vogt ] @@ -1356,7 +1356,7 @@ apt (0.9.10) unstable; urgency=low * add missing Turkish (tr) to po/LINGUAS * correct management-typo in description found by lintian * implement debian/rules build-{arch,indep} as required by policy 3.9.4 - * reenable automatic parallel build of APT + * re-enable automatic parallel build of APT * exclude config.{sub,guess} from source package * update the symbol files to reflect current state * unset LANGUAGE for showing [Y/n] answer hints @@ -1626,7 +1626,7 @@ apt (0.9.7.9~exp2) experimental; urgency=low - keep the last good InRelease file around just as we do it with Release.gpg in case the new one we download isn't good for us * apt-pkg/deb/debmetaindex.cc: - - reenable InRelease by default + - re-enable InRelease by default * ftparchive/writer.cc, apt-pkg/deb/debindexfile.cc, apt-pkg/deb/deblistparser.cc: -- cgit v1.2.3 From a0abb75b8d1d30a6b4de86665042948b786a1cff Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 21:06:41 +0200 Subject: debian/control: Replace debian by Debian Thanks: Lintian --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index bd7232834..5e813155c 100644 --- a/debian/control +++ b/debian/control @@ -116,7 +116,7 @@ Description: package management related utility programs * apt-extracttemplates is used by debconf to prompt for configuration questions before installation. * apt-ftparchive is used to create Packages and other index files - needed to publish an archive of debian packages + needed to publish an archive of Debian packages * apt-sortpkgs is a Packages/Sources file normalizer. Package: apt-transport-https -- cgit v1.2.3 From 40ce4d9a259527492f0b6fbf718371563dc1849e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 21:09:11 +0200 Subject: debian/control: Drop the versioned python-apt conflict Thanks: Lintian --- debian/control | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/control b/debian/control index 5e813155c..b554255bf 100644 --- a/debian/control +++ b/debian/control @@ -22,7 +22,6 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${apt:keyring}, gpgv | gpgv2, gnupg | gnupg2, adduser Replaces: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~), sun-java6-jdk (>> 0), sun-java5-jdk (>> 0), openjdk-6-jdk (<< 6b24-1.11-0ubuntu1~) Breaks: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~), sun-java6-jdk (>> 0), sun-java5-jdk (>> 0), openjdk-6-jdk (<< 6b24-1.11-0ubuntu1~) -Conflicts: python-apt (<< 0.7.93.2~) Suggests: aptitude | synaptic | wajig, dpkg-dev (>= 1.17.2), apt-doc, python-apt Description: commandline package manager This package provides commandline tools for searching and -- cgit v1.2.3 From a24d67a2b7f5c310f62c0d2dabbc324e2a39c3dc Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 21:11:40 +0200 Subject: debian/control: Remove XS- from Testsuite and bump Standards-Version Thanks: Lintian --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index b554255bf..678c75d35 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: important Maintainer: APT Development Team Uploaders: Michael Vogt , Christian Perrier , Julian Andres Klode -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Build-Depends: dpkg-dev (>= 1.15.8), debhelper (>= 8.1.3~), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.4~), zlib1g-dev, libbz2-dev, liblzma-dev, @@ -15,7 +15,7 @@ Build-Depends-Indep: doxygen, w3m, graphviz Build-Conflicts: autoconf2.13, automake1.4 Vcs-Git: git://anonscm.debian.org/apt/apt.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=apt/apt.git -XS-Testsuite: autopkgtest +Testsuite: autopkgtest Package: apt Architecture: any -- cgit v1.2.3 From 0885c46f0c23f77e994eef51b772a171c3caf280 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 21:22:43 +0200 Subject: Set Acquire::Changelogs::URI::Origin::Tanglu for Tanglu changelogs --- apt-pkg/init.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 858bcec43..509fc1bc7 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -118,6 +118,7 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("Acquire::IndexTargets::deb-src::Sources::Optional", false); Cnf.CndSet("Acquire::Changelogs::URI::Origin::Debian", "http://metadata.ftp-master.debian.org/changelogs/CHANGEPATH_changelog"); + Cnf.CndSet("Acquire::Changelogs::URI::Origin::Tanglu", "http://metadata.tanglu.org/changelogs/CHANGEPATH_changelog"); Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ubuntu", "http://changelogs.ubuntu.com/changelogs/pool/CHANGEPATH/changelog"); Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ultimedia", "http://packages.ultimediaos.com/changelogs/pool/CHANGEPATH/changelog.txt"); -- cgit v1.2.3 From 71510743f4a5f6c26d7cfaccb720e3008475d8e8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 22:30:41 +0200 Subject: Also add 'in combination with the other options.' to another error Gbp-Dch: ignore --- apt-pkg/contrib/cmndline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc index 87255e996..40365237e 100644 --- a/apt-pkg/contrib/cmndline.cc +++ b/apt-pkg/contrib/cmndline.cc @@ -124,7 +124,7 @@ bool CommandLine::Parse(int argc,const char **argv) Args *A; for (A = ArgList; A->end() == false && A->ShortOpt != *Opt; A++); if (A->end() == true) - return _error->Error(_("Command line option '%c' [from %s] is not known."),*Opt,argv[I]); + return _error->Error(_("Command line option '%c' [from %s] is not understood in combination with the other options."),*Opt,argv[I]); if (HandleOpt(I,argc,argv,Opt,A) == false) return false; -- cgit v1.2.3 From dd5978bff4d0bea85b3adbf52a194afd25a655b3 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 22:43:00 +0200 Subject: apt-cache(8): Drop the #versions >= #package names comparison Closes: #691281 --- doc/apt-cache.8.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/apt-cache.8.xml b/doc/apt-cache.8.xml index ac3aaa37a..a8f1b4586 100644 --- a/doc/apt-cache.8.xml +++ b/doc/apt-cache.8.xml @@ -122,8 +122,7 @@ Reverse Provides: Total distinct versions is the number of package versions - found in the cache; this value is therefore at least equal to the - number of total package names. If more than one distribution is being accessed + found in the cache. If more than one distribution is being accessed (for instance, "stable" and "unstable"), this value can be considerably larger than the number of total package names. -- cgit v1.2.3 From 516582f486e967c8b9ca8635b524757ba12131ba Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 14 Aug 2015 22:54:20 +0200 Subject: add {contrib,non-free}/{metapackages,oldlibs} to section specialhandling Closes: 788320 --- debian/apt.conf.autoremove | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/apt.conf.autoremove b/debian/apt.conf.autoremove index 3c4843e3d..3609ca49c 100644 --- a/debian/apt.conf.autoremove +++ b/debian/apt.conf.autoremove @@ -29,6 +29,8 @@ APT Never-MarkAuto-Sections { "metapackages"; + "contrib/metapackages"; + "non-free/metapackages"; "restricted/metapackages"; "universe/metapackages"; "multiverse/metapackages"; @@ -37,6 +39,8 @@ APT Move-Autobit-Sections { "oldlibs"; + "contrib/oldlibs"; + "non-free/oldlibs"; "restricted/oldlibs"; "universe/oldlibs"; "multiverse/oldlibs"; -- cgit v1.2.3 From df53919b1ea2148f111150578ee9b9618b84d01a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 23:45:17 +0200 Subject: apt-get: allow non-root --print-uris build-dep Closes: #283400 --- cmdline/apt-get.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 80e344740..acf6c2155 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -966,8 +966,10 @@ static bool DoBuildDep(CommandLine &CmdL) CacheFile Cache; _config->Set("APT::Install-Recommends", false); + + bool WantLock = _config->FindB("APT::Get::Print-URIs", false) == false; - if (Cache.Open(true) == false) + if (Cache.Open(WantLock) == false) return false; if (CmdL.FileSize() <= 1) -- cgit v1.2.3 From 7f97aa748270231d63b6419a271ba74029eebcd3 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 14 Aug 2015 23:57:13 +0200 Subject: doc/files.dbk: Improve documentation for {src,}pkgcache.bin This should be enough for most persons. Closes: #465551 --- doc/files.dbk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/files.dbk b/doc/files.dbk index f513e0008..714255a53 100644 --- a/doc/files.dbk +++ b/doc/files.dbk @@ -198,11 +198,11 @@ installation
Binary Package Cache (srcpkgcache.bin and pkgcache.bin) Please see cache.sgml for a complete description of what this file -is. The cache file is updated whenever the contents of the lists -directory changes. If the cache is erased, corrupted or of a non-matching +is. The cache file is updated whenever the Packages or Release files of the lists +directory or the dpkg status file changes. If the cache is erased, corrupted or of a non-matching version it will be automatically rebuilt by all of the tools that need it. srcpkgcache.bin contains a cache of all of the -package files in the source list. This allows regeneration of the cache +package, release files in the source list. In comparison to pkgcache.bin, it does not include the /var/lib/dpkg/status file. This allows regeneration of the cache when the status files change to use a prebuilt version for greater speed.
-- cgit v1.2.3 From 7a139fa8bf2c18da54b5837c9290ba5b77e9c629 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 15 Aug 2015 10:44:57 +0200 Subject: update: Check if the cache could be opened, don't just assume it This seems to cause Bug#756162, as in that case the depcache was NULL. I'm not entirely sure how that happens, but it's better to be check here rather then crash later on. Closes: #756162 --- apt-private/private-update.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apt-private/private-update.cc b/apt-private/private-update.cc index 73a82e988..1323771f0 100644 --- a/apt-private/private-update.cc +++ b/apt-private/private-update.cc @@ -84,7 +84,8 @@ bool DoUpdate(CommandLine &CmdL) if (_config->FindB("APT::Cmd::Show-Update-Stats", false) == true) { int upgradable = 0; - Cache.Open(); + if (Cache.Open() == false) + return false; for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() != true; ++I) { pkgDepCache::StateCache &state = Cache[I]; -- cgit v1.2.3 From 91e42c2b4e9a6e8c7c1db29e9d1606741d251ca0 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 15 Aug 2015 10:48:59 +0200 Subject: cachefile.cc: Do not ignore return value of pkgDepCache::Init() Currently, this always returns true, but it might start returning false at some point in the future... Gbp-Dch: ignore --- apt-pkg/cachefile.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index ed3c2dd0a..214864095 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -157,8 +157,7 @@ bool pkgCacheFile::BuildDepCache(OpProgress *Progress) if (_error->PendingError() == true) return false; - DCache->Init(Progress); - return true; + return DCache->Init(Progress); } /*}}}*/ // CacheFile::Open - Open the cache files, creating if necessary /*{{{*/ -- cgit v1.2.3 From a0a6695515f8d8d7db3f52751d4d14f8266c286c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 15 Aug 2015 11:52:50 +0200 Subject: Add GetPriority(VerIterator) to pkgDepCache::Policy Also unify the case of considerFiles and ConsiderFiles to be ConsiderFiles in all cases. Gbp-Dch: ignore --- apt-pkg/depcache.cc | 2 ++ apt-pkg/depcache.h | 1 + apt-pkg/policy.cc | 4 ++-- apt-pkg/policy.h | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 367605826..8b2099992 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1780,6 +1780,8 @@ bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep) const // Policy::GetPriority - Get the priority of the package pin /*{{{*/ APT_CONST signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgIterator const &/*Pkg*/) { return 0; } +APT_CONST signed short pkgDepCache::Policy::GetPriority(pkgCache::VerIterator const &/*Ver*/, bool /*ConsiderFiles*/) +{ return 0; } APT_CONST signed short pkgDepCache::Policy::GetPriority(pkgCache::PkgFileIterator const &/*File*/) { return 0; } /*}}}*/ diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 6a1d6f8b3..ba997c8a6 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -281,6 +281,7 @@ class pkgDepCache : protected pkgCache::Namespace virtual VerIterator GetCandidateVer(PkgIterator const &Pkg); virtual bool IsImportantDep(DepIterator const &Dep) const; virtual signed short GetPriority(PkgIterator const &Pkg); + virtual signed short GetPriority(VerIterator const &Ver, bool ConsiderFiles=true); virtual signed short GetPriority(PkgFileIterator const &File); virtual ~Policy() {}; diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 4711372bc..badf702ca 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -368,11 +368,11 @@ APT_PURE signed short pkgPolicy::GetPriority(pkgCache::PkgIterator const &Pkg) return Pins[Pkg->ID].Priority; return 0; } -APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver, bool considerFiles) +APT_PURE signed short pkgPolicy::GetPriority(pkgCache::VerIterator const &Ver, bool ConsiderFiles) { if (VerPins[Ver->ID].Type != pkgVersionMatch::None) return VerPins[Ver->ID].Priority; - if (!considerFiles) + if (!ConsiderFiles) return 0; int priority = std::numeric_limits::min(); diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index 5be6657e9..bb0ff7e27 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -80,7 +80,7 @@ class pkgPolicy : public pkgDepCache::Policy // Things for the cache interface. virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; virtual signed short GetPriority(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; - virtual signed short GetPriority(pkgCache::VerIterator const &Pkg, bool ConsiderFiles = true); + virtual signed short GetPriority(pkgCache::VerIterator const &Ver, bool ConsiderFiles = true) APT_OVERRIDE; virtual signed short GetPriority(pkgCache::PkgFileIterator const &File) APT_OVERRIDE; bool InitDefaults(); -- cgit v1.2.3 From 35ea8b154b105727cf0a0f0238d51b82a0d7c045 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 15 Aug 2015 15:33:40 +0200 Subject: Document the general effect of the comma operator Closes: #574939 --- doc/apt_preferences.5.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/apt_preferences.5.xml b/doc/apt_preferences.5.xml index be6f12f6a..79132e007 100644 --- a/doc/apt_preferences.5.xml +++ b/doc/apt_preferences.5.xml @@ -254,6 +254,11 @@ Pin-Priority: 500
+ +The effect of the comma operator is similar to an "and" in logic: All +conditions must be satisfied for the pin to match. There is one exception: +For any type of condition (such as two "a" conditions), only the last such +condition is checked. -- cgit v1.2.3 From fe9a05dfc97769c8494dc1744822d959639eb312 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 16 Aug 2015 15:59:22 +0200 Subject: When looking if Provides match, OR them with the normal patches Simply overriding the value caused patterns that previously matched a real package name to not match anymore. Closes: #760868 --- cmdline/apt-cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index a03224986..75337fa07 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1440,7 +1440,7 @@ static bool Search(CommandLine &CmdL) size_t const PrvPatternOffset = id * NumPatterns; for (unsigned I = 0; I < NumPatterns; ++I) - PatternMatch[PrvPatternOffset + I] = PatternMatch[PatternOffset + I]; + PatternMatch[PrvPatternOffset + I] |= PatternMatch[PatternOffset + I]; } } -- cgit v1.2.3 From 0e54edd2eda54637596d620a31abb3131ad0a6b4 Mon Sep 17 00:00:00 2001 From: Kusanagi Kouichi Date: Sun, 16 Aug 2015 16:45:04 +0200 Subject: Show full package records in apt-cache search -f This just changes the DoSearch code to use DisplayRecord to display the record when the full record is requested. Closes: #660851 [jak@debian.org: Wrote the commit message] --- cmdline/apt-cache.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 75337fa07..f7abb823d 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1332,6 +1332,7 @@ static bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V) struct ExDescFile { pkgCache::DescFile *Df; + pkgCache::VerIterator V; map_id_t ID; }; @@ -1417,6 +1418,7 @@ static bool Search(CommandLine &CmdL) if (D.end() == true) continue; DFList[G->ID].Df = D.FileList(); + DFList[G->ID].V = V; DFList[G->ID].ID = G->ID; } @@ -1436,6 +1438,7 @@ static bool Search(CommandLine &CmdL) if (D.end() == true) continue; DFList[id].Df = D.FileList(); + DFList[id].V = V; DFList[id].ID = id; size_t const PrvPatternOffset = id * NumPatterns; @@ -1477,13 +1480,7 @@ static bool Search(CommandLine &CmdL) if (matchedAll == true) { if (ShowFull == true) - { - const char *Start; - const char *End; - P.GetRec(Start,End); - fwrite(Start,End-Start,1,stdout); - putc('\n',stdout); - } + DisplayRecord(CacheFile, J->V); else printf("%s - %s\n",P.Name().c_str(),P.ShortDesc().c_str()); } -- cgit v1.2.3 From 45b19add6c4d95a5feca5e710e1a080be6cee4c2 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 7 Dec 2014 22:15:36 -0500 Subject: Use terminfo's typical save_cursor/restore_cursor sequences Not all terminals understand DOS' escape sequences for save/restore cursor, so use the more typical sequences from terminfo. Closes: #772521 Signed-off-by: James McCoy --- apt-pkg/install-progress.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index ff3f652e5..58e552474 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -287,13 +287,13 @@ void PackageManagerFancy::SetupTerminalScrollArea(int nr_rows) std::cout << "\n"; // save cursor - std::cout << "\033[s"; + std::cout << "\0337"; // set scroll region (this will place the cursor in the top left) std::cout << "\033[0;" << nr_rows - 1 << "r"; // restore cursor but ensure its inside the scrolling area - std::cout << "\033[u"; + std::cout << "\0338"; static const char *move_cursor_up = "\033[1A"; std::cout << move_cursor_up; @@ -375,8 +375,8 @@ bool PackageManagerFancy::DrawStatusLine() if (unlikely(size.rows < 1 || size.columns < 1)) return false; - static std::string save_cursor = "\033[s"; - static std::string restore_cursor = "\033[u"; + static std::string save_cursor = "\0337"; + static std::string restore_cursor = "\0338"; // green static std::string set_bg_color = DeQuoteString( -- cgit v1.2.3 From 3b9eaca8c6adba831078749c4a3819f76e373df7 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 16 Aug 2015 17:07:43 +0200 Subject: install: If package already is the newest version, display version Also do it unconditionally, as it does not hurt. Closes: #315149 --- apt-private/private-install.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index e61c4ca51..4a589a263 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -816,8 +816,9 @@ void TryToInstall::operator() (pkgCache::VerIterator const &Ver) { else Cache->GetDepCache()->SetReInstall(Pkg, true); } else - ioprintf(c1out,_("%s is already the newest version.\n"), - Pkg.FullName(true).c_str()); + // TRANSLATORS: First string is package name, second is version + ioprintf(c1out,_("%s is already the newest version (%s).\n"), + Pkg.FullName(true).c_str(), Pkg.CurrentVer().VerStr()); } // Install it with autoinstalling enabled (if we not respect the minial -- cgit v1.2.3 From ebc5b43cca0a16e3f552130db9233fa14b313739 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 16 Aug 2015 17:25:51 +0200 Subject: Make pkgCache::Priority() static, it does not need the instance It still compiles after the change, so just merge it. Closes: #448627 --- apt-pkg/pkgcache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index ff250b532..801f8556d 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -225,7 +225,7 @@ class pkgCache /*{{{*/ inline map_id_t Hash(const char *S) const {return sHash(S);} // Useful transformation things - const char *Priority(unsigned char Priority); + static const char *Priority(unsigned char Priority); // Accessors GrpIterator FindGrp(const std::string &Name); -- cgit v1.2.3 From 1040dc888db00fdb0fe059e6b847fdc88fe53d80 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 16 Aug 2015 23:11:07 +0200 Subject: Replace "extra" in "the following extra packages [...]" by "additional" This breaks the translation for no big gain, but we broke enough strings already for that to not really matter anymore. Closes: #82430 --- apt-private/private-install.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 4a589a263..844fcbc7e 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -682,7 +682,7 @@ bool DoInstall(CommandLine &CmdL) to what the user asked */ SortedPackageUniverse Universe(Cache); if (Cache->InstCount() != verset[MOD_INSTALL].size()) - ShowList(c1out, _("The following extra packages will be installed:"), Universe, + ShowList(c1out, _("The following additional packages will be installed:"), Universe, PkgIsExtraInstalled(&Cache, &verset[MOD_INSTALL]), &PrettyFullName, CandidateVersion(&Cache)); -- cgit v1.2.3 From 44d9e9f91b6e87717844a7ec562bd38886a57aa6 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 17 Aug 2015 10:10:57 +0200 Subject: Do not crash in 'apt show' for non-installed packages For a non-installed package, manual_installed was set to the null pointer. This was passed to Tag::Rewrite, which expects an string (empty for null-type values) and the conversion from null pointer to string does not work correctly. --- apt-private/private-show.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc index 790bc0092..3a393b746 100644 --- a/apt-private/private-show.cc +++ b/apt-private/private-show.cc @@ -94,7 +94,7 @@ static bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V, if (is_installed) manual_installed = !(state.Flags & pkgCache::Flag::Auto) ? "yes" : "no"; else - manual_installed = 0; + manual_installed = ""; // FIXME: add verbose that does not do the removal of the tags? std::vector RW; -- cgit v1.2.3 From 88a8975f156e452d9f3ebe76822b236e8962ebba Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 17 Aug 2015 12:01:45 +0200 Subject: Cleanup includes after running iwyu --- apt-pkg/acquire-item.cc | 2 -- apt-pkg/acquire-worker.cc | 4 ---- apt-pkg/acquire.cc | 3 --- apt-pkg/algorithms.cc | 2 -- apt-pkg/aptconfiguration.cc | 1 - apt-pkg/cdrom.cc | 2 -- apt-pkg/deb/debindexfile.cc | 11 +---------- apt-pkg/deb/deblistparser.cc | 2 -- apt-pkg/deb/debmetaindex.cc | 3 --- apt-pkg/deb/debversion.cc | 1 - apt-pkg/deb/dpkgpm.cc | 2 -- apt-pkg/depcache.cc | 1 - apt-pkg/edsp.cc | 11 ----------- apt-pkg/edsp/edspindexfile.cc | 5 ----- apt-pkg/edsp/edsplistparser.cc | 1 - apt-pkg/edsp/edspsystem.cc | 2 -- apt-pkg/indexcopy.cc | 1 - apt-pkg/indexcopy.h | 2 ++ apt-pkg/indexfile.cc | 2 -- apt-pkg/init.cc | 1 - apt-pkg/install-progress.cc | 2 -- apt-pkg/metaindex.cc | 2 -- apt-pkg/orderlist.cc | 2 -- apt-pkg/packagemanager.cc | 1 - apt-pkg/pkgcache.cc | 1 - apt-pkg/pkgcachegen.cc | 2 -- apt-pkg/policy.cc | 2 -- apt-pkg/update.cc | 2 -- 28 files changed, 3 insertions(+), 70 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 3ed52dbf2..e10a278b5 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -42,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index e9ef4e9ac..0f1a162a3 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -34,9 +33,6 @@ #include #include #include -#include -#include -#include #include /*}}}*/ diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 5fd378096..2b870cf69 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -27,8 +27,6 @@ #include #include #include -#include -#include #include #include @@ -41,7 +39,6 @@ #include #include #include -#include #include /*}}}*/ diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 446afa08d..6d982c551 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -19,9 +19,7 @@ #include #include #include -#include #include -#include #include #include #include diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 7e20a7d61..f5bc18394 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -29,7 +29,6 @@ #include #include -#include /*}}}*/ namespace APT { // setDefaultConfigurationForCompressors /*{{{*/ diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 463225963..ffbf86735 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -16,8 +16,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 627cd36c5..d3599b353 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -16,27 +16,18 @@ #include #include #include -#include #include -#include -#include -#include -#include #include #include -#include #include #include -#include #include #include -#include #include #include -#include #include -#include + #include /*}}}*/ diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 489d0434e..42eca8677 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -18,10 +18,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 123c91648..b2e9eeb00 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -20,12 +20,9 @@ #include #include #include -#include #include -#include #include -#include #include #include diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc index 043025912..48462c6a2 100644 --- a/apt-pkg/deb/debversion.cc +++ b/apt-pkg/deb/debversion.cc @@ -16,7 +16,6 @@ #include #include -#include #include #include /*}}}*/ diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 644e4d8e4..6ae85d2ea 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -27,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 8b2099992..39bbe484f 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 34b0b0cc7..83d0d7db6 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -7,31 +7,20 @@ // Include Files /*{{{*/ #include -#include #include #include -#include -#include -#include -#include #include #include #include -#include -#include #include #include #include -#include #include #include -#include #include -#include #include #include -#include #include /*}}}*/ diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index a8a528131..409117c5e 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -12,13 +12,8 @@ #include #include #include -#include -#include #include -#include #include -#include -#include #include #include diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index a54a46b1e..ff79b537e 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -18,7 +18,6 @@ #include #include -#include /*}}}*/ // ListParser::edspListParser - Constructor /*{{{*/ diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc index c4583252f..f577efcbd 100644 --- a/apt-pkg/edsp/edspsystem.cc +++ b/apt-pkg/edsp/edspsystem.cc @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -23,7 +22,6 @@ #include #include -#include /*}}}*/ // System::edspSystem - Constructor /*{{{*/ diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index f9adb2fb8..13eccc8db 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index 316672e1d..d4f04b5b1 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -10,8 +10,10 @@ #define INDEXCOPY_H #include +#ifndef APT_11_CLEAN_HEADERS #include #include +#endif #include diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index 06312c173..8e50ecfae 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -24,9 +24,7 @@ #include -#include #include -#include #include #include diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 509fc1bc7..eab198fac 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index 58e552474..497a360e9 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -8,10 +8,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index baf695f16..1632b928c 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -3,8 +3,6 @@ #include #include -#include - #include #include /*}}}*/ diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index dae37e8f8..1e0640422 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -68,14 +68,12 @@ #include #include #include -#include #include #include #include #include #include -#include #include /*}}}*/ diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index dcae01126..06ec986ed 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 045d7b41e..9d3929cd9 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -34,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 68175a24a..6daebbc2a 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -18,8 +18,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index badf702ca..eaa72f084 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -34,7 +33,6 @@ #include #include #include -#include #include /*}}}*/ diff --git a/apt-pkg/update.cc b/apt-pkg/update.cc index 6e65c387c..eca22f8be 100644 --- a/apt-pkg/update.cc +++ b/apt-pkg/update.cc @@ -8,10 +8,8 @@ #include #include #include -#include #include -#include #include /*}}}*/ -- cgit v1.2.3 From ac7f8f7916f16905d8eeb0133bc650d89726d0f4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 17 Aug 2015 14:29:02 +0200 Subject: Fix all the wrong removals of includes that iwyu got wrong Git-Dch: ignore --- apt-pkg/acquire-item.cc | 1 + apt-pkg/acquire-worker.cc | 1 + apt-pkg/acquire.cc | 2 ++ apt-pkg/cdrom.cc | 2 ++ apt-pkg/deb/debindexfile.cc | 1 + apt-pkg/edsp.cc | 5 +++++ apt-pkg/indexcopy.cc | 1 + apt-pkg/install-progress.cc | 1 + apt-pkg/policy.cc | 1 + apt-pkg/update.cc | 1 + 10 files changed, 16 insertions(+) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index e10a278b5..26c835444 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -43,6 +43,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 0f1a162a3..b15340448 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -33,6 +33,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 2b870cf69..f8b077367 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index ffbf86735..76c450618 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index d3599b353..c43ee7b91 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 83d0d7db6..aea6f3a5d 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -12,6 +12,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 13eccc8db..8a7df2eb3 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -31,6 +31,7 @@ #include #include #include +#include #include "indexcopy.h" #include diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc index 497a360e9..14409e301 100644 --- a/apt-pkg/install-progress.cc +++ b/apt-pkg/install-progress.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index eaa72f084..91ad1d5bf 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -33,6 +33,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/apt-pkg/update.cc b/apt-pkg/update.cc index eca22f8be..369e85122 100644 --- a/apt-pkg/update.cc +++ b/apt-pkg/update.cc @@ -8,6 +8,7 @@ #include #include #include +#include #include -- cgit v1.2.3 From a98847f8c8b9215fea4b8d5b22639ce23c4e0d17 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 17 Aug 2015 14:56:23 +0200 Subject: debian/NEWS: Mention new pinning algorithm added in 2.0~exp1 --- debian/NEWS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/NEWS b/debian/NEWS index b0524c741..d9abd6d23 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,15 @@ +apt (2.0~exp1) experimental; urgency=medium + + A new algorithm for pinning has been implemented, it now assigns a + pin priority to a version instead of assigning a pin to a package. + + This might break existing corner cases of pinning, if they use multiple + pins involving the same package name or patterns matching the same + package name, but should overall lead to pinning that actually works + as intended and documented. + + -- Julian Andres Klode Mon, 17 Aug 2015 14:45:17 +0200 + apt (0.8.11) unstable; urgency=low * apt-get install pkg/experimental will now not only switch the -- cgit v1.2.3 From 9f5f0e60f1d3c997c8c2e794dee122829bdf142d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 17 Aug 2015 15:48:49 +0200 Subject: Really fix all iwyu issues Git-Dch: ignore --- apt-pkg/cdrom.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 76c450618..dea4a88c3 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include -- cgit v1.2.3 From 3dddcdf2432e78f37c74d8c76c2c519a8d935ab2 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 17 Aug 2015 18:33:22 +0200 Subject: Re-add support for G++ 4.8 and configure travis to use it This makes tests work again! Gbp-Dch: ignore --- .travis.yml | 8 +++++--- apt-pkg/cacheset.h | 4 ++-- apt-private/private-cachefile.cc | 2 +- apt-private/private-cacheset.cc | 2 +- debian/control | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a20018a79..993492b7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ before_install: - sudo apt-get update -q install: - sudo ./prepare-release travis-ci - - export CC=gcc-5 - - export CXX=g++-5 -script: make -j1 && make test && test/integration/run-tests + - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + - sudo apt-get -qq update + - sudo apt-get -qq install g++-4.8 + - export CXX=g++-4.8 +script: make && make test && test/integration/run-tests diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 95df55dcc..7c03ad97a 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -407,7 +407,7 @@ public: /*{{{*/ bool empty() const APT_OVERRIDE { return _cont.empty(); } void clear() APT_OVERRIDE { return _cont.clear(); } size_t size() const APT_OVERRIDE { return _cont.size(); } -#if __cplusplus >= 201103L +#if __GNUC__ >= 5 || (__GNUC_MINOR__ >= 9 && __GNUC__ >= 4) iterator erase( const_iterator pos ) { return iterator(_cont.erase(pos._iter)); } iterator erase( const_iterator first, const_iterator last ) { return iterator(_cont.erase(first._iter, last._iter)); } #else @@ -897,7 +897,7 @@ public: /*{{{*/ bool empty() const APT_OVERRIDE { return _cont.empty(); } void clear() APT_OVERRIDE { return _cont.clear(); } size_t size() const APT_OVERRIDE { return _cont.size(); } -#if __cplusplus >= 201103L +#if __GNUC__ >= 5 || (__GNUC_MINOR__ >= 9 && __GNUC__ >= 4) iterator erase( const_iterator pos ) { return iterator(_cont.erase(pos._iter)); } iterator erase( const_iterator first, const_iterator last ) { return iterator(_cont.erase(first._iter, last._iter)); } #else diff --git a/apt-private/private-cachefile.cc b/apt-private/private-cachefile.cc index 2b2050684..32cad1c33 100644 --- a/apt-private/private-cachefile.cc +++ b/apt-private/private-cachefile.cc @@ -33,7 +33,7 @@ static bool SortPackagesByName(pkgCache * const Owner, return strcmp(Owner->StrP + GA->Name, Owner->StrP + GB->Name) <= 0; } SortedPackageUniverse::SortedPackageUniverse(CacheFile &Cache) : - PackageUniverse{Cache}, List{Cache.UniverseList} + PackageUniverse{Cache}, List(Cache.UniverseList) { } void SortedPackageUniverse::LazyInit() const diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc index 36d40117c..8db736507 100644 --- a/apt-private/private-cacheset.cc +++ b/apt-private/private-cacheset.cc @@ -118,7 +118,7 @@ CacheSetHelperVirtuals::CacheSetHelperVirtuals(bool const ShowErrors, GlobalErro // CacheSetHelperAPTGet - responsible for message telling from the CacheSets/*{{{*/ CacheSetHelperAPTGet::CacheSetHelperAPTGet(std::ostream &out) : - APT::CacheSetHelper{true}, out{out} + APT::CacheSetHelper{true}, out(out) { explicitlyNamed = true; } diff --git a/debian/control b/debian/control index 678c75d35..82f455287 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Build-Depends: dpkg-dev (>= 1.15.8), debhelper (>= 8.1.3~), libdb-dev, zlib1g-dev, libbz2-dev, liblzma-dev, xsltproc, docbook-xsl, docbook-xml, po4a (>= 0.34-2), autotools-dev, autoconf, automake, libgtest-dev, - g++-5 (>= 5.1.1-20) + g++ (>= 4:5.2) Build-Depends-Indep: doxygen, w3m, graphviz Build-Conflicts: autoconf2.13, automake1.4 Vcs-Git: git://anonscm.debian.org/apt/apt.git -- cgit v1.2.3 From e7ebb41440cbe298b07c7fb7c6b20a64a17200f0 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 17 Aug 2015 18:37:09 +0200 Subject: Fix the test suite again Gbp-Dch: ignore --- .../test-allow-scores-for-all-dependency-types | 4 +-- .../test-architecture-specification-parsing | 6 ++--- .../test-bug-470115-new-and-tighten-recommends | 18 ++++++------- .../integration/test-bug-604222-new-and-autoremove | 6 ++--- .../test-bug-612099-multiarch-conflicts | 8 +++--- test/integration/test-bug-612557-garbage-upgrade | 4 +-- .../test-bug-613420-new-garbage-dependency | 4 +-- .../test-bug-686346-package-missing-architecture | 2 +- .../test-bug-709560-set-candidate-release | 2 +- .../test-bug-723586-any-stripped-in-single-arch | 2 +- .../test-bug-723705-tagfile-truncates-fields | 2 +- .../test-bug-735967-lib32-to-i386-unavailable | 2 +- .../test-bug-758153-versioned-provides-support | 16 ++++++------ test/integration/test-bug-multiarch-upgrade | 2 +- test/integration/test-essential-force-loopbreak | 2 +- test/integration/test-handling-broken-orgroups | 8 +++--- .../test-ignore-provides-if-versioned-breaks | 6 ++--- .../test-ignore-provides-if-versioned-conflicts | 6 ++--- test/integration/test-multiarch-allowed | 16 ++++++------ test/integration/test-multiarch-foreign | 16 ++++++------ test/integration/test-parse-all-archs-into-cache | 6 ++--- .../test-prefer-higher-priority-providers | 10 ++++---- ...prefer-native-architecture-over-higher-priority | 2 +- ...prevent-markinstall-multiarch-same-versionscrew | 2 +- test/integration/test-release-candidate-switching | 30 +++++++++++----------- .../test-specific-architecture-dependencies | 14 +++++----- ...u-bug-1130419-prefer-installed-ma-same-siblings | 12 ++++----- test/integration/test-ubuntu-bug-614993 | 2 +- .../test-ubuntu-bug-806274-install-suggests | 8 +++--- ...u-bug-835625-multiarch-lockstep-installed-first | 4 +-- .../test-unpack-different-version-unpacked | 12 ++++----- test/integration/test-xorg-break-providers | 2 +- 32 files changed, 118 insertions(+), 118 deletions(-) diff --git a/test/integration/test-allow-scores-for-all-dependency-types b/test/integration/test-allow-scores-for-all-dependency-types index 56cfc9a69..30cc2fc93 100755 --- a/test/integration/test-allow-scores-for-all-dependency-types +++ b/test/integration/test-allow-scores-for-all-dependency-types @@ -115,7 +115,7 @@ Inst baz (2 unversioned [amd64]) Conf baz (2 unversioned [amd64])' aptget install baz -st unversioned testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following packages will be REMOVED: bar @@ -139,7 +139,7 @@ Inst baz (2 unversioned [amd64]) Conf baz (2 unversioned [amd64])' aptget install baz -st unversioned testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following packages will be REMOVED: bar diff --git a/test/integration/test-architecture-specification-parsing b/test/integration/test-architecture-specification-parsing index f5a5b123e..701b10c3e 100755 --- a/test/integration/test-architecture-specification-parsing +++ b/test/integration/test-architecture-specification-parsing @@ -28,7 +28,7 @@ setupaptarchive testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo pkg-arch-foo @@ -48,7 +48,7 @@ Conf pkg-arch-no-foo (1.0 stable [${NATIVE}])" aptget install pkg-arch-no-foo -s testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo pkg-arch-foo-unrelated-no @@ -60,7 +60,7 @@ Conf pkg-arch-foo-unrelated-no (1.0 stable [${NATIVE}])" aptget install pkg-arch testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo pkg-arch-foo-unrelated-no2 diff --git a/test/integration/test-bug-470115-new-and-tighten-recommends b/test/integration/test-bug-470115-new-and-tighten-recommends index 80f699ef3..3c159811d 100755 --- a/test/integration/test-bug-470115-new-and-tighten-recommends +++ b/test/integration/test-bug-470115-new-and-tighten-recommends @@ -49,7 +49,7 @@ setupaptarchive testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: cool The following packages will be upgraded: cool tighten-cool @@ -61,7 +61,7 @@ Conf tighten-cool (2 unstable [all])' aptget install tighten-cool -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: stuff The following packages will be upgraded: stuff tighten-coolorstuff @@ -73,7 +73,7 @@ Conf tighten-coolorstuff (2 unstable [all])' aptget install tighten-coolorstuff testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: cool The following packages will be upgraded: cool tighten-coolorstuff2 @@ -85,7 +85,7 @@ Conf tighten-coolorstuff2 (2 unstable [all])' aptget install tighten-coolorstuff testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: cool The following packages will be upgraded: cool newrec-cool @@ -97,7 +97,7 @@ Conf newrec-cool (2 unstable [all])' aptget install newrec-cool -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: super The following NEW packages will be installed: super @@ -111,7 +111,7 @@ Conf super (2 unstable [all])' aptget install newrec-super -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: cool The following packages will be upgraded: cool newrec-coolorstuff @@ -123,7 +123,7 @@ Conf newrec-coolorstuff (2 unstable [all])' aptget install newrec-coolorstuff -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: stuff The following packages will be upgraded: cool-gone stuff @@ -135,7 +135,7 @@ Conf stuff (2 unstable [all])' aptget install cool-gone -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: super The following NEW packages will be installed: super @@ -151,7 +151,7 @@ Conf super-overtake (2 unstable [all])' aptget install super-overtake -s # the first option in an or-group should be the preferred one… testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: cool The following packages will be upgraded: cool upgrade-over-new diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index 3b5fa20c4..e910c70cb 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -40,7 +40,7 @@ Reading state information... The following package was automatically installed and is no longer required: libvtk5.4 Use 'apt-get autoremove' to remove it. -The following extra packages will be installed: +The following additional packages will be installed: libavcodec52 libopenal-dev libvtk5.4 The following NEW packages will be installed: dummy-archive libavcodec52 libopenal-dev @@ -55,7 +55,7 @@ Building dependency tree... Reading state information... 1 package was automatically installed and is no longer required. Use 'apt-get autoremove' to remove it. -The following extra packages will be installed: +The following additional packages will be installed: libavcodec52 libopenal-dev libvtk5.4 The following NEW packages will be installed: dummy-archive libavcodec52 libopenal-dev @@ -78,7 +78,7 @@ Building dependency tree... MarkKeep libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0 MarkKeep libvtk5-dev [ i386 ] < none -> 5.4.2-8 > ( libdevel ) FU=0 MarkDelete libvtk5.4 [ i386 ] < none -> 5.4.2-8 > ( libs ) FU=0 -The following extra packages will be installed: +The following additional packages will be installed: libavcodec52 libopenal-dev The following NEW packages will be installed: dummy-archive libavcodec52 libopenal-dev diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index 401b521a5..af8391555 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -41,7 +41,7 @@ Conf foobar (1.0 stable [i386])' aptget install foobar -st stable testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -The following extra packages will be installed: +The following additional packages will be installed: libc6:amd64 The following packages will be REMOVED: libc6 @@ -96,7 +96,7 @@ Conf foobar (1.0 stable [i386])' aptget install foobar/stable -st testing testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -The following extra packages will be installed: +The following additional packages will be installed: libc6:amd64 The following packages will be REMOVED: libc6 @@ -145,7 +145,7 @@ Conf foobar-same (1.0 stable [i386])' aptget install foobar-same -st stable testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -The following extra packages will be installed: +The following additional packages will be installed: libc6-same:amd64 The following NEW packages will be installed: foobar-same:amd64 libc6-same:amd64 @@ -206,7 +206,7 @@ Conf foobar-same (1.0 stable [i386])' aptget install foobar-same/stable -st test testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -The following extra packages will be installed: +The following additional packages will be installed: libc6-same:amd64 The following packages will be REMOVED: libc6-same diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade index 552330d81..1709af7f2 100755 --- a/test/integration/test-bug-612557-garbage-upgrade +++ b/test/integration/test-bug-612557-garbage-upgrade @@ -20,7 +20,7 @@ testmarkedauto python-uno openoffice.org-common testfailureequal 'Reading package lists... Building dependency tree... Reading state information... -The following extra packages will be installed: +The following additional packages will be installed: libreoffice-common The following packages will be REMOVED: openoffice.org-common openoffice.org-emailmerge @@ -38,7 +38,7 @@ testmarkedauto python-uno openoffice.org-common openoffice.org-emailmerge testfailureequal 'Reading package lists... Building dependency tree... Reading state information... -The following extra packages will be installed: +The following additional packages will be installed: libreoffice-common The following packages will be REMOVED: openoffice.org-common openoffice.org-emailmerge diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency index 18eab79c2..8424b10b7 100755 --- a/test/integration/test-bug-613420-new-garbage-dependency +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -24,7 +24,7 @@ Reading state information... The following packages were automatically installed and are no longer required: libreoffice-officebean openoffice.org-officebean Use 'apt-get autoremove' to remove them. -The following extra packages will be installed: +The following additional packages will be installed: libreoffice-core libreoffice-officebean openoffice.org-officebean The following packages will be REMOVED: openoffice.org-core @@ -40,7 +40,7 @@ Building dependency tree... Reading state information... 2 packages were automatically installed and are no longer required. Use 'apt-get autoremove' to remove them. -The following extra packages will be installed: +The following additional packages will be installed: libreoffice-core libreoffice-officebean openoffice.org-officebean The following packages will be REMOVED: openoffice.org-core diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture index dae0fa81d..d9bc0c3f2 100755 --- a/test/integration/test-bug-686346-package-missing-architecture +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -27,7 +27,7 @@ Conf pkgc (1 unstable [amd64])' aptget install pkgc -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: pkgb The following packages will be REMOVED: pkgb:none diff --git a/test/integration/test-bug-709560-set-candidate-release b/test/integration/test-bug-709560-set-candidate-release index ab41d8f2a..502ade92c 100755 --- a/test/integration/test-bug-709560-set-candidate-release +++ b/test/integration/test-bug-709560-set-candidate-release @@ -25,7 +25,7 @@ testsuccessequal "Reading package lists... Building dependency tree... Selected version '2.0' (experimental [all]) for 'foo' Selected version '2.1' (experimental [all]) for 'foo-dep' because of 'foo' -The following extra packages will be installed: +The following additional packages will be installed: foo-dep The following NEW packages will be installed: foo foo-dep diff --git a/test/integration/test-bug-723586-any-stripped-in-single-arch b/test/integration/test-bug-723586-any-stripped-in-single-arch index 8a835a6db..78c4eae64 100755 --- a/test/integration/test-bug-723586-any-stripped-in-single-arch +++ b/test/integration/test-bug-723586-any-stripped-in-single-arch @@ -17,7 +17,7 @@ setupaptarchive INSTALLLOG='Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: python3 The following NEW packages will be installed: python3-gnupg diff --git a/test/integration/test-bug-723705-tagfile-truncates-fields b/test/integration/test-bug-723705-tagfile-truncates-fields index 29f98550c..21878ebf0 100755 --- a/test/integration/test-bug-723705-tagfile-truncates-fields +++ b/test/integration/test-bug-723705-tagfile-truncates-fields @@ -12,7 +12,7 @@ aptget install --print-uris -y cdebconf-newt-terminal cdebconf-gtk-terminal 2>&1 testfileequal filename.log "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: cdebconf-gtk-udeb cdebconf-newt-udeb cdebconf-udeb libc6-udeb libglib2.0-udeb libgtk2.0-0-udeb libvte9-udeb The following NEW packages will be installed: diff --git a/test/integration/test-bug-735967-lib32-to-i386-unavailable b/test/integration/test-bug-735967-lib32-to-i386-unavailable index eb6e1a331..1523b81e0 100755 --- a/test/integration/test-bug-735967-lib32-to-i386-unavailable +++ b/test/integration/test-bug-735967-lib32-to-i386-unavailable @@ -78,7 +78,7 @@ Conf lib32nss-mdns (0.10-6 unstable [amd64])' aptget dist-upgrade -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libfoo libfoo-bin:i386 The following NEW packages will be installed: foo libfoo libfoo-bin:i386 diff --git a/test/integration/test-bug-758153-versioned-provides-support b/test/integration/test-bug-758153-versioned-provides-support index bf42f57fd..6d43d9943 100755 --- a/test/integration/test-bug-758153-versioned-provides-support +++ b/test/integration/test-bug-758153-versioned-provides-support @@ -157,7 +157,7 @@ Conf cool-webapp (4 experimental [all])' aptget install cool-webapp foreign-webs testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: baz:i386 foo @@ -182,7 +182,7 @@ E: Unable to correct problems, you have held broken packages.' aptget install ba testsuccessequal "Reading package lists... Building dependency tree... Selected version '2' (experimental [amd64]) for 'baz' -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: baz foo @@ -195,7 +195,7 @@ Conf baz (2 experimental [amd64])" aptget install baz/experimental -s -q=0 testsuccessequal "Reading package lists... Building dependency tree... Selected version '2' (experimental [i386]) for 'baz:i386' -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: baz:i386 foo @@ -219,7 +219,7 @@ E: Unable to correct problems, you have held broken packages.' aptget install ba testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: next The following NEW packages will be installed: needsrealnext next @@ -231,7 +231,7 @@ Conf needsrealnext (2 unstable [amd64])' aptget install needsrealnext -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: next The following NEW packages will be installed: needsrealnext:i386 next @@ -243,7 +243,7 @@ Conf needsrealnext:i386 (2 unstable [i386])' aptget install needsrealnext:i386 - testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: virtualnext2 The following NEW packages will be installed: needsnext2 virtualnext2 @@ -255,7 +255,7 @@ Conf needsnext2 (2 unstable [amd64])' aptget install needsnext2 -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: virtualnext2 The following NEW packages will be installed: needsnext2:i386 virtualnext2 @@ -267,7 +267,7 @@ Conf needsnext2:i386 (2 unstable [i386])' aptget install needsnext2:i386 -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: virtualnext3 The following NEW packages will be installed: needsnext3 virtualnext3 diff --git a/test/integration/test-bug-multiarch-upgrade b/test/integration/test-bug-multiarch-upgrade index 56071f184..b8821126f 100755 --- a/test/integration/test-bug-multiarch-upgrade +++ b/test/integration/test-bug-multiarch-upgrade @@ -18,7 +18,7 @@ setupaptarchive testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libcups2 The following packages will be upgraded: libcups2 libcups2:i386 diff --git a/test/integration/test-essential-force-loopbreak b/test/integration/test-essential-force-loopbreak index 50c682d43..86a852c32 100755 --- a/test/integration/test-essential-force-loopbreak +++ b/test/integration/test-essential-force-loopbreak @@ -27,7 +27,7 @@ testforcebreak() { rm -f rootdir/var/lib/apt/extended_states testfailureequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: sysvinit The following NEW packages will be installed: systemd-sysv diff --git a/test/integration/test-handling-broken-orgroups b/test/integration/test-handling-broken-orgroups index 15964a270..a465e5234 100755 --- a/test/integration/test-handling-broken-orgroups +++ b/test/integration/test-handling-broken-orgroups @@ -25,7 +25,7 @@ setupaptarchive testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: cool The following NEW packages will be installed: cool coolstuff @@ -37,7 +37,7 @@ Conf coolstuff (1.0-1 unstable [all])' aptget install coolstuff -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: stuff The following NEW packages will be installed: coolstuff2 stuff @@ -72,7 +72,7 @@ Conf coolstuff-brokenrec (1.0-1 unstable [all])' aptget install coolstuff-broken testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: stuff The following NEW packages will be installed: coolstuff-conflict stuff @@ -84,7 +84,7 @@ Conf coolstuff-conflict (1.0-1 unstable [all])' aptget install coolstuff-conflic testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: extrastuff The following NEW packages will be installed: coolstuff-provided extrastuff diff --git a/test/integration/test-ignore-provides-if-versioned-breaks b/test/integration/test-ignore-provides-if-versioned-breaks index 4d6114637..a7d9d4054 100755 --- a/test/integration/test-ignore-provides-if-versioned-breaks +++ b/test/integration/test-ignore-provides-if-versioned-breaks @@ -57,7 +57,7 @@ Conf foo-provider (1.0 unstable [i386])' aptget install foo-provider foo-breaker testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo-breaker-3 foo-provider @@ -95,7 +95,7 @@ Conf foo-foreign-provider (1.0 unstable [i386])' aptget install foo-foreign-prov testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo-foreign:amd64 The following NEW packages will be installed: foo-foreign-breaker-3 foo-foreign-provider @@ -133,7 +133,7 @@ Conf foo-same-provider (1.0 unstable [i386])' aptget install foo-same-provider f testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo-same foo-same:amd64 The following NEW packages will be installed: foo-same-breaker-3 foo-same-provider diff --git a/test/integration/test-ignore-provides-if-versioned-conflicts b/test/integration/test-ignore-provides-if-versioned-conflicts index 6a0c924e2..f30789ea6 100755 --- a/test/integration/test-ignore-provides-if-versioned-conflicts +++ b/test/integration/test-ignore-provides-if-versioned-conflicts @@ -57,7 +57,7 @@ Conf foo-provider (1.0 unstable [i386])' aptget install foo-provider foo-breaker testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo-breaker-3 foo-provider @@ -95,7 +95,7 @@ Conf foo-foreign-provider (1.0 unstable [i386])' aptget install foo-foreign-prov testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo-foreign:amd64 The following NEW packages will be installed: foo-foreign-breaker-3 foo-foreign-provider @@ -133,7 +133,7 @@ Conf foo-same-provider (1.0 unstable [i386])' aptget install foo-same-provider f testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo-same foo-same:amd64 The following NEW packages will be installed: foo-same-breaker-3 foo-same-provider diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed index 2c791ca19..2eb479c17 100755 --- a/test/integration/test-multiarch-allowed +++ b/test/integration/test-multiarch-allowed @@ -40,7 +40,7 @@ The following information may help to resolve the situation: solveableinsinglearch0() { testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo needsfoo @@ -53,7 +53,7 @@ Conf needsfoo (1 unstable [amd64])' aptget install needsfoo -s solveableinsinglearch0 testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo:i386 The following NEW packages will be installed: foo:i386 needsfoo:i386 @@ -74,7 +74,7 @@ E: Unable to correct problems, you have held broken packages." aptget install ne solveableinsinglearch1() { testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo $1 @@ -89,7 +89,7 @@ testneedsfooallgood() { solveableinsinglearch1 $1 testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: foo $1:i386 @@ -168,7 +168,7 @@ Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative solveableinsinglearch3() { testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: coolfoo The following NEW packages will be installed: coolfoo needscoolfoo @@ -179,7 +179,7 @@ Conf coolfoo (1 unstable [amd64]) Conf needscoolfoo (1 unstable [amd64])" aptget install needscoolfoo -s testsuccessequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: coolfoo The following NEW packages will be installed: coolfoo coolfoover needscoolfoo @@ -196,7 +196,7 @@ The following packages have unmet dependencies: E: Unable to correct problems, you have held broken packages." aptget install needscoolfooany -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: coolfoo The following NEW packages will be installed: coolfoo needscoolfoover0 @@ -207,7 +207,7 @@ Conf coolfoo (1 unstable [amd64]) Conf needscoolfoover0 (1 unstable [amd64])' aptget install needscoolfoover0 -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: coolfoo coolfoover The following NEW packages will be installed: coolfoo coolfoover needscoolfoover1 diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign index a266e35ed..58e5b462a 100755 --- a/test/integration/test-multiarch-foreign +++ b/test/integration/test-multiarch-foreign @@ -27,7 +27,7 @@ setupaptarchive testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: cool-foo:i386 foo @@ -59,7 +59,7 @@ Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:armel -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: bar The following NEW packages will be installed: bar cool-bar:i386 @@ -103,7 +103,7 @@ Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider:i386 satisfiable_in_singlearch() { testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: cool-foo foo @@ -125,7 +125,7 @@ Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:amd64 -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: bar The following NEW packages will be installed: bar cool-bar @@ -158,7 +158,7 @@ Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider -s -q testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: cool-foo-x64 foo @@ -199,7 +199,7 @@ hatersgonnahate 'foo:i386' #FIXME: do not work in single-arch as i386 isn't known at cache generation time testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: cool-foo-x32 foo @@ -211,7 +211,7 @@ Conf cool-foo-x32 (1.0 unstable [amd64])' aptget install cool-foo-x32 -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: bar The following NEW packages will be installed: bar cool-bar-x32 @@ -223,7 +223,7 @@ Conf cool-bar-x32 (1.0 unstable [amd64])' aptget install cool-bar-x32 -s -q=0 testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: bar The following NEW packages will be installed: bar cool-bar-x64 diff --git a/test/integration/test-parse-all-archs-into-cache b/test/integration/test-parse-all-archs-into-cache index f61862912..7741563e3 100755 --- a/test/integration/test-parse-all-archs-into-cache +++ b/test/integration/test-parse-all-archs-into-cache @@ -34,7 +34,7 @@ Building dependency tree...' aptget check -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libfoo1 The following packages will be REMOVED: foo:amd64 @@ -49,7 +49,7 @@ Conf foo (1 unstable [i386])' aptget install foo -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libfoo1 The following packages will be REMOVED: foo:amd64 libfoo1:amd64 @@ -65,7 +65,7 @@ Conf foo (2 experimental [i386])' aptget install foo/experimental -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo libfoo1 The following packages will be REMOVED: foo:amd64 diff --git a/test/integration/test-prefer-higher-priority-providers b/test/integration/test-prefer-higher-priority-providers index 85a302fb1..e6da2e151 100755 --- a/test/integration/test-prefer-higher-priority-providers +++ b/test/integration/test-prefer-higher-priority-providers @@ -15,7 +15,7 @@ setupaptarchive testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: awesome foo @@ -39,7 +39,7 @@ testsuccessequal "Reading package lists... Building dependency tree... Package 'bar' is not installed, so not removed Package 'baz' is not installed, so not removed -The following extra packages will be installed: +The following additional packages will be installed: foo The following NEW packages will be installed: awesome foo @@ -52,7 +52,7 @@ Conf awesome (1 unstable [all])" aptget install awesome bar- baz- -s testsuccessequal "Reading package lists... Building dependency tree... Package 'foo' is not installed, so not removed -The following extra packages will be installed: +The following additional packages will be installed: bar The following NEW packages will be installed: awesome bar @@ -66,7 +66,7 @@ testsuccessequal "Reading package lists... Building dependency tree... Package 'foo' is not installed, so not removed Package 'baz' is not installed, so not removed -The following extra packages will be installed: +The following additional packages will be installed: bar The following NEW packages will be installed: awesome bar @@ -80,7 +80,7 @@ testsuccessequal "Reading package lists... Building dependency tree... Package 'foo' is not installed, so not removed Package 'bar' is not installed, so not removed -The following extra packages will be installed: +The following additional packages will be installed: baz The following NEW packages will be installed: awesome baz diff --git a/test/integration/test-prefer-native-architecture-over-higher-priority b/test/integration/test-prefer-native-architecture-over-higher-priority index 7e4f8f34b..e7f8c28e7 100755 --- a/test/integration/test-prefer-native-architecture-over-higher-priority +++ b/test/integration/test-prefer-native-architecture-over-higher-priority @@ -14,7 +14,7 @@ setupaptarchive testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: m4 The following NEW packages will be installed: autoconf m4 diff --git a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew index 5f67c0191..11c120c53 100755 --- a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew +++ b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew @@ -83,7 +83,7 @@ E: Unable to correct problems, you have held broken packages.' aptget install de testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libsame3:i386 libsame3 The following NEW packages will be installed: depender3 libsame3 diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching index 510a8e078..1790e8381 100755 --- a/test/integration/test-release-candidate-switching +++ b/test/integration/test-release-candidate-switching @@ -56,7 +56,7 @@ setupaptarchive testfailureequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.1-1+sid) amarok-utils (2.3.1-1+sid) libc6 (2.11.2-7+sid) @@ -75,7 +75,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testfailureequal "Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -97,7 +97,7 @@ Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -119,7 +119,7 @@ Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-null' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-null' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -143,7 +143,7 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -173,7 +173,7 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-higher' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-higher' Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine' because of 'amarok-higher' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-higher' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -197,7 +197,7 @@ Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null2' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-null2' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-null2' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -221,7 +221,7 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine' Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine' because of 'amarok-xine' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -245,7 +245,7 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine2' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine2' Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-xine2' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine2' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -270,7 +270,7 @@ Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine3' because of 'amarok-xine3' Selected version '2.0' (experimental [all]) for 'intermediatepkg' because of 'phonon-backend-xine3' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine3' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) intermediatepkg (2.0) @@ -296,7 +296,7 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine4' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine4' Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-xine4' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine4' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -320,7 +320,7 @@ Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-broken' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-broken' Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-broken' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-broken' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -343,7 +343,7 @@ Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-recommends' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) amarok-utils (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -365,7 +365,7 @@ testfailureequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) Recommended packages: amarok-utils (2.3.1-1+sid) @@ -386,7 +386,7 @@ testfailureequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends2' Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends2' -The following extra packages will be installed: +The following additional packages will be installed: amarok-common (2.3.2-2+exp) libc6 (2.11.2-7+sid) libmtp8 (0.3.1+sid) diff --git a/test/integration/test-specific-architecture-dependencies b/test/integration/test-specific-architecture-dependencies index e3dfd0c2a..f6635a4d6 100755 --- a/test/integration/test-specific-architecture-dependencies +++ b/test/integration/test-specific-architecture-dependencies @@ -35,7 +35,7 @@ setupaptarchive testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libc6:i386 The following NEW packages will be installed: libc6:i386 pre-depender @@ -47,7 +47,7 @@ Conf pre-depender (1 unstable [all])' aptget install pre-depender -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libc6:i386 The following NEW packages will be installed: depender libc6:i386 @@ -59,7 +59,7 @@ Conf depender (1 unstable [all])' aptget install depender -s testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libc6:i386 The following NEW packages will be installed: depender-x32:i386 libc6:i386 @@ -71,7 +71,7 @@ Conf depender-x32:i386 (1 unstable [i386])' aptget install depender-x32:i386 -s testequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libc6:i386 The following NEW packages will be installed: depender-x32 libc6:i386 @@ -83,7 +83,7 @@ Conf depender-x32 (1 unstable [amd64])' aptget install depender-x32:amd64 -s testequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libc6 The following NEW packages will be installed: depender-x64 libc6 @@ -95,7 +95,7 @@ Conf depender-x64 (1 unstable [amd64])' aptget install depender-x64:amd64 -s testequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libc6 The following NEW packages will be installed: depender-x64:i386 libc6 @@ -267,7 +267,7 @@ configarchitecture 'amd64' testequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libc6 The following NEW packages will be installed: depender-x64 libc6 diff --git a/test/integration/test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings b/test/integration/test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings index 192ed5efc..2fc67096e 100755 --- a/test/integration/test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings +++ b/test/integration/test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings @@ -22,7 +22,7 @@ setupaptarchive testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libmesa:i386 The following NEW packages will be installed: libmesa:i386 steam:i386 @@ -33,7 +33,7 @@ Conf libmesa:i386 (1 stable [i386]) Conf steam:i386 (1 stable [i386])' aptget install steam -st stable testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libmesa:i386 The following NEW packages will be installed: libmesa:i386 steam:i386 @@ -47,7 +47,7 @@ cp rootdir/var/lib/dpkg/status default-status.dpkg insertinstalledpackage 'libmesa' 'amd64' '1' 'Multi-Arch: same' testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libmesa:i386 The following NEW packages will be installed: libmesa:i386 steam:i386 @@ -58,7 +58,7 @@ Conf libmesa:i386 (1 stable [i386]) Conf steam:i386 (1 stable [i386])' aptget install steam -st stable testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libmesa libmesa:i386 The following NEW packages will be installed: libmesa:i386 steam:i386 @@ -78,7 +78,7 @@ Conflicts: libmesa Multi-Arch: same' testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libmesa-lts:i386 The following NEW packages will be installed: libmesa-lts:i386 steam:i386 @@ -89,7 +89,7 @@ Conf libmesa-lts:i386 (1 stable [i386]) Conf steam:i386 (1 stable [i386])' aptget install steam -st stable testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libmesa-lts libmesa-lts:i386 The following NEW packages will be installed: libmesa-lts:i386 steam:i386 diff --git a/test/integration/test-ubuntu-bug-614993 b/test/integration/test-ubuntu-bug-614993 index 7067713e8..6e0a53025 100755 --- a/test/integration/test-ubuntu-bug-614993 +++ b/test/integration/test-ubuntu-bug-614993 @@ -10,7 +10,7 @@ setupaptarchive # test success UPGRADE="Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: libdrm-intel1 libdrm-nouveau1 libmtdev1 libutouch-grail1 libx11-xcb1 libxcb-aux0 libxcb-dri2-0 libxfont1 xserver-common xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-mouse diff --git a/test/integration/test-ubuntu-bug-806274-install-suggests b/test/integration/test-ubuntu-bug-806274-install-suggests index 3f02316f4..2d1cfcd9f 100755 --- a/test/integration/test-ubuntu-bug-806274-install-suggests +++ b/test/integration/test-ubuntu-bug-806274-install-suggests @@ -17,7 +17,7 @@ setupaptarchive testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: bar foo Suggested packages: baz @@ -34,7 +34,7 @@ Conf bar (1.0 unstable [i386])' aptget install apt -s --install-recommends --no- testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: bar baz foo The following NEW packages will be installed: apt bar baz foo @@ -50,7 +50,7 @@ Conf baz (1.0 unstable [i386])' aptget install apt -s --install-recommends --ins testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: foo Suggested packages: baz @@ -66,7 +66,7 @@ Conf apt (0.8.15 unstable [i386])' aptget install apt -s --no-install-recommends testsuccessequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: baz foo Recommended packages: bar diff --git a/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first b/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first index 269038d0f..9eab1cbfd 100755 --- a/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first +++ b/test/integration/test-ubuntu-bug-835625-multiarch-lockstep-installed-first @@ -16,7 +16,7 @@ setupaptarchive testequalor2 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: apt:i386 libsame:i386 The following NEW packages will be installed: libsame @@ -30,7 +30,7 @@ Conf libsame (2 unstable [amd64]) [apt:i386 ] Inst apt:i386 [1] (2 unstable [i386]) Conf apt:i386 (2 unstable [i386])' 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: apt:i386 libsame:i386 The following NEW packages will be installed: libsame diff --git a/test/integration/test-unpack-different-version-unpacked b/test/integration/test-unpack-different-version-unpacked index ae121cf4e..cdc187d15 100755 --- a/test/integration/test-unpack-different-version-unpacked +++ b/test/integration/test-unpack-different-version-unpacked @@ -32,7 +32,7 @@ insertinstalledpackage 'libqtcore4' 'i386' '1' 'Multi-Arch: same' '' 'install ok testsuccessequal 'Reading package lists... Building dependency tree... Correcting dependencies... Done -The following extra packages will be installed: +The following additional packages will be installed: libqtcore4:i386 The following packages will be upgraded: libqtcore4:i386 @@ -48,7 +48,7 @@ insertinstalledpackage 'libqtcore4' 'amd64' '1' 'Multi-Arch: same' '' 'install o testsuccessequal 'Reading package lists... Building dependency tree... Correcting dependencies... Done -The following extra packages will be installed: +The following additional packages will be installed: libqtcore4 The following packages will be upgraded: libqtcore4 @@ -64,7 +64,7 @@ insertinstalledpackage 'libqtcore4' 'i386' '1' 'Multi-Arch: same' testsuccessequal 'Reading package lists... Building dependency tree... Correcting dependencies... Done -The following extra packages will be installed: +The following additional packages will be installed: libqtcore4:i386 The following packages will be upgraded: libqtcore4:i386 @@ -80,7 +80,7 @@ insertinstalledpackage 'libqtcore4' 'amd64' '1' 'Multi-Arch: same' testsuccessequal 'Reading package lists... Building dependency tree... Correcting dependencies... Done -The following extra packages will be installed: +The following additional packages will be installed: libqtcore4 The following packages will be upgraded: libqtcore4 @@ -96,7 +96,7 @@ insertinstalledpackage 'libqtcore4' 'i386' '1' 'Multi-Arch: same' '' 'install ok testsuccessequal 'Reading package lists... Building dependency tree... Correcting dependencies... Done -The following extra packages will be installed: +The following additional packages will be installed: libqtcore4:i386 The following packages will be upgraded: libqtcore4:i386 @@ -111,7 +111,7 @@ insertinstalledpackage 'libqtcore4' 'amd64' '1' 'Multi-Arch: same' '' 'install o testsuccessequal 'Reading package lists... Building dependency tree... Correcting dependencies... Done -The following extra packages will be installed: +The following additional packages will be installed: libqtcore4 The following packages will be upgraded: libqtcore4 diff --git a/test/integration/test-xorg-break-providers b/test/integration/test-xorg-break-providers index ff1f3b077..57fd0e234 100755 --- a/test/integration/test-xorg-break-providers +++ b/test/integration/test-xorg-break-providers @@ -15,7 +15,7 @@ setupaptarchive testfailureequal 'Reading package lists... Building dependency tree... -The following extra packages will be installed: +The following additional packages will be installed: xserver-xorg-video-intel The following packages will be upgraded: xserver-xorg-core xserver-xorg-video-intel -- cgit v1.2.3 From 858f91bb796e68b8133574cc85649b9af87a9e8b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 17 Aug 2015 18:58:34 +0200 Subject: Fix the test suite harder Gbp-Dch: ignore --- test/integration/test-bug-611729-mark-as-manual | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/test-bug-611729-mark-as-manual b/test/integration/test-bug-611729-mark-as-manual index a7bde393b..31856b2c1 100755 --- a/test/integration/test-bug-611729-mark-as-manual +++ b/test/integration/test-bug-611729-mark-as-manual @@ -37,14 +37,14 @@ testmarkedauto 'b' testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -b is already the newest version. +b is already the newest version (1.0). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b --only-upgrade testmarkedauto 'b' testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -b is already the newest version. +b is already the newest version (1.0). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -d testmarkedauto 'b' @@ -62,7 +62,7 @@ Reinstall: b:i386 (1.0)' testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... -b is already the newest version. +b is already the newest version (1.0). b set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b testmarkedauto -- cgit v1.2.3 From 586bdb0c1216eb2bf35334b0f124a9c3598de160 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 18 Aug 2015 10:44:50 +0200 Subject: Do not fail if building test/ fails (issues with parallel builds) Git-Dch: ignore --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0393b424f..7680f0842 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,8 @@ all headers library clean veryclean binary program doc manpages docbook test upd $(MAKE) -C dselect $@ $(MAKE) -C doc $@ $(MAKE) -C po $@ - $(MAKE) -C test $@ + # FIXME: -C test has issue swith parallel builds, investigate! + -$(MAKE) -C test $@ fast: $(MAKE) -C vendor all -- cgit v1.2.3 From 2a22cd60f04c4291ea9b9b72e15b6d2ec378b001 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 17 Aug 2015 18:50:43 +0200 Subject: releasing package apt version 1.1~exp9 --- debian/NEWS | 2 +- debian/changelog | 282 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 283 insertions(+), 1 deletion(-) diff --git a/debian/NEWS b/debian/NEWS index d9abd6d23..41ac763d8 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,4 +1,4 @@ -apt (2.0~exp1) experimental; urgency=medium +apt (1.1~exp9) experimental; urgency=medium A new algorithm for pinning has been implemented, it now assigns a pin priority to a version instead of assigning a pin to a package. diff --git a/debian/changelog b/debian/changelog index f9bb815da..4c1ff24ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,285 @@ +apt (1.1~exp9) experimental; urgency=medium + + [ Michael Vogt ] + * Add "ca-certificates" recommends to apt-transport-https + * test/integration/test-apt-download-progress: + - fix test failure on fast hardware + * Rename "Size" in ServerState to TotalFileSize + * Make apt compile with clang++ again + * Cleanup includes (Thanks iwyu) + + [ David Kalnischkies ] + * reenable patchsize limit option for pdiffs + * better non-virtual metaIndex.LocalFileName() implementation + * mark internal interfaces as hidden + * restore ABI of pkgTagSection + * streamline display of --help in all tools + * allow uninstalled packages to be put on hold + * use 'best' hash for source authentication (LP: #1098738) + * reenable support for -s (and co) in apt-get source (Closes: 742578) + * create directory for extended_states if needed + * create our cache and lib directory always with mode 755 + * fix file ownership tests to work on kfreebsd + * use dpkg --merge-avail only if needed in apt-mark + * properly handle already reinstall pkgs in ordering (Closes: 770291) + * correct architecture detection for 'rc' packages for purge (Closes: 770898) + * derive more of https from http method + * properly implement pkgRecord::Parser for *.deb files + * improve https method queue progress reporting. + Thanks to Robert Edmonds and Anders Kaseorg for initial patchs + (Closes: 777565, 781509) + * calculate only expected hashes in methods + * calculate hashes while downloading in https + * ensure lists/ files have correct permissions after apt-cdrom add + * unsigned Release files can expire, too + * a hit on Release files means the indexes will be hits too + * remove "first package seen is native package" assumption. + Thanks to Axel Beckert for testing (Closes: 782777) + * improve partial/ cleanup in abort and failure cases + * a pin of 1000 always means downgrade allowed + * remove unused and strange default-value for pins + * show non-matching m-a:same versions in debug message + * fix 'Source' to 'Package' rename in apt-ftparchive + * sync TFRewrite*Order arrays with dpkg and dak + * stop depending on copy-on-write for std::string + * implement a more c++-style TFRewrite alternative + * rewrite all TFRewrite instances to use the new pkgTagSection::Write + * detect 416 complete file in partial by expected hash + * implement VerifyFile as all-hashes check + * detect Releasefile IMS hits even if the server doesn't + * treat older Release files than we already have as an IMSHit + * don't try other compressions on hashsum mismatch + * rework hashsum verification in the acquire system + * check patch hashes in rred worker instead of in the handler + * add more parsing error checking for rred + * support hashes for compressed pdiff files + * do not request files if we expect an IMS hit + * configureable acquire targets to download additional files + * show URI.Path in all acquire item descriptions + * implement 'apt-get files' to access index targets + * store Release files data in the Cache + * implement default apt-get file --release-info mode (Closes: 752702) + * populate the Architecture field for PackageFiles (Closes: 687255) + * hide Translation-* in 'apt-cache policy' output + * provide a public interface for acquiring changelogs + (Closes: 687147, 739854, 784027, 787190) + * ensure valid or remove destination file in file method + * deal better with acquiring the same URI multiple times + * call URIStart in cdrom and file method + * show item ID in Hit, Ign and Err lines as well + * condense parallel requests with the same hashes to one + * support lang= and target= sources.list options + * bring back deb822 sources.list entries as .sources + * detect and error out on conflicting Trusted settings + * merge indexRecords into metaIndex + * add sources.list Check-Valid-Until and Valid-Until-{Max,Min} options + * implement Signed-By option for sources.list + * remove the longtime deprecated vendor{,list} stuff + * allow individual targets to be kept compressed + * support gpg 2.1.x in apt-key (Closes: 781042) + * merge keyrings with cat instead of gpg in apt-key. + Thanks to Daniel Kahn Gillmor for the suggestion + * handle site-changing redirects as mirror changes + * disable locking even for root in --simulate + * rename 'apt-get files' to 'apt-get indextargets' + * enforce GCC5 C++11 ABI and usage + * show or-groups in not-installed recommends and suggests lists + * hide implicit deps in apt-cache again by default + * just-in-time creation for (explicit) negative deps + * add volatile sources support in libapt-pkg + * parse packages from all architectures into the cache + * enhance "hit paywall" error message to mention the probable cause + * drop extra newline in 'Failed to fetch' and 'GPG error' message + * mark again deps of pkgs in APT::Never-MarkAuto-Sections as manual. + Thanks to Raphaël Hertzog and Adam Conrad for detailed reports and + initial patches (Closes: 793360) (LP: #1479207) + * change to libapt-pkg abi 5.0 with versioned symbols + * move APT::Never-MarkAuto-Sections handling to MarkDelete + * move manual-bit from 'oldlibs' pkg to its dependencies + * remove Dir:: scope limit of RootDir in the documentation (Closes: 659387) + * add {contrib,non-free}/{metapackages,oldlibs} to section specialhandling + (Closes: 788320) + + [ Frans Spiesschaert ] + * Dutch program translation update (Closes: 771039) + + [ Julien Patriarca ] + * French program translation update (Closes: 766755) + + [ Zhou Mo ] + * Chinese (simplified) program translation update (Closes: 766170) + * Chinese (simplified) program translation update (Closes: 771982) + + [ Miroslav Kure ] + * Czech program translation update (Closes: 764055) + + [ Mert Dirik ] + * Turkish program translation update (Closes: 763379) + * Turkish translation update for apt (Closes: #789491) + + [ Kenshi Muto ] + * Japanese program translation update (Closes: 763033) + * Japanese program translation update (Closes: 772678) + + [ James McCoy ] + * support long keyids in "apt-key del" instead of ignoring them + (Closes: 754436) + * tighten filtering of kernel images in apt.auto-removal (Closes: 772732) + * Use terminfo's typical save_cursor/restore_cursor sequences + (Closes: #772521) + + [ Manuel "Venturi" Porras Peralta ] + * Spanish program translation update (Closes: 771815) + + [ Jean-Pierre Giraud ] + * French manpages translation update (Closes: 771967) + + [ Theppitak Karoonboonyanan ] + * Thai program translation update (Closes: 772913) + + [ Tomasz Buchert ] + * Fix crash in the apt-transport-https when Owner is NULL (Closes: #778375) + + [ Helmut Grohne ] + * parse arch-qualified Provides correctly (Closes: 777071) + + [ Beatrice Torracca ] + * Italian manpage translation update (Closes: 776702) + + [ Jérémy Bobbio ] + * stop displaying time of build in online help (Closes: 774342) + + [ Robert Edmonds ] + * HttpsMethod::Fetch(): Zero the FetchResult object when leaving due to 404 + + [ Milo Casagrande ] + * Italian program translation update (Closes: 782122) + + [ Julian Andres Klode ] + * pkgPolicy: Introduce storage and helpers for per-version pins + * versionmatch: Extract version match checking out of Find() + * policy: Assign per-version pins + * apt-cache: Change version pin output to use per-version pins + * fileutl_test.cc: Check for /etc/passwd instead of /bin/sh + * policy: Return highest file pin if version pin == 0 in GetPriority() + * Determine the candidate based on per-version pins, instead of old code + (Closes: #770017, #622237, #620249, #685215) + * policy: Fix the new policy implementation to handle downgrades correctly + * Fix test case breakage from the new policy implementation + * policy: Fix the handling of config-files states + * Replace INT_MIN with std::numeric_limits::min + * Simply ignore cruft in the status files, do not treat it as prio 0 + * Fix an obscure warning from GCC + * apt-get: Do not include apt-pkg/indexrecords.h + * Drop C++11 elements from headers + * Re-introduce None as a deprecated alias for No + * Make QItem a subclass of DescItem + * ExecFork: Use /proc/self/fd to determine which files to close + (Closes: #764204) + * Merge changelog entries from sid-gcc5 + * Bump apt-inst SONAME to 2.0 to adjust for the ABI break in apt-pkg + * Annotate more methods with APT_OVERRIDE. + Thanks to g++ -Wsuggest-override + * debian/gbp.conf: Set multimaint-merge = True + * debian/control: Rename libapt-pkg4.15 -> libapt-pkg5.0 + * apt.cron.daily: Reference 10periodic instead of 02periodic (LP: #1332106) + * Makefile: Add a make fast command for development + * Add a parameter ConsiderFiles to GetPriority(VerIterator) + * apt-cache: Modify policy output to use per-version pins + * Only make Upgradable() return true for packages with a candidate + (LP: #896689) + * apt-cache: Improve translateability of the "with priority" thing + * policy: Be more strict about parsing pin files, and document prio 0 + (Closes: #429912) + * apt_preferences(5): Re-document how priorities are calculated + (Closes: #554773) + * Drop the Section field from pkgCache::Package again + * Fix integration tests for the removal of the Package pin output + * Remove an invalid fi from a testcase + * C++11: Switch from auto_ptr to unique_ptr + * Mark SPtr as deprecated, and convert users to std::unique_ptr + * Deprecate SPtrArray and convert everyone to unique_ptr + * Use setresuid() and setresgid() where available + * Accept --upgradeable as synonym for --upgradable (Closes: #787846) + * po/fr.po: Remove the unbreakable space before ! in the confirm string + (Closes: #727680) + * Replace --force-yes by various options starting with --allow + * Add integration test for Pin-Priority range checks + * Replace UINT_MAX with std::numeric_limits::max() + * Mention that source order only matter per version (Closes: #617445) + * Say "in combination with the other options" if an option is not understood + (Closes: #762758) + * apt-cache: Show an error if stats gets any arguments (Closes: #153161) + * apt-cache(8): Mention that --names-only search provides (Closes: #618017) + * apt_preferences(5): Correct default pin assignment documentation + (Closes: #623706) + * apt_preferences(5): Mention overlapping of pin matches + * Make auto-remove and auto-clean aliases for the versions without - + (Closes: #274159) + * apt: Add autoremove and auto-remove commands + * changelog: Replace reenable by re-enable everywhere. + Thanks to Lintian + * debian/control: Replace debian by Debian. + Thanks to Lintian + * debian/control: Drop the versioned python-apt conflict. + Thanks to Lintian + * debian/control: Remove XS- from Testsuite and bump Standards-Version. + Thanks to Lintian + * Set Acquire::Changelogs::URI::Origin::Tanglu for Tanglu changelogs + * Also add 'in combination with the other options.' to another error + * apt-cache(8): Drop the #versions >= #package names comparison + (Closes: #691281) + * apt-get: allow non-root --print-uris build-dep (Closes: #283400) + * doc/files.dbk: Improve documentation for {src,}pkgcache.bin + (Closes: #465551) + * update: Check if the cache could be opened, don't just assume it + (Closes: #756162) + * cachefile.cc: Do not ignore return value of pkgDepCache::Init() + * Add GetPriority(VerIterator) to pkgDepCache::Policy + * Document the general effect of the comma operator (Closes: #574939) + * When looking if Provides match, OR them with the normal patches + (Closes: #760868) + * install: If package already is the newest version, display version + (Closes: #315149) + * Make pkgCache::Priority() static, it does not need the instance + (Closes: #448627) + * Replace "extra" in "the following extra packages [...]" by "additional" + (Closes: #82430) + * Do not crash in 'apt show' for non-installed packages + * debian/NEWS: Mention new pinning algorithm added in 2.0~exp1 + + [ Yuri Kozlov ] + * Russian program translation update (Closes: 789709) + + [ Guillem Jover ] + * po-fixups: fill Project-Id-Version and Encoding correctly (Closes: 612996) + * Do not set unhonored DPKG_NO_TSTP variable for dpkg (Closes: #765366) + + [ Daniel Hartwig ] + * support setting a port for rsh:// in sources.list (Closes: 624727) + * replace direct calls to egrep with grep -E. + Thanks to David Weinehall for initial patch (Closes: 255577) + + [ Luca Bruno ] + * Replace all "press enter" occurrences with "press [Enter]" + Thanks to Andre Felipe Machado for initial patch (Closes: 414848) + + [ Jonathan Nieder ] + * document VERSION 2 (and 3) pre-install-pkgs hook interface (Closes: 627188) + + [ Tomas Pospisek ] + * document APT::Periodic::RandomSleep. + Thanks to Chris Bainbridge and Kees Cook for initial text (Closes: 776380) + + [ Johannes Schauer ] + * use a=experimental instead n=experimental in pin documentation + (Closes: 783343) + + [ Kusanagi Kouichi ] + * Show full package records in apt-cache search -f (Closes: #660851) + + -- Michael Vogt Tue, 18 Aug 2015 11:15:52 +0200 + apt (1.1~exp8) experimental; urgency=medium [ Michael Vogt ] -- cgit v1.2.3