178 lines
4.4 KiB
HTML
178 lines
4.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Dpkg::Path</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Dpkg::Path</H1>
|
|
Section: libdpkg-perl (3perl)<BR>Updated: 2020-03-23<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Dpkg::Path - some common path handling functions
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
It provides some functions to handle various path.
|
|
<A NAME="lbAD"> </A>
|
|
<H2>FUNCTIONS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">get_pkg_root_dir($file)<DD>
|
|
|
|
|
|
This function will scan upwards the hierarchy of directory to find out
|
|
the directory which contains the ``<FONT SIZE="-1">DEBIAN''</FONT> sub-directory and it will return
|
|
its path. This directory is the root directory of a package being built.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If no <FONT SIZE="-1">DEBIAN</FONT> subdirectory is found, it will return undef.
|
|
<DT id="2">relative_to_pkg_root($file)<DD>
|
|
|
|
|
|
Returns the filename relative to get_pkg_root_dir($file).
|
|
<DT id="3">guess_pkg_root_dir($file)<DD>
|
|
|
|
|
|
This function tries to guess the root directory of the package build tree.
|
|
It will first use <B>get_pkg_root_dir()</B>, but it will fallback to a more
|
|
imprecise check: namely it will use the parent directory that is a
|
|
sub-directory of the debian directory.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
It can still return undef if a file outside of the debian sub-directory is
|
|
provided.
|
|
<DT id="4">check_files_are_the_same($file1, $file2, $resolve_symlink)<DD>
|
|
|
|
|
|
|
|
|
|
This function verifies that both files are the same by checking that the device
|
|
numbers and the inode numbers returned by <B>stat()</B>/<B>lstat()</B> are the same. If
|
|
<TT>$resolve_symlink</TT> is true then <B>stat()</B> is used, otherwise <B>lstat()</B> is used.
|
|
<DT id="5">canonpath($file)<DD>
|
|
|
|
|
|
This function returns a cleaned path. It simplifies double //, and remove
|
|
/./ and /../ intelligently. For /../ it simplifies the path only if the
|
|
previous element is not a symlink. Thus it should only be used on real
|
|
filenames.
|
|
<DT id="6">$newpath = resolve_symlink($symlink)<DD>
|
|
|
|
|
|
|
|
|
|
Return the filename of the file pointed by the symlink. The new name is
|
|
canonicalized by <B>canonpath()</B>.
|
|
<DT id="7">$cmdpath = find_command($command)<DD>
|
|
|
|
|
|
|
|
|
|
Return the path of the command if defined and available on an absolute or
|
|
relative path or on the <TT>$PATH</TT>, undef otherwise.
|
|
<DT id="8">$control_file = get_control_path($pkg, $filetype)<DD>
|
|
|
|
|
|
|
|
|
|
Return the path of the control file of type <TT>$filetype</TT> for the given
|
|
package.
|
|
<DT id="9">@control_files = get_control_path($pkg)<DD>
|
|
|
|
|
|
|
|
|
|
Return the path of all available control files for the given package.
|
|
<DT id="10">$file = find_build_file($basename)<DD>
|
|
|
|
|
|
|
|
|
|
Selects the right variant of the given file: the arch-specific variant
|
|
(``$basename.$arch'') has priority over the OS-specific variant
|
|
(``$basename.$os'') which has priority over the default variant
|
|
(``$basename''). If none of the files exists, then it returns undef.
|
|
<DT id="11">@files = find_build_file($basename)<DD>
|
|
|
|
|
|
|
|
|
|
Return the available variants of the given file. Returns an empty
|
|
list if none of the files exists.
|
|
</DL>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>CHANGES</H2>
|
|
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Version 1.04 (dpkg 1.17.11)</H3>
|
|
|
|
|
|
|
|
Update semantics: <B>find_command()</B> now handles an empty or undef argument.
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Version 1.03 (dpkg 1.16.1)</H3>
|
|
|
|
|
|
|
|
New function: <B>find_build_file()</B>
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Version 1.02 (dpkg 1.16.0)</H3>
|
|
|
|
|
|
|
|
New function: <B>get_control_path()</B>
|
|
<A NAME="lbAI"> </A>
|
|
<H3>Version 1.01 (dpkg 1.15.8)</H3>
|
|
|
|
|
|
|
|
New function: <B>find_command()</B>
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Version 1.00 (dpkg 1.15.6)</H3>
|
|
|
|
|
|
|
|
Mark the module as public.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="12"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="13"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DT id="14"><A HREF="#lbAD">FUNCTIONS</A><DD>
|
|
<DT id="15"><A HREF="#lbAE">CHANGES</A><DD>
|
|
<DL>
|
|
<DT id="16"><A HREF="#lbAF">Version 1.04 (dpkg 1.17.11)</A><DD>
|
|
<DT id="17"><A HREF="#lbAG">Version 1.03 (dpkg 1.16.1)</A><DD>
|
|
<DT id="18"><A HREF="#lbAH">Version 1.02 (dpkg 1.16.0)</A><DD>
|
|
<DT id="19"><A HREF="#lbAI">Version 1.01 (dpkg 1.15.8)</A><DD>
|
|
<DT id="20"><A HREF="#lbAJ">Version 1.00 (dpkg 1.15.6)</A><DD>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:39 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|