Bug#886036: Improve changelog version parsing

2018-08-22 Thread Chris Lamb
Dear Felix,

> Both errors were fixed in this merge request. Thank you!
> 
> https://salsa.debian.org/lintian/lintian/merge_requests/20

Ooh, thanks for the speedy turnaround. I'll restrict my review comments
to the MR — looking forward to merging it. Feel free to glance around
the other version-related tags on:

  https://lintian.debian.org/tags/

… to check if there are not any other regressions.


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#886036: Improve changelog version parsing

2018-08-22 Thread Felix Lechner
Hi Chris,

There were two separate errors. Versions with "0" in any component
were not evaluated correctly. (The Perl string "0" is logically false
even though it has non-zero length.) A second problem was that
versions with "+bzr" triggered false positives for
'debian-changelog-version-requires-debian-revision'. That was solved
by restricting binary NMUs (which probably should not appear in source
changelogs anyway) to one or more digits. Both errors were fixed in
this merge request. Thank you!

https://salsa.debian.org/lintian/lintian/merge_requests/20

Best regards,
Felix> found 886036 2.5.97
> thanks
>
> Hi Felix,
>
> >  * checks/source-changelog.{desc.pm}:
> >+ [FL] Rework, centralise and improve version parsing.
> >  (Closes: #886036)
>
> I'm seeing some false-positives here:
>
>   https://lintian.debian.org/tags/malformed-debian-changelog-version.html
>
> Could you take a look?
>
>
> Regards,
>
> --
>   ,''`.
>  : :'  : Chris Lamb
>  `. `'`  la...@debian.org / chris-lamb.co.uk
>`-



Bug#886036: Improve changelog version parsing

2018-08-22 Thread Chris Lamb
found 886036 2.5.97
thanks

Hi Felix,

>  * checks/source-changelog.{desc.pm}:
>+ [FL] Rework, centralise and improve version parsing.
>  (Closes: #886036)

I'm seeing some false-positives here:

  https://lintian.debian.org/tags/malformed-debian-changelog-version.html

Could you take a look?


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#886036: Improve changelog version parsing

2018-08-16 Thread Chris Lamb
tags 886036 + pending
thanks

Applied in Git, pending upload:

  
https://salsa.debian.org/lintian/lintian/commit/0005c81dc200a0787a2716aacd6e00f859101c36

  checks/cruft.desc| 35 --
  checks/cruft.pm  | 14 
  checks/source-changelog.desc | 46 +
  checks/source-changelog.pm   | 85 +++-
  debian/changelog |  3 +
  t/source/package-version-0/desc  |  3 +
  t/tests/changelog-file-etch-nmu/desc |  4 +-
  t/tests/changelog-file-etch/desc |  5 +-
  t/tests/changelog-file-experimental/tags |  2 +-
  t/tests/changelog-file-general/desc  |  4 ++
  t/tests/changelog-file-stable/desc   |  1 +
  t/tests/changelog-version-non-native-simple/desc |  6 ++
  t/tests/changelog-version-non-native-simple/tags |  0
  t/tests/changelog-version-special-chars/desc |  7 ++
  t/tests/changelog-version-special-chars/tags |  4 ++
  t/tests/cruft-native-dash-version/desc   |  5 +-
  t/tests/cruft-native-dash-version/tags   |  2 +-
  t/tests/cruft-non-native-version/desc|  5 +-
  t/tests/cruft-non-native-version/tags|  2 +-
  t/tests/fields-version-bad-rc/desc   |  5 +-
  t/tests/fields-version-bad/desc  |  2 +
  t/tests/fields-version-dfsg-native/desc  |  5 +-
  t/tests/fields-version-dot-dfsg/desc |  5 +-
  t/tests/fields-version-dsfg/desc |  5 +-
  t/tests/legacy-binary/desc   |  2 +-
  t/tests/legacy-binary/tags   |  2 +-
  t/tests/legacy-fields/desc   |  2 +-
  t/tests/legacy-fields/tags   |  2 +-
  t/tests/legacy-filenames/tags|  2 +-
  t/tests/legacy-libbaz/desc   |  2 +-
  t/tests/legacy-libbaz/tags   |  2 +-
  t/tests/legacy-maintainer-scripts/tags   |  2 +-
  t/tests/nmu-local-changelog/desc |  1 +
  t/tests/nmu-local-version/desc   |  1 +
  t/tests/nmu-team-upload/desc |  5 +-
  35 files changed, 207 insertions(+), 71 deletions(-)


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#886036: Improve changelog version parsing

2018-07-13 Thread Chris Lamb
Hi Felix,

> Thank you for following up. I have more patches. I am just not sure if the
> version parsing should really be duplicated in Lintian. Maybe there is a
> benefit to checks and balances, but at least some of the work might well go
> into 'dpkg/scripts/Dpkg/Version.pm', which we could then use in Lintian.

That sounds look a good idea although it might affect our backporting
policy? I'm afraid I can't speak to this, alas. Niels? :)


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#886036: Improve changelog version parsing

2018-07-13 Thread Felix Lechner
Hi Chris,

Thank you for following up. I have more patches. I am just not sure if the
version parsing should really be duplicated in Lintian. Maybe there is a
benefit to checks and balances, but at least some of the work might well go
into 'dpkg/scripts/Dpkg/Version.pm', which we could then use in Lintian.

What do you think, please? Thank you for your guidance!

Best regards,
Felix

On Sun, Apr 15, 2018 at 1:21 AM, Chris Lamb  wrote:
> Chris Lamb wrote:
>
>> Can you update us on the status of this issue? Did we resolve it already
>> or do you have more patches ready to roll soon? :)
>
> Gentle ping on this? I do remember you had some patches queued up,
> I just hope we/I haven't neglected them somewhere...
>
>
> Regards,
>
> --
>   ,''`.
>  : :'  : Chris Lamb
>  `. `'`  la...@debian.org / chris-lamb.co.uk
>`-


Bug#886036: Improve changelog version parsing

2018-04-15 Thread Chris Lamb
Chris Lamb wrote:

> Can you update us on the status of this issue? Did we resolve it already
> or do you have more patches ready to roll soon? :)

Gentle ping on this? I do remember you had some patches queued up,
I just hope we/I haven't neglected them somewhere...


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#886036: Improve changelog version parsing

2018-02-18 Thread Chris Lamb
Hey Felix,

> Improve changelog version parsing

Can you update us on the status of this issue? Did we resolve it already
or do you have more patches ready to roll soon? :)


Best wishes,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#886036: Improve changelog version parsing

2018-01-06 Thread Chris Lamb
Hi Felix,

> * 0001 Addresses an issue when the version contains two hyphens; now
> the string is split properly into two parts.

Pushed here:

  
https://anonscm.debian.org/git/lintian/lintian.git/commit/?id=f3f373e5365a58d7ee3b126b8f1dfbda557d02a4

> * 0002 Removes an old exception allowing -0.X on native source NMUs,
> which now triggers the appropriate warning.

Pushed here:

  
https://anonscm.debian.org/git/lintian/lintian.git/commit/?id=ddd9095056f649718414ce6a7db20949ef65d1ac

Many thanks :)


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#886036: Improve changelog version parsing

2018-01-05 Thread Felix Lechner
Hi Chris!

Here are two preliminary bug fixes:

* 0001 Addresses an issue when the version contains two hyphens; now
the string is split properly into two parts.
* 0002 Removes an old exception allowing -0.X on native source NMUs,
which now triggers the appropriate warning.

The patches were rebased for today's master. They are perl-tidy and
run on all tests.

Please don't close the bug just yet. Thank you!

Best regards,
Felix



On Tue, Jan 2, 2018 at 8:33 AM, Chris Lamb  wrote:
> Hi Felix!
>
>> Please have a look at https://github.com/lechner/lintian
>
> Woah, looks great! Thank you. Before I merge, can you just…
>
>   a) Add some tests for the debian-changelog-version-malformed
>  tag.
>
>   b) Add a changelog entry that closes this bug (#886036)
>
> Many thanks again...
>
>
> Best wishes,
>
> --
>   ,''`.
>  : :'  : Chris Lamb
>  `. `'`  la...@debian.org / chris-lamb.co.uk
>`-


0001-c-changelog-file-Fix-version-parsing-for-hyphen-in-u.patch.xz
Description: application/xz


0002-c-cruft-Fix-version-parsing-for-native-packages.patch.xz
Description: application/xz


Bug#886036: Improve changelog version parsing

2018-01-02 Thread Chris Lamb
Hi Felix!

> Please have a look at https://github.com/lechner/lintian

Woah, looks great! Thank you. Before I merge, can you just…

  a) Add some tests for the debian-changelog-version-malformed
 tag.

  b) Add a changelog entry that closes this bug (#886036)

Many thanks again...


Best wishes,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#886036: Improve changelog version parsing

2018-01-01 Thread Felix Lechner
Dear Chris,

On Mon, Jan 1, 2018 at 1:41 PM, Chris Lamb  wrote:
> (Could you push these to a Git repository somewhere? That would make
> them easier to apply... Thanks in advance!)

Please have a look at https://github.com/lechner/lintian. The repo
contains my locally synchronized copy of your master as well as my
branch 'improve-changelog-version-parsing'. Each commit passes all
tests and is perl-tidy.

Unfortunately, I annotated the patches manually in greater detail. You
may wish to consult them. The upshot is:

Many version checks happen on binary packages in
checks/changelog-file.pm, although they may be more helpful on source
packages. Per suggestion from Paul Wise, one could check that binary
packages ship with the source changelog. If the maintainers are
receptive to part of this patch series, the author would be happy help
consolidate further checks in checks/source-changelog. Thank you!

Best regards,
Felix



Bug#886036: Improve changelog version parsing

2018-01-01 Thread Chris Lamb
Dear Felix,

> The patches apply to the 2.5.68 master—one after the other, and
> ordered in likelihood of acceptance. Thank you!

(Could you push these to a Git repository somewhere? That would make
them easier to apply... Thanks in advance!)


Best wishes,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#886036: Improve changelog version parsing

2018-01-01 Thread Felix Lechner
Package: lintian
Version: 2.5.67
Severity: wishlist
Tags: patch

Hi,

The attached patch set improves the version parsing in changelog. The
patches are annotated, but I also copied brief descriptions below.

The patches apply to the 2.5.68 master—one after the other, and
ordered in likelihood of acceptance. Thank you!

Best regards,
Felix

0001:
c/changelog-file: Fix version parsing for hyphen in upstream version
This patch fixes an issue when the upstream version contains a hyphen.
While the presence of a hyphen may not be desirable, it is okay
according to policy. This patch is superseded by another more elegant
patch later in the series.

0002:
c/cruft: Fix version parsing for native packages
This patch improves version parsing for native packages. It removes an
outdated pattern for non-maintainer uploads. The patch is superseded
by another patch later in the series.

0003:
c/source-changelog: Add version parsing
This patch adds version parsing to checks/source-changelog, where it
may be more appropriate than in the various places it is presently.
The parsing employs a somewhat long but hopefully correct regular
expression.

0004:
c/cruft: Transfer native and non-native version checking to c/source-changelog
This patch transfers two checks for version strings from checks/cruft
to checks/source-changelog, where they may a better home. The original
author also thought they did not belong in their original place. That
deficiency is now cured.

0005:
c/source-changelog: Add version info to native and non-native tag output
This patch prints the offending version string when the tags
'native-package-with-dash-version' or
'non-native-package-with-native-version' are emitted. Perhaps it helps
the user.

0006:
c/source-changelog: Add tag for hyphens in upstream versions
This patch adds a new tag 'hyphen-in-upstream-version' to warn about
the legal but occasionally perilous presence of hyphens in version
strings. It was the original motivation behind this patch series. I
had accidentally uploaded a package with such a version and tried to
work on it with Debian tools for shared libraries (dpkg-gensymbols or
its KDE cousin). I would like to see such a warning in the future, if
possible.

0007:
c/source-changelog: Rename tag 'native-package-with-dash-version' to
'hyphen-in-native-version'
This patch renames the tag 'native-package-with-dash-version' to
'hyphen-in-native-version'. The tag is totally related to
'hyphen-in-upstream-version' and deserves a less crufty and perhaps
less cryptic name.

0008:
c/source-changelog: Rename tag
'non-native-package-with-native-version' to
'debian-changelog-missing-debian-revision'
This patch renames the tag 'non-native-package-with-native-version' to
'debian-changelog-missing-debian-revision'. It is an attempt to add
clarity and userfriendliness to the name.


 checks/changelog-file.pm |  8 +++---
 checks/cruft.desc| 35 
 checks/cruft.pm  | 14 --
 checks/source-changelog.desc | 46 
 checks/source-changelog.pm   | 38 ++
 t/tests/changelog-file-experimental/tags |  2 +-
 t/tests/changelog-file-general/desc  |  8 +-
 t/tests/changelog-file-general/tags  |  1 +
 t/tests/cruft-native-dash-version/desc   |  3 ++-
 t/tests/cruft-native-dash-version/tags   |  2 +-
 t/tests/cruft-non-native-version/desc|  3 ++-
 t/tests/cruft-non-native-version/tags|  2 +-
 t/tests/legacy-binary/desc   |  2 +-
 t/tests/legacy-binary/tags   |  2 +-
 t/tests/legacy-fields/desc   |  2 +-
 t/tests/legacy-fields/tags   |  2 +-
 t/tests/legacy-filenames/tags|  1 +
 t/tests/legacy-libbaz/desc   |  2 +-
 t/tests/legacy-libbaz/tags   |  2 +-
 t/tests/legacy-maintainer-scripts/tags   |  1 +
 20 files changed, 111 insertions(+), 65 deletions(-)

-- 
2.15.1


improve-changelog-version-parsing.tar.xz
Description: application/xz