Dh_Lib.pm: Ensure `install_dir` uses chown when root should be used
A bug in `install_dir` made it not chown directories to `root:root`
when it should have. This regression has largely gone unnoticed
thanks to dpkg chown'ing files in the control.tar and `dh_fixperms`
covering up most the remaining mistakes. Additionally,
`Rules-Requires-Root` made this a non-issue for 60% of the archive.
Unfortunately, this bug has gone undiscovered for quite a while and
`install_dir` has been used in cases where chown'ing should never have
been used (both inside and outside debhelper itself). To reduce the
breakage, a new `mkdirs` function has been added that takes over the
"no-chown" case. Additionally, `install_dir` code will attempt to
detect "misuse" and "gracefully" degrade with a warning in compat 14
and older in third-party debhelper tools.
Note that the degration only aims to cover the common cases in
third-party debhelper tools. The helpers provided by debhelper itself
will now instead cause an error due to lack of permissions if there
are further bugs in debhelper.
Dh_Lib.pm: Ensure `install_{file,prog,lib}` uses chown when root should be used
Previously, they would skip the `chown` call and rely on `dh_fixperms`
or `dpkg-deb` to fix the ownership. However, that could cause issues
when the helper was run after `dh_fixperms` and install files that
`dpkg-deb` would not reset ownership of.
Gbp-Dch: full
Signed-off-by: Niels Thykier <email address hidden>
Dh_Lib.pm: Provide `mkdirs` to create (non-package) directories
This is an alternative to `install_dir` that never does chown (and is
not printed with `--verbose`). It is intended for creating
directories that are not part of a binary package.
Note that at the moment `install_dir` does not do chown either,
which is a bug (causing #1024261).
dh_builddeb: Always pass `--root-owner-group` to `dpkg-deb` for dbgsym packages
Static ownership is not really useful for them and we no longer need
to make the use `--root-owner-group` usage conditional since
`dpkg-deb` in oldstable supports the flag.