Commit d95a2c93 authored by Niels Thykier's avatar Niels Thykier
Browse files

dh_testroot.1: Update R³ documentation



Signed-off-by: default avatarNiels Thykier <niels@thykier.net>
parent 158f74cc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -73,6 +73,9 @@ debhelper (11.3) UNRELEASED; urgency=medium
  * makefile.pm: Revert the use of -O/-Oline for make, which helps
    debugging what commands time out on the buildds.  Thanks to
    Adrian Bunk for the report.  (Closes: #895196)
  * dh_testroot.1: Update R³ documentation to reflect the current
    implementation and not the initial draft.  Thanks to Jens Reyer
    for reporting the inconsistency.  (Closes: #899125)

  [ Dmitry Shachnev ]
  * qmake.pm: Use ${DEB_HOST_GNU_TYPE}-qmake wrapper for
+34 −15
Original line number Diff line number Diff line
@@ -12,33 +12,52 @@ B<dh_testroot> [S<I<debhelper options>>]

=head1 DESCRIPTION

B<dh_testroot> is used to determine if the package has access to at
least the level of root access that it declared it needed via the
Rules-Requires-Root (R³) field.
B<dh_testroot> is used to determine if the target is being run with
sufficient access to (fake)root.

The following is how B<dh_testroot> behaves based on the effective
value of the R³ field:
The definition of sufficient access depends on whether the builder
(the tool invoking the F<debian/rules> target) supports the
I<Rules-Requires-Root> (R³) field.  If the builder supports R³, then
it will set the environment variable I<DEB_RULES_REQUIRES_ROOT> and
B<dh_testroot> will validate that the builder followed the minimum
requirements for the given value of I<DEB_RULES_REQUIRES_ROOT>.

If the builder does not support I<Rules-Requires-Root>, then it will
not set the I<DEB_RULES_REQUIRES_ROOT> environment variable.  This
will in turn make B<dh_testroot> (and the rest of debhelper) fall back
to assuming that (fake)root is implied.

The following is a summary of how B<dh_testroot> behaves based on the
I<DEB_RULES_REQUIRES_ROOT> environment variable (leading and trailing
whitespace in the variable is ignored).

=over 4

=item "binary-targets"
=item -

B<dh_testroot> asserts that it is run as root or under L<fakeroot(1)>.
If unset, or set to C<binary-targets>, then B<dh_testroot> asserts
that it is run as root or under L<fakeroot(1)>.

=item "no"
=item -

B<dh_testroot> returns successfully.
If set to C<no>, then B<dh_testroot> returns successfully (without
performing any additional checks).

=item Any other value than the above
=item -

B<dh_testroot> asserts that it is either run as root (or under
L<fakeroot(1)>) or the builder has provided the B<DEB_GAIN_ROOT_CMD>
environment variable (e.g. via dpkg-buildpackage -r).
If set to any other value than the above, then B<dh_testroot> asserts
that it is either run as root (or under L<fakeroot(1)>) or the builder
has provided the B<DEB_GAIN_ROOT_CMD> environment variable (e.g. via
dpkg-buildpackage -r).

=back

For backwards compatibility, B<dh_testroot> will consider the absence
of the R³ field as if the R³ field was set to "binary-targets".
Please note that B<dh_testroot> does I<not> read the
I<Rules-Requires-Root> field.  Which implies that B<dh_testroot> may
produce incorrect result if the builder lies in
I<DEB_RULES_REQUIRES_ROOT>.  On the flip side, it also enables things
like testing for what will happen when I<DEB_RULES_REQUIRES_ROOT> is
set to a given value.

=cut