#include "config.h"#include <stdlib.h>#include <stdio.h>#include <fcntl.h>#include <string.h>#include <unistd.h>#include <time.h>#include <dirent.h>#include "sync.h"#include "alpm_list.h"#include "log.h"#include "error.h"#include "package.h"#include "db.h"#include "cache.h"#include "deps.h"#include "conflict.h"#include "trans.h"#include "util.h"#include "handle.h"#include "alpm.h"#include "server.h"#include "delta.h"

Go to the source code of this file.
Functions | |
| pmsyncpkg_t * | _alpm_sync_new (int type, pmpkg_t *spkg, void *data) |
| void | _alpm_sync_free (pmsyncpkg_t *sync) |
| int | alpm_sync_sysupgrade (pmdb_t *db_local, alpm_list_t *dbs_sync, alpm_list_t **syncpkgs) |
| int | _alpm_sync_sysupgrade (pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync, alpm_list_t **syncpkgs) |
| int | _alpm_sync_addtarget (pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync, char *name) |
| int | _alpm_sync_prepare (pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync, alpm_list_t **data) |
| unsigned long | alpm_pkg_download_size (pmpkg_t *newpkg, pmdb_t *db_local) |
| int | _alpm_sync_commit (pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) |
| pmsyncpkg_t * | _alpm_sync_find (alpm_list_t *syncpkgs, const char *pkgname) |
| pmsynctype_t | alpm_sync_get_type (const pmsyncpkg_t *sync) |
| pmpkg_t * | alpm_sync_get_pkg (const pmsyncpkg_t *sync) |
| void * | alpm_sync_get_data (const pmsyncpkg_t *sync) |
| int _alpm_sync_addtarget | ( | pmtrans_t * | trans, | |
| pmdb_t * | db_local, | |||
| alpm_list_t * | dbs_sync, | |||
| char * | name | |||
| ) |
Definition at line 258 of file lib/libalpm/sync.c.
References _, _alpm_db_get_pkgfromcache(), _alpm_log(), _alpm_pkg_compare_versions(), _alpm_pkg_should_ignore(), _alpm_sync_find(), _alpm_sync_new(), alpm_list_add(), ALPM_LOG_FUNC, alpm_pkg_get_name(), alpm_pkg_get_version(), ASSERT, __alpm_list_t::data, __pmtrans_t::flags, FREE, __alpm_list_t::next, __pmtrans_t::packages, PM_ERR_DB_NULL, PM_ERR_MEMORY, PM_ERR_PKG_NOT_FOUND, PM_ERR_PKG_REPO_NOT_FOUND, PM_ERR_TRANS_NULL, PM_ERR_WRONG_ARGS, pm_errno, PM_LOG_DEBUG, PM_LOG_ERROR, PM_LOG_WARNING, PM_SYNC_TYPE_UPGRADE, PM_TRANS_CONV_INSTALL_IGNOREPKG, PM_TRANS_FLAG_NEEDED, QUESTION, RET_ERR, STRDUP, and __pmdb_t::treename.
Referenced by _alpm_trans_addtarget().


