From 012b102ad1baf9f24601cbec6365fe43aad2d521 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 21 Oct 2005 19:51:41 +0000 Subject: * ABI/API change: add "VerIterator::TranslatedDescription()" method to make the life of the api user easier --- cmdline/apt-cache.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 810dbe7b0..cb1aeb514 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1237,13 +1237,7 @@ bool DisplayRecord(pkgCache::VerIterator V) // Show the right description pkgRecords Recs(*GCache); - pkgCache::DescIterator DescDefault = V.DescriptionList(); - pkgCache::DescIterator Desc = DescDefault; - for (; Desc.end() == false; Desc++) - if (pkgIndexFile::LanguageCode() == Desc.LanguageCode()) - break; - if (Desc.end() == true) Desc = DescDefault; - + pkgCache::DescIterator Desc = V.TranslatedDescription(); pkgRecords::Parser &P = Recs.Lookup(Desc.FileList()); cout << "Description" << ( (strcmp(Desc.LanguageCode(),"") != 0) ? "-" : "" ) << Desc.LanguageCode() << ": " << P.LongDesc(); -- cgit v1.2.3 From 7049e4e9ca6db15326d8a76f4f5f9ab592a925e3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sun, 23 Oct 2005 09:27:12 +0000 Subject: * be extra carefull in cmdline/apt-get.cc:FindSrc() and check VF.File() for NULL --- cmdline/apt-get.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 3475d79ae..040f670b1 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1200,7 +1200,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, VerTag = string(TmpSrc.begin() + Slash + 1,TmpSrc.end()); TmpSrc = string(TmpSrc.begin(),TmpSrc.begin() + Slash); } - else if(DefRel.empty() == false) + else if(DefRel.empty() == false) { // we have a default release, try to locate the pkg. we do it like // this because GetCandidateVer() will not "downgrade", that means @@ -1211,6 +1211,10 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs, for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++) { + // extra paranioa + if(VF.File() == NULL) + continue; + /* 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 -- cgit v1.2.3