[Build-common-hackers] Bug#724281: Bug#724281: cdbs: license check a lot of time results in an error

Jonas Smedegaard dr at jones.dk
Mon Feb 3 21:56:52 UTC 2014

Hi IOhannes,

Quoting IOhannes m zmoelnig (2014-02-03 17:18:52)
> after a suggestion from jonas that it might be related to locales, i tried
> running the licensecheck with the following locales:
>   C
>   en_US.utf-8
>   de_AT.utf-8

Right, that is one issue.  More specifically it is LC_COLLATE (i.e. the 
sorting order).  Danish "aa" sorts _after_ z as it it an old way of 
expressing a different character å (a-ring), the last character in 
danish alphabet.

> for testing i chose the cdbs package itself (cdbs-0.4.123, currently 
> UNRELEASED, commit 512bff6636ad09a).


> i first set the locales (both LC_ALL and LANG),

Setting LANG should not be needed.  Most correct would be to set only 
LC_COLLATE - and if you want "belt and suspenders" approach, then set 
all three.  See "man setlocale" for priority of those variables.

> then ran the following command
> twice, storing the generated debian/copyright_newhints:

>     $ DEB_MAINTAINER_MODE=yes dpkg-buildpackage -rfakeroot

I believe running twice should be relevant only if the package is broken 
and doesn't clean properly.  If that's the case then examining the 
actual dirt accumulated is relevant.

> the resulting files (and the output of `locale` for each locale) can 
> be found in the attachment.
> as you can see, i got 6 different copyright_newhints :-(


Looking at the output I suspect some place in the code _lacks_ sorting 
(as opposed to sorting language-dependent).  I believe the recent update 
to Perl 5.18 introduced some deliberate randomization of hashing 
algorithms (for security reasons, to circumvent predictability) which 
may play a role in how I didn't notice this issue when I wrote the code.

 - Jonas

 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/build-common-hackers/attachments/20140203/9c5d9be0/attachment.sig>

More information about the Build-common-hackers mailing list