Package Functions

Functions to manipulate libalpm packages. More...

Functions

int alpm_pkg_load (const char *filename, unsigned short full, pmpkg_t **pkg)
int alpm_pkg_free (pmpkg_t *pkg)
int alpm_pkg_checkmd5sum (pmpkg_t *pkg)
int alpm_pkg_vercmp (const char *ver1, const char *ver2)
const char * alpm_pkg_get_filename (pmpkg_t *pkg)
const char * alpm_pkg_get_name (pmpkg_t *pkg)
const char * alpm_pkg_get_version (pmpkg_t *pkg)
const char * alpm_pkg_get_desc (pmpkg_t *pkg)
const char * alpm_pkg_get_url (pmpkg_t *pkg)
time_t alpm_pkg_get_builddate (pmpkg_t *pkg)
time_t alpm_pkg_get_installdate (pmpkg_t *pkg)
const char * alpm_pkg_get_packager (pmpkg_t *pkg)
const char * alpm_pkg_get_md5sum (pmpkg_t *pkg)
const char * alpm_pkg_get_arch (pmpkg_t *pkg)
unsigned long alpm_pkg_get_size (pmpkg_t *pkg)
unsigned long alpm_pkg_get_isize (pmpkg_t *pkg)
pmpkgreason_t alpm_pkg_get_reason (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_licenses (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_groups (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_depends (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_optdepends (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_conflicts (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_provides (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_deltas (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_replaces (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_files (pmpkg_t *pkg)
alpm_list_talpm_pkg_get_backup (pmpkg_t *pkg)
void * alpm_pkg_changelog_open (pmpkg_t *pkg)
size_t alpm_pkg_changelog_read (void *ptr, size_t size, const pmpkg_t *pkg, const void *fp)
int alpm_pkg_changelog_close (const pmpkg_t *pkg, void *fp)
unsigned short alpm_pkg_has_scriptlet (pmpkg_t *pkg)
alpm_list_talpm_pkg_compute_requiredby (pmpkg_t *pkg)
 Compute the packages requiring a given package.

Detailed Description

Functions to manipulate libalpm packages.


Function Documentation

int alpm_pkg_changelog_close ( const pmpkg_t pkg,
void *  fp 
)

Close a package changelog for reading. Similar to fclose in functionality, except that the 'file stream' could really be from an archive as well as from the database.

Parameters:
pkg the package that the changelog was read from
fp a 'file stream' to the package changelog
Returns:
whether closing the package changelog stream was successful

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

References __pmpkg_t::origin, PKG_FROM_CACHE, and PKG_FROM_FILE.

Referenced by dump_pkg_changelog().

Here is the caller graph for this function:

void* alpm_pkg_changelog_open ( pmpkg_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

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

References alpm_db_get_name(), ALPM_LOG_FUNC, alpm_option_get_dbpath(), alpm_pkg_get_name(), alpm_pkg_get_version(), ASSERT, _pmhandle_t::db_local, __pmpkg_t::file, handle, __pmpkg_t::origin, __pmpkg_t::origin_data, PKG_FROM_CACHE, PKG_FROM_FILE, PM_ERR_LIBARCHIVE_ERROR, PM_ERR_PKG_OPEN, and RET_ERR.

Referenced by dump_pkg_changelog().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t alpm_pkg_changelog_read ( void *  ptr,
size_t  size,
const pmpkg_t pkg,
const 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.

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

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

References __pmpkg_t::origin, PKG_FROM_CACHE, and PKG_FROM_FILE.

Referenced by dump_pkg_changelog().

Here is the caller graph for this function:

int alpm_pkg_checkmd5sum ( pmpkg_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)

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

References _, _alpm_filecache_find(), _alpm_log(), alpm_get_md5sum(), ALPM_LOG_FUNC, alpm_pkg_get_filename(), alpm_pkg_get_md5sum(), alpm_pkg_get_name(), alpm_pkg_get_version(), ASSERT, __pmpkg_t::db, _pmhandle_t::db_local, FREE, handle, __pmpkg_t::origin, __pmpkg_t::origin_data, PKG_FROM_CACHE, PM_ERR_NOT_A_FILE, PM_ERR_PKG_INVALID, PM_ERR_WRONG_ARGS, pm_errno, PM_LOG_DEBUG, PM_LOG_ERROR, and RET_ERR.

Here is the call graph for this function:

alpm_list_t* alpm_pkg_compute_requiredby ( pmpkg_t pkg  ) 

Compute the packages requiring a given package.

Parameters:
pkg a package
Returns:
the list of packages requiring pkg
A depends on B through n depends <=> A listed in B's requiredby n times n == 0 or 1 in almost all cases

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

References _alpm_db_get_pkgcache(), _alpm_log(), alpm_depcmp(), alpm_list_add(), alpm_option_get_localdb(), alpm_pkg_get_depends(), alpm_pkg_get_name(), __alpm_list_t::data, __pmpkg_t::name, __alpm_list_t::next, and PM_LOG_DEBUG.

Referenced by dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

int alpm_pkg_free ( pmpkg_t pkg  ) 

Free a package.

Parameters:
pkg package pointer to free
Returns:
0 on success, -1 on error (pm_errno is set accordingly)

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

References _alpm_log(), _alpm_pkg_free(), ASSERT, __pmpkg_t::origin, PKG_FROM_CACHE, PM_ERR_WRONG_ARGS, PM_LOG_FUNCTION, and RET_ERR.

Referenced by _alpm_db_scan(), main(), and pacman_query().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* alpm_pkg_get_arch ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, __pmpkg_t::arch, ASSERT, __pmpkg_t::db, handle, __pmpkg_t::infolevel, INFRQ_DESC, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* alpm_pkg_get_backup ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::backup, __pmpkg_t::db, _pmhandle_t::db_local, handle, __pmpkg_t::infolevel, INFRQ_FILES, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by _alpm_pkg_dup(), and dump_pkg_backups().

Here is the call graph for this function:

Here is the caller graph for this function:

time_t alpm_pkg_get_builddate ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::builddate, __pmpkg_t::db, handle, __pmpkg_t::infolevel, INFRQ_DESC, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* alpm_pkg_get_conflicts ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::conflicts, __pmpkg_t::db, handle, __pmpkg_t::infolevel, INFRQ_DEPENDS, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by _alpm_pkg_dup(), and dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* alpm_pkg_get_deltas ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, __pmpkg_t::deltas, handle, __pmpkg_t::infolevel, INFRQ_DELTAS, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by _alpm_pkg_dup().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* alpm_pkg_get_depends ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, __pmpkg_t::depends, handle, __pmpkg_t::infolevel, INFRQ_DEPENDS, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by _alpm_pkg_dup(), _alpm_recursedeps(), alpm_checkdeps(), alpm_pkg_compute_requiredby(), and dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* alpm_pkg_get_desc ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, __pmpkg_t::desc, handle, __pmpkg_t::infolevel, INFRQ_DESC, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by _alpm_db_search(), and dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* alpm_pkg_get_filename ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, __pmpkg_t::arch, ASSERT, __pmpkg_t::db, __pmpkg_t::filename, handle, __pmpkg_t::infolevel, INFRQ_DESC, __pmpkg_t::name, __pmpkg_t::origin, __pmpkg_t::origin_data, PKG_FROM_CACHE, PM_ERR_MEMORY, RET_ERR, STRDUP, and __pmpkg_t::version.

Referenced by _alpm_sync_commit(), alpm_pkg_checkmd5sum(), alpm_pkg_download_size(), and dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* alpm_pkg_get_files ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, _pmhandle_t::db_local, __pmpkg_t::files, handle, __pmpkg_t::infolevel, INFRQ_FILES, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by _alpm_db_find_fileconflicts(), _alpm_pkg_dup(), _alpm_remove_commit(), and dump_pkg_files().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* alpm_pkg_get_groups ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, __pmpkg_t::groups, handle, __pmpkg_t::infolevel, INFRQ_DESC, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by _alpm_db_load_grpcache(), _alpm_pkg_dup(), _alpm_pkg_should_ignore(), and dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

time_t alpm_pkg_get_installdate ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, handle, __pmpkg_t::infolevel, INFRQ_DESC, __pmpkg_t::installdate, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long alpm_pkg_get_isize ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, handle, __pmpkg_t::infolevel, INFRQ_DESC, __pmpkg_t::isize, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by display_targets(), and dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* alpm_pkg_get_licenses ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, handle, __pmpkg_t::infolevel, INFRQ_DESC, __pmpkg_t::licenses, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by _alpm_pkg_dup(), and dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* alpm_pkg_get_md5sum ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, handle, __pmpkg_t::infolevel, INFRQ_DESC, __pmpkg_t::md5sum, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by alpm_pkg_checkmd5sum(), and dump_pkg_full().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* alpm_pkg_get_name ( pmpkg_t pkg  ) 

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

References _alpm_db_read(), ALPM_LOG_FUNC, ASSERT, __pmpkg_t::db, handle, __pmpkg_t::infolevel, INFRQ_BASE, __pmpkg_t::name, __pmpkg_t::origin, __pmpkg_t::origin_data, and PKG_FROM_CACHE.

Referenced by _alpm_add_loadtarget(), _alpm_db_add_pkgincache(), _alpm_db_find_fileconflicts(), _alpm_db_load_grpcache(), _alpm_db_load_pkgcache(), _alpm_db_remove_pkgfromcache(), _alpm_db_search(), _alpm_pkg_cmp(), _alpm_pkg_compare_versions(),