libalpm
Arch Linux Package Manager Library
Data Structures | Functions | Variables
package.h File Reference
#include <sys/types.h>
#include "alpm.h"
#include "backup.h"
#include "db.h"
#include "signing.h"
Include dependency graph for lib/libalpm/package.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pkg_operations
 Package operations struct. More...
struct  __alpm_pkg_t

Functions

alpm_file_t_alpm_file_copy (alpm_file_t *dest, const alpm_file_t *src)
int _alpm_files_cmp (const void *f1, const void *f2)
alpm_pkg_t_alpm_pkg_new (void)
int _alpm_pkg_dup (alpm_pkg_t *pkg, alpm_pkg_t **new_ptr)
 Duplicate a package data struct.
void _alpm_pkg_free (alpm_pkg_t *pkg)
void _alpm_pkg_free_trans (alpm_pkg_t *pkg)
int _alpm_pkg_validate_internal (alpm_handle_t *handle, const char *pkgfile, alpm_pkg_t *syncpkg, alpm_siglevel_t level, alpm_siglist_t **sigdata)
 Validate a package.
alpm_pkg_t_alpm_pkg_load_internal (alpm_handle_t *handle, const char *pkgfile, int full)
 Load a package and create the corresponding alpm_pkg_t struct.
int _alpm_pkg_cmp (const void *p1, const void *p2)
int _alpm_pkg_compare_versions (alpm_pkg_t *local_pkg, alpm_pkg_t *pkg)
alpm_pkg_t_alpm_pkg_find (alpm_list_t *haystack, const char *needle)
int _alpm_pkg_should_ignore (alpm_handle_t *handle, alpm_pkg_t *pkg)
 Test if a package should be ignored.

Variables

struct pkg_operations default_pkg_ops
 The standard package operations struct.

Function Documentation

alpm_file_t* _alpm_file_copy ( alpm_file_t dest,
const alpm_file_t src 
)

Definition at line 434 of file lib/libalpm/package.c.

References _alpm_file_t::mode, _alpm_file_t::name, _alpm_file_t::size, and STRDUP.

Referenced by _alpm_pkg_dup().

Here is the caller graph for this function:

int _alpm_files_cmp ( const void *  f1,
const void *  f2 
)

Definition at line 446 of file lib/libalpm/package.c.

References _alpm_file_t::name.

int _alpm_pkg_cmp ( const void *  p1,
const void *  p2 
)

Definition at line 642 of file lib/libalpm/package.c.

References __alpm_pkg_t::name.

Referenced by _alpm_outerconflicts(), and _alpm_sync_prepare().

Here is the caller graph for this function:

int _alpm_pkg_compare_versions ( alpm_pkg_t local_pkg,
alpm_pkg_t pkg 
)

Definition at line 635 of file lib/libalpm/package.c.

References alpm_pkg_vercmp(), and __alpm_pkg_t::version.

Referenced by _alpm_resolvedeps(), alpm_add_pkg(), and alpm_sync_newversion().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_pkg_dup ( alpm_pkg_t pkg,
alpm_pkg_t **  new_ptr 
)

Duplicate a package data struct.

Parameters:
pkgthe package to duplicate
new_ptrlocation to store duplicated package pointer
Returns:
0 on success, -1 on fatal error, 1 on non-fatal error

Definition at line 477 of file lib/libalpm/package.c.

References _, _alpm_backup_dup(), _alpm_delta_dup(), _alpm_file_copy(), _alpm_log(), _alpm_pkg_free(), ALPM_ERR_MEMORY, ALPM_ERR_PKG_INVALID, ALPM_ERR_WRONG_ARGS, alpm_list_add(), alpm_list_strdup(), ALPM_LOG_WARNING, __alpm_pkg_t::arch, __alpm_pkg_t::backup, __alpm_pkg_t::builddate, CALLOC, __alpm_pkg_t::conflicts, _alpm_filelist_t::count, __alpm_list_t::data, __alpm_pkg_t::db, __alpm_pkg_t::deltas, __alpm_pkg_t::depends, __alpm_pkg_t::desc, __alpm_pkg_t::file, __alpm_pkg_t::filename, __alpm_pkg_t::files, _alpm_filelist_t::files, pkg_operations::force_load, __alpm_pkg_t::groups, __alpm_pkg_t::handle, __alpm_pkg_t::infolevel, __alpm_pkg_t::installdate, __alpm_pkg_t::isize, __alpm_pkg_t::licenses, MALLOC, __alpm_pkg_t::md5sum, __alpm_pkg_t::name, __alpm_pkg_t::name_hash, __alpm_list_t::next, __alpm_pkg_t::ops, __alpm_pkg_t::optdepends, __alpm_pkg_t::origin, __alpm_pkg_t::origin_data, __alpm_pkg_t::packager, PKG_FROM_FILE, __alpm_handle_t::pm_errno, __alpm_pkg_t::provides, __alpm_pkg_t::reason, __alpm_pkg_t::replaces, RET_ERR, __alpm_pkg_t::scriptlet, __alpm_pkg_t::sha256sum, __alpm_pkg_t::size, STRDUP, __alpm_pkg_t::url, and __alpm_pkg_t::version.

