Lintian::Util - Online Linux Manual PageSection : 3
Updated : 2020-11-27
Source : Lintian v2.104.0
Note : Debian Package Checker
NAMELintian::Util − Lintian utility functions
SYNOPSIS use Lintian::Util;
DESCRIPTIONThis module contains a number of utility subs that are nice to have, but on their own did not warrant their own module. Most subs are imported only on request.
VARIABLES$PKGNAME_REGEX Regular expression that matches valid package names. The expression is not anchored and does not enforce any ‟boundary” characters. $PKGREPACK_REGEX Regular expression that matches ‟repacked” package names. The expression is not anchored and does not enforce any ‟boundary” characters. It should only be applied to the upstream portion (see #931846). $PKGVERSION_REGEX Regular expression that matches valid package versions. The expression is not anchored and does not enforce any ‟boundary” characters.
FUNCTIONSdrain_pipe(FD) Reads and discards any remaining contents from FD, which is assumed to be a pipe. This is mostly done to avoid having the ‟write”−end die with a SIGPIPE due to a ‟broken pipe” (which can happen if you just close the pipe). 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). get_file_digest(ALGO, FILE) Creates an ALGO digest object that is seeded with the contents of FILE. If you just want the hex digest, please use ‟get_file_checksum(ALGO, FILE)” instead. 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}. get_file_checksum(ALGO, FILE) Returns a hexadecimal string of the message digest checksum generated by the algorithm ALGO on FILE. 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}. perm2oct(PERM) Translates PERM to an octal permission. PERM should be a string describing the permissions as done by tar t or ls −l. That is, it should be a string like ‟−rw−r\*(--r\-\-\*(R". If the string does not appear to be a valid permission, it will cause a trappable error. Examples: # Good
perm2oct('−rw−r−−r−−') == 0644
perm2oct('−rwxr−xr−x') == 0755
# Bad
perm2oct('broken') # too short to be recognised
perm2oct('−resurunet') # contains unknown permissions
human_bytes(SIZE) open_gz (FILE) Opens a handle that reads from the GZip compressed FILE. On failure, this sub emits a trappable error. Note: The handle may be a pipe from an external processes. locate_executable (CMD) drop_relative_prefix(STRING) Remove an initial ./ from STRING, if present version_from_changelog normalize_pkg_path(PATH) Normalize PATH by removing superfluous path segments. PATH is assumed to be relative the package root. Note that the result will never start nor end with a slash, even if PATH does. 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_link_target(CURDIR, LINK_TARGET) Normalize the path obtained by following a link with LINK_TARGET as its target from CURDIR as the current directory. CURDIR is assumed to be relative to the package root. Note that the result will never start nor end with a slash, even if CURDIR or DEST does. 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 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). is_ancestor_of(PARENTDIR, PATH) Returns true if and only if PATH is PARENTDIR or a path stored somewhere within PARENTDIR (or its subdirs). This function will resolve the paths; any failure to resolve the path will cause a trappable error. read_md5sums unescape_md5sum_filename
SEE ALSOlintian (1) 0
Johanes Gumabo
Data Size : 16,097 byte
man-Lintian::Util.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 201,902
Visitor ID : :
Visitor IP : 3.21.44.115 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|Lintian::Util.3|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\|
) (htmlprn|149|Lintian::Util.3|36/37|.el══─{─══. ds -- — |.el══─{─══. ds -- \|\(em\|
) (parse_manual_page_|249|Lintian::Util.3|43|br══─}─══|'br══─}─══
) (htmlprn|149|Lintian::Util.3|43|'br══─}─══ |'br══─}─══
) (rof_escape_sequence|91|Lintian::Util.3|210|\*(--r\-\-\*(R". |string like \*(L"\-rw\-r\*(--r\-\-\*(R".
)