-
cd49504d
by Felix Lechner
at 2019-09-11T15:51:54Z
In t/scripts/desc-fields.t, do not complain when tag in Test-Against: is associated with the virtual check lintian.
The tag 'malformed-debian-changelog-version' is now issued centrally
in Lintian::Collect::Source. That is not a check. References to this
tag in tests would normally cause errors. This ignores the condition
for now.
The field Test-Against: in tests will go away once all checks have
been broken into smaller units. At least in the case of the lintian
pseudo-check, there is no need to remove the references from tests
right away. This commit avoids unnecessary errors.
Gbp-Dch: ignore
-
e15acd54
by Felix Lechner
at 2019-09-11T15:51:54Z
Add new module Lintian::Info::Changelog::Version; wraps version parsing.
This module makes a reliable mechanism to parse changelog versions
available to all checks (and the remainder of the Lintian code base).
Lintian previously used many different regular expressions. They were
consolidated here for consistency.
The only noteworthy item is that, for native packages, the upstream
portion always returns the empty string. That logic is different from
the wording in Debian's Policy but in the opinion of the author more
logical.
Raises an exception when parsing fails.
The full, unparsed version string is available via $version->literal.
Taken from checks/source-changelog.pm with some modifications. For
example, character classes are specified with greater detail.
Gbp-Dch: ignore
-
cf42ce33
by Felix Lechner
at 2019-09-11T15:51:54Z
Revert "Do not trigger repack requirement when the Debian revision includes the "repack" indicator. (Closes: #931846)"
Return to parsing the upstream portion of a version only.
In the modules that use this regex, version components will be
obtained from the centralized version parser. The full regex
including the Debian revision is no longer needed.
This reverts commit 5a67ee0c480151b56d68ee8ed374fb64d916f146.
Gbp-Dch: ignore
-
acc3ed4d
by Felix Lechner
at 2019-09-11T15:51:54Z
In Lintian::Collect::Changes, apply repack regex to locally upstream versions only.
It would be great to use the centralized version parser here, but the
native heuristics are only available in source packages.
Applies the original fix for #931846 to the regex locally.
Ideally, we would here rely on the 'repacked' method instead, if a
source package is mentioned in the changes file.
Gbp-Dch: ignore
-
94459d24
by Felix Lechner
at 2019-09-11T15:51:54Z
In Lintian::Collect::Source, use centralized version parser.
Centralizes most version parsing so that it takes place for source
packages. Lintian can determine a package's nativeness only from
source packages. That information is required to parse all version
components, even for simple versions.
More details are in the email excerpt below.
Does not currently check if changelogs in binary packages are the same
as in the source package. That was mentioned in an unquoted part of
the email (and originally suggested by pabs) but would be difficult to
test using standard tools. That condition belongs more appropriately
into the test suite for dpkg-buildpackage.
For native packages, the method ->repacked now always returns false.
Native packages have no upstream source and cannot be repacked.
The 'native' method was not removed from Lintian::Collect::Binary yet.
Some checks such as 'fields' still depend on it. First, those
subchecks have to be transferred into source-only sections in their
respective checks.
This commit implements most proposed actions from:
https://lists.debian.org/debian-lint-maint/2019/07/msg00141.html
which is restated here:
Detecting native binary packages [1] does not work nearly as well as
for source packages [2]. In the Lintian test suite, we see
discrepancies in the same *.changes files [3]. For that reason, I will
soon propose to move all tags that depend on the detection from
'binary' to 'source'.
In practice, that means moving many tags from the check
'changelog-file' to 'source-changelog'. (The check 'fields' may be
split up.) The reclassification of tags as source vs. binary will
cause ripple effects, such as the adjustment of expected tags in the
test suite and potentially the greater ecosystem via overrides.
-
1d46ab8a
by Felix Lechner
at 2019-09-11T15:51:55Z
In checks/changelog.pm, use centralized version parser, but in source facet.
The version parser in Lintian::Info::Changelog::Version splits version
strings into components, and checks the results for consistency. Uses
the centralized function when analyzing a changelog instead of relying
on custom regular expressions. It is more reliable.
The new parser code was adapted from the code that was here (removed
with this commit) with added modifications and improvements. One
important change is that, for native packages, the method->upstream
now always returns an empty string.
Also includes some cleanup regarding to processing order, variable
naming and simplified conditional logic.
Renames many variables to the 'latest' and 'previous' scheme. This was
super confusing before, when the 'first version' was actually the
latest one.
The email validation appeared incomplete: It seemed to ensure merely
that there was a dot in the domain. Now uses Email::Valid to ensure
addresses are acceptable.
Gbp-Dch: ignore
-
8ebf69c1
by Felix Lechner
at 2019-09-11T15:51:55Z
In checks/watch-file.pm, use centralized version parser.
This is a better fix to Bug#931846 than the original patch. Now it is
much clearer to which part of the version string we are matching.
Now uses only the upstream part for pre-release detection. These
prerelease feature is probably not needed for native packages. They
are turned off for native packages.
Gbp-Dch: ignore
-
07a576a8
by Felix Lechner
at 2019-09-11T15:51:55Z
Associate tag 'malformed-debian-changelog-version' with check lintian.
This tag is now issued in Lintian::Collect::Source and thus no longer
associated with a traditional check. The tag is instead paired with
the placeholder check 'lintian'.
Centralized version parsing was instituted to improve accuracy. It
requires information about nativeness that is only available from
source packages.
Gbp-Dch: ignore
-
8efbf69c
by Felix Lechner
at 2019-09-11T15:51:55Z
Add new tag 'odd-historical-debian-changelog-version'.
This tag is issued in check 'changelog' when the format of historical
changelog versions does not match expectations.
That can happen simply because there was a parsing error, but also
because a package changed from native to non-native (or vice versa).
The resulting tags will probably never change in the future (except
perhaps the tag output format), so they are easy to override.
The severity of the new tag is minor.
Gbp-Dch: ignore
-
60e7b3ea
by Felix Lechner
at 2019-09-11T15:51:55Z
Remove tag 'hyphen-in-native-debian-changelog-version'.
This tag can no longer be issued. The new version parser raises an
exception before the tag can be issued.
At the same time, the centralized parser does not offer detailed
advice as to what is wrong, but it works better. The parser instead
issues the summary tag 'malformed-debian-changelog-version'.
Removes the tag hyphen-in-native-debian-changelog-version from
Lintian.
Gbp-Dch: ignore
-
7db52e66
by Felix Lechner
at 2019-09-11T15:51:55Z
Remove tag 'debian-changelog-version-requires-debian-revision'.
This tag can no longer be issued. The new version parser raises an
exception before the tag can be issued.
At the same time, the centralized parser does not offer detailed
advice as to what is wrong, but it works better. The parser instead
issues the summary tag 'malformed-debian-changelog-version'.
Removes the tag debian-changelog-version-requires-debian-revision from
Lintian.
Gbp-Dch: ignore
-
14643612
by Felix Lechner
at 2019-09-11T15:51:56Z
Remove tag 'latest-debian-changelog-entry-changed-to-native'.
Lintian cannot determine that condition reliably without querying the
archive. Lintian can only tell when historical changelog versions do
not conform to expectations for the package's current nativeness.
Removes the tag latest-debian-changelog-entry-changed-to-native from
Lintian.
Gbp-Dch: ignore
-
926cdb76
by Felix Lechner
at 2019-09-11T15:51:56Z
In Test::Lintian::Run, do not leave blank lines in 'tagdiff' when there are no tags.
This reverts an earlier change that appeared to work better. Alas, it
did not and was reverted. Empty tagdiff files are truly empty once
again.
Gbp-Dch: ignore
-
48584af9
by Felix Lechner
at 2019-09-11T15:51:56Z
In Test::Lintian::Prepare, derive Prev-Version: from nativeness, not prior version.
Some tests examine what happens when versions change between native
and non-native. In some cases that causes Prev-Version: to have the
wrong format, too.
Uses the package's nativeness instead to decide on a format for the
calculated prior version (which may or may not be used by tests).
Gbp-Dch: ignore
-
13f83069
by Felix Lechner
at 2019-09-11T15:51:56Z
In tests, adjust expected tags for centralized version parsing.
Most of these changes are for tags that moved from binary to source.
Successful version parsing depends on determining whether a package is
native, and that can only be done reliably in a source package. As a
result, related tags are now source tags.
Also, the extra information for some tags, for example for epochs, was
modified to show the full version string (as opposed to just the
epoch). That may aid a maintainer in locating the offending changelog
entry more quickly.
Finally, the previous parsing methods offered more detailed advice
about why a version was unacceptable. The new parser offers fewer
tags, but they work better.
The two new tags are called 'malformed-debian-changelog-version' and
'odd-historical-debian-changelog-version'.
Gbp-Dch: ignore
-
a115aa40
by Felix Lechner
at 2019-09-11T15:51:56Z
Add a test for the unusual but legal version string '4.6.2-1-1' in non-native packages.
As Unit193 pointed out, this is a valid non-native version string.
With recent changes to version parsing, Lintian should no longer
complain about it.
Gbp-Dch: ignore
-
e9f4a777
by Felix Lechner
at 2019-09-11T15:51:56Z
Remove references to non-existing tags from Tags-Against: in tests.
These tags were removed from Lintian and should not appear in the test
specifications. The references would cause errors in the internal
harness scripts.
Removes the references to non-existing tags.
Gbp-Dch: ignore
-
f95d0ad4
by Felix Lechner
at 2019-09-11T15:51:56Z
In test 'changelog/changelog-file-missing-explicit-entry' for stable releases, use plus not tilde.
The tilde may be correct usage for some backports, but is super
confusing to the eye. When adjusting this test, the tag read:
changelog-file-missing-explicit-entry (source): changelog-file-missing-explicit-entry 0.9-1 -> 1.2-3 (missing) -> 1.2-3~deb9u1
Debian's normal version scheme would not find that strange or
problematic. Release candidates are commonly introduced via the
lower-ordering tilde.
Apparently, there is a special case for the specific suffix ~debXu1,
where X is a number.
Leaves the check alone, but modifies the test slightly so we do not
see the awkward condition again.
Gbp-Dch: ignore