+// GuessThirdPartyChangelogUri - return url /*{{{*/
+// ---------------------------------------------------------------------
+bool GuessThirdPartyChangelogUri(CacheFile &Cache,
+ pkgCache::PkgIterator Pkg,
+ pkgCache::VerIterator Ver,
+ string &out_uri)
+{
+ pkgRecords Recs(Cache);
+ pkgSourceList *SrcList = Cache.GetSourceList();
+
+ // get the binary deb server path
+ pkgRecords::Parser &rec=Recs.Lookup(Ver.FileList());
+ string srcpkg = rec.SourcePkg().empty() ? Pkg.Name() : rec.SourcePkg();
+ // FIXME: deal with cases like gcc-defaults (srcver != binver)
+ string srcver = StripEpoch(Ver.VerStr());
+
+ pkgCache::VerFileIterator Vf = Ver.FileList();
+ if (Vf.end() == true)
+ return false;
+ pkgCache::PkgFileIterator F = Vf.File();
+ pkgIndexFile *index;
+ if(SrcList->FindIndex(F, index) == false)
+ return false;
+ // get archive uri for the binary deb
+ string deb_uri = index->ArchiveURI(rec.FileName());
+
+ // now strip away the filename and add srcpkg_srcver.changelog
+ out_uri = flNotFile(deb_uri);
+ out_uri += srcpkg + "_" + srcver + ".changelog";
+ return true;
+}