Handles

Handles are objects that provide access to pacman databases and transactions.

class Handle(rootpath: string, dbpath: string)

A handle object is initialized with a root path (i.e.., where do packages get installed) and a dbpath (i.e., where is the database information located). Generally, these parameters default to root path being ‘/’ and a dbpath being ‘/var/lib/pacman’.

get_localdb()
Return a reference to the local database object
Returns:an alpm database object for the localdb
get_syncdbs()
Return a list of references to the sync databases currently registered.
Returns:an alpm database object for the syncdb.
register_syncdb(name: string, flags: int)

Registers the database with the given name.

Parameters:
  • name (str) – The name of the database to register (e.g., ‘core’)
  • flags (int) – an integer constant representing the type of access (i.e., an ALPM_SIG_* constant as exported in the parent module)
Returns:

an alpm database object for this syncdb

set_pkgreason(package: Package, reason: int)

Sets the reason for this package installation’s (e.g., explicitly or as a dependency)

Parameters:
  • package (Package) – the package.
  • reason (int) – 0 for explicitly requrested by a user or 1 for as dependency of another package
Returns:

Nothing

add_cachedir()

Adds a cachedir.

Parameters:path (str) – the path to the cachedir to add.
Returns:Nothing
add_ignoregrp()

Add an ignoregrp.

Parameters:groupname (str) – the groupname to ignore
Returns:nothing
add_ignorepkg()

Add an ignorepkg.

Parameters:pkgname (str) – the package name to ignore
Returns:nothing
add_noextract()

Add a noextract package.

Parameters:pkgname (str) – the package name to noextract
Returns:nothing
add_noupgrade()

Add a noupgrade package

Parameters:pkgname (str) – the package name to noextract
Returns:nothing
init_transaction()

Initializes a transaction

Parameters:
  • nodeps (bool) – skip dependency checks
  • force (bool) – overwrite existing packages (deprecated)
  • nosave (bool) – do not save .pacsave files
  • nodepversion (bool) – undocumented
  • cascade (bool) – remove all dependent packages
  • recurse (bool) – remove also explicitly installed unneeded dependent packages
  • dbonly (bool) – only remove database entry, do not remove files
  • alldeps (bool) – mark packages as non-explicitly installed
  • downloadonly (bool) – download pakcages but do not install/upgrade anything
  • noscriptlet (bool) – do not execute the install scriptlet of one exists
  • noconflicts (bool) – ignore conflicts
  • needed (bool) – do not reinstall the targets that are already up-to-date.
  • allexplicit (bool) – undocmented
  • unneeded (bool) – remove also explicitly unneeded deps
  • recurseall (bool) – undocumented
  • nolock (bool) – do not database
Returns:

a Transaction object