alpm_api(3)

NAME
alpm_api - Public API

The libalpm Public API.

  Modules
Options
Libalpm option getters and setters.
Database Functions
Functions to query and manipulate the database of libalpm.
Package Functions
Functions to manipulate libalpm packages.
Transaction Functions
Functions to manipulate libalpm transactions.
Dependency Functions
Functions dealing with libalpm representation of dependency information.

  Data Structures
struct _alpm_depend_t
Dependency.
struct _alpm_depmissing_t
Missing dependency.
struct _alpm_conflict_t
Conflict.
struct _alpm_fileconflict_t
File conflict.
struct _alpm_group_t
Package group.
struct _alpm_delta_t
Package upgrade delta.
struct _alpm_file_t
File in a package.
struct _alpm_filelist_t
Package filelist container.
struct _alpm_backup_t
Local package or package file backup entry.
struct _alpm_pgpkey_t
struct _alpm_sigresult_t
Signature result.
struct _alpm_siglist_t
Signature list.
struct _alpm_event_any_t
struct _alpm_event_package_operation_t
struct _alpm_event_optdep_removal_t
struct _alpm_event_delta_patch_t
struct _alpm_event_scriptlet_info_t
struct _alpm_event_database_missing_t
struct _alpm_event_pkgdownload_t
struct _alpm_event_pacnew_created_t
struct _alpm_event_pacsave_created_t
struct _alpm_event_hook_t
struct _alpm_event_hook_run_t
union _alpm_event_t
Events.
struct _alpm_question_any_t
struct _alpm_question_install_ignorepkg_t
struct _alpm_question_replace_t
struct _alpm_question_conflict_t
struct _alpm_question_corrupted_t
struct _alpm_question_remove_pkgs_t
struct _alpm_question_select_provider_t
struct _alpm_question_import_key_t
union _alpm_question_t
Questions.

  Typedefs
typedef int64_t alpm_time_t
typedef enum _alpm_pkgreason_t alpm_pkgreason_t
Package install reasons.
typedef enum _alpm_pkgfrom_t alpm_pkgfrom_t
Location a package object was loaded from.
typedef enum _alpm_pkgvalidation_t alpm_pkgvalidation_t
Method used to validate a package.
typedef enum _alpm_depmod_t alpm_depmod_t
Types of version constraints in dependency specs.
typedef enum _alpm_fileconflicttype_t alpm_fileconflicttype_t
File conflict type.
typedef enum _alpm_siglevel_t alpm_siglevel_t
PGP signature verification options.
typedef enum _alpm_sigstatus_t alpm_sigstatus_t
PGP signature verification status return codes.
typedef enum _alpm_sigvalidity_t alpm_sigvalidity_t
PGP signature verification status return codes.
typedef struct _alpm_depend_t alpm_depend_t
Dependency.
typedef struct _alpm_depmissing_t alpm_depmissing_t
Missing dependency.
typedef struct _alpm_conflict_t alpm_conflict_t
Conflict.
typedef struct _alpm_fileconflict_t alpm_fileconflict_t
File conflict.
typedef struct _alpm_group_t alpm_group_t
Package group.
typedef struct _alpm_delta_t alpm_delta_t
Package upgrade delta.
typedef struct _alpm_file_t alpm_file_t
File in a package.
typedef struct _alpm_filelist_t alpm_filelist_t
Package filelist container.
typedef struct _alpm_backup_t alpm_backup_t
Local package or package file backup entry.
typedef struct _alpm_pgpkey_t alpm_pgpkey_t
typedef struct _alpm_sigresult_t alpm_sigresult_t
Signature result.
typedef struct _alpm_siglist_t alpm_siglist_t
Signature list.
typedef enum _alpm_hook_when_t alpm_hook_when_t
typedef enum _alpm_loglevel_t alpm_loglevel_t
Logging Levels.
typedef void(* alpm_cb_log) (alpm_loglevel_t, const char *, va_list)
typedef int enum _alpm_event_type_t alpm_event_type_t
Type of events.
typedef struct _alpm_event_any_t alpm_event_any_t
typedef enum _alpm_package_operation_t alpm_package_operation_t
typedef struct _alpm_event_package_operation_t alpm_event_package_operation_t
typedef struct _alpm_event_optdep_removal_t alpm_event_optdep_removal_t
typedef struct _alpm_event_delta_patch_t alpm_event_delta_patch_t
typedef struct _alpm_event_scriptlet_info_t alpm_event_scriptlet_info_t
typedef struct _alpm_event_database_missing_t alpm_event_database_missing_t
typedef struct _alpm_event_pkgdownload_t alpm_event_pkgdownload_t
typedef struct _alpm_event_pacnew_created_t alpm_event_pacnew_created_t
typedef struct _alpm_event_pacsave_created_t alpm_event_pacsave_created_t
typedef struct _alpm_event_hook_t alpm_event_hook_t
typedef struct _alpm_event_hook_run_t alpm_event_hook_run_t
typedef union _alpm_event_t alpm_event_t
Events.
typedef void(* alpm_cb_event) (alpm_event_t *)
Event callback.
typedef enum _alpm_question_type_t alpm_question_type_t
Type of questions.
typedef struct _alpm_question_any_t alpm_question_any_t
typedef struct _alpm_question_install_ignorepkg_t alpm_question_install_ignorepkg_t
typedef struct _alpm_question_replace_t alpm_question_replace_t
typedef struct _alpm_question_conflict_t alpm_question_conflict_t
typedef struct _alpm_question_corrupted_t alpm_question_corrupted_t
typedef struct _alpm_question_remove_pkgs_t alpm_question_remove_pkgs_t
typedef struct _alpm_question_select_provider_t alpm_question_select_provider_t
typedef struct _alpm_question_import_key_t alpm_question_import_key_t
typedef union _alpm_question_t alpm_question_t
Questions.
typedef void(* alpm_cb_question) (alpm_question_t *)
Question callback.
typedef enum _alpm_progress_t alpm_progress_t
Progress.
typedef void(* alpm_cb_progress) (alpm_progress_t, const char *, int, size_t, size_t)
Progress callback.
typedef void(* alpm_cb_download) (const char *filename, off_t xfered, off_t total)
Type of download progress callbacks.
typedef void(* alpm_cb_totaldl) (off_t total)
typedef int(* alpm_cb_fetch) (const char *url, const char *localpath, int force)
A callback for downloading files.

  Enumerations
