use Lintian::Util;
Most subs are imported only on request.
May cause an exception if there are issues reading from the pipe.
Caveat: This will block until the pipe is closed from the ``write''-end, so only use it with pipes where the ``write''-end will eventually close their end by themselves (or something else will make them close it).
ALGO can be 'md5' or shaX, where X is any number supported by Digest::SHA (e.g. 'sha256').
This sub is a convenience wrapper around Digest::{MD5,SHA}.
ALGO can be 'md5' or shaX, where X is any number supported by Digest::SHA (e.g. 'sha256').
This sub is a convenience wrapper around Digest::{MD5,SHA}.
If the string does not appear to be a valid permission, it will cause a trappable error.
Examples:
# Good perm2oct('-rw-r--r--') == oct(644) perm2oct('-rwxr-xr-x') == oct(755) # Bad perm2oct('broken') # too short to be recognised perm2oct('-resurunet') # contains unknown permissions
As the name suggests, this is a path ``normalization'' rather than a true path resolution (for that use Cwd::realpath). Particularly, it assumes none of the path segments are symlinks.
normalize_pkg_path will return "q{}" (i.e. the empty string) if PATH is normalized to the root dir and "undef" if the path cannot be normalized without escaping the package root.
normalize_pkg_path will return "q{}" (i.e. the empty string) if the target is the root dir and "undef" if the path cannot be normalized without escaping the package root.
CAVEAT: This function is not always sufficient to test if it is safe to open a given symlink. Use "is_ancestor_of(PARENTDIR, PATH)" for that. If you must use this function, remember to check that the target is not a symlink (or if it is, that it can be resolved safely).
This function will resolve the paths; any failure to resolve the path will cause a trappable error.