apt.debfile
— Classes related to debian package files¶
The apt.debfile
provides classes to work with locally available
debian packages, or source packages.
Binary packages¶
-
class
apt.debfile.
DebPackage
(filename: Optional[str] = None, cache: Optional[apt.cache.Cache] = None)¶ A Debian Package (.deb file).
The
DebPackage
class is a class for working with ‘.deb’ files, also known as Debian packages.It provides methods and attributes to get a list of the files in the package, to install the package and much more.
If you specify cache it has to point to an
apt.cache.Cache()
object.-
VERSION_NEWER
= 3¶
-
VERSION_NONE
= 0¶
-
VERSION_OUTDATED
= 1¶
-
VERSION_SAME
= 2¶
-
check_breaks_existing_packages
() → bool¶ check if installing the package would break exsisting package on the system, e.g. system has: smc depends on smc-data (= 1.4) and user tries to installs smc-data 1.6
-
check_conflicts
() → bool¶ Check if there are conflicts with existing or selected packages.
Check if the package conflicts with a existing or to be installed package. Return True if the pkg is OK.
-
compare_to_version_in_cache
(use_installed: bool = True) → int¶ Compare the package to the version available in the cache.
Checks if the package is already installed or availabe in the cache and if so in what version, returns one of (VERSION_NONE, VERSION_OUTDATED, VERSION_SAME, VERSION_NEWER).
-
property
conflicts
¶ List of packages conflicting with this package.
-
property
control_filelist
¶ return the list of files in control.tar.gz
-
debug
= 0¶
-
property
depends
¶ List of packages on which this package depends on.
-
property
filelist
¶ return the list of files in the deb.
-
install
(install_progress: Optional[apt.progress.base.InstallProgress] = None) → int¶ Install the package.
-
property
missing_deps
¶ Return missing dependencies.
-
property
provides
¶ List of virtual packages which are provided by this package.
-
property
replaces
¶ List of packages which are replaced by this package.
-
replaces_real_pkg
(pkgname: str, oper: str, ver: str) → bool¶ Return True if a given non-virtual package is replaced.
Return True if the deb packages replaces a real (not virtual) packages named (pkgname, oper, ver).
-
property
required_changes
¶ Get the changes required to satisfy the dependencies.
Returns: a tuple with (install, remove, unauthenticated)
-
Source packages¶
-
class
apt.debfile.
DscSrcPackage
(filename: Optional[str] = None, cache: Optional[apt.cache.Cache] = None)¶ A locally available source package.
Provide functionality to work with locally available source packages, especially with their ‘.dsc’ file.
New in version 0.7.9.
-
VERSION_NEWER
= 3¶
-
VERSION_NONE
= 0¶
-
VERSION_OUTDATED
= 1¶
-
VERSION_SAME
= 2¶
-
check
(allow_downgrade: bool = False) → bool¶ Check if the package is installable.
The second parameter is ignored and only exists for compatibility with parent type.
-
check_breaks_existing_packages
() → bool¶ check if installing the package would break exsisting package on the system, e.g. system has: smc depends on smc-data (= 1.4) and user tries to installs smc-data 1.6
-
check_conflicts
() → bool¶ Check if there are conflicts with existing or selected packages.
Check if the package conflicts with a existing or to be installed package. Return True if the pkg is OK.
-
compare_to_version_in_cache
(use_installed: bool = True) → int¶ Compare the package to the version available in the cache.
Checks if the package is already installed or availabe in the cache and if so in what version, returns one of (VERSION_NONE, VERSION_OUTDATED, VERSION_SAME, VERSION_NEWER).
-
property
conflicts
¶ Return the dependencies of the package
-
property
control_filelist
¶ return the list of files in control.tar.gz
-
debug
= 0¶
-
property
depends
¶ Return the dependencies of the package
-
property
filelist
¶ Return the list of files associated with this dsc file
-
install
(install_progress: Optional[apt.progress.base.InstallProgress] = None) → int¶ Install the package.
-
property
missing_deps
¶ Return missing dependencies.
-
property
provides
¶ List of virtual packages which are provided by this package.
-
property
replaces
¶ List of packages which are replaced by this package.
-
replaces_real_pkg
(pkgname: str, oper: str, ver: str) → bool¶ Return True if a given non-virtual package is replaced.
Return True if the deb packages replaces a real (not virtual) packages named (pkgname, oper, ver).
-
property
required_changes
¶ Get the changes required to satisfy the dependencies.
Returns: a tuple with (install, remove, unauthenticated)
-