1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# dpkg manual page - dpkg-realpath(1)
#
# Copyright © 2020-2021 Guillem Jover <guillem@debian.org>
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
=encoding utf8
=head1 NAME
dpkg-realpath - print the resolved pathname with DPKG_ROOT support
=head1 SYNOPSIS
B<dpkg-realpath> [I<option>...] I<pathname>
=head1 DESCRIPTION
B<dpkg-realpath> is a tool (since dpkg 1.20.1) to resolve a pathname,
that takes the L<dpkg(1)> root directory into account, either implicitly
from the B<DPKG_ROOT> environment variable or from the command-line
B<--root> or B<--instdir> options, and returns an absolute I<pathname>
relative to the root directory.
The root directory must not be prefixed to the I<pathname> to be resolved.
This is intended to be used by other B<dpkg> helpers, or by maintainer
scripts instead of using L<realpath(1)> or L<readlink(1)> to canonicalize
pathnames, as these latter commands do not support canonicalization
relative to a different root than F</>.
This program was introduced in dpkg 1.20.1.
=head1 OPTIONS
=over
=item B<-z>, B<--zero>
Use a NUL byte to end output lines instead of a new line character
(since dpkg 1.20.6).
=item B<--instdir> I<directory>
=item B<--root> I<directory>
Set the root directory to I<directory>, which is the base directory
that pathnames get canonicalized against.
Defaults to «B</>» if B<DPKG_ROOT> has not been set.
=item B<-?>, B<--help>
Show the usage message and exit.
=item B<--version>
Show the version and exit.
=back
=head1 ENVIRONMENT
=over
=item B<DPKG_ROOT>
If set and the B<--instdir> or B<--root> options have not been
specified, it will be used as the filesystem root directory.
=item B<DPKG_COLORS>
Sets the color mode.
The currently accepted values are: B<auto> (default), B<always> and B<never>.
=back
=head1 SEE ALSO
L<realpath(1)>,
L<readlink(1)>.
|