| int _alpm_sync_commit | ( | pmtrans_t * | trans, | |
| pmdb_t * | db_local, | |||
| alpm_list_t ** | data | |||
| ) |
Definition at line 945 of file lib/libalpm/sync.c.
References _, _alpm_downloadfiles(), _alpm_filecache_find(), _alpm_filecache_setup(), _alpm_log(), _alpm_pkg_find(), _alpm_trans_addtarget(), _alpm_trans_commit(), _alpm_trans_free(), _alpm_trans_init(), _alpm_trans_new(), _alpm_trans_prepare(), alpm_db_get_url(), alpm_list_add(), alpm_list_free(), alpm_list_getdata(), alpm_list_last(), alpm_list_next(), ALPM_LOG_FUNC, alpm_pkg_download_size(), alpm_pkg_get_filename(), ASSERT, __pmtrans_t::cb_conv, __pmtrans_t::cb_event, __pmtrans_t::cb_progress, __pmsyncpkg_t::data, __alpm_list_t::data, __pmpkg_t::db, _pmhandle_t::dbs_sync, EVENT, __pmdelta_t::filename, __pmtrans_t::flags, FREE, FREELIST, handle, __pmpkg_t::name, __alpm_list_t::next, __pmpkg_t::origin_data, __pmtrans_t::packages, __pmsyncpkg_t::pkg, PM_ERR_DB_NULL, PM_ERR_DLT_CORRUPTED, PM_ERR_DLT_PATCHFAILED, PM_ERR_MEMORY, PM_ERR_PKG_CORRUPTED, PM_ERR_RETRIEVE, PM_ERR_TRANS_NULL, pm_errno, PM_LOG_DEBUG, PM_LOG_ERROR, PM_LOG_WARNING, PM_PKG_REASON_DEPEND, PM_SYNC_TYPE_DEPEND, PM_SYNC_TYPE_REPLACE, PM_TRANS_EVT_DELTA_INTEGRITY_DONE, PM_TRANS_EVT_DELTA_INTEGRITY_START, PM_TRANS_EVT_DELTA_PATCHES_DONE, PM_TRANS_EVT_DELTA_PATCHES_START, PM_TRANS_EVT_INTEGRITY_DONE, PM_TRANS_EVT_INTEGRITY_START, PM_TRANS_EVT_PRINTURI, PM_TRANS_EVT_RETRIEVE_START, PM_TRANS_FLAG_DOWNLOADONLY, PM_TRANS_FLAG_NODEPS, PM_TRANS_FLAG_PRINTURIS, PM_TRANS_TYPE_REMOVE, PM_TRANS_TYPE_UPGRADE, __pmpkg_t::reason, RET_ERR, __pmdb_t::servers, __pmtrans_t::state, STATE_COMMITING, STATE_DOWNLOADING, __pmdb_t::treename, __pmsyncpkg_t::type, and _pmhandle_t::usedelta.
Referenced by _alpm_trans_commit().


| pmsyncpkg_t* _alpm_sync_find | ( | alpm_list_t * | syncpkgs, | |
| const char * | pkgname | |||
| ) |
Definition at line 1211 of file lib/libalpm/sync.c.
References _alpm_log(), alpm_pkg_get_name(), alpm_pkg_get_version(), alpm_sync_get_pkg(), __alpm_list_t::data, __alpm_list_t::next, and PM_LOG_DEBUG.
Referenced by _alpm_sync_addtarget(), _alpm_sync_prepare(), and _alpm_sync_sysupgrade().


| void _alpm_sync_free | ( | pmsyncpkg_t * | sync | ) |
Definition at line 65 of file lib/libalpm/sync.c.
References alpm_list_free(), ALPM_LOG_FUNC, __pmsyncpkg_t::data, FREE, PM_SYNC_TYPE_REPLACE, and __pmsyncpkg_t::type.
Referenced by _alpm_sync_prepare(), and _alpm_trans_free().


| pmsyncpkg_t* _alpm_sync_new | ( | int | type, | |
| pmpkg_t * | spkg, | |||
| void * | data | |||
| ) |
Definition at line 50 of file lib/libalpm/sync.c.
References ALPM_LOG_FUNC, CALLOC, __pmsyncpkg_t::data, __pmsyncpkg_t::pkg, PM_ERR_MEMORY, RET_ERR, and __pmsyncpkg_t::type.
Referenced by _alpm_sync_addtarget(), _alpm_sync_prepare(), and _alpm_sync_sysupgrade().

