From c5d6a22cc65d4f5d0405c0a2a392c659e2959e3f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 18 Nov 2010 14:10:50 +0100 Subject: cmdline/apt-get.cc: use source version instead of binary version --- cmdline/apt-get.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index a1987b977..db9424985 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2751,10 +2751,12 @@ string GetChangelogPath(CacheFile &Cache, pkgRecords Recs(Cache); 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()); + string ver = Ver.VerStr(); + // if there is a source version it always wins + if (rec.SourceVer() != "") + ver = rec.SourceVer(); path = flNotFile(rec.FileName()); - path += srcpkg + "_" + srcver; + path += srcpkg + "_" + StripEpoch(ver); return path; } /*}}}*/ -- cgit v1.2.3 From 88573174ba96c9b3948ee7cba8c6073b13a27c32 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 18 Nov 2010 14:12:57 +0100 Subject: cmdline/apt-get.cc: remove srcpkg --- cmdline/apt-get.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index db9424985..0879cf7c6 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2802,7 +2802,6 @@ bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher, * GuessThirdPartyChangelogUri for details how) */ { - string srcpkg; string path; string descr; string server; @@ -2816,9 +2815,9 @@ bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher, "http://packages.debian.org/changelogs"); path = GetChangelogPath(CacheFile, Pkg, Ver); strprintf(changelog_uri, "%s/%s/changelog", server.c_str(), path.c_str()); - strprintf(descr, _("Changelog for %s (%s)"), srcpkg.c_str(), changelog_uri.c_str()); + strprintf(descr, _("Changelog for %s (%s)"), Pkg.Name(), changelog_uri.c_str()); // queue it - new pkgAcqFile(&Fetcher, changelog_uri, "", 0, descr, srcpkg, "ignored", targetfile); + new pkgAcqFile(&Fetcher, changelog_uri, "", 0, descr, Pkg.Name(), "ignored", targetfile); // try downloading it, if that fails, they third-party-changelogs location // FIXME: res is "Continue" even if I get a 404?!? @@ -2828,8 +2827,8 @@ bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher, string third_party_uri; if (GuessThirdPartyChangelogUri(CacheFile, Pkg, Ver, third_party_uri)) { - strprintf(descr, _("Changelog for %s (%s)"), srcpkg.c_str(), third_party_uri.c_str()); - new pkgAcqFile(&Fetcher, third_party_uri, "", 0, descr, srcpkg, "ignored", targetfile); + strprintf(descr, _("Changelog for %s (%s)"), Pkg.Name(), third_party_uri.c_str()); + new pkgAcqFile(&Fetcher, third_party_uri, "", 0, descr, Pkg.Name(), "ignored", targetfile); res = Fetcher.Run(); } } -- cgit v1.2.3