Bug#891867: diffoscope: improve .changes diffs

Mattia Rizzolo mattia at debian.org
Thu Mar 1 21:24:01 UTC 2018


On Thu, Mar 01, 2018 at 09:00:27PM +0000, Chris Lamb wrote:
> >              differences.append(Difference.from_text(
> > -                self.deb822.get_as_string('Checksums-Sha256'),
> > -                other.deb822.get_as_string('Checksums-Sha256'),
> > +                self.deb822.get_as_string('Checksums-Sha256') + "\n",
> > +                other.deb822.get_as_string('Checksums-Sha256') + "\n",
> 
> Why not .strip() them all instead, out of interest?

Because deb822.get_as_string() returns a single string containing all of
'Checksums-Sha256' (in this case) with the \n embedded in that string.
So to .str() them all you'd need to instead do a .splitlines() of
deb822.get_as_string() and then add something clever to Difference to
handle the array instead of a text.

I am not a fan of "randomly" adding \n either, but for sure it is the
simplest way to make the diff behaviour here saner.

-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
more about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20180301/6aaa43a3/attachment.sig>


More information about the Reproducible-builds mailing list