Add a package to the transaction.
If the package was loaded by alpm_pkg_load(), it will be freed upon
alpm_trans_release() invocation.
@param handle the context handle
@param pkg the package to add
@return 0 on success, -1 on error (pm_errno is set accordingly)
Get a group entry from a package database.
@param db pointer to the package database to get the group from
@param name of the group
@return the groups entry on success, NULL on error
Get the group cache of a package database.
@param db pointer to the package database to get the group from
@return the list of groups on success, NULL on error
Get a package entry from a package database.
@param db pointer to the package database to get the package from
@param name of the package
@return the package entry on success, NULL on error
Get the package cache of a package database.
@param db pointer to the package database to get the package from
@return the list of packages on success, NULL on error
Get the signature verification level for a database.
Will return the default verification level if this database is set up
with ALPM_SIG_USE_DEFAULT.
@param db pointer to the package database
@return the signature verification level
Gets the usage of a database.
@param db pointer to the package database to get the status of
@param usage pointer to an alpm_db_usage_t to store db’s status
@return 0 on success, or -1 on error
Check the validity of a database.
This is most useful for sync databases and verifying signature status.
If invalid, the handle error code will be set accordingly.
@param db pointer to the package database
@return 0 if valid, -1 if invalid (pm_errno is set accordingly)
Searches a database with regular expressions.
@param db pointer to the package database to search in
@param needles a list of regular expressions to search for
@return the list of packages matching all regular expressions on success, NULL on error
Sets the usage of a database.
@param db pointer to the package database to set the status for
@param usage a bitmask of alpm_db_usage_t values
@return 0 on success, or -1 on error
Returns a newly allocated string representing the dependency information.
@param dep a dependency info structure
@return a formatted string, e.g. “glibc>=2.12”
Return a newly allocated dependency information parsed from a string
@param depstring a formatted string, e.g. “glibc=2.12”
@return a dependency info structure
Fetch a remote pkg.
@param handle the context handle
@param url URL of the package to download
@return the downloaded filepath on success, NULL on error
Determines whether a package filelist contains a given path.
The provided path should be relative to the install root with no leading
slashes, e.g. “etc/localtime”. When searching for directories, the path must
have a trailing slash.
@param filelist a pointer to a package filelist
@param path the path to search for in the package
@return a pointer to the matching file or NULL if not found
Get the database of locally installed packages.
The returned pointer points to an internal structure
of libalpm which should only be manipulated through
libalpm functions.
@return a reference to the local database
Get the list of sync databases.
Returns a list of alpm_db_t structures, one for each registered
sync database.
@param handle the context handle
@return a reference to an internal list of alpm_db_t structures
@name Accessors to the list of no-extract files.
These functions modify the list of filenames which should
be skipped packages which should
not be upgraded by a sysupgrade operation.
@{
Open a package changelog for reading.
Similar to fopen in functionality, except that the returned ‘file
stream’ could really be from an archive as well as from the database.
@param pkg the package to read the changelog of (either file or db)
@return a ‘file stream’ to the package changelog
Read data from an open changelog ‘file stream’.
Similar to fread in functionality, this function takes a buffer and
amount of data to read. If an error occurs pm_errno will be set.
@param ptr a buffer to fill with raw changelog data
@param size the size of the buffer
@param pkg the package that the changelog is being read from
@param fp a ‘file stream’ to the package changelog
@return the number of characters read, or 0 if there is no more data or an
error occurred.
Check the integrity (with md5) of a package from the sync cache.
@param pkg package pointer
@return 0 on success, -1 on error (pm_errno is set accordingly)
Computes the list of packages optionally requiring a given package.
The return value of this function is a newly allocated
list of package names (char*), it should be freed by the caller.
@param pkg a package
@return the list of packages optionally requiring pkg
Computes the list of packages requiring a given package.
The return value of this function is a newly allocated
list of package names (char*), it should be freed by the caller.
@param pkg a package
@return the list of packages requiring pkg
Returns the size of download.
Returns the size of the files that will be downloaded to install a
package.
@param newpkg the new package to upgrade to
@return the size of the download
Find a package in a list by name.
@param haystack a list of alpm_pkg_t
@param needle the package name
@return a pointer to the package if found or NULL
Returns the list of packages conflicting with pkg.
@param pkg a pointer to package
@return a reference to an internal list of alpm_depend_t structures.
Returns the database containing pkg.
Returns a pointer to the alpm_db_t structure the package is
originating from, or NULL if the package was loaded from a file.
@param pkg a pointer to package
@return a pointer to the DB containing pkg, or NULL.
Returns the list of package dependencies as alpm_depend_t.
@param pkg a pointer to package
@return a reference to an internal list of alpm_depend_t structures.
Returns the list of files installed by pkg.
The filenames are relative to the install root,
and do not include leading slashes.
@param pkg a pointer to package
@return a pointer to a filelist object containing a count and an array of
package file objects
Returns the package’s MD5 checksum as a string.
The returned string is a sequence of 32 lowercase hexadecimal digits.
@param pkg a pointer to package
@return a reference to an internal string
Returns the list of package optional dependencies.
@param pkg a pointer to package
@return a reference to an internal list of alpm_depend_t structures.
Returns the list of packages to be replaced by pkg.
@param pkg a pointer to package
@return a reference to an internal list of alpm_depend_t structures.
Returns the package’s SHA256 checksum as a string.
The returned string is a sequence of 64 lowercase hexadecimal digits.
@param pkg a pointer to package
@return a reference to an internal string
Returns the size of the package. This is only available for sync database
packages and package files, not those loaded from the local database.
@param pkg a pointer to package
@return the size of the package in bytes.
Returns the package version as a string.
This includes all available epoch, version, and pkgrel components. Use
alpm_pkg_vercmp() to compare version strings if necessary.
@param pkg a pointer to package
@return a reference to an internal string
Create a package from a file.
If full is false, the archive is read only until all necessary
metadata is found. If it is true, the entire archive is read, which
serves as a verification of integrity and the filelist can be created.
The allocated structure should be freed using alpm_pkg_free().
@param handle the context handle
@param filename location of the package tarball
@param full whether to stop the load after metadata is read or continue
through the full archive
@param level what level of package signature checking to perform on the
package; note that this must be a ‘.sig’ file type verification
@param pkg address of the package pointer
@return 0 on success, -1 on error (pm_errno is set accordingly)
Read next entry from a package mtree file.
@param pkg the package that the mtree file is being read from
@param archive the archive structure reading from the mtree file
@param entry an archive_entry to store the entry header information
@return 0 if end of archive is reached, non-zero otherwise.
Set install reason for a package in the local database.
The provided package object must be from the local database or this method
will fail. The write to the local database is performed immediately.
@param pkg the package to update
@param reason the new install reason
@return 0 on success, -1 on error (pm_errno is set accordingly)
Test if a package should be ignored.
Checks if the package is ignored via IgnorePkg, or if the package is
in a group ignored via IgnoreGroup.
@param handle the context handle
@param pkg the package to test
@return 1 if the package should be ignored, 0 otherwise
Register a sync database of packages.
@param handle the context handle
@param treename the name of the sync repository
@param level what level of signature checking to perform on the
database; note that this must be a ‘.sig’ file type verification
@return an alpm_db_t* on success (the value), NULL on error
Add a package removal action to the transaction.
@param handle the context handle
@param pkg the package to uninstall
@return 0 on success, -1 on error (pm_errno is set accordingly)
Search for packages to upgrade and add them to the transaction.
@param handle the context handle
@param enable_downgrade allow downgrading of packages if the remote version is lower
@return 0 on success, -1 on error (pm_errno is set accordingly)
Commit a transaction.
@param handle the context handle
@param data the address of an alpm_list where detailed description
of an error can be dumped (i.e. list of conflicting files)
@return 0 on success, -1 on error (pm_errno is set accordingly)
Initialize the transaction.
@param handle the context handle
@param flags flags of the transaction (like nodeps, etc; see alpm_transflag_t)
@return 0 on success, -1 on error (pm_errno is set accordingly)
Prepare a transaction.
@param handle the context handle
@param data the address of an alpm_list where a list
of alpm_depmissing_t objects is dumped (conflicting packages)
@return 0 on success, -1 on error (pm_errno is set accordingly)
Type of download progress callbacks.
@param filename the name of the file being downloaded
@param xfered the number of transferred bytes
@param total the total number of bytes to transfer
A callback for downloading files
@param url the URL of the file to be downloaded
@param localpath the directory to which the file should be downloaded
@param force whether to force an update, even if the file is the same
@return 0 on success, 1 if the file exists and is identical, -1 on
error.
Type of questions.
Unlike the events or progress enumerations, this enum has bitmask values
so a frontend can use a bitmask map to supply preselected answers to the
different types of questions.
Events.
This is an union passed to the callback, that allows the frontend to know
which type of event was triggered (via type). It is then possible to
typecast the pointer to the right structure, or use the union field, in order
to access event-specific data.
Questions.
This is an union passed to the callback, that allows the frontend to know
which type of question was triggered (via type). It is then possible to
typecast the pointer to the right structure, or use the union field, in order
to access question-specific data.