Bug#712432: Debian::Control::binary returns a Tie::IxHash object, not a hashref

Olof Johansson olof at ethup.se
Sat Jun 15 22:14:47 UTC 2013


Package: dh-make-perl
Version: 0.76-1
Tags: patch

Debian::Control's synopsis describes the following usage:

 my $c = Debian::Control->new();         # construct a new
 $c->read($file);                        # parse debian/control file
 $c->binary->{'libfoo-perl'}->Description(
     "Foo Perl module\n" .
     " Foo makes this and that"
 );

But internally, the module uses Tie::IxHash's object oriented
interface, making $c-binary be a Tie::IxHash rather than a tied hash
reference. This was introduced in commit d17eedda6 [1].

Within the dh-make-perl distribution, $c->binary isn't treated as a
hashref anywhere, but instead it's treated like a Tie::IxHash object,
using it's method interface, e.g. $c->binary->FETCH('libfoo-perl').

I've made a fix, keeping backwards compatibility. However, the API
becomes somewhat convoluted imho, having to do

 $c->binary_tie->{'libfoo-perl'}

instead of

 $c->binary->{'libfoo-perl'}

What do you think? (If compatibility wasn't an issue, I would probably
have swapped the names.)

1: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/dh-make-perl.git;a=commitdiff;h=d17eedda6

Regards,
-- 
 --------------------------------------------------------------- 
| Olof Johansson                              http://stdlib.se/ |
|  irc: zibri                           https://github.com/olof |
 --------------------------------------------------------------- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Debian-Control-Expose-the-actual-tie-for-binary.patch
Type: text/x-diff
Size: 3196 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20130616/5f524418/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20130616/5f524418/attachment.sig>


More information about the pkg-perl-maintainers mailing list