package.c File Reference

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <locale.h>
#include <archive.h>
#include <archive_entry.h>
#include "package.h"
#include "alpm_list.h"
#include "log.h"
#include "util.h"
#include "error.h"
#include "db.h"
#include "cache.h"
#include "delta.h"
#include "handle.h"
#include "deps.h"

Include dependency graph for lib/libalpm/package.c:

Go to the source code of this file.

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.
int _alpm_versioncmp (const char *a, const char *b)
pmpkg_t_alpm_pkg_new (const char *name, const char *version)
pmpkg_t_alpm_pkg_dup (pmpkg_t *pkg)
void _alpm_pkg_free (pmpkg_t *pkg)
int _alpm_pkg_compare_versions (pmpkg_t *local_pkg, pmpkg_t *pkg)
int _alpm_pkg_cmp (const void *p1, const void *p2)
pmpkg_t_alpm_pkg_load (const char *pkgfile, unsigned short full)
pmpkg_t_alpm_pkg_find (const char *needle, alpm_list_t *haystack)
int _alpm_pkg_should_ignore (pmpkg_t *pkg)


Function Documentation

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

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

References alpm_pkg_get_name().

Referenced by _alpm_db_add_pkgincache(), _alpm_db_load_pkgcache(), _alpm_db_remove_pkgfromcache(), _alpm_outerconflicts(), and alpm_checkdeps().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_pkg_compare_versions ( pmpkg_t local_pkg,
pmpkg_t pkg 
)

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

References _, _alpm_db_read(), _alpm_log(), _alpm_versioncmp(), alpm_db_get_name(), ALPM_LOG_FUNC, alpm_pkg_get_name(), alpm_pkg_get_version(), __pmpkg_t::db, __pmpkg_t::force, INFRQ_DESC, __pmpkg_t::origin, __pmpkg_t::origin_data, PKG_FROM_CACHE, and PM_LOG_WARNING.

Referenced by _alpm_sync_addtarget(), and _alpm_sync_sysupgrade().

Here is the call graph for this function:

Here is the caller graph for this function:

pmpkg_t* _alpm_pkg_dup ( pmpkg_t pkg  ) 

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

References _alpm_dep_dup(), alpm_list_add(), alpm_list_copy_data(), alpm_list_next(), alpm_list_strdup(), ALPM_LOG_FUNC, alpm_pkg_get_backup(), alpm_pkg_get_conflicts(), alpm_pkg_get_deltas(), alpm_pkg_get_depends(), alpm_pkg_get_files(), alpm_pkg_get_groups(), alpm_pkg_get_licenses(), alpm_pkg_get_optdepends(), alpm_pkg_get_provides(), alpm_pkg_get_replaces(), __pmpkg_t::arch, __pmpkg_t::backup, __pmpkg_t::builddate, CALLOC, __pmpkg_t::conflicts, __alpm_list_t::data, __pmpkg_t::db, __pmpkg_t::deltas, __pmpkg_t::depends, __pmpkg_t::desc, __pmpkg_t::file, __pmpkg_t::filename, __pmpkg_t::files, __pmpkg_t::force, __pmpkg_t::groups, __pmpkg_t::infolevel, __pmpkg_t::installdate, __pmpkg_t::isize, __pmpkg_t::licenses, __pmpkg_t::md5sum, __pmpkg_t::name, __pmpkg_t::optdepends, __pmpkg_t::origin, __pmpkg_t::origin_data, __pmpkg_t::packager, PKG_FROM_FILE, PM_ERR_MEMORY, __pmpkg_t::provides, __pmpkg_t::reason, __pmpkg_t::replaces, RET_ERR, __pmpkg_t::scriptlet, __pmpkg_t::size, STRDUP, __pmpkg_t::url, and __pmpkg_t::version.

Referenced by _alpm_db_add_pkgincache(), and _alpm_recursedeps().

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

References ALPM_LOG_FUNC, alpm_pkg_get_name(), __alpm_list_t::data, and __alpm_list_t::next.

Referenced by _alpm_db_get_pkgfromcache(), _alpm_remove_loadtarget(), _alpm_remove_prepare(), _alpm_resolvedeps(), _alpm_sync_commit(), _alpm_sync_prepare(), and _alpm_sync_sysupgrade().

