1 # dpkg manual page - dpkg-realpath(1)
3 # Copyright © 2020-2021 Guillem Jover <guillem@debian.org>
5 # This is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <https://www.gnu.org/licenses/>.
22 dpkg-realpath - print the resolved pathname with DPKG_ROOT support
26 B<dpkg-realpath> [I<option>...] I<pathname>
30 B<dpkg-realpath> is a tool (since dpkg 1.20.1) to resolve a pathname,
31 that takes the L<dpkg(1)> root directory into account, either implicitly
32 from the B<DPKG_ROOT> environment variable or from the command-line
33 B<--root> or B<--instdir> options, and returns an absolute I<pathname>
34 relative to the root directory.
35 The root directory must not be prefixed to the I<pathname> to be resolved.
37 This is intended to be used by other B<dpkg> helpers, or by maintainer
38 scripts instead of using L<realpath(1)> or L<readlink(1)> to canonicalize
39 pathnames, as these latter commands do not support canonicalization
40 relative to a different root than F</>.
46 =item B<-z>, B<--zero>
48 Use a NUL byte to end output lines instead of a new line character
51 =item B<--instdir> I<directory>
53 =item B<--root> I<directory>
55 Set the root directory to I<directory>, which is the base directory
56 that pathnames get canonicalized against.
57 Defaults to «B</>» if B<DPKG_ROOT> has not been set.
59 =item B<-?>, B<--help>
61 Show the usage message and exit.
65 Show the version and exit.
75 If set and the B<--instdir> or B<--root> options have not been
76 specified, it will be used as the filesystem root directory.
81 The currently accepted values are: B<auto> (default), B<always> and B<never>.