Referenced by _alpm_db_add_pkgincache(), _alpm_recursedeps(), _alpm_sync_prepare(), and alpm_remove_pkg().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_pkg_t* _alpm_pkg_find ( alpm_list_t haystack,
const char *  needle 
)

Definition at line 652 of file lib/libalpm/package.c.

References _alpm_hash_sdbm(), __alpm_list_t::data, __alpm_pkg_t::name, __alpm_pkg_t::name_hash, and __alpm_list_t::next.

Referenced by _alpm_resolvedeps(), _alpm_sync_prepare(), alpm_add_pkg(), alpm_checkdeps(), alpm_find_group_pkgs(), alpm_remove_pkg(), and alpm_sync_sysupgrade().

Here is the call graph for this function:

Here is the caller graph for this function:

void _alpm_pkg_free ( alpm_pkg_t pkg)

Definition at line 619 of file lib/libalpm/package.c.

References _alpm_pkg_free(), alpm_list_free(), __alpm_pkg_t::origin, PKG_FROM_FILE, and __alpm_pkg_t::removes.

Referenced by _alpm_trans_free().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_pkg_t* _alpm_pkg_load_internal ( alpm_handle_t handle,
const char *  pkgfile,
int  full 
)

Definition at line 453 of file lib/libalpm/package.c.

References CALLOC.

Referenced by _alpm_pkg_load_internal().

Here is the caller graph for this function:

int _alpm_pkg_should_ignore ( alpm_handle_t handle,
alpm_pkg_t pkg 
)

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.

Parameters:
handlethe context handle
pkgthe package to test
Returns:
1 if the package should be ignored, 0 otherwise

Definition at line 690 of file lib/libalpm/package.c.

References _alpm_fnmatch(), alpm_list_find(), alpm_pkg_get_groups(), __alpm_list_t::data, __alpm_handle_t::ignoregroup, __alpm_handle_t::ignorepkg, __alpm_pkg_t::name, and __alpm_list_t::next.

Referenced by alpm_find_group_pkgs().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_pkg_validate_internal ( alpm_handle_t handle,
const char *  pkgfile,
alpm_pkg_t syncpkg,
alpm_siglevel_t  level,
alpm_siglist_t **  sigdata 
)

Validate a package.

Parameters:
handlethe context handle
pkgfilepath to the package file
syncpkgpackage object to load verification data from (md5sum, sha256sum, and/or base64 signature)
levelthe required level of signature verification
sigdatasignature data from the package to pass back
Returns:
0 if package is fully valid, -1 and pm_errno otherwise

Definition at line 307 of file be_package.c.

References _alpm_access(), _alpm_check_pgp_helper(), _alpm_log(), _alpm_sigpath(), _alpm_test_checksum(), ALPM_CSUM_MD5, ALPM_CSUM_SHA256, ALPM_ERR_PKG_INVALID_CHECKSUM, ALPM_ERR_PKG_INVALID_SIG, ALPM_ERR_PKG_NOT_FOUND, ALPM_ERR_WRONG_ARGS, ALPM_LOG_DEBUG, ALPM_SIG_PACKAGE, ALPM_SIG_PACKAGE_MARGINAL_OK, ALPM_SIG_PACKAGE_OPTIONAL, ALPM_SIG_PACKAGE_UNKNOWN_OK, __alpm_pkg_t::base64_sig, __alpm_pkg_t::md5sum, __alpm_handle_t::pm_errno, RET_ERR, and __alpm_pkg_t::sha256sum.

Referenced by alpm_pkg_load().

Here is the call graph for this function:

Here is the caller graph for this function: