1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-10 19:45:01 -05:00

Prefix alpm_pkgfrom_t members with ALPM_

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2012-04-01 15:37:19 +10:00 committed by Dan McGee
parent 42d408e0c2
commit 3be02aa27c
7 changed files with 31 additions and 31 deletions

View File

@ -59,9 +59,9 @@ typedef enum _alpm_pkgreason_t {
/** Location a package object was loaded from. */ /** Location a package object was loaded from. */
typedef enum _alpm_pkgfrom_t { typedef enum _alpm_pkgfrom_t {
PKG_FROM_FILE = 1, ALPM_PKG_FROM_FILE = 1,
PKG_FROM_LOCALDB, ALPM_PKG_FROM_LOCALDB,
PKG_FROM_SYNCDB ALPM_PKG_FROM_SYNCDB
} alpm_pkgfrom_t; } alpm_pkgfrom_t;
/** Location a package object was loaded from. */ /** Location a package object was loaded from. */

View File

@ -448,7 +448,7 @@ static int local_db_populate(alpm_db_t *db)
continue; continue;
} }
pkg->origin = PKG_FROM_LOCALDB; pkg->origin = ALPM_PKG_FROM_LOCALDB;
pkg->origin_data.db = db; pkg->origin_data.db = db;
pkg->ops = &local_pkg_ops; pkg->ops = &local_pkg_ops;
pkg->handle = db->handle; pkg->handle = db->handle;
@ -968,7 +968,7 @@ int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info)
int SYMEXPORT alpm_pkg_set_reason(alpm_pkg_t *pkg, alpm_pkgreason_t reason) int SYMEXPORT alpm_pkg_set_reason(alpm_pkg_t *pkg, alpm_pkgreason_t reason)
{ {
ASSERT(pkg != NULL, return -1); ASSERT(pkg != NULL, return -1);
ASSERT(pkg->origin == PKG_FROM_LOCALDB, ASSERT(pkg->origin == ALPM_PKG_FROM_LOCALDB,
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1)); RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
ASSERT(pkg->origin_data.db == pkg->handle->db_local, ASSERT(pkg->origin_data.db == pkg->handle->db_local,
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1)); RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));

View File

@ -521,7 +521,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
CLOSE(fd); CLOSE(fd);
/* internal fields for package struct */ /* internal fields for package struct */
newpkg->origin = PKG_FROM_FILE; newpkg->origin = ALPM_PKG_FROM_FILE;
newpkg->origin_data.file = strdup(pkgfile); newpkg->origin_data.file = strdup(pkgfile);
newpkg->ops = get_file_pkg_ops(); newpkg->ops = get_file_pkg_ops();
newpkg->handle = handle; newpkg->handle = handle;

View File

@ -357,7 +357,7 @@ static alpm_pkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname,
pkg->version = pkgver; pkg->version = pkgver;
pkg->name_hash = pkgname_hash; pkg->name_hash = pkgname_hash;
pkg->origin = PKG_FROM_SYNCDB; pkg->origin = ALPM_PKG_FROM_SYNCDB;
pkg->origin_data.db = db; pkg->origin_data.db = db;
pkg->ops = &default_pkg_ops; pkg->ops = &default_pkg_ops;
pkg->ops->get_validation = _sync_get_validation; pkg->ops->get_validation = _sync_get_validation;

View File