| int _alpm_sync_prepare | ( | pmtrans_t * | trans, | |
| pmdb_t * | db_local, | |||
| alpm_list_t * | dbs_sync, | |||
| alpm_list_t ** | data | |||
| ) |
Definition at line 368 of file lib/libalpm/sync.c.
References _, _alpm_checkconflicts(), _alpm_conflict_free(), _alpm_db_get_pkgfromcache(), _alpm_log(), _alpm_pkg_find(), _alpm_prov_cmp(), _alpm_resolvedeps(), _alpm_sortbydeps(), _alpm_sync_find(), _alpm_sync_free(), _alpm_sync_new(), alpm_checkdeps(), alpm_list_add(), alpm_list_find(), alpm_list_find_str(), alpm_list_free(), alpm_list_free_inner(), alpm_list_remove(), ALPM_LOG_FUNC, alpm_pkg_get_name(), alpm_pkg_get_provides(), alpm_pkg_get_version(), ASSERT, __pmsyncpkg_t::data, __alpm_list_t::data, EVENT, __pmtrans_t::flags, FREELIST, __pmpkg_t::name, __alpm_list_t::next, __pmconflict_t::package1, __pmconflict_t::package2, __pmtrans_t::packages, __pmsyncpkg_t::pkg, PM_ERR_CONFLICTING_DEPS, PM_ERR_DB_NULL, PM_ERR_MEMORY, PM_ERR_TRANS_NULL, PM_ERR_UNSATISFIED_DEPS, pm_errno, PM_LOG_DEBUG, PM_LOG_ERROR, PM_SYNC_TYPE_DEPEND, PM_SYNC_TYPE_REPLACE, PM_TRANS_CONV_CONFLICT_PKG, PM_TRANS_EVT_INTERCONFLICTS_DONE, PM_TRANS_EVT_INTERCONFLICTS_START, PM_TRANS_EVT_RESOLVEDEPS_DONE, PM_TRANS_EVT_RESOLVEDEPS_START, PM_TRANS_FLAG_DEPENDSONLY, PM_TRANS_FLAG_NOCONFLICTS, PM_TRANS_FLAG_NODEPS, PM_TRANS_FLAG_PRINTURIS, PM_TRANS_TYPE_ADD, QUESTION, RET_ERR, __pmtrans_t::targets, and __pmsyncpkg_t::type.
Referenced by _alpm_trans_prepare().


| int _alpm_sync_sysupgrade | ( | pmtrans_t * | trans, | |
| pmdb_t * | db_local, | |||
| alpm_list_t * | dbs_sync, | |||
| alpm_list_t ** | syncpkgs | |||
| ) |
Definition at line 183 of file lib/libalpm/sync.c.
References _, _alpm_db_get_pkgcache(), _alpm_db_get_pkgfromcache(), _alpm_log(), _alpm_pkg_compare_versions(), _alpm_pkg_find(), _alpm_pkg_should_ignore(), _alpm_sync_find(), _alpm_sync_new(), alpm_list_add(), ALPM_LOG_FUNC, alpm_pkg_get_name(), alpm_pkg_get_version(), __pmsyncpkg_t::data, __alpm_list_t::data, __alpm_list_t::next, PM_ERR_MEMORY, pm_errno, PM_LOG_DEBUG, PM_LOG_WARNING, PM_SYNC_TYPE_REPLACE, PM_SYNC_TYPE_UPGRADE, and __pmsyncpkg_t::type.
Referenced by _alpm_trans_sysupgrade(), and alpm_sync_sysupgrade().


Returns the size of the files that will be downloaded to install a package.
| newpkg | the new package to upgrade to | |
| db_local | the local database |
Definition at line 712 of file lib/libalpm/sync.c.
References _alpm_delta_path_size_uncached(), _alpm_filecache_find(), alpm_list_free(), alpm_pkg_get_filename(), alpm_pkg_get_size(), FREE, handle, and _pmhandle_t::usedelta.
Referenced by _alpm_sync_commit(), and display_targets().


| void* alpm_sync_get_data | ( | const pmsyncpkg_t * | sync | ) |
Definition at line 1248 of file lib/libalpm/sync.c.
References ASSERT, and __pmsyncpkg_t::data.
Referenced by display_targets().

| pmpkg_t* alpm_sync_get_pkg | ( | const pmsyncpkg_t * | sync | ) |
Definition at line 1240 of file lib/libalpm/sync.c.
References ASSERT, and __pmsyncpkg_t::pkg.
Referenced by _alpm_sync_find(), and display_targets().

| pmsynctype_t alpm_sync_get_type | ( | const pmsyncpkg_t * | sync | ) |
Definition at line 1232 of file lib/libalpm/sync.c.
References ASSERT, and __pmsyncpkg_t::type.
Referenced by display_targets().

| int alpm_sync_sysupgrade | ( | pmdb_t * | db_local, | |
| alpm_list_t * | dbs_sync, | |||
| alpm_list_t ** | syncpkgs | |||
| ) |
Get a list of upgradable packages on the current system Adds out of date packages to *list.
Definition at line 177 of file lib/libalpm/sync.c.
References _alpm_sync_sysupgrade().

1.5.4