Control: tag -1 + confirmed

On Mon, 10 Apr 2017 22:37:28 +1000, Ben Finney wrote:

> Given a Perl module::
> 
>     use Debian::Control::Stanza::Source;
> 
>     my $s = Debian::Control::Stanza::Source->new( {
>         'Build-Depends' => "debhelper",
>         'VCS-Git' => "https://example.org/";,
>     } );
> 
> The above code causes the error message::
> 
>     Invalid field given (VCS_Git) at ./foo.pl line 6.
> 
> The spelling “VCS-Git” is not invalid. Debian Policy §5.1 specifies
> that “Field names are not case-sensitive […]”.

Thank you, that's indeed an issue.
 
> The library should allow field names without regard to their
> capitalisation. For example, the names “vcs-git”, “Vcs-Git”,
> “VCS-Git”, “vcS-gIt” should all be interpreted as the same field name
> by ‘libdebian-source-perl’.

Right. Unfortunately that's not so easy, as these field names are not
just strings but they are also automatically generated accessors; the
error message above is in fact the user-friendly version of the
underlying problem:


% perl -MDebian::Control::Stanza::Source -E '$s = 
Debian::Control::Stanza::Source->new(); say $s->Vcs_Git; say $s->VCS_Git;'

Can't locate object method "VCS_Git" via package 
"Debian::Control::Stanza::Source" at -e line 1.


Maybe someone has an idea how we can simulate something like
case-insensitive method names?


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Van Morrison

Attachment: signature.asc
Description: Digital Signature

Reply via email to