1Dpkg::Path(3) libdpkg-perl Dpkg::Path(3)
2
3
4
6 Dpkg::Path - some common path handling functions
7
9 It provides some functions to handle various path.
10
12 get_pkg_root_dir($file)
13 This function will scan upwards the hierarchy of directory to
14 find out the directory which contains the "DEBIAN" sub-
15 directory and it will return its path. This directory is the
16 root directory of a package being built.
17
18 If no DEBIAN subdirectory is found, it will return undef.
19
20 relative_to_pkg_root($file)
21 Returns the filename relative to get_pkg_root_dir($file).
22
23 guess_pkg_root_dir($file)
24 This function tries to guess the root directory of the package
25 build tree. It will first use get_pkg_root_dir(), but it will
26 fallback to a more imprecise check: namely it will use the
27 parent directory that is a sub-directory of the debian
28 directory.
29
30 It can still return undef if a file outside of the debian sub-
31 directory is provided.
32
33 check_files_are_the_same($file1, $file2, $resolve_symlink)
34 This function verifies that both files are the same by checking
35 that the device numbers and the inode numbers returned by
36 stat()/lstat() are the same. If $resolve_symlink is true then
37 stat() is used, otherwise lstat() is used.
38
39 canonpath($file)
40 This function returns a cleaned path. It simplifies double //,
41 and remove /./ and /../ intelligently. For /../ it simplifies
42 the path only if the previous element is not a symlink. Thus it
43 should only be used on real filenames.
44
45 $newpath = resolve_symlink($symlink)
46 Return the filename of the file pointed by the symlink. The new
47 name is canonicalized by canonpath().
48
49 $cmdpath = find_command($command)
50 Return the path of the command if defined and available on an
51 absolute or relative path or on the $PATH, undef otherwise.
52
53 $control_file = get_control_path($pkg, $filetype)
54 Return the path of the control file of type $filetype for the
55 given package.
56
57 @control_files = get_control_path($pkg)
58 Return the path of all available control files for the given
59 package.
60
61 $file = find_build_file($basename)
62 Selects the right variant of the given file: the arch-specific
63 variant ("$basename.$arch") has priority over the OS-specific
64 variant ("$basename.$os") which has priority over the default
65 variant ("$basename"). If none of the files exists, then it
66 returns undef.
67
68 @files = find_build_file($basename)
69 Return the available variants of the given file. Returns an
70 empty list if none of the files exists.
71
73 Version 1.04 (dpkg 1.17.11)
74 Update semantics: find_command() now handles an empty or undef
75 argument.
76
77 Version 1.03 (dpkg 1.16.1)
78 New function: find_build_file()
79
80 Version 1.02 (dpkg 1.16.0)
81 New function: get_control_path()
82
83 Version 1.01 (dpkg 1.15.8)
84 New function: find_command()
85
86 Version 1.00 (dpkg 1.15.6)
87 Mark the module as public.
88
89
90
911.18.25 2018-06-17 Dpkg::Path(3)