alpm_packages(3)

NAME
alpm_packages - Package Functions

 - Functions to manipulate libalpm packages.

SYNOPSIS

  Functions
int alpm_pkg_free (alpm_pkg_t *pkg)
Free a package.
int alpm_pkg_checkmd5sum (alpm_pkg_t *pkg)
Check the integrity (with md5) of a package from the sync cache.
const char * alpm_pkg_get_filename (alpm_pkg_t *pkg)
Gets the name of the file from which the package was loaded.
const char * alpm_pkg_get_base (alpm_pkg_t *pkg)
Returns the package base name.
const char * alpm_pkg_get_name (alpm_pkg_t *pkg)
Returns the package name.
const char * alpm_pkg_get_version (alpm_pkg_t *pkg)
Returns the package version as a string.
alpm_pkgfrom_t alpm_pkg_get_origin (alpm_pkg_t *pkg)
Returns the origin of the package.
const char * alpm_pkg_get_desc (alpm_pkg_t *pkg)
Returns the package description.
const char * alpm_pkg_get_url (alpm_pkg_t *pkg)
Returns the package URL.
alpm_time_t alpm_pkg_get_builddate (alpm_pkg_t *pkg)
Returns the build timestamp of the package.
alpm_time_t alpm_pkg_get_installdate (alpm_pkg_t *pkg)
Returns the install timestamp of the package.
const char * alpm_pkg_get_packager (alpm_pkg_t *pkg)
Returns the packager's name.
const char * alpm_pkg_get_md5sum (alpm_pkg_t *pkg)
Returns the package's MD5 checksum as a string.
const char * alpm_pkg_get_sha256sum (alpm_pkg_t *pkg)
Returns the package's SHA256 checksum as a string.
const char * alpm_pkg_get_base64_sig (alpm_pkg_t *pkg)
Returns the base64 encoded package signature.
const char * alpm_pkg_get_arch (alpm_pkg_t *pkg)
Returns the architecture for which the package was built.
off_t alpm_pkg_get_size (alpm_pkg_t *pkg)
Returns the size of the package.
off_t alpm_pkg_get_isize (alpm_pkg_t *pkg)
Returns the installed size of the package.
alpm_pkgreason_t alpm_pkg_get_reason (alpm_pkg_t *pkg)
Returns the package installation reason.
int alpm_pkg_get_validation (alpm_pkg_t *pkg)
Returns the method used to validate a package during install.
alpm_list_t * alpm_pkg_get_licenses (alpm_pkg_t *pkg)
Returns the list of package licenses.
alpm_list_t * alpm_pkg_get_groups (alpm_pkg_t *pkg)
Returns the list of package groups.
alpm_list_t * alpm_pkg_get_depends (alpm_pkg_t *pkg)
Returns the list of package dependencies as alpm_depend_t.
alpm_list_t * alpm_pkg_get_optdepends (alpm_pkg_t *pkg)
Returns the list of package optional dependencies.
alpm_list_t * alpm_pkg_get_checkdepends (alpm_pkg_t *pkg)
Returns a list of package check dependencies.
alpm_list_t * alpm_pkg_get_makedepends (alpm_pkg_t *pkg)
Returns a list of package make dependencies.
alpm_list_t * alpm_pkg_get_conflicts (alpm_pkg_t *pkg)
Returns the list of packages conflicting with pkg.
alpm_list_t * alpm_pkg_get_provides (alpm_pkg_t *pkg)
Returns the list of packages provided by pkg.
alpm_list_t * alpm_pkg_get_replaces (alpm_pkg_t *pkg)
Returns the list of packages to be replaced by pkg.
alpm_filelist_t * alpm_pkg_get_files (alpm_pkg_t *pkg)
Returns the list of files installed by pkg.
alpm_list_t * alpm_pkg_get_backup (alpm_pkg_t *pkg)
Returns the list of files backed up when installing pkg.
alpm_db_t * alpm_pkg_get_db (alpm_pkg_t *pkg)
Returns the database containing pkg.
void * alpm_pkg_changelog_open (alpm_pkg_t *pkg)
Open a package changelog for reading.
size_t alpm_pkg_changelog_read (void *ptr, size_t size, const alpm_pkg_t *pkg, void *fp)
Read data from an open changelog 'file stream'.
int alpm_pkg_changelog_close (const alpm_pkg_t *pkg, void *fp)
Close a package changelog for reading.
struct archive * alpm_pkg_mtree_open (alpm_pkg_t *pkg)
Open a package mtree file for reading.
int alpm_pkg_mtree_next (const alpm_pkg_t *pkg, struct archive *archive, struct archive_entry **entry)
Read entry from an open mtree file.
int alpm_pkg_mtree_close (const alpm_pkg_t *pkg, struct archive *archive)
Close a package mtree file for reading.
int alpm_pkg_has_scriptlet (alpm_pkg_t *pkg)
Returns whether the package has an install scriptlet.
alpm_list_t * alpm_pkg_compute_requiredby (alpm_pkg_t *pkg)
Compute the packages requiring a given package.
alpm_list_t * alpm_pkg_compute_optionalfor (alpm_pkg_t *pkg)
Compute the packages optionally requiring a given package.

  Variables
