Bug#1015913: /usr/share/perl5/Config/Model/models/Dpkg/Control.pl: failure applying Dpkg::Control fixes when current directory is single character

2022-07-27 Thread Dominique Dumont
On Monday, 25 July 2022 10:19:18 CEST you wrote:
> I guess I can tweak the formula
> l30  to return undef when the match regex (L35) cannot be satisfied.

Which uncovered a bug in libconfig-model-perl. Fixing this bug will also 
require libconfig-model-perl 2.151

All the best



Bug#1015913: /usr/share/perl5/Config/Model/models/Dpkg/Control.pl: failure applying Dpkg::Control fixes when current directory is single character

2022-07-25 Thread Dominique Dumont
Hi

On Saturday, 23 July 2022 20:31:40 CEST you wrote:
>  Configuration item 'source Source' has a wrong value:
>   computed value error:
>   value '1' does not match regexp \w[\w+\-\.]{1,}
>  value is computed from 'use Cwd; getcwd =~ m!/([^/]+)$!; $1;'

Right. This is one case where cme tries to be too smart. 

The Source parameter is set up to have $PWD as default value [1] and the value 
is checked to match a name with more than one char [2].

> In the real case the root_dir argument points to an existing package
> directory containing 'debian/control' and all, e.g:
> 
> $ sudo apt install dh-make-perl
> $ mkdir -p ~/tmp/1
> $ cd ~/tmp/1
> $ dh-make-perl --cpan Alias

But this default value does not makes sense. I guess I can tweak the formula 
l30  to return undef when the match regex (L35) cannot be satisfied. Then user 
must manually set the Source value before saving because this value is 
mandatory (L34)

> I hope this is enough to reproduce and diagnose the problem.

Sure, thanks for the boiled down step. This will go in the non reg test suite 
;-)

All the best

[1] 
https://salsa.debian.org/perl-team/modules/packages/libconfig-model-dpkg-perl/-/blob/master/lib/Config/Model/models/Dpkg/Control/Source.pl#L28
[2] 
https://salsa.debian.org/perl-team/modules/packages/libconfig-model-dpkg-perl/-/blob/master/lib/Config/Model/models/Dpkg/Control/Source.pl#L35



Bug#1015913: /usr/share/perl5/Config/Model/models/Dpkg/Control.pl: failure applying Dpkg::Control fixes when current directory is single character

2022-07-23 Thread Damyan Ivanov
Package: libconfig-model-dpkg-perl
Version: 2.161
Severity: normal
File: /usr/share/perl5/Config/Model/models/Dpkg/Control.pl
Tags: upstream

Hi,

Discovered when running dh-make-perl from a directory named '1'. Here's a 
reproducer. Note the name of the current directory:

 ╭─ ~/tmp/1 
 ╰─ LANG=C perl -MConfig::Model 
-wE'Config::Model->new->instance(root_class_name => "Dpkg::Control", root_dir 
=> "/non-existent")->apply_fixes'

 Reading package lists... Done
 Building dependency tree... Done
 Reading state information... Done
 Configuration item 'source Source' has a wrong value:
computed value error:
value '1' does not match regexp \w[\w+\-\.]{1,}
 value is computed from 'use Cwd; getcwd =~ m!/([^/]+)$!; $1;'

In the real case the root_dir argument points to an existing package 
directory containing 'debian/control' and all, e.g:

$ sudo apt install dh-make-perl
$ mkdir -p ~/tmp/1
$ cd ~/tmp/1
$ dh-make-perl --cpan Alias

I hope this is enough to reproduce and diagnose the problem.


-- Damyan

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'stable'), 
(500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.18.0-2-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libconfig-model-dpkg-perl depends on:
ii  debhelper  13.8
ii  libapt-pkg-perl0.1.40+b1
ii  libarray-intspan-perl  2.004-2
ii  libconfig-model-backend-yaml-perl  2.134-1
ii  libconfig-model-perl   2.150-1
ii  libdata-compare-perl   1.27-2
ii  libexporter-lite-perl  0.09-1
ii  liblog-log4perl-perl   1.55-1
ii  libmouse-perl  2.5.10-1+b2
ii  libparse-debcontrol-perl   2.005-5
ii  libparse-recdescent-perl   1.967015+dfsg-3
ii  libsoftware-licensemoreutils-perl  1.009-1
ii  libsort-versions-perl  1.62-2
ii  libtext-autoformat-perl1.75-1
ii  libtext-levenshtein-damerau-perl   0.41-2
ii  libtoml-tiny-perl  0.15-1
ii  liburi-perl5.12-1
ii  libwww-perl6.67-1
ii  libyaml-libyaml-perl   0.83+ds-1+b1
ii  licensecheck   3.3.0-1
ii  lintian2.115.2
ii  perl [libmodule-corelist-perl] 5.34.0-5

Versions of packages libconfig-model-dpkg-perl recommends:
ii  libconfig-model-tkui-perl  1.375-1

libconfig-model-dpkg-perl suggests no packages.

-- no debconf information