enum _alpm_pkgreason_t { ALPM_PKG_REASON_EXPLICIT = 0, ALPM_PKG_REASON_DEPEND = 1 } Package install reasons. "
enum _alpm_pkgfrom_t { ALPM_PKG_FROM_FILE = 1, ALPM_PKG_FROM_LOCALDB, ALPM_PKG_FROM_SYNCDB } Location a package object was loaded from. "
enum _alpm_pkgvalidation_t { ALPM_PKG_VALIDATION_UNKNOWN = 0, ALPM_PKG_VALIDATION_NONE = (1 << 0), ALPM_PKG_VALIDATION_MD5SUM = (1 << 1), ALPM_PKG_VALIDATION_SHA256SUM = (1 << 2), ALPM_PKG_VALIDATION_SIGNATURE = (1 << 3) } Method used to validate a package. "
enum _alpm_depmod_t { ALPM_DEP_MOD_ANY = 1, ALPM_DEP_MOD_EQ, ALPM_DEP_MOD_GE, ALPM_DEP_MOD_LE, ALPM_DEP_MOD_GT, ALPM_DEP_MOD_LT } Types of version constraints in dependency specs. "
enum _alpm_fileconflicttype_t { ALPM_FILECONFLICT_TARGET = 1, ALPM_FILECONFLICT_FILESYSTEM } File conflict type. "
enum _alpm_siglevel_t { ALPM_SIG_PACKAGE = (1 << 0), ALPM_SIG_PACKAGE_OPTIONAL = (1 << 1), ALPM_SIG_PACKAGE_MARGINAL_OK = (1 << 2), ALPM_SIG_PACKAGE_UNKNOWN_OK = (1 << 3), ALPM_SIG_DATABASE = (1 << 10), ALPM_SIG_DATABASE_OPTIONAL = (1 << 11), ALPM_SIG_DATABASE_MARGINAL_OK = (1 << 12), ALPM_SIG_DATABASE_UNKNOWN_OK = (1 << 13), ALPM_SIG_USE_DEFAULT = (1 << 31) } PGP signature verification options. "
enum _alpm_sigstatus_t { ALPM_SIGSTATUS_VALID, ALPM_SIGSTATUS_KEY_EXPIRED, ALPM_SIGSTATUS_SIG_EXPIRED, ALPM_SIGSTATUS_KEY_UNKNOWN, ALPM_SIGSTATUS_KEY_DISABLED, ALPM_SIGSTATUS_INVALID } PGP signature verification status return codes. "
enum _alpm_sigvalidity_t { ALPM_SIGVALIDITY_FULL, ALPM_SIGVALIDITY_MARGINAL, ALPM_SIGVALIDITY_NEVER, ALPM_SIGVALIDITY_UNKNOWN } PGP signature verification status return codes. "
enum _alpm_hook_when_t { ALPM_HOOK_PRE_TRANSACTION = 1, ALPM_HOOK_POST_TRANSACTION }
enum _alpm_loglevel_t { ALPM_LOG_ERROR = 1, ALPM_LOG_WARNING = (1 << 1), ALPM_LOG_DEBUG = (1 << 2), ALPM_LOG_FUNCTION = (1 << 3) } Logging Levels. "
enum _alpm_event_type_t { ALPM_EVENT_CHECKDEPS_START = 1, ALPM_EVENT_CHECKDEPS_DONE, ALPM_EVENT_FILECONFLICTS_START, ALPM_EVENT_FILECONFLICTS_DONE, ALPM_EVENT_RESOLVEDEPS_START, ALPM_EVENT_RESOLVEDEPS_DONE, ALPM_EVENT_INTERCONFLICTS_START, ALPM_EVENT_INTERCONFLICTS_DONE, ALPM_EVENT_TRANSACTION_START, ALPM_EVENT_TRANSACTION_DONE, ALPM_EVENT_PACKAGE_OPERATION_START, ALPM_EVENT_PACKAGE_OPERATION_DONE, ALPM_EVENT_INTEGRITY_START, ALPM_EVENT_INTEGRITY_DONE, ALPM_EVENT_LOAD_START, ALPM_EVENT_LOAD_DONE, ALPM_EVENT_DELTA_INTEGRITY_START, ALPM_EVENT_DELTA_INTEGRITY_DONE, ALPM_EVENT_DELTA_PATCHES_START, ALPM_EVENT_DELTA_PATCHES_DONE, ALPM_EVENT_DELTA_PATCH_START, ALPM_EVENT_DELTA_PATCH_DONE, ALPM_EVENT_DELTA_PATCH_FAILED, ALPM_EVENT_SCRIPTLET_INFO, ALPM_EVENT_RETRIEVE_START, ALPM_EVENT_RETRIEVE_DONE, ALPM_EVENT_RETRIEVE_FAILED, ALPM_EVENT_PKGDOWNLOAD_START, ALPM_EVENT_PKGDOWNLOAD_DONE, ALPM_EVENT_PKGDOWNLOAD_FAILED, ALPM_EVENT_DISKSPACE_START, ALPM_EVENT_DISKSPACE_DONE, ALPM_EVENT_OPTDEP_REMOVAL, ALPM_EVENT_DATABASE_MISSING, ALPM_EVENT_KEYRING_START, ALPM_EVENT_KEYRING_DONE, ALPM_EVENT_KEY_DOWNLOAD_START, ALPM_EVENT_KEY_DOWNLOAD_DONE, ALPM_EVENT_PACNEW_CREATED, ALPM_EVENT_PACSAVE_CREATED, ALPM_EVENT_HOOK_START, ALPM_EVENT_HOOK_DONE, ALPM_EVENT_HOOK_RUN_START, ALPM_EVENT_HOOK_RUN_DONE } Type of events. "
enum _alpm_package_operation_t { ALPM_PACKAGE_INSTALL = 1, ALPM_PACKAGE_UPGRADE, ALPM_PACKAGE_REINSTALL, ALPM_PACKAGE_DOWNGRADE, ALPM_PACKAGE_REMOVE }
enum _alpm_question_type_t { ALPM_QUESTION_INSTALL_IGNOREPKG = (1 << 0), ALPM_QUESTION_REPLACE_PKG = (1 << 1), ALPM_QUESTION_CONFLICT_PKG = (1 << 2), ALPM_QUESTION_CORRUPTED_PKG = (1 << 3), ALPM_QUESTION_REMOVE_PKGS = (1 << 4), ALPM_QUESTION_SELECT_PROVIDER = (1 << 5), ALPM_QUESTION_IMPORT_KEY = (1 << 6) } Type of questions. "
enum _alpm_progress_t { ALPM_PROGRESS_ADD_START, ALPM_PROGRESS_UPGRADE_START, ALPM_PROGRESS_DOWNGRADE_START, ALPM_PROGRESS_REINSTALL_START, ALPM_PROGRESS_REMOVE_START, ALPM_PROGRESS_CONFLICTS_START, ALPM_PROGRESS_DISKSPACE_START, ALPM_PROGRESS_INTEGRITY_START, ALPM_PROGRESS_LOAD_START, ALPM_PROGRESS_KEYRING_START } Progress. "

  Functions