struct pkg_operations default_pkg_ops
The standard package operations struct.

Detailed Description

Functions to manipulate libalpm packages.

Function Documentation

  int alpm_pkg_changelog_close (const alpm_pkg_t * pkg, void * fp)

Close a package changelog for reading.

  void * alpm_pkg_changelog_open (alpm_pkg_t * pkg)

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.

Parameters
    pkg the package to read the changelog of (either file or db)

Returns
    a 'file stream' to the package changelog

  size_t alpm_pkg_changelog_read (void * ptr, size_t size, const alpm_pkg_t * pkg, void * fp)

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.

Parameters
    ptr a buffer to fill with raw changelog data
    size the size of the buffer
    pkg the package that the changelog is being read from
    fp a 'file stream' to the package changelog

Returns
    the number of characters read, or 0 if there is no more data or an error occurred.

  int alpm_pkg_checkmd5sum (alpm_pkg_t * pkg)

Check the integrity (with md5) of a package from the sync cache.

Parameters
    pkg package pointer

Returns
    0 on success, -1 on error (pm_errno is set accordingly)

  alpm_list_t * alpm_pkg_compute_optionalfor (alpm_pkg_t * pkg)

Compute the packages optionally requiring a given package. Computes the list of packages optionally requiring a given package.

  alpm_list_t * alpm_pkg_compute_requiredby (alpm_pkg_t * pkg)

Compute the packages requiring a given package. Computes the list of packages requiring a given package.

  int alpm_pkg_free (alpm_pkg_t * pkg)

Free a package.

Parameters
    pkg package pointer to free

Returns
    0 on success, -1 on error (pm_errno is set accordingly)

  const char * alpm_pkg_get_arch (alpm_pkg_t * pkg)

Returns the architecture for which the package was built.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  alpm_list_t * alpm_pkg_get_backup (alpm_pkg_t * pkg)

Returns the list of files backed up when installing pkg.

Parameters
    pkg a pointer to package

Returns
    a reference to a list of alpm_backup_t objects

  const char * alpm_pkg_get_base (alpm_pkg_t * pkg)

Returns the package base name.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  const char * alpm_pkg_get_base64_sig (alpm_pkg_t * pkg)

Returns the base64 encoded package signature.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  alpm_time_t alpm_pkg_get_builddate (alpm_pkg_t * pkg)

Returns the build timestamp of the package.

Parameters
    pkg a pointer to package

Returns
    the timestamp of the build time

  alpm_list_t * alpm_pkg_get_checkdepends (alpm_pkg_t * pkg)

Returns a list of package check dependencies.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal list of alpm_depend_t structures.

  alpm_list_t * alpm_pkg_get_conflicts (alpm_pkg_t * pkg)

Returns the list of packages conflicting with pkg.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal list of alpm_depend_t structures.

  alpm_db_t * alpm_pkg_get_db (alpm_pkg_t * pkg)

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.

Parameters
    pkg a pointer to package

Returns
    a pointer to the DB containing pkg, or NULL.

  alpm_list_t * alpm_pkg_get_depends (alpm_pkg_t * pkg)

Returns the list of package dependencies as alpm_depend_t.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal list of alpm_depend_t structures.

  const char * alpm_pkg_get_desc (alpm_pkg_t * pkg)

Returns the package description.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  const char * alpm_pkg_get_filename (alpm_pkg_t * pkg)

Gets the name of the file from which the package was loaded.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  alpm_filelist_t * alpm_pkg_get_files (alpm_pkg_t * pkg)

Returns the list of files installed by pkg. The filenames are relative to the install root, and do not include leading slashes.

