Bug#878515: lintian: Use of uninitialized value in string eq at …/checks/fields.pm line 512. / Use of uninitialized value in string ne at …/checks/fields.pm lines 521 and 537.
Hi,
sorry for not responding earlier.
Niels Thykier wrote:
> >> I propose a new tag "section-is-empty"
> >
> > We could re-use "no-section-field" and simply modify the description
> > to also say "or empty".
I somehow dislike that variant. (Thought about it, too.)
> > I just tried to fix this, but when creating testcases with a blank
> > source and binary Sections, I get (for source)
I at least have a working test case for binary packages (but not more yet):
diff --git a/t/debs/fields-general-bad/control b/t/debs/fields-general-bad/control
index a23dd299a..4fbd0ee83 100644
--- a/t/debs/fields-general-bad/control
+++ b/t/debs/fields-general-bad/control
@@ -3,7 +3,7 @@ Source: fields-general-bad
Version: 1.0?
Architecture: weird i386 amd64
Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
-Section: devel
+Section:
Priority: is
weird
Unknown-Field: Hallo World
diff --git a/t/debs/fields-general-bad/desc b/t/debs/fields-general-bad/desc
index 79fd5db1c..c89eac1e4 100644
--- a/t/debs/fields-general-bad/desc
+++ b/t/debs/fields-general-bad/desc
@@ -9,6 +9,7 @@ Test-For:
bad-version-number
multiline-field
package-not-lowercase
+ section-is-empty
too-many-architectures
unknown-architecture
unknown-field-in-control
diff --git a/t/debs/fields-general-bad/tags b/t/debs/fields-general-bad/tags
index 993ec2df0..eb9c99f03 100644
--- a/t/debs/fields-general-bad/tags
+++ b/t/debs/fields-general-bad/tags
@@ -13,3 +13,4 @@ W: fields-general-BAD?: file-name-contains-wildcard-character usr/share/doc/fiel
W: fields-general-BAD?: file-name-contains-wildcard-character usr/share/doc/fields-general-BAD?/changelog.gz
W: fields-general-BAD?: file-name-contains-wildcard-character usr/share/doc/fields-general-BAD?/copyright
W: fields-general-BAD?: unknown-architecture weird
+E: fields-general-BAD?: section-is-empty
I get the following (expected) error:
~/lintian/lintian → debian/rules runtests onlyrun=fields-general-bad
.... running tests ....
mkdir -p "/home/abe/lintian/lintian/debian/test-out"
t/runtests -k t "/home/abe/lintian/lintian/debian/test-out" fields-general-bad
ENV[PATH]=/home/abe/perl5/perlbrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/sbin:/usr/sbin:/usr/local/bin/sbin:/usr/games:/home/abe/bin
debs::fields-general-bad: diff -u t/debs/fields-general-bad/tags /home/abe/lintian/lintian/debian/test-out/debs/tags.fields-general-bad
--- t/debs/fields-general-bad/tags 2017-10-14 13:45:25.436078765 +0200
+++ /home/abe/lintian/lintian/debian/test-out/debs/tags.fields-general-bad 2017-10-18 15:49:13.819645976 +0200
@@ -9,8 +9,11 @@
E: fields-general-BAD?: too-many-architectures
E: fields-general-BAD?: unknown-priority is weird
I: fields-general-BAD?: unknown-field-in-control unknown-field
+Use of uninitialized value $parts[-1] in string eq at /home/abe/lintian/lintian/checks/fields.pm line 537.
+Use of uninitialized value $parts[-1] in string ne at /home/abe/lintian/lintian/checks/fields.pm line 521.
+Use of uninitialized value $parts[0] in string eq at /home/abe/lintian/lintian/checks/fields.pm line 512.
W: fields-general-BAD?: file-name-contains-wildcard-character usr/share/doc/fields-general-BAD?/
W: fields-general-BAD?: file-name-contains-wildcard-character usr/share/doc/fields-general-BAD?/changelog.gz
W: fields-general-BAD?: file-name-contains-wildcard-character usr/share/doc/fields-general-BAD?/copyright
W: fields-general-BAD?: unknown-architecture weird
-E: fields-general-BAD?: section-is-empty
+W: fields-general-BAD?: unknown-section
fail debs::fields-general-bad: output differs!
Failed tests (1)
debs::fields-general-bad
debian/rules:48: recipe for target 'runtests' failed
make: *** [runtests] Error 1
> > Use of uninitialized value $file in hash element at /home/lamby/git/debian/lintian/lintian/lib/Lintian/Collect/Changes.pm line 142.
> >
> > ... and the following when I add a binary with an empty Section:
> >
> > tests::fields-section-general: dpkg-genchanges >../fields-section-general_1.0_amd64.changes
> > tests::fields-section-general: dpkg-genchanges: error: package fields-section-general has section contrib/devel in control file but - in files list
> > tests::fields-section-general: dpkg-buildpackage: error: dpkg-genchanges subprocess returned exit status 25
> >
> >
> > How are you creating this frankenpackage? :)
Not with dpkg-buildpackage, because dpkg-genchanges will fail. BTDT. :-)
> You may want to use the t/debs test suite and the t/changes for this
> kind of package (basically just a deb with nothing else and a .changes
> with nothing else). The latter as we apparently have a bug in
> L::C::Changes as well. :)
Yes, we need separate tests for .deb and .dsc (and maybe .changees,
but I think a check for .changes might not be not necessary.)
Regards, Axel
--
,''`. | Axel Beckert <abe@debian.org>, https://people.debian.org/~abe/
: :' : | Debian Developer, ftp.ch.debian.org Admin
`. `' | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5
`- | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE
Reply to: