Hi,

On Wed, 2008-10-29 at 17:44 +0000, James Westby wrote:
> When using debdiff to diff the current version with the previous
> (debdiff with no arguments in an unpacked source package) it fails
> to do the right thing if the distribution name of the current or
> previous version contains a hyphen.
> 
> The problem is this:
> 
>     if(/^(.+)\s\((\d+:)?(.+)\)\s(\w+)\;\surgency=.+$/) {
>         unshift @ARGV, "../".$1."_".$3.".dsc";
>         $guessed_version++;
>     }
> 
> the \w+ doesn't match e.g. intrepid-security, so the tool tries to
> compare two different versions.

To be honest a .+? would probably work, given that we're throwing away
the distribution anyway. I'm guessing that the regex was probably
adapted from a version of dpkg's parser at some point, so I'm tempted to
update the above to more closely match what dpkg actually looks for now
- policy doesn't put any restrictions on distribution names but dpkg
constrains them to the same set of characters as valid package names.

> This is probably more frequent on Ubuntu as we use hyphenated
> distributions more often, though testing-propsed-updates uploads
> will probably trigger it.
> 
> Could debdiff use the parser from dpkg-dev to extract the wanted
> information, making it more robust?

dpkg-parsechangelog (and the perl modules behind it) have only fairly
recently (in Debian terms - 1.14.16) acquired the ability to select only
the "top n" entries from a changelog, which is why I imagine they
weren't used before; that and the fact that reading the file directly
saves a fork.

At least in the short term I'm therefore probably just going to update
the regex to match dpkg's current changelog parsing.

Regards,

Adam




-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to