Parameters
    pkg a pointer to package

Returns
    a pointer to a filelist object containing a count and an array of package file objects

  alpm_list_t * alpm_pkg_get_groups (alpm_pkg_t * pkg)

Returns the list of package groups.

Parameters
    pkg a pointer to package

Returns
    a pointer to an internal list of strings.

Referenced by alpm_pkg_should_ignore().

  alpm_time_t alpm_pkg_get_installdate (alpm_pkg_t * pkg)

Returns the install timestamp of the package.

Parameters
    pkg a pointer to package

Returns
    the timestamp of the install time

  off_t alpm_pkg_get_isize (alpm_pkg_t * pkg)

Returns the installed size of the package.

Parameters
    pkg a pointer to package

Returns
    the total size of files installed by the package.

  alpm_list_t * alpm_pkg_get_licenses (alpm_pkg_t * pkg)

Returns the list of package licenses.

Parameters
    pkg a pointer to package

Returns
    a pointer to an internal list of strings.

  alpm_list_t * alpm_pkg_get_makedepends (alpm_pkg_t * pkg)

Returns a list of package make dependencies.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal list of alpm_depend_t structures.

  const char * alpm_pkg_get_md5sum (alpm_pkg_t * pkg)

Returns the package's MD5 checksum as a string. The returned string is a sequence of 32 lowercase hexadecimal digits.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  const char * alpm_pkg_get_name (alpm_pkg_t * pkg)

Returns the package name.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  alpm_list_t * alpm_pkg_get_optdepends (alpm_pkg_t * pkg)

Returns the list of package optional dependencies.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal list of alpm_depend_t structures.

  alpm_pkgfrom_t alpm_pkg_get_origin (alpm_pkg_t * pkg)

Returns the origin of the package.

Returns
    an alpm_pkgfrom_t constant, -1 on error

  const char * alpm_pkg_get_packager (alpm_pkg_t * pkg)

Returns the packager's name.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  alpm_list_t * alpm_pkg_get_provides (alpm_pkg_t * pkg)

Returns the list of packages provided by pkg.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal list of alpm_depend_t structures.

  alpm_pkgreason_t alpm_pkg_get_reason (alpm_pkg_t * pkg)

Returns the package installation reason.

Parameters
    pkg a pointer to package

Returns
    an enum member giving the install reason.

  alpm_list_t * alpm_pkg_get_replaces (alpm_pkg_t * pkg)

Returns the list of packages to be replaced by pkg.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal list of alpm_depend_t structures.

  const char * alpm_pkg_get_sha256sum (alpm_pkg_t * pkg)

Returns the package's SHA256 checksum as a string. The returned string is a sequence of 64 lowercase hexadecimal digits.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  off_t alpm_pkg_get_size (alpm_pkg_t * pkg)

Returns the size of the package. This is only available for sync database packages and package files, not those loaded from the local database.

Parameters
    pkg a pointer to package

Returns
    the size of the package in bytes.

  const char * alpm_pkg_get_url (alpm_pkg_t * pkg)

Returns the package URL.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  int alpm_pkg_get_validation (alpm_pkg_t * pkg)

Returns the method used to validate a package during install.

Parameters
    pkg a pointer to package

Returns
    an enum member giving the validation method

  const char * alpm_pkg_get_version (alpm_pkg_t * pkg)

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.

Parameters
    pkg a pointer to package

Returns
    a reference to an internal string

  int alpm_pkg_has_scriptlet (alpm_pkg_t * pkg)

Returns whether the package has an install scriptlet.

Returns
    0 if FALSE, TRUE otherwise

  int alpm_pkg_mtree_close (const alpm_pkg_t * pkg, struct archive * archive)

Close a package mtree file for reading.

  int alpm_pkg_mtree_next (const alpm_pkg_t * pkg, struct archive * archive, struct archive_entry ** entry)

Read entry from an open mtree file. Read next entry from a package mtree file.

  struct archive * alpm_pkg_mtree_open (alpm_pkg_t * pkg)

Open a package mtree file for reading.

Parameters
    pkg the local package to read the changelog of

Returns
    a archive structure for the package mtree file

Variable Documentation

  struct pkg_operations default_pkg_ops

The standard package operations struct. Get fields directly from the struct itself with no abstraction layer or any type of lazy loading.

Author

Generated automatically by Doxygen for libalpm from the source code.