Python 3.7 warns:
.../debian/lib/python/debian_linux/debian.py:403: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
class PackageArchitecture(collections.MutableSet):
SchemaItemBoolean and SchemaItemInteger attempt to raise an exception
of type Error when given invalid input, but this type has never been
defined. Use ValueError instead.
MakeFlags.__repr__ references a "flags" type (probably meant to be
MakeFlags). Gencontrol.write_config references the "file" type which
was removed in Python 3. Clearly neither of these methods are
actually used, so delete them.
- Add explicit imports for all needed modules, rather than indirectly
(accidentally!) importing them with "from ... import *"
- Replace all "from ... import *" statements, which inhibit static
checking, with explicit lists of names to import
- Delete the remaining unneeded imports reported by pyflakes
Fix coding style violations reported by pycodestyle. This is
mostly a matter of reformatting code, particularly to eliminate
over-long lines. I also rename one variable ("l" is considered
visually ambiguous) and change a bare "except" to explicitly
catch all exceptions.
There are three types of error or warning remaining:
- debian/bin/...: E402 module level import not at top of file
Scripts in debian/bin need to modify the import path before
importing from debian/lib/python.
- E127 continuation line over-indented for visual indent
This seems to be a false positive. pycodestyle doesn't seem to be
happy with any level of indent (including 0) on a continuation line
in a "with" statement.
- debian/lib/python/debian_linux/debian.py:15:2: W291 trailing whitespace
This is a false positive. The trailing spaces are in a long
string and are intentional.
Several regexes were written as normal strings. Thankfully it appears
that none of the backslash-escaped sequences in them are parsed in
normal strings, so this shouldn't make any practical difference.
I converted the main patch series to quilt format in 3.2.20-1, but
this patch system was still used by genorig.py. One useful
feature that was not available elsewhere was using patch + unifdef
to exclude only part of a source file. However no source files
have needed this since 3.16-rc4 and I don't expect this to ever
be needed again.
The preceding changes moved the file removal/exclusion list into
debian/copyright and the disabling of broken features into the
main patch series, so the private patch system isn't doing
anything.
So we can now remove it completely.
The Version class already parses the version into upstream and Debian
revision parts. Match the results of that against two separate
regexps rather than matching the whole version string and potentially
parsing it inconsistently.
As a result we no longer have to explicitly exclude '-' in the
revision_other group.
Closes: #898087
We always used to match arbitrary revision suffixes, but in commit
f4dbf1aa82 ".../debian.py: Fix binNMU revision parsing" I excluded
'+' from the revision_other to ensure that it wouldn't match a
binNMU suffix (which is matched separately).
Stop excluding '+' from the revision_other group, and change the
repetition to non-greedy so that any binNMU suffix will still match
the following group.
We didn't check for invalid characters in the upstream or revision
parts. Tighten the regexps for those parts.
Also, failure to match the epoch or revision groups caused
those parts to be treated as part of the upstream version.
Split out the three parts and match them against separate
regexps.
In VersionLinux, any binNMU version will currently match the
revision_other group in the regexp and therefore never be recognised
as an experimental, security, or backport version. This is probably
harmless in practice because:
- binNMUs don't happen in those suites
- Only debian/bin/gencontrol.py cares about the linux_revision_other
attribute, and it won't be run for a binNMU version
But let's fix it by matching the binNMU suffix separately.
I incorrectly added a requirement of a newline after urgency in the
changelog entry top line as part of
"debian/lib/python/debian_linux/debian.py: Parse bottom lines of
changelog entries". For a binNMU, there will be ", binary-only=yes"
after the urgency. Since we don't currently care about any fields
after urgency, allow either a comma or newline.
Changelog doesn't currently provide access to the maintainer
name/address and date. We need this when updating the signed template
changelog.
While we're at it, make sure we don't ignore any important lines.
Anything beginning with exactly zero or one spaces is a top or bottom
line, respectively; anything else is internal text we can ignore.
We set the source package name from debian/changelog, which is not
appropriate when generating a source package template for a signed image
package. Only set the source package name if it's not in the control
template.
Currently we don't allow versions like 3.16.7-ckt9-3~deb8u1~bpo7+1 in
*-backports, but we should! Add the security suffix as an option
before the backports suffix.
We also don't check that an upload to *-security or *-lts includes the
expected suffix and nothing else. Add a check for that.
svn path=/dists/trunk/linux/; revision=22539
The Debian release is now identified by only the major version so
there need not be 2 digits directly after ~bpo. Eventually the
major version will grow to 2 digits itself, so allow 1 or more
digits after the ~bpo.
svn path=/dists/trunk/linux/; revision=22538
Unfortunately it is not sufficient to provide virtual packages
that exactly match the ABI name. For example, 'reportbug kernel'
doesn't find the virtual package, and neither do dpkg commands
such as 'dpkg -l linux-image-$(uname -r)'.
svn path=/dists/sid/linux/; revision=22034
* debian/bin/gencontrol.py: Export internal ABI.
* debian/lib/python/debian_linux/debian.py: Export three-part version.
* debian/rules.real
- Provide more variables.
- Make udeb generation easier.
- Use internal ABI for files.
* debian/templates/control.*: Provide name with internal ABI.
* debian/templates/image.plain.*: Use internal ABI.
svn path=/dists/sid/linux/; revision=22017