@ -46,7 +46,7 @@ int SYMEXPORT alpm_pkg_free(alpm_pkg_t *pkg)
ASSERT(pkg != NULL, return -1); ASSERT(pkg != NULL, return -1);
/* Only free packages loaded in user space */ /* Only free packages loaded in user space */
if(pkg->origin == PKG_FROM_FILE) { if(pkg->origin == ALPM_PKG_FROM_FILE) {
_alpm_pkg_free(pkg); _alpm_pkg_free(pkg);
} }
@ -62,7 +62,7 @@ int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg)
ASSERT(pkg != NULL, return -1); ASSERT(pkg != NULL, return -1);
pkg->handle->pm_errno = 0; pkg->handle->pm_errno = 0;
/* We only inspect packages from sync repositories */ /* We only inspect packages from sync repositories */
ASSERT(pkg->origin == PKG_FROM_SYNCDB, ASSERT(pkg->origin == ALPM_PKG_FROM_SYNCDB,
RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1)); RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1));
fpath = _alpm_filecache_find(pkg->handle, pkg->filename); fpath = _alpm_filecache_find(pkg->handle, pkg->filename);
@ -351,7 +351,7 @@ alpm_db_t SYMEXPORT *alpm_pkg_get_db(alpm_pkg_t *pkg)
{ {
/* Sanity checks */ /* Sanity checks */
ASSERT(pkg != NULL, return NULL); ASSERT(pkg != NULL, return NULL);
ASSERT(pkg->origin != PKG_FROM_FILE, return NULL); ASSERT(pkg->origin != ALPM_PKG_FROM_FILE, return NULL);
pkg->handle->pm_errno = 0; pkg->handle->pm_errno = 0;
return pkg->origin_data.db; return pkg->origin_data.db;
@ -418,7 +418,7 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(alpm_pkg_t *pkg)
ASSERT(pkg != NULL, return NULL); ASSERT(pkg != NULL, return NULL);
pkg->handle->pm_errno = 0; pkg->handle->pm_errno = 0;
if(pkg->origin == PKG_FROM_FILE) { if(pkg->origin == ALPM_PKG_FROM_FILE) {
/* The sane option; search locally for things that require this. */ /* The sane option; search locally for things that require this. */
find_requiredby(pkg, pkg->handle->db_local, &reqs); find_requiredby(pkg, pkg->handle->db_local, &reqs);
} else { } else {
@ -554,7 +554,7 @@ int _alpm_pkg_dup(alpm_pkg_t *pkg, alpm_pkg_t **new_ptr)
/* internal */ /* internal */
newpkg->infolevel = pkg->infolevel; newpkg->infolevel = pkg->infolevel;
newpkg->origin = pkg->origin; newpkg->origin = pkg->origin;
if(newpkg->origin == PKG_FROM_FILE) { if(newpkg->origin == ALPM_PKG_FROM_FILE) {
newpkg->origin_data.file = strdup(pkg->origin_data.file); newpkg->origin_data.file = strdup(pkg->origin_data.file);
} else { } else {
newpkg->origin_data.db = pkg->origin_data.db; newpkg->origin_data.db = pkg->origin_data.db;
@ -614,15 +614,15 @@ void _alpm_pkg_free(alpm_pkg_t *pkg)
alpm_list_free(pkg->delta_path); alpm_list_free(pkg->delta_path);
alpm_list_free(pkg->removes); alpm_list_free(pkg->removes);
if(pkg->origin == PKG_FROM_FILE) { if(pkg->origin == ALPM_PKG_FROM_FILE) {
FREE(pkg->origin_data.file); FREE(pkg->origin_data.file);
} }
FREE(pkg); FREE(pkg);
} }
/* This function should be used when removing a target from upgrade/sync target list /* This function should be used when removing a target from upgrade/sync target list
* Case 1: If pkg is a loaded package file (PKG_FROM_FILE), it will be freed. * Case 1: If pkg is a loaded package file (ALPM_PKG_FROM_FILE), it will be freed.
* Case 2: If pkg is a pkgcache entry (PKG_FROM_CACHE), it won't be freed, * Case 2: If pkg is a pkgcache entry (ALPM_PKG_FROM_CACHE), it won't be freed,
* only the transaction specific fields of pkg will be freed. * only the transaction specific fields of pkg will be freed.
*/ */
void _alpm_pkg_free_trans(alpm_pkg_t *pkg) void _alpm_pkg_free_trans(alpm_pkg_t *pkg)
@ -631,7 +631,7 @@ void _alpm_pkg_free_trans(alpm_pkg_t *pkg)
return; return;
} }
if(pkg->origin == PKG_FROM_FILE) { if(pkg->origin == ALPM_PKG_FROM_FILE) {
_alpm_pkg_free(pkg); _alpm_pkg_free(pkg);
return; return;
} }

View File

@ -288,7 +288,7 @@ static int compute_download_size(alpm_pkg_t *newpkg)
alpm_handle_t *handle = newpkg->handle; alpm_handle_t *handle = newpkg->handle;
int ret = 0; int ret = 0;
if(newpkg->origin != PKG_FROM_SYNCDB) { if(newpkg->origin != ALPM_PKG_FROM_SYNCDB) {
newpkg->infolevel |= INFRQ_DSIZE; newpkg->infolevel |= INFRQ_DSIZE;
newpkg->download_size = 0; newpkg->download_size = 0;
return 0; return 0;
@ -365,7 +365,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
for(i = trans->add; i; i = i->next) { for(i = trans->add; i; i = i->next) {
alpm_pkg_t *spkg = i->data; alpm_pkg_t *spkg = i->data;
from_sync += (spkg->origin == PKG_FROM_SYNCDB); from_sync += (spkg->origin == ALPM_PKG_FROM_SYNCDB);
} }
/* ensure all sync database are valid if we will be using them */ /* ensure all sync database are valid if we will be using them */
@ -821,7 +821,7 @@ static int find_dl_candidates(alpm_db_t *repo, alpm_list_t **files, alpm_list_t
for(i = handle->trans->add; i; i = i->next) { for(i = handle->trans->add; i; i = i->next) {
alpm_pkg_t *spkg = i->data; alpm_pkg_t *spkg = i->data;
if(spkg->origin != PKG_FROM_FILE && repo == spkg->origin_data.db) { if(spkg->origin != ALPM_PKG_FROM_FILE && repo == spkg->origin_data.db) {
alpm_list_t *delta_path = spkg->delta_path; alpm_list_t *delta_path = spkg->delta_path;
if(!repo->servers) { if(!repo->servers) {
@ -991,7 +991,7 @@ static int check_validity(alpm_handle_t *handle,
PROGRESS(handle, ALPM_PROGRESS_INTEGRITY_START, "", percent, PROGRESS(handle, ALPM_PROGRESS_INTEGRITY_START, "", percent,
total, current); total, current);
if(v.pkg->origin == PKG_FROM_FILE) { if(v.pkg->origin == ALPM_PKG_FROM_FILE) {
continue; /* pkg_load() has been already called, this package is valid */ continue; /* pkg_load() has been already called, this package is valid */
} }
@ -1067,7 +1067,7 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data,
PROGRESS(handle, ALPM_PROGRESS_LOAD_START, "", percent, PROGRESS(handle, ALPM_PROGRESS_LOAD_START, "", percent,
total, current); total, current);
if(spkg->origin == PKG_FROM_FILE) { if(spkg->origin == ALPM_PKG_FROM_FILE) {
continue; /* pkg_load() has been already called, this package is valid */ continue; /* pkg_load() has been already called, this package is valid */
} }
@ -1137,7 +1137,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
* realistically if there are small and huge packages involved */ * realistically if there are small and huge packages involved */
for(i = trans->add; i; i = i->next) { for(i = trans->add; i; i = i->next) {
alpm_pkg_t *spkg = i->data; alpm_pkg_t *spkg = i->data;
if(spkg->origin != PKG_FROM_FILE) { if(spkg->origin != ALPM_PKG_FROM_FILE) {
total_bytes += spkg->size; total_bytes += spkg->size;
} }
total++; total++;

View File

@ -127,7 +127,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
validation = alpm_list_add(validation, _("Unknown")); validation = alpm_list_add(validation, _("Unknown"));
} }
if(extra || from == PKG_FROM_LOCALDB) { if(extra || from == ALPM_PKG_FROM_LOCALDB) {
/* compute this here so we don't get a pause in the middle of output */ /* compute this here so we don't get a pause in the middle of output */
requiredby = alpm_pkg_compute_requiredby(pkg); requiredby = alpm_pkg_compute_requiredby(pkg);
} }
@ -135,7 +135,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
cols = getcols(fileno(stdout)); cols = getcols(fileno(stdout));
/* actual output */ /* actual output */
if(from == PKG_FROM_SYNCDB) { if(from == ALPM_PKG_FROM_SYNCDB) {
string_display(_("Repository :"), string_display(_("Repository :"),
alpm_db_get_name(alpm_pkg_get_db(pkg)), cols); alpm_db_get_name(alpm_pkg_get_db(pkg)), cols);
} }
@ -147,16 +147,16 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
deplist_display(_("Provides :"), alpm_pkg_get_provides(pkg), cols); deplist_display(_("Provides :"), alpm_pkg_get_provides(pkg), cols);
deplist_display(_("Depends On :"), alpm_pkg_get_depends(pkg), cols); deplist_display(_("Depends On :"), alpm_pkg_get_depends(pkg), cols);
optdeplist_display(_("Optional Deps :"), alpm_pkg_get_optdepends(pkg), cols); optdeplist_display(_("Optional Deps :"), alpm_pkg_get_optdepends(pkg), cols);
if(extra || from == PKG_FROM_LOCALDB) { if(extra || from == ALPM_PKG_FROM_LOCALDB) {
list_display(_("Required By :"), requiredby, cols); list_display(_("Required By :"), requiredby, cols);
} }
deplist_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg), cols); deplist_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg), cols);
deplist_display(_("Replaces :"), alpm_pkg_get_replaces(pkg), cols); deplist_display(_("Replaces :"), alpm_pkg_get_replaces(pkg), cols);
size = humanize_size(alpm_pkg_get_size(pkg), 'K', 2, &label); size = humanize_size(alpm_pkg_get_size(pkg), 'K', 2, &label);
if(from == PKG_FROM_SYNCDB) { if(from == ALPM_PKG_FROM_SYNCDB) {
printf(_("Download Size : %6.2f %s\n"), size, label); printf(_("Download Size : %6.2f %s\n"), size, label);
} else if(from == PKG_FROM_FILE) { } else if(from == ALPM_PKG_FROM_FILE) {
printf(_("Compressed Size: %6.2f %s\n"), size, label); printf(_("Compressed Size: %6.2f %s\n"), size, label);
} }
@ -166,18 +166,18 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
string_display(_("Packager :"), alpm_pkg_get_packager(pkg), cols); string_display(_("Packager :"), alpm_pkg_get_packager(pkg), cols);
string_display(_("Architecture :"), alpm_pkg_get_arch(pkg), cols); string_display(_("Architecture :"), alpm_pkg_get_arch(pkg), cols);
string_display(_("Build Date :"), bdatestr, cols); string_display(_("Build Date :"), bdatestr, cols);
if(from == PKG_FROM_LOCALDB) { if(from == ALPM_PKG_FROM_LOCALDB) {
string_display(_("Install Date :"), idatestr, cols); string_display(_("Install Date :"), idatestr, cols);
string_display(_("Install Reason :"), reason, cols); string_display(_("Install Reason :"), reason, cols);
} }
if(from == PKG_FROM_FILE || from == PKG_FROM_LOCALDB) { if(from == ALPM_PKG_FROM_FILE || from == ALPM_PKG_FROM_LOCALDB) {
string_display(_("Install Script :"), string_display(_("Install Script :"),
alpm_pkg_has_scriptlet(pkg) ? _("Yes") : _("No"), cols); alpm_pkg_has_scriptlet(pkg) ? _("Yes") : _("No"), cols);
} }
list_display(_("Validated By :"), validation, cols); list_display(_("Validated By :"), validation, cols);
if(from == PKG_FROM_FILE) { if(from == ALPM_PKG_FROM_FILE) {
alpm_siglist_t siglist; alpm_siglist_t siglist;
int err = alpm_pkg_check_pgp_signature(pkg, &siglist); int err = alpm_pkg_check_pgp_signature(pkg, &siglist);
if(err && alpm_errno(config->handle) == ALPM_ERR_SIG_MISSING) { if(err && alpm_errno(config->handle) == ALPM_ERR_SIG_MISSING) {
@ -194,7 +194,7 @@ void dump_pkg_full(alpm_pkg_t *pkg, int extra)
string_display(_("Description :"), alpm_pkg_get_desc(pkg), cols); string_display(_("Description :"), alpm_pkg_get_desc(pkg), cols);
/* Print additional package info if info flag passed more than once */ /* Print additional package info if info flag passed more than once */
if(from == PKG_FROM_LOCALDB && extra) { if(from == ALPM_PKG_FROM_LOCALDB && extra) {
dump_pkg_backups(pkg); dump_pkg_backups(pkg);
} }