Module util

Source
Expand description

Contains miscellaneous helper utilities.

Enums§

DiskSpace
Disk Space that apt will use for a transaction.
NumSys
Numeral System for unit conversion.

Functions§

apt_is_locked
Checks if any locks are currently active for the lockfile. Note that this will only return true if the current process has an active lock, while calls to apt_lock will return an AptErrors if another process has an active lock.
apt_lock
Lock the APT lockfile. This should be done before modifying any APT files such as with crate::cache::Cache::update and then apt_unlock should be called after.
apt_lock_inner
Unlock the Dpkg lockfile. This should be done before manually running crate::cache::Cache::do_install and then apt_unlock_inner should be called after.
apt_unlock
Unlock the APT lockfile.
apt_unlock_inner
Unlock the Dpkg lockfile.
cmp_versions
Compares two package versions, ver1 and ver2. The returned enum variant applies to the first version passed in.
get_apt_progress_string
Get an APT-styled progress bar.
show_broken_pkg
Reference implementation to print broken packages just like apt does.
terminal_height
Get the terminal’s height, i.e. the number of rows it has.
terminal_width
Get the terminal’s width, i.e. the number of columns it has.
time_str
Converts seconds into a human readable time string.
unit_str
Converts bytes into human readable output.