Some debhelper config files should be executable, because either:
1. debhelper should execute them (with dh-exec) instead of reading them
directly. Currently we change the permissions after substitution.
2. They are included in signed-template binary packages, and lintian
will complain about them being non-executable scripts. Currently
we override these warnings.
Replace the special case code by copying the file permissions bits
from the template to the output file in substitute_debhelper_config().
dpkg keeps all directories of the old package version (and renames
the old files) until an upgrade is complete. This prevents simply
replacing a directory with a symlink. We have to use
dpkg-maintscript-helper to work around this limitation.
Closes: #942861
Currently we have two copies of the _substitute_file() method, and
lots of somewhat similar invocations of it since different binary
packages need different sets of debhelper configs.
We already name the templates in a fairly consistent way, so we can
replace this with a loop that tries to expand all possible templates
for a package and ignores those that are missing. Add a method for
this to the Gencontrol base class and use it in both subclasses
where we prevously used _substitute_file().
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.
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.
We have not used per-architecture patches for many years. This is a
step toward using a more standard patch system.
svn path=/dists/sid/linux/; revision=19070
* debian/lib/python/debian_linux/gencontrol.py
- Provide all informations for main type functions.
- Remove some "vars" updates.
svn path=/dists/trunk/linux-2.6/; revision=11352
- Generate rule for makefile deps.
- Simplify makefile rules generation.
- Don't bail out if extra template is missing.
svn path=/dists/trunk/linux-2.6/; revision=10136