X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/54debba5d21783160e78706f6c21b274ca4b805b..3dc863efa5f825a16b46ccba0771e86895459c77:/cmdline/apt-cache.cc diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 7d402a2fd..cc4c1559e 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -102,13 +102,15 @@ bool UnMet(CommandLine &CmdL) if (End->Type != pkgCache::Dep::PreDepends && End->Type != pkgCache::Dep::Depends && End->Type != pkgCache::Dep::Suggests && - End->Type != pkgCache::Dep::Recommends) + End->Type != pkgCache::Dep::Recommends && + End->Type != pkgCache::Dep::DpkgBreaks) continue; // Important deps only if (Important == true) if (End->Type != pkgCache::Dep::PreDepends && - End->Type != pkgCache::Dep::Depends) + End->Type != pkgCache::Dep::Depends && + End->Type != pkgCache::Dep::DpkgBreaks) continue; // Verify the or group @@ -869,6 +871,7 @@ bool XVcg(CommandLine &CmdL) then show the relation but do not recurse */ if (Hit == false && (D->Type == pkgCache::Dep::Conflicts || + D->Type == pkgCache::Dep::DpkgBreaks || D->Type == pkgCache::Dep::Obsoletes)) { if (Show[D.TargetPkg()->ID] == None && @@ -890,6 +893,9 @@ bool XVcg(CommandLine &CmdL) case pkgCache::Dep::Conflicts: printf("label: \"conflicts\" color: lightgreen }\n"); break; + case pkgCache::Dep::DpkgBreaks: + printf("label: \"breaks\" color: lightgreen }\n"); + break; case pkgCache::Dep::Obsoletes: printf("label: \"obsoletes\" color: lightgreen }\n"); break; @@ -1225,31 +1231,41 @@ bool DisplayRecord(pkgCache::VerIterator V) return false; } - // Strip the Description - unsigned char *DescP = (unsigned char*)strstr((char*)Buffer, "Description:"); - *DescP='\0'; + // Get a pointer to start of Description field + const unsigned char *DescP = (unsigned char*)strstr((char*)Buffer, "Description:"); - // Write all the rest - if (fwrite(Buffer,1,V.FileList()->Size+1,stdout) < (size_t)(V.FileList()->Size+1)) + // Write all but Description + if (fwrite(Buffer,1,DescP - Buffer,stdout) < (size_t)(DescP - Buffer)) { delete [] Buffer; return false; } - delete [] Buffer; - // 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() << endl; + cout << "Description" << ( (strcmp(Desc.LanguageCode(),"") != 0) ? "-" : "" ) << Desc.LanguageCode() << ": " << P.LongDesc(); + + // Find the first field after the description (if there is any) + for(DescP++;DescP != &Buffer[V.FileList()->Size];DescP++) + { + if(*DescP == '\n' && *(DescP+1) != ' ') + { + // write the rest of the buffer + const unsigned char *end=&Buffer[V.FileList()->Size]; + if (fwrite(DescP,1,end-DescP,stdout) < (size_t)(end-DescP)) + { + delete [] Buffer; + return false; + } + break; + } + } + // write a final newline (after the description) + cout<ProvidesList != 0) - { - ioprintf(std::cout,_("Package %s is a virtual package provided by:\n"), - Pkg.Name()); - - pkgCache::PrvIterator I = Pkg.ProvidesList(); - for (; I.end() == false; I++) - cout << " " << I.OwnerPkg().Name() << endl; - cout << _("You should explicitly select one to show.") << endl; - continue; - } - // Find the proper version to use. if (_config->FindB("APT::Cache::AllVersions","true") == true) { @@ -1633,10 +1636,11 @@ bool Madison(CommandLine &CmdL) pkgCache &Cache = *GCache; - // Create the text record parsers + // Create the src text record parsers and ignore errors about missing + // deb-src lines that are generated from pkgSrcRecords::pkgSrcRecords pkgSrcRecords SrcRecs(*SrcList); if (_error->PendingError() == true) - return false; + _error->Discard(); for (const char **I = CmdL.FileList + 1; *I != 0; I++) {