int alpm_logaction (alpm_handle_t *handle, const char *prefix, const char *fmt,...) __attribute__((format(printf
char * alpm_fetch_pkgurl (alpm_handle_t *handle, const char *url)
Fetch a remote pkg.
alpm_file_t * alpm_filelist_contains (alpm_filelist_t *filelist, const char *path)
Determines whether a package filelist contains a given path.
int alpm_pkg_check_pgp_signature (alpm_pkg_t *pkg, alpm_siglist_t *siglist)
Check the PGP signature for the given package file.
int alpm_db_check_pgp_signature (alpm_db_t *db, alpm_siglist_t *siglist)
Check the PGP signature for the given database.
int alpm_siglist_cleanup (alpm_siglist_t *siglist)
Clean up and free a signature result list.
int alpm_decode_signature (const char *base64_data, unsigned char **data, size_t *data_len)
Decode a loaded signature in base64 form.
int alpm_extract_keyid (alpm_handle_t *handle, const char *identifier, const unsigned char *sig, const size_t len, alpm_list_t **keys)
Extract the Issuer Key ID from a signature.
alpm_list_t * alpm_find_group_pkgs (alpm_list_t *dbs, const char *name)
Find group members across a list of databases.
alpm_pkg_t * alpm_sync_newversion (alpm_pkg_t *pkg, alpm_list_t *dbs_sync)
Check for new version of pkg in sync repos (only the first occurrence is considered in sync)

  Common Transactions
int alpm_sync_sysupgrade (alpm_handle_t *handle, int enable_downgrade)
Search for packages to upgrade and add them to the transaction.
int alpm_add_pkg (alpm_handle_t *handle, alpm_pkg_t *pkg)
Add a package to the transaction.
int alpm_remove_pkg (alpm_handle_t *handle, alpm_pkg_t *pkg)
Add a package removal action to the transaction.

Detailed Description

The libalpm Public API.

Typedef Documentation

  typedef struct _alpm_backup_t alpm_backup_t

Local package or package file backup entry.

  typedef void(* alpm_cb_download) (const char *filename, off_t xfered, off_t total)

Type of download progress callbacks.

Parameters:
    filename the name of the file being downloaded
    xfered the number of transferred bytes
    total the total number of bytes to transfer

  typedef void(* alpm_cb_event) (alpm_event_t *)

Event callback.

  typedef int(* alpm_cb_fetch) (const char *url, const char *localpath, int force)

A callback for downloading files.

Parameters:
    url the URL of the file to be downloaded
    localpath the directory to which the file should be downloaded
    force whether to force an update, even if the file is the same

Returns:
    0 on success, 1 if the file exists and is identical, -1 on error.

  typedef void(* alpm_cb_progress) (alpm_progress_t, const char *, int, size_t, size_t)

Progress callback.

  typedef void(* alpm_cb_question) (alpm_question_t *)

Question callback.

  typedef struct _alpm_conflict_t alpm_conflict_t

Conflict.

  typedef struct _alpm_delta_t alpm_delta_t

Package upgrade delta.

  typedef struct _alpm_depend_t alpm_depend_t

Dependency.

  typedef struct _alpm_depmissing_t alpm_depmissing_t

Missing dependency.

  typedef enum _alpm_depmod_t alpm_depmod_t

Types of version constraints in dependency specs.

  typedef union _alpm_event_t alpm_event_t

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.

  typedef int enum _alpm_event_type_t alpm_event_type_t

Type of events.

  typedef struct _alpm_file_t alpm_file_t

File in a package.

  typedef struct _alpm_fileconflict_t alpm_fileconflict_t

File conflict.

  typedef enum _alpm_fileconflicttype_t alpm_fileconflicttype_t

File conflict type. Whether the conflict results from a file existing on the filesystem, or with another target in the transaction.

  typedef struct _alpm_filelist_t alpm_filelist_t

Package filelist container.

  typedef struct _alpm_group_t alpm_group_t

Package group.

  typedef enum _alpm_loglevel_t alpm_loglevel_t

Logging Levels.

  typedef enum _alpm_pkgfrom_t alpm_pkgfrom_t

Location a package object was loaded from.

  typedef enum _alpm_pkgreason_t alpm_pkgreason_t

Package install reasons.

  typedef enum _alpm_pkgvalidation_t alpm_pkgvalidation_t

Method used to validate a package.

  typedef enum _alpm_progress_t alpm_progress_t

Progress.

  typedef union _alpm_question_t alpm_question_t

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.

  typedef enum _alpm_question_type_t alpm_question_type_t

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.

  typedef enum _alpm_siglevel_t alpm_siglevel_t

PGP signature verification options.

  typedef struct _alpm_siglist_t alpm_siglist_t

Signature list. Contains the number of signatures found and a pointer to an array of results. The array is of size count.

  typedef struct _alpm_sigresult_t alpm_sigresult_t

Signature result. Contains the key, status, and validity of a given signature.

  typedef enum _alpm_sigstatus_t alpm_sigstatus_t

PGP signature verification status return codes.

  typedef enum _alpm_sigvalidity_t alpm_sigvalidity_t

PGP signature verification status return codes.

Enumeration Type Documentation

  enum _alpm_depmod_t

Types of version constraints in dependency specs.

Enumerator

ALPM_DEP_MOD_ANY
    No version constraint.

ALPM_DEP_MOD_EQ
    Test version equality (package=x.y.z)

ALPM_DEP_MOD_GE
    Test for at least a version (package>=x.y.z)

ALPM_DEP_MOD_LE
    Test for at most a version (package<=x.y.z)

ALPM_DEP_MOD_GT
    Test for greater than some version (package>x.y.z)

ALPM_DEP_MOD_LT
    Test for less than some version (package<x.y.z)

  enum _alpm_event_type_t

Type of events.

Enumerator

ALPM_EVENT_CHECKDEPS_START
    Dependencies will be computed for a package.

ALPM_EVENT_CHECKDEPS_DONE
    Dependencies were computed for a package.

ALPM_EVENT_FILECONFLICTS_START
    File conflicts will be computed for a package.

ALPM_EVENT_FILECONFLICTS_DONE
    File conflicts were computed for a package.

ALPM_EVENT_RESOLVEDEPS_START
    Dependencies will be resolved for target package.

ALPM_EVENT_RESOLVEDEPS_DONE
    Dependencies were resolved for target package.

ALPM_EVENT_INTERCONFLICTS_START
    Inter-conflicts will be checked for target package.

ALPM_EVENT_INTERCONFLICTS_DONE
    Inter-conflicts were checked for target package.

ALPM_EVENT_TRANSACTION_START
    Processing the package transaction is starting.

ALPM_EVENT_TRANSACTION_DONE
    Processing the package transaction is finished.

ALPM_EVENT_PACKAGE_OPERATION_START
    Package will be installed/upgraded/downgraded/re-installed/removed; See alpm_event_package_operation_t for arguments.

ALPM_EVENT_PACKAGE_OPERATION_DONE
    Package was installed/upgraded/downgraded/re-installed/removed; See alpm_event_package_operation_t for arguments.

ALPM_EVENT_INTEGRITY_START
    Target package's integrity will be checked.

ALPM_EVENT_INTEGRITY_DONE
    Target package's integrity was checked.

ALPM_EVENT_LOAD_START
    Target package will be loaded.

ALPM_EVENT_LOAD_DONE
    Target package is finished loading.

ALPM_EVENT_DELTA_INTEGRITY_START
    Target delta's integrity will be checked.

ALPM_EVENT_DELTA_INTEGRITY_DONE
    Target delta's integrity was checked.

ALPM_EVENT_DELTA_PATCHES_START
    Deltas will be applied to packages.

ALPM_EVENT_DELTA_PATCHES_DONE
    Deltas were applied to packages.

ALPM_EVENT_DELTA_PATCH_START
    Delta patch will be applied to target package; See alpm_event_delta_patch_t for arguments.

ALPM_EVENT_DELTA_PATCH_DONE
    Delta patch was applied to target package.

ALPM_EVENT_DELTA_PATCH_FAILED
    Delta patch failed to apply to target package.

ALPM_EVENT_SCRIPTLET_INFO
    Scriptlet has printed information; See alpm_event_scriptlet_info_t for arguments.

ALPM_EVENT_RETRIEVE_START
    Files will be downloaded from a repository.

ALPM_EVENT_RETRIEVE_DONE
    Files were downloaded from a repository.

ALPM_EVENT_RETRIEVE_FAILED
    Not all files were successfully downloaded from a repository.

ALPM_EVENT_PKGDOWNLOAD_START
    A file will be downloaded from a repository; See alpm_event_pkgdownload_t for arguments.

ALPM_EVENT_PKGDOWNLOAD_DONE
    A file was downloaded from a repository; See alpm_event_pkgdownload_t for arguments.

ALPM_EVENT_PKGDOWNLOAD_FAILED
    A file failed to be downloaded from a repository; See alpm_event_pkgdownload_t for arguments.

ALPM_EVENT_DISKSPACE_START
    Disk space usage will be computed for a package.

ALPM_EVENT_DISKSPACE_DONE
    Disk space usage was computed for a package.

ALPM_EVENT_OPTDEP_REMOVAL
    An optdepend for another package is being removed; See alpm_event_optdep_removal_t for arguments.

ALPM_EVENT_DATABASE_MISSING
    A configured repository database is missing; See alpm_event_database_missing_t for arguments.

ALPM_EVENT_KEYRING_START
    Checking keys used to create signatures are in keyring.

ALPM_EVENT_KEYRING_DONE
    Keyring checking is finished.

ALPM_EVENT_KEY_DOWNLOAD_START
    Downloading missing keys into keyring.

ALPM_EVENT_KEY_DOWNLOAD_DONE
    Key downloading is finished.

ALPM_EVENT_PACNEW_CREATED
    A .pacnew file was created; See alpm_event_pacnew_created_t for arguments.

ALPM_EVENT_PACSAVE_CREATED
    A .pacsave file was created; See alpm_event_pacsave_created_t for arguments.

ALPM_EVENT_HOOK_START
    Processing hooks will be started.

ALPM_EVENT_HOOK_DONE
    Processing hooks is finished.

ALPM_EVENT_HOOK_RUN_START
    A hook is starting.

ALPM_EVENT_HOOK_RUN_DONE
    A hook has finnished runnning.

  enum _alpm_fileconflicttype_t

File conflict type. Whether the conflict results from a file existing on the filesystem, or with another target in the transaction.

  enum _alpm_loglevel_t

Logging Levels.

  enum _alpm_package_operation_t

Enumerator

ALPM_PACKAGE_INSTALL
    Package (to be) installed. (No oldpkg)

ALPM_PACKAGE_UPGRADE
    Package (to be) upgraded.

ALPM_PACKAGE_REINSTALL
    Package (to be) re-installed.

ALPM_PACKAGE_DOWNGRADE
    Package (to be) downgraded.

ALPM_PACKAGE_REMOVE
    Package (to be) removed. (No newpkg)

  enum _alpm_pkgfrom_t

Location a package object was loaded from.

  enum _alpm_pkgreason_t

Package install reasons.

Enumerator

ALPM_PKG_REASON_EXPLICIT
    Explicitly requested by the user.

ALPM_PKG_REASON_DEPEND
    Installed as a dependency for another package.

  enum _alpm_pkgvalidation_t

Method used to validate a package.

  enum _alpm_progress_t

Progress.

  enum _alpm_question_type_t

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.

  enum _alpm_siglevel_t

PGP signature verification options.

  enum _alpm_sigstatus_t

PGP signature verification status return codes.

  enum _alpm_sigvalidity_t

PGP signature verification status return codes.

Function Documentation

  int alpm_add_pkg (alpm_handle_t * handle, alpm_pkg_t * pkg)

Add a package to the transaction. If the package was loaded by alpm_pkg_load(), it will be freed upon alpm_trans_release() invocation.

Parameters:
    handle the context handle
    pkg the package to add

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

References ALPM_EVENT_PACKAGE_OPERATION_DONE, ALPM_EVENT_PACKAGE_OPERATION_START, ALPM_EVENT_PACNEW_CREATED, alpm_filelist_contains(), alpm_list_add(), alpm_list_count(), alpm_logaction(), ALPM_PACKAGE_DOWNGRADE, ALPM_PACKAGE_INSTALL, ALPM_PACKAGE_REINSTALL, ALPM_PACKAGE_UPGRADE, alpm_pkg_find(), alpm_pkg_get_reason(), alpm_pkg_has_scriptlet(), ALPM_PKG_REASON_DEPEND, ALPM_PKG_REASON_EXPLICIT, ALPM_TRANS_FLAG_ALLDEPS, ALPM_TRANS_FLAG_ALLEXPLICIT, ALPM_TRANS_FLAG_DBONLY, ALPM_TRANS_FLAG_DOWNLOADONLY, ALPM_TRANS_FLAG_NEEDED, ALPM_TRANS_FLAG_NOSCRIPTLET, __alpm_list_t::data, __alpm_list_t::next, _alpm_event_package_operation_t::operation, and _alpm_event_pacnew_created_t::type.

  int alpm_db_check_pgp_signature (alpm_db_t * db, alpm_siglist_t * siglist)

Check the PGP signature for the given database.

Parameters:
    db the database to check
    siglist a pointer to storage for signature results

Returns:
    a int value : 0 (valid), 1 (invalid), -1 (an error occurred)

  int alpm_decode_signature (const char * base64_data, unsigned char ** data, size_t * data_len)

Decode a loaded signature in base64 form.

Parameters:
    base64_data the signature to attempt to decode
    data the decoded data; must be freed by the caller
    data_len the length of the returned data

Returns:
    0 on success, -1 on failure to properly decode

References alpm_list_add(), alpm_list_find_str(), alpm_list_free(), alpm_siglist_cleanup(), base64_decode(), __alpm_list_t::data, _alpm_question_import_key_t::import, __alpm_list_t::next, and _alpm_question_import_key_t::type.

Referenced by alpm_pkg_download_size().

  int alpm_extract_keyid (alpm_handle_t * handle, const char * identifier, const unsigned char * sig, const size_t len, alpm_list_t ** keys)

Extract the Issuer Key ID from a signature.

Parameters:
    sig PGP signature
    len length of signature
    keys a pointer to storage for key IDs

Returns:
    0 on success, -1 on error

References alpm_list_add().

Referenced by alpm_pkg_download_size(), and alpm_pkg_load().

  char* alpm_fetch_pkgurl (alpm_handle_t * handle, const char * url)

Fetch a remote pkg.

Parameters:
    handle the context handle
    url URL of the package to download

Returns:
    the downloaded filepath on success, NULL on error

  alpm_file_t* alpm_filelist_contains (alpm_filelist_t * filelist, const char * path)

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.

Parameters:
    filelist a pointer to a package filelist
    path the path to search for in the package

Returns:
    a pointer to the matching file or NULL if not found

Referenced by alpm_add_pkg(), alpm_checkconflicts(), and alpm_remove_pkg().

  alpm_list_t* alpm_find_group_pkgs (alpm_list_t * dbs, const char * name)

Find group members across a list of databases. If a member exists in several databases, only the first database is used. IgnorePkg is also handled.

Parameters:
    dbs the list of alpm_db_t *
    name the name of the group

Returns:
    the list of alpm_pkg_t * (caller is responsible for alpm_list_free)

References alpm_checkdeps(), alpm_db_get_group(), alpm_db_get_pkg(), alpm_dep_free(), alpm_dep_from_string(), ALPM_EVENT_INTERCONFLICTS_DONE, ALPM_EVENT_INTERCONFLICTS_START, ALPM_EVENT_RESOLVEDEPS_DONE, ALPM_EVENT_RESOLVEDEPS_START, alpm_list_add(), alpm_list_copy(), alpm_list_diff(), alpm_list_free(), alpm_list_free_inner(), alpm_list_remove(), alpm_pkg_find(), ALPM_PKG_REASON_DEPEND, alpm_pkg_should_ignore(), ALPM_TRANS_FLAG_NOCONFLICTS, ALPM_TRANS_FLAG_NODEPS, __alpm_list_t::data, _alpm_question_install_ignorepkg_t::install, __alpm_list_t::next, _alpm_group_t::packages, _alpm_question_conflict_t::remove, _alpm_question_remove_pkgs_t::skip, _alpm_question_install_ignorepkg_t::type, _alpm_question_conflict_t::type, and _alpm_question_remove_pkgs_t::type.

  int alpm_pkg_check_pgp_signature (alpm_pkg_t * pkg, alpm_siglist_t * siglist)

Check the PGP signature for the given package file.

Parameters:
    pkg the package to check
    siglist a pointer to storage for signature results

Returns:
    a int value : 0 (valid), 1 (invalid), -1 (an error occurred)

  int alpm_remove_pkg (alpm_handle_t * handle, alpm_pkg_t * pkg)

Add a package removal action to the transaction.

Parameters:
    handle the context handle
    pkg the package to uninstall

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

Parameters:
    handle the context handle
    pkg the package to uninstall

Returns:
    0 on success, -1 on error

References alpm_checkdeps(), ALPM_EVENT_CHECKDEPS_DONE, ALPM_EVENT_CHECKDEPS_START, ALPM_EVENT_OPTDEP_REMOVAL, ALPM_EVENT_PACKAGE_OPERATION_DONE, ALPM_EVENT_PACKAGE_OPERATION_START, ALPM_EVENT_PACSAVE_CREATED, alpm_filelist_contains(), alpm_list_add(), alpm_list_count(), alpm_list_find_str(), alpm_list_free(), alpm_list_free_inner(), alpm_list_next(), alpm_list_remove(), alpm_logaction(), ALPM_PACKAGE_REMOVE, alpm_pkg_find(), alpm_pkg_get_files(), alpm_pkg_get_optdepends(), alpm_pkg_has_scriptlet(), ALPM_TRANS_FLAG_CASCADE, ALPM_TRANS_FLAG_DBONLY, ALPM_TRANS_FLAG_NODEPS, ALPM_TRANS_FLAG_NOSAVE, ALPM_TRANS_FLAG_NOSCRIPTLET, ALPM_TRANS_FLAG_RECURSE, ALPM_TRANS_FLAG_RECURSEALL, ALPM_TRANS_FLAG_UNNEEDED, __alpm_list_t::data, __alpm_list_t::next, _alpm_event_package_operation_t::type, _alpm_event_optdep_removal_t::type, and _alpm_event_pacsave_created_t::type.

  int alpm_siglist_cleanup (alpm_siglist_t * siglist)

Clean up and free a signature result list. Note that this does not free the siglist object itself in case that was allocated on the stack; this is the responsibility of the caller.

Parameters:
    siglist a pointer to storage for signature results

Returns:
    0 on success, -1 on error

Referenced by alpm_decode_signature(), and alpm_pkg_download_size().

  alpm_pkg_t* alpm_sync_newversion (alpm_pkg_t * pkg, alpm_list_t * dbs_sync)

Check for new version of pkg in sync repos (only the first occurrence is considered in sync)

References alpm_list_add(), alpm_pkg_find(), alpm_pkg_get_db(), alpm_pkg_get_reason(), alpm_pkg_get_replaces(), ALPM_PKG_REASON_EXPLICIT, alpm_pkg_should_ignore(), __alpm_list_t::data, __alpm_list_t::next, _alpm_question_replace_t::replace, and _alpm_question_replace_t::type.

  int alpm_sync_sysupgrade (alpm_handle_t * handle, int enable_downgrade)

Search for packages to upgrade and add them to the transaction.

Parameters:
    handle the context handle
    enable_downgrade allow downgrading of packages if the remote version is lower

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

References alpm_list_add(), alpm_list_join(), alpm_pkg_find(), __alpm_list_t::data, and __alpm_list_t::next.

Author

Generated automatically by Doxygen for libalpm from the source code.