retitle 333468 'aptitude changelog' can't deal with binNMU'ed packages
tags 333468 + patch
thanks

On 2007-04-30 09:35 +0200, Sven Joachim wrote:

> On Thu, 13 Oct 2005 11:57:50 -0700, Daniel Burrows wrote:
>
>>  There are a lot of weird corner cases where the source and binary
>> versions differ (as is currently the case for dpkg).  aptitude doesn't
>> attempt to cover them all.
>
>>  The proper solution would be for the binary package to contain a
>> reference to its source version.  I've heard through the grapevine
>> that this proper solution is planned in the future, so I'm not really
>> interested in cramming short-term hacks into aptitude to cover this
>> situation.
>
> FWIW, this seems to have been implemented in the meantime, packages
> that are binNMU'ed do have a Source: field in the control file.
> Aptitude should use that field to construct the URL of the changelog.
> Can you implement this, Daniel?

No progress on this bug in the last year, and I just couldn't stand this
"Couldn't fetch URL..." any more.  While I'm not familiar enough with
the aptitude source (nor with C++, for that matter) to implement a
proper solution that uses the Source: field, at least I have a (tested!)
patch that deals with the current scheme of binNMU names:

--8<---------------cut here---------------start------------->8---
diff -r b9df1dc55acd src/generic/apt/pkg_changelog.cc
--- a/src/generic/apt/pkg_changelog.cc  Wed Apr 23 19:54:20 2008 -0700
+++ b/src/generic/apt/pkg_changelog.cc  Mon Apr 28 19:23:56 2008 +0200
@@ -138,6 +138,8 @@
       realver.assign(ver, ver.find(':')+1, ver.npos);
     else
       realver = ver;
+    if(realver.rfind("+b") == realver.length()-3)
+      realver.erase(realver.length()-3);
 
     uri = 
ssprintf("http://packages.debian.org/changelogs/pool/%s/%s/%s/%s_%s/changelog";,
                   realsection.c_str(),
--8<---------------cut here---------------end--------------->8---

If you think this is too much of a hack, feel free to remove the patch
tag.  But since the binNMU naming scheme is quite established and
unlikely to change soon, it may at least represent a mid-term solution
until somebody¹ comes up with a better design.

Cheers,
       Sven


¹ s/somebody/Daniel Burrows/ would come nearer to the truth. ;-)



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to