Here is the call graph for this function:

Here is the caller graph for this function:

void _alpm_pkg_free ( pmpkg_t pkg  ) 

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

References _alpm_dep_free(), alpm_list_free(), alpm_list_free_inner(), ALPM_LOG_FUNC, __pmpkg_t::arch, __pmpkg_t::backup, __pmpkg_t::conflicts, __pmpkg_t::deltas, __pmpkg_t::depends, __pmpkg_t::desc, __pmpkg_t::file, __pmpkg_t::filename, __pmpkg_t::files, FREE, FREELIST, __pmpkg_t::groups, __pmpkg_t::licenses, __pmpkg_t::md5sum, __pmpkg_t::name, __pmpkg_t::optdepends, __pmpkg_t::origin, __pmpkg_t::origin_data, __pmpkg_t::packager, PKG_FROM_FILE, __pmpkg_t::provides, __pmpkg_t::replaces, __pmpkg_t::url, and __pmpkg_t::version.

Referenced by _alpm_add_loadtarget(), _alpm_db_free_pkgcache(), _alpm_db_remove_pkgfromcache(), _alpm_db_scan(), _alpm_pkg_load(), _alpm_resolvedeps(), _alpm_trans_free(), and alpm_pkg_free().

Here is the call graph for this function:

Here is the caller graph for this function:

pmpkg_t* _alpm_pkg_load ( const char *  pkgfile,
unsigned short  full 
)

Load a package and create the corresponding pmpkg_t struct.

Parameters:
pkgfile path to the package file
full whether to stop the load after metadata is read or continue through the full archive
Returns:
An information filled pmpkg_t struct

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

References _, _alpm_log(), _alpm_pkg_free(), _alpm_pkg_new(), _alpm_str_cmp(), alpm_list_add(), alpm_list_count(), alpm_list_msort(), ALPM_LOG_FUNC, config, __pmpkg_t::file, __pmpkg_t::files, FREE, FREELIST, __pmpkg_t::infolevel, INFRQ_ALL, INFRQ_BASE, INFRQ_DEPENDS, INFRQ_DESC, __pmpkg_t::name, __pmpkg_t::origin, __pmpkg_t::origin_data, PKG_FROM_FILE, PM_ERR_LIBARCHIVE_ERROR, PM_ERR_MEMORY, PM_ERR_PKG_INVALID, PM_ERR_PKG_OPEN, PM_ERR_WRONG_ARGS, pm_errno, PM_LOG_DEBUG, PM_LOG_ERROR, RET_ERR, __pmpkg_t::scriptlet, __pmpkg_t::size, and __pmpkg_t::version.

Referenced by _alpm_add_loadtarget(), and alpm_pkg_load().

Here is the call graph for this function:

Here is the caller graph for this function:

pmpkg_t* _alpm_pkg_new ( const char *  name,
const char *  version 
)

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

References ALPM_LOG_FUNC, CALLOC, __pmpkg_t::name, PM_ERR_MEMORY, RET_ERR, STRDUP, and __pmpkg_t::version.

Referenced by _alpm_db_scan(), _alpm_pkg_load(), and _alpm_resolvedeps().

Here is the caller graph for this function:

int _alpm_pkg_should_ignore ( pmpkg_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 IgnoreGrp.

Parameters:
pkg the package to test
Returns:
1 if the package should be ignored, 0 otherwise

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

References alpm_list_find_str(), alpm_list_getdata(), alpm_list_next(), alpm_pkg_get_groups(), alpm_pkg_get_name(), handle, _pmhandle_t::ignoregrp, and _pmhandle_t::ignorepkg.

Referenced by _alpm_resolvedeps(), _alpm_sync_addtarget(), and _alpm_sync_sysupgrade().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_versioncmp ( const char *  a,
const char *  b 
)

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

References _alpm_versioncmp(), ALPM_LOG_FUNC, and strverscmp().

Referenced by _alpm_add_loadtarget(), _alpm_pkg_compare_versions(), _alpm_versioncmp(), and alpm_pkg_vercmp().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Mon Jan 14 23:57:50 2008 for libalpm by  doxygen 1.5.4