index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 9c5d800e..27bd04d2 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -50,11 +50,11 @@ #include "handle.h" /** Add a package to the transaction. */ -int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, pmpkg_t *pkg) +int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) { const char *pkgname, *pkgver; pmtrans_t *trans; - pmpkg_t *local; + alpm_pkg_t *local; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -132,7 +132,7 @@ static int perform_extraction(alpm_handle_t *handle, struct archive *archive, } static int extract_single_file(alpm_handle_t *handle, struct archive *archive, - struct archive_entry *entry, pmpkg_t *newpkg, pmpkg_t *oldpkg) + struct archive_entry *entry, alpm_pkg_t *newpkg, alpm_pkg_t *oldpkg) { const char *entryname; mode_t entrymode; @@ -450,13 +450,13 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, return errors; } -static int commit_single_pkg(alpm_handle_t *handle, pmpkg_t *newpkg, +static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, size_t pkg_current, size_t pkg_count) { int i, ret = 0, errors = 0; char scriptlet[PATH_MAX]; int is_upgrade = 0; - pmpkg_t *oldpkg = NULL; + alpm_pkg_t *oldpkg = NULL; alpm_db_t *db = handle->db_local; pmtrans_t *trans = handle->trans; @@ -465,7 +465,7 @@ static int commit_single_pkg(alpm_handle_t *handle, pmpkg_t *newpkg, alpm_pkg_get_version(newpkg)); /* see if this is an upgrade. if so, remove the old package first */ - pmpkg_t *local = _alpm_db_get_pkgfromcache(db, newpkg->name); + alpm_pkg_t *local = _alpm_db_get_pkgfromcache(db, newpkg->name); if(local) { is_upgrade = 1; @@ -700,7 +700,7 @@ int _alpm_upgrade_packages(alpm_handle_t *handle) /* loop through our package list adding/upgrading one at a time */ for(targ = trans->add; targ; targ = targ->next) { - pmpkg_t *newpkg = targ->data; + alpm_pkg_t *newpkg = targ->data; if(handle->trans->state == STATE_INTERRUPTED) { return ret; diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 5b71e9a2..6bff5567 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -102,7 +102,7 @@ typedef enum _pgp_verify_t { typedef struct __alpm_handle_t alpm_handle_t; typedef struct __alpm_db_t alpm_db_t; -typedef struct __pmpkg_t pmpkg_t; +typedef struct __alpm_pkg_t alpm_pkg_t; typedef struct __pmtrans_t pmtrans_t; /** Dependency */ @@ -140,7 +140,7 @@ typedef struct _pmfileconflict_t { typedef struct _pmgrp_t { /** group name */ char *name; - /** list of pmpkg_t packages */ + /** list of alpm_pkg_t packages */ alpm_list_t *packages; } pmgrp_t; @@ -398,7 +398,7 @@ int alpm_db_update(int level, alpm_db_t *db); * @param name of the package * @return the package entry on success, NULL on error */ -pmpkg_t *alpm_db_get_pkg(alpm_db_t *db, const char *name); +alpm_pkg_t *alpm_db_get_pkg(alpm_db_t *db, const char *name); /** Get the package cache of a package database. * @param db pointer to the package database to get the package from @@ -456,19 +456,19 @@ int alpm_db_set_pkgreason(alpm_db_t *db, const char *name, alpm_pkgreason_t reas * @return 0 on success, -1 on error (pm_errno is set accordingly) */ int alpm_pkg_load(alpm_handle_t *handle, const char *filename, int full, - pgp_verify_t check_sig, pmpkg_t **pkg); + pgp_verify_t check_sig, alpm_pkg_t **pkg); /** Free a package. * @param pkg package pointer to free * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_pkg_free(pmpkg_t *pkg); +int alpm_pkg_free(alpm_pkg_t *pkg); /** Check the integrity (with md5) of a package from the sync cache. * @param pkg package pointer * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_pkg_checkmd5sum(pmpkg_t *pkg); +int alpm_pkg_checkmd5sum(alpm_pkg_t *pkg); /** Compare two version strings and determine which one is 'newer'. */ int alpm_pkg_vercmp(const char *a, const char *b); @@ -479,7 +479,7 @@ int alpm_pkg_vercmp(const char *a, const char *b); * @param pkg a package * @return the list of packages requiring pkg */ -alpm_list_t *alpm_pkg_compute_requiredby(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_compute_requiredby(alpm_pkg_t *pkg); /** @name Package Property Accessors * Any pointer returned by these functions points to internal structures @@ -492,13 +492,13 @@ alpm_list_t *alpm_pkg_compute_requiredby(pmpkg_t *pkg); * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_filename(pmpkg_t *pkg); +const char *alpm_pkg_get_filename(alpm_pkg_t *pkg); /** Returns the package name. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_name(pmpkg_t *pkg); +const char *alpm_pkg_get_name(alpm_pkg_t *pkg); /** Returns the package version as a string. * This includes all available epoch, version, and pkgrel components. Use @@ -506,116 +506,116 @@ const char *alpm_pkg_get_name(pmpkg_t *pkg); * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_version(pmpkg_t *pkg); +const char *alpm_pkg_get_version(alpm_pkg_t *pkg); /** Returns the package description. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_desc(pmpkg_t *pkg); +const char *alpm_pkg_get_desc(alpm_pkg_t *pkg); /** Returns the package URL. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_url(pmpkg_t *pkg); +const char *alpm_pkg_get_url(alpm_pkg_t *pkg); /** Returns the build timestamp of the package. * @param pkg a pointer to package * @return the timestamp of the build time */ -time_t alpm_pkg_get_builddate(pmpkg_t *pkg); +time_t alpm_pkg_get_builddate(alpm_pkg_t *pkg); /** Returns the install timestamp of the package. * @param pkg a pointer to package * @return the timestamp of the install time */ -time_t alpm_pkg_get_installdate(pmpkg_t *pkg); +time_t alpm_pkg_get_installdate(alpm_pkg_t *pkg); /** Returns the packager's name. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_packager(pmpkg_t *pkg); +const char *alpm_pkg_get_packager(alpm_pkg_t *pkg); /** Returns the package's MD5 checksum as a string. * The returned string is a sequence of lowercase hexadecimal digits. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_md5sum(pmpkg_t *pkg); +const char *alpm_pkg_get_md5sum(alpm_pkg_t *pkg); /** Returns the architecture for which the package was built. * @param pkg a pointer to package * @return a reference to an internal string */ -const char *alpm_pkg_get_arch(pmpkg_t *pkg); +const char *alpm_pkg_get_arch(alpm_pkg_t *pkg); /** Returns the size of the package. * @param pkg a pointer to package * @return the size of the package in bytes. */ -off_t alpm_pkg_get_size(pmpkg_t *pkg); +off_t alpm_pkg_get_size(alpm_pkg_t *pkg); /** Returns the installed size of the package. * @param pkg a pointer to package * @return the total size of files installed by the package. */ -off_t alpm_pkg_get_isize(pmpkg_t *pkg); +off_t alpm_pkg_get_isize(alpm_pkg_t *pkg); /** Returns the package installation reason. * @param pkg a pointer to package * @return an enum member giving the install reason. */ -alpm_pkgreason_t alpm_pkg_get_reason(pmpkg_t *pkg); +alpm_pkgreason_t alpm_pkg_get_reason(alpm_pkg_t *pkg); /** Returns the list of package licenses. * @param pkg a pointer to package * @return a pointer to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_licenses(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_licenses(alpm_pkg_t *pkg); /** Returns the list of package groups. * @param pkg a pointer to package * @return a pointer to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_groups(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_groups(alpm_pkg_t *pkg); /** Returns the list of package dependencies as pmdepend_t. * @param pkg a pointer to package * @return a reference to an internal list of pmdepend_t structures. */ -alpm_list_t *alpm_pkg_get_depends(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_depends(alpm_pkg_t *pkg); /** Returns the list of package optional dependencies. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_optdepends(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_optdepends(alpm_pkg_t *pkg); /** Returns the list of package names conflicting with pkg. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_conflicts(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_conflicts(alpm_pkg_t *pkg); /** Returns the list of package names provided by pkg. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_provides(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_provides(alpm_pkg_t *pkg); /** Returns the list of available deltas for pkg. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_deltas(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_deltas(alpm_pkg_t *pkg); /** Returns the list of packages to be replaced by pkg. * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_replaces(alpm_pkg_t *pkg); /** Returns the list of files installed by pkg. * The filenames are relative to the install root, @@ -623,7 +623,7 @@ alpm_list_t *alpm_pkg_get_replaces(pmpkg_t *pkg); * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_files(alpm_pkg_t *pkg); /** Returns the list of files backed up when installing pkg. * The elements of the returned list have the form @@ -632,7 +632,7 @@ alpm_list_t *alpm_pkg_get_files(pmpkg_t *pkg); * @param pkg a pointer to package * @return a reference to an internal list of strings. */ -alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_get_backup(alpm_pkg_t *pkg); /** Returns the database containing pkg. * Returns a pointer to the alpm_db_t structure the package is @@ -640,9 +640,9 @@ alpm_list_t *alpm_pkg_get_backup(pmpkg_t *pkg); * @param pkg a pointer to package * @return a pointer to the DB containing pkg, or NULL. */ -alpm_db_t *alpm_pkg_get_db(pmpkg_t *pkg); +alpm_db_t *alpm_pkg_get_db(alpm_pkg_t *pkg); -/* End of pmpkg_t accessors */ +/* End of alpm_pkg_t accessors */ /* @} */ /** Open a package changelog for reading. @@ -651,7 +651,7 @@ alpm_db_t *alpm_pkg_get_db(pmpkg_t *pkg); * @param pkg the package to read the changelog of (either file or db) * @return a 'file stream' to the package changelog */ -void *alpm_pkg_changelog_open(pmpkg_t *pkg); +void *alpm_pkg_changelog_open(alpm_pkg_t *pkg); /** Read data from an open changelog 'file stream'. * Similar to fread in functionality, this function takes a buffer and @@ -664,16 +664,16 @@ void *alpm_pkg_changelog_open(pmpkg_t *pkg); * error occurred. */ size_t alpm_pkg_changelog_read(void *ptr, size_t size, - const pmpkg_t *pkg, const void *fp); + const alpm_pkg_t *pkg, const void *fp); -/*int alpm_pkg_changelog_feof(const pmpkg_t *pkg, void *fp);*/ +/*int alpm_pkg_changelog_feof(const alpm_pkg_t *pkg, void *fp);*/ -int alpm_pkg_changelog_close(const pmpkg_t *pkg, void *fp); +int alpm_pkg_changelog_close(const alpm_pkg_t *pkg, void *fp); /** Returns whether the package has an install scriptlet. * @return 0 if FALSE, TRUE otherwise */ -int alpm_pkg_has_scriptlet(pmpkg_t *pkg); +int alpm_pkg_has_scriptlet(alpm_pkg_t *pkg); /** Returns the size of download. * Returns the size of the files that will be downloaded to install a @@ -681,9 +681,9 @@ int alpm_pkg_has_scriptlet(pmpkg_t *pkg); * @param newpkg the new package to upgrade to * @return the size of the download */ -off_t alpm_pkg_download_size(pmpkg_t *newpkg); +off_t alpm_pkg_download_size(alpm_pkg_t *newpkg); -alpm_list_t *alpm_pkg_unused_deltas(pmpkg_t *pkg); +alpm_list_t *alpm_pkg_unused_deltas(alpm_pkg_t *pkg); /* End of alpm_pkg */ /** @} */ @@ -692,7 +692,7 @@ alpm_list_t *alpm_pkg_unused_deltas(pmpkg_t *pkg); * Signatures */ -int alpm_pkg_check_pgp_signature(pmpkg_t *pkg); +int alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg); int alpm_db_check_pgp_signature(alpm_db_t *db); @@ -706,7 +706,7 @@ alpm_list_t *alpm_find_grp_pkgs(alpm_list_t *dbs, const char *name); * Sync */ -pmpkg_t *alpm_sync_newversion(pmpkg_t *pkg, alpm_list_t *dbs_sync); +alpm_pkg_t *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync); /** @addtogroup alpm_api_trans Transaction Functions * Functions to manipulate libalpm transactions @@ -870,13 +870,13 @@ pmtransflag_t alpm_trans_get_flags(alpm_handle_t *handle); /** Returns a list of packages added by the transaction. * @param handle the context handle - * @return a list of pmpkg_t structures + * @return a list of alpm_pkg_t structures */ alpm_list_t * alpm_trans_get_add(alpm_handle_t *handle); /** Returns the list of packages removed by the transaction. * @param handle the context handle - * @return a list of pmpkg_t structures + * @return a list of alpm_pkg_t structures */ alpm_list_t * alpm_trans_get_remove(alpm_handle_t *handle); @@ -938,14 +938,14 @@ int alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade); * @param pkg the package to add * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_add_pkg(alpm_handle_t *handle, pmpkg_t *pkg); +int alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg); /** Add a package removal action to the transaction. * @param handle the context handle * @param pkg the package to uninstall * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_remove_pkg(alpm_handle_t *handle, pmpkg_t *pkg); +int alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg); /** @} */ @@ -957,8 +957,8 @@ int alpm_remove_pkg(alpm_handle_t *handle, pmpkg_t *pkg); alpm_list_t *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglist, alpm_list_t *remove, alpm_list_t *upgrade, int reversedeps); -pmpkg_t *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring); -pmpkg_t *alpm_find_dbs_satisfier(alpm_handle_t *handle, +alpm_pkg_t *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring); +alpm_pkg_t *alpm_find_dbs_satisfier(alpm_handle_t *handle, alpm_list_t *dbs, const char *depstring); alpm_list_t *alpm_checkconflicts(alpm_handle_t *handle, alpm_list_t *pkglist); diff --git a/lib/libalpm/backup.c b/lib/libalpm/backup.c index dc0c5674..408c0e17 100644 --- a/lib/libalpm/backup.c +++ b/lib/libalpm/backup.c @@ -55,7 +55,7 @@ int _alpm_split_backup(const char *string, pmbackup_t **backup) return 0; } -/* Look for a filename in a pmpkg_t.backup list. If we find it, +/* Look for a filename in a alpm_pkg_t.backup list. If we find it, * then we return the full backup entry. */ pmbackup_t *_alpm_needbackup(const char *file, const alpm_list_t *backup_list) diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 1422871d..f59f74fe 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -55,85 +55,85 @@ * initialized. */ -static const char *_cache_get_filename(pmpkg_t *pkg) +static const char *_cache_get_filename(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->filename; } -static const char *_cache_get_desc(pmpkg_t *pkg) +static const char *_cache_get_desc(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->desc; } -static const char *_cache_get_url(pmpkg_t *pkg) +static const char *_cache_get_url(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->url; } -static time_t _cache_get_builddate(pmpkg_t *pkg) +static time_t _cache_get_builddate(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, 0); return pkg->builddate; } -static time_t _cache_get_installdate(pmpkg_t *pkg) +static time_t _cache_get_installdate(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, 0); return pkg->installdate; } -static const char *_cache_get_packager(pmpkg_t *pkg) +static const char *_cache_get_packager(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->packager; } -static const char *_cache_get_md5sum(pmpkg_t *pkg) +static const char *_cache_get_md5sum(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->md5sum; } -static const char *_cache_get_arch(pmpkg_t *pkg) +static const char *_cache_get_arch(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->arch; } -static off_t _cache_get_size(pmpkg_t *pkg) +static off_t _cache_get_size(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, -1); return pkg->size; } -static off_t _cache_get_isize(pmpkg_t *pkg) +static off_t _cache_get_isize(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, -1); return pkg->isize; } -static alpm_pkgreason_t _cache_get_reason(pmpkg_t *pkg) +static alpm_pkgreason_t _cache_get_reason(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, -1); return pkg->reason; } -static alpm_list_t *_cache_get_licenses(pmpkg_t *pkg) +static alpm_list_t *_cache_get_licenses(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->licenses; } -static alpm_list_t *_cache_get_groups(pmpkg_t *pkg) +static alpm_list_t *_cache_get_groups(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->groups; } -static int _cache_has_scriptlet(pmpkg_t *pkg) +static int _cache_has_scriptlet(alpm_pkg_t *pkg) { if(!(pkg->infolevel & INFRQ_SCRIPTLET)) { _alpm_local_db_read(pkg->origin_data.db, pkg, INFRQ_SCRIPTLET); @@ -141,43 +141,43 @@ static int _cache_has_scriptlet(pmpkg_t *pkg) return pkg->scriptlet; } -static alpm_list_t *_cache_get_depends(pmpkg_t *pkg) +static alpm_list_t *_cache_get_depends(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->depends; } -static alpm_list_t *_cache_get_optdepends(pmpkg_t *pkg) +static alpm_list_t *_cache_get_optdepends(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->optdepends; } -static alpm_list_t *_cache_get_conflicts(pmpkg_t *pkg) +static alpm_list_t *_cache_get_conflicts(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->conflicts; } -static alpm_list_t *_cache_get_provides(pmpkg_t *pkg) +static alpm_list_t *_cache_get_provides(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->provides; } -static alpm_list_t *_cache_get_replaces(pmpkg_t *pkg) +static alpm_list_t *_cache_get_replaces(alpm_pkg_t *pkg) { LAZY_LOAD(INFRQ_DESC, NULL); return pkg->replaces; } /* local packages can not have deltas */ -static alpm_list_t *_cache_get_deltas(pmpkg_t UNUSED *pkg) +static alpm_list_t *_cache_get_deltas(alpm_pkg_t UNUSED *pkg) { return NULL; } -static alpm_list_t *_cache_get_files(pmpkg_t *pkg) +static alpm_list_t *_cache_get_files(alpm_pkg_t *pkg) { if(pkg->origin == PKG_FROM_LOCALDB && !(pkg->infolevel & INFRQ_FILES)) { @@ -186,7 +186,7 @@ static alpm_list_t *_cache_get_files(pmpkg_t *pkg) return pkg->files; } -static alpm_list_t *_cache_get_backup(pmpkg_t *pkg) +static alpm_list_t *_cache_get_backup(alpm_pkg_t *pkg) { if(pkg->origin == PKG_FROM_LOCALDB && !(pkg->infolevel & INFRQ_FILES)) { @@ -201,7 +201,7 @@ static alpm_list_t *_cache_get_backup(pmpkg_t *pkg) * @param pkg the package (from db) to read the changelog * @return a 'file stream' to the package changelog */ -static void *_cache_changelog_open(pmpkg_t *pkg) +static void *_cache_changelog_open(alpm_pkg_t *pkg) { char clfile[PATH_MAX]; snprintf(clfile, PATH_MAX, "%s/%s/%s-%s/changelog", @@ -222,7 +222,7 @@ static void *_cache_changelog_open(pmpkg_t *pkg) * @return the number of characters read, or 0 if there is no more data */ static size_t _cache_changelog_read(void *ptr, size_t size, - const pmpkg_t UNUSED *pkg, const void *fp) + const alpm_pkg_t UNUSED *pkg, const void *fp) { return fread(ptr, 1, size, (FILE *)fp); } @@ -234,7 +234,7 @@ static size_t _cache_changelog_read(void *ptr, size_t size, * @param fp a 'file stream' to the package changelog * @return whether closing the package changelog stream was successful */ -static int _cache_changelog_close(const pmpkg_t UNUSED *pkg, void *fp) +static int _cache_changelog_close(const alpm_pkg_t UNUSED *pkg, void *fp) { return fclose((FILE *)fp); } @@ -424,7 +424,7 @@ static int local_db_populate(alpm_db_t *db) while((ent = readdir(dbdir)) != NULL) { const char *name = ent->d_name; - pmpkg_t *pkg; + alpm_pkg_t *pkg; if(strcmp(name, ".") == 0 || strcmp(name, "..") == 0) { continue; @@ -484,7 +484,7 @@ static int local_db_populate(alpm_db_t *db) } /* Note: the return value must be freed by the caller */ -static char *get_pkgpath(alpm_db_t *db, pmpkg_t *info) +static char *get_pkgpath(alpm_db_t *db, alpm_pkg_t *info) { size_t len; char *pkgpath; @@ -498,7 +498,7 @@ static char *get_pkgpath(alpm_db_t *db, pmpkg_t *info) } -int _alpm_local_db_read(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) +int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq) { FILE *fp = NULL; char path[PATH_MAX]; @@ -718,7 +718,7 @@ error: return -1; } -int _alpm_local_db_prepare(alpm_db_t *db, pmpkg_t *info) +int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info) { mode_t oldmask; int retval = 0; @@ -742,7 +742,7 @@ int _alpm_local_db_prepare(alpm_db_t *db, pmpkg_t *info) return retval; } -int _alpm_local_db_write(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) +int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq) { FILE *fp = NULL; char path[PATH_MAX]; @@ -910,7 +910,7 @@ cleanup: return retval; } -int _alpm_local_db_remove(alpm_db_t *db, pmpkg_t *info) +int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info) { int ret = 0; char *pkgpath = NULL; diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index b4f729b5..4433d31c 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -43,7 +43,7 @@ * @param pkg the package (file) to read the changelog * @return a 'file stream' to the package changelog */ -static void *_package_changelog_open(pmpkg_t *pkg) +static void *_package_changelog_open(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); @@ -87,7 +87,7 @@ static void *_package_changelog_open(pmpkg_t *pkg) * @return the number of characters read, or 0 if there is no more data */ static size_t _package_changelog_read(void *ptr, size_t size, - const pmpkg_t UNUSED *pkg, const void *fp) + const alpm_pkg_t UNUSED *pkg, const void *fp) { ssize_t sret = archive_read_data((struct archive *)fp, ptr, size); /* Report error (negative values) */ @@ -105,7 +105,7 @@ static size_t _package_changelog_read(void *ptr, size_t size, * @param fp a 'file stream' to the package changelog * @return whether closing the package changelog stream was successful */ -static int _package_changelog_close(const pmpkg_t UNUSED *pkg, void *fp) +static int _package_changelog_close(const alpm_pkg_t UNUSED *pkg, void *fp) { return archive_read_finish((struct archive *)fp); } @@ -130,13 +130,13 @@ static struct pkg_operations *get_file_pkg_ops(void) } /** - * Parses the package description file for a package into a pmpkg_t struct. + * Parses the package description file for a package into a alpm_pkg_t struct. * @param archive the archive to read from, pointed at the .PKGINFO entry - * @param newpkg an empty pmpkg_t struct to fill with package info + * @param newpkg an empty alpm_pkg_t struct to fill with package info * * @return 0 on success, -1 on error */ -static int parse_descfile(alpm_handle_t *handle, struct archive *a, pmpkg_t *newpkg) +static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t *newpkg) { char *ptr = NULL; char *key = NULL; @@ -224,14 +224,14 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, pmpkg_t *new } /** - * Load a package and create the corresponding pmpkg_t struct. + * Load a package and create the corresponding alpm_pkg_t struct. * @param handle the context handle * @param pkgfile path to the package file * @param full whether to stop the load after metadata is read or continue * through the full archive - * @return An information filled pmpkg_t struct + * @return An information filled alpm_pkg_t struct */ -pmpkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, +alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, int full, const char *md5sum, const char *base64_sig, pgp_verify_t check_sig) { @@ -239,7 +239,7 @@ pmpkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, int config = 0; struct archive *archive; struct archive_entry *entry; - pmpkg_t *newpkg = NULL; + alpm_pkg_t *newpkg = NULL; struct stat st; size_t files_count = 0; @@ -388,7 +388,7 @@ error: } int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int full, - pgp_verify_t check_sig, pmpkg_t **pkg) + pgp_verify_t check_sig, alpm_pkg_t **pkg) { CHECK_HANDLE(handle, return -1); ASSERT(pkg != NULL, RET_ERR(handle, PM_ERR_WRONG_ARGS, -1)); diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 2ce343c5..9d3646c8 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -245,14 +245,14 @@ cleanup: /* Forward decl so I don't reorganize the whole file right now */ static int sync_db_read(alpm_db_t *db, struct archive *archive, - struct archive_entry *entry, pmpkg_t **likely_pkg); + struct archive_entry *entry, alpm_pkg_t **likely_pkg); -static pmpkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname, - const char **entry_filename, pmpkg_t *likely_pkg) +static alpm_pkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname, + const char **entry_filename, alpm_pkg_t *likely_pkg) { char *pkgname = NULL, *pkgver = NULL; unsigned long pkgname_hash; - pmpkg_t *pkg; + alpm_pkg_t *pkg; /* get package and db file names */ if(entry_filename) { @@ -368,7 +368,7 @@ static int sync_db_populate(alpm_db_t *db) struct stat buf; struct archive *archive; struct archive_entry *entry; - pmpkg_t *pkg = NULL; + alpm_pkg_t *pkg = NULL; if((archive = archive_read_new()) == NULL) { RET_ERR(db->handle, PM_ERR_LIBARCHIVE, -1); @@ -452,10 +452,10 @@ static int sync_db_populate(alpm_db_t *db) } while(1) /* note the while(1) and not (0) */ static int sync_db_read(alpm_db_t *db, struct archive *archive, - struct archive_entry *entry, pmpkg_t **likely_pkg) + struct archive_entry *entry, alpm_pkg_t **likely_pkg) { const char *entryname, *filename; - pmpkg_t *pkg; + alpm_pkg_t *pkg; struct archive_read_buffer buf; entryname = archive_entry_pathname(entry); diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index dbe90581..d269a066 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -138,7 +138,7 @@ static void check_conflict(alpm_handle_t *handle, return; } for(i = list1; i; i = i->next) { - pmpkg_t *pkg1 = i->data; + alpm_pkg_t *pkg1 = i->data; const char *pkg1name = alpm_pkg_get_name(pkg1); alpm_list_t *j; @@ -148,7 +148,7 @@ static void check_conflict(alpm_handle_t *handle, pmdepend_t *parsed_conflict = _alpm_splitdep(conflict); for(k = list2; k; k = k->next) { - pmpkg_t *pkg2 = k->data; + alpm_pkg_t *pkg2 = k->data; const char *pkg2name = alpm_pkg_get_name(pkg2); if(strcmp(pkg1name, pkg2name) == 0) { @@ -315,7 +315,7 @@ void _alpm_fileconflict_free(pmfileconflict_t *conflict) } static int dir_belongsto_pkg(const char *root, const char *dirpath, - pmpkg_t *pkg) + alpm_pkg_t *pkg) { struct dirent *ent = NULL; struct stat sbuf; @@ -380,7 +380,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, * different cases. */ for(current = 0, i = upgrade; i; i = i->next, current++) { alpm_list_t *k, *tmpfiles; - pmpkg_t *p1, *p2, *dbpkg; + alpm_pkg_t *p1, *p2, *dbpkg; char path[PATH_MAX]; p1 = i->data; @@ -474,7 +474,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, /* Check remove list (will we remove the conflicting local file?) */ for(k = remove; k && !resolved_conflict; k = k->next) { - pmpkg_t *rempkg = k->data; + alpm_pkg_t *rempkg = k->data; if(alpm_list_find_str(alpm_pkg_get_files(rempkg), relative_path)) { _alpm_log(handle, PM_LOG_DEBUG, "local file will be removed, not a conflict: %s\n", @@ -489,7 +489,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, if(!p2 || strcmp(p1->name, p2->name) == 0) { continue; } - pmpkg_t *localp2 = _alpm_db_get_pkgfromcache(handle->db_local, p2->name); + alpm_pkg_t *localp2 = _alpm_db_get_pkgfromcache(handle->db_local, p2->name); /* localp2->files will be removed (target conflicts are handled by CHECK 1) */ if(localp2 && alpm_list_find_str(alpm_pkg_get_files(localp2), filestr)) { diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 6872f517..4c1922d9 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -220,7 +220,7 @@ const char SYMEXPORT *alpm_db_get_name(const alpm_db_t *db) } /** Get a package entry from a package database. */ -pmpkg_t SYMEXPORT *alpm_db_get_pkg(alpm_db_t *db, const char *name) +alpm_pkg_t SYMEXPORT *alpm_db_get_pkg(alpm_db_t *db, const char *name) { ASSERT(db != NULL, return NULL); db->handle->pm_errno = 0; @@ -275,7 +275,7 @@ int SYMEXPORT alpm_db_set_pkgreason(alpm_db_t *db, const char *name, alpm_pkgrea /* TODO assert db == db_local ? shouldn't need a db param at all here... */ ASSERT(name != NULL, RET_ERR(db->handle, PM_ERR_WRONG_ARGS, -1)); - pmpkg_t *pkg = _alpm_db_get_pkgfromcache(db, name); + alpm_pkg_t *pkg = _alpm_db_get_pkgfromcache(db, name); if(pkg == NULL) { RET_ERR(db->handle, PM_ERR_PKG_NOT_FOUND, -1); } @@ -397,7 +397,7 @@ alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles) } for(j = list; j; j = j->next) { - pmpkg_t *pkg = j->data; + alpm_pkg_t *pkg = j->data; const char *matched = NULL; const char *name = alpm_pkg_get_name(pkg); const char *desc = alpm_pkg_get_desc(pkg); @@ -513,9 +513,9 @@ alpm_list_t *_alpm_db_get_pkgcache(alpm_db_t *db) } /* "duplicate" pkg then add it to pkgcache */ -int _alpm_db_add_pkgincache(alpm_db_t *db, pmpkg_t *pkg) +int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg) { - pmpkg_t *newpkg; + alpm_pkg_t *newpkg; if(db == NULL || pkg == NULL || !(db->status & DB_STATUS_PKGCACHE)) { return -1; @@ -535,9 +535,9 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, pmpkg_t *pkg) return 0; } -int _alpm_db_remove_pkgfromcache(alpm_db_t *db, pmpkg_t *pkg) +int _alpm_db_remove_pkgfromcache(alpm_db_t *db, alpm_pkg_t *pkg) { - pmpkg_t *data = NULL; + alpm_pkg_t *data = NULL; if(db == NULL || pkg == NULL || !(db->status & DB_STATUS_PKGCACHE)) { return -1; @@ -561,7 +561,7 @@ int _alpm_db_remove_pkgfromcache(alpm_db_t *db, pmpkg_t *pkg) return 0; } -pmpkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target) +alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target) { if(db == NULL) { return NULL; @@ -590,7 +590,7 @@ static int load_grpcache(alpm_db_t *db) for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) { const alpm_list_t *i; - pmpkg_t *pkg = lp->data; + alpm_pkg_t *pkg = lp->data; for(i = alpm_pkg_get_groups(pkg); i; i = i->next) { const char *grpname = i->data; diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 0e623f09..9c6d6052 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -87,20 +87,20 @@ alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename, void _alpm_db_unregister(alpm_db_t *db); /* be_*.c, backend specific calls */ -int _alpm_local_db_read(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq); -int _alpm_local_db_prepare(alpm_db_t *db, pmpkg_t *info); -int _alpm_local_db_write(alpm_db_t *db, pmpkg_t *info, pmdbinfrq_t inforeq); -int _alpm_local_db_remove(alpm_db_t *db, pmpkg_t *info); +int _alpm_local_db_read(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq); +int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info); +int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, pmdbinfrq_t inforeq); +int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info); /* cache bullshit */ /* packages */ void _alpm_db_free_pkgcache(alpm_db_t *db); -int _alpm_db_add_pkgincache(alpm_db_t *db, pmpkg_t *pkg); -int _alpm_db_remove_pkgfromcache(alpm_db_t *db, pmpkg_t *pkg); +int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg); +int _alpm_db_remove_pkgfromcache(alpm_db_t *db, alpm_pkg_t *pkg); pmpkghash_t *_alpm_db_get_pkgcache_hash(alpm_db_t *db); alpm_list_t *_alpm_db_get_pkgcache(alpm_db_t *db); int _alpm_db_ensure_pkgcache(alpm_db_t *db, pmdbinfrq_t infolevel); -pmpkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target); +alpm_pkg_t *_alpm_db_get_pkgfromcache(alpm_db_t *db, const char *target); /* groups */ void _alpm_db_free_grpcache(alpm_db_t *db); alpm_list_t *_alpm_db_get_grpcache(alpm_db_t *db); diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index 26866aa7..0128e556 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -247,7 +247,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota * @{ */ -alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(alpm_pkg_t *pkg) { off_t pkgsize = alpm_pkg_get_size(pkg); alpm_list_t *unused = find_unused( diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index b9d7a8ff..914d1a3a 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -67,7 +67,7 @@ void _alpm_depmiss_free(pmdepmissing_t *miss) } /* Does pkg1 depend on pkg2, ie. does pkg2 satisfy a dependency of pkg1? */ -static int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2) +static int _alpm_dep_edge(alpm_pkg_t *pkg1, alpm_pkg_t *pkg2) { alpm_list_t *i; for(i = alpm_pkg_get_depends(pkg1); i; i = i->next) { @@ -78,7 +78,7 @@ static int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2) return 0; } -/* Convert a list of pmpkg_t * to a graph structure, +/* Convert a list of alpm_pkg_t * to a graph structure, * with a edge for each dependency. * Returns a list of vertices (one vertex = one package) * (used by alpm_sortbydeps) @@ -97,11 +97,11 @@ static alpm_list_t *dep_graph_init(alpm_list_t *targets) /* We compute the edges */ for(i = vertices; i; i = i->next) { pmgraph_t *vertex_i = i->data; - pmpkg_t *p_i = vertex_i->data; + alpm_pkg_t *p_i = vertex_i->data; /* TODO this should be somehow combined with alpm_checkdeps */ for(j = vertices; j; j = j->next) { pmgraph_t *vertex_j = j->data; - pmpkg_t *p_j = vertex_j->data; + alpm_pkg_t *p_j = vertex_j->data; if(_alpm_dep_edge(p_i, p_j)) { vertex_i->children = alpm_list_add(vertex_i->children, vertex_j); @@ -157,8 +157,8 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, vertex = nextchild; } else if(nextchild->state == -1) { - pmpkg_t *vertexpkg = vertex->data; - pmpkg_t *childpkg = nextchild->data; + alpm_pkg_t *vertexpkg = vertex->data; + alpm_pkg_t *childpkg = nextchild->data; const char *message; _alpm_log(handle, PM_LOG_WARNING, _("dependency cycle detected:\n")); @@ -226,12 +226,12 @@ static void release_filtered_depend(pmdepend_t *dep, int nodepversion) } } -static pmpkg_t *find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep) +static alpm_pkg_t *find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep) { alpm_list_t *i; for(i = pkgs; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(_alpm_depcmp(pkg, dep)) { return pkg; } @@ -241,17 +241,17 @@ static pmpkg_t *find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep) /** Find a package satisfying a specified dependency. * The dependency can include versions with depmod operators. - * @param pkgs an alpm_list_t* of pmpkg_t where the satisfier will be searched + * @param pkgs an alpm_list_t* of alpm_pkg_t where the satisfier will be searched * @param depstring package or provision name, versioned or not - * @return a pmpkg_t* satisfying depstring + * @return a alpm_pkg_t* satisfying depstring */ -pmpkg_t SYMEXPORT *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring) +alpm_pkg_t SYMEXPORT *alpm_find_satisfier(alpm_list_t *pkgs, const char *depstring) { pmdepend_t *dep = _alpm_splitdep(depstring); if(!dep) { return NULL; } - pmpkg_t *pkg = find_dep_satisfier(pkgs, dep); + alpm_pkg_t *pkg = find_dep_satisfier(pkgs, dep); _alpm_dep_free(dep); return pkg; } @@ -277,7 +277,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis targets = alpm_list_join(alpm_list_copy(remove), alpm_list_copy(upgrade)); for(i = pkglist; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(_alpm_pkg_find(targets, pkg->name)) { modified = alpm_list_add(modified, pkg); } else { @@ -290,7 +290,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis /* look for unsatisfied dependencies of the upgrade list */ for(i = upgrade; i; i = i->next) { - pmpkg_t *tp = i->data; + alpm_pkg_t *tp = i->data; _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: package %s-%s\n", alpm_pkg_get_name(tp), alpm_pkg_get_version(tp)); @@ -318,11 +318,11 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis /* reversedeps handles the backwards dependencies, ie, * the packages listed in the requiredby field. */ for(i = dblist; i; i = i->next) { - pmpkg_t *lp = i->data; + alpm_pkg_t *lp = i->data; for(j = alpm_pkg_get_depends(lp); j; j = j->next) { pmdepend_t *depend = j->data; depend = filtered_depend(depend, nodepversion); - pmpkg_t *causingpkg = find_dep_satisfier(modified, depend); + alpm_pkg_t *causingpkg = find_dep_satisfier(modified, depend); /* we won't break this depend, if it is already broken, we ignore it */ /* 1. check upgrade list for satisfiers */ /* 2. check dblist for satisfiers */ @@ -369,7 +369,7 @@ static int dep_vercmp(const char *version1, alpm_depmod_t mod, return equal; } -int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep) +int _alpm_depcmp(alpm_pkg_t *pkg, pmdepend_t *dep) { alpm_list_t *i; int satisfy = 0; @@ -472,7 +472,7 @@ pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep) * targets and a db is safe to remove. We do NOT remove it if it is in the * target list, or if if the package was explictly installed and * include_explicit == 0 */ -static int can_remove_package(alpm_db_t *db, pmpkg_t *pkg, alpm_list_t *targets, +static int can_remove_package(alpm_db_t *db, alpm_pkg_t *pkg, alpm_list_t *targets, int include_explicit) { alpm_list_t *i; @@ -498,7 +498,7 @@ static int can_remove_package(alpm_db_t *db, pmpkg_t *pkg, alpm_list_t *targets, /* see if other packages need it */ for(i = _alpm_db_get_pkgcache(db); i; i = i->next) { - pmpkg_t *lpkg = i->data; + alpm_pkg_t *lpkg = i->data; if(_alpm_dep_edge(lpkg, pkg) && !_alpm_pkg_find(targets, lpkg->name)) { return 0; } @@ -527,9 +527,9 @@ void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit) } for(i = targs; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; for(j = _alpm_db_get_pkgcache(db); j; j = j->next) { - pmpkg_t *deppkg = j->data; + alpm_pkg_t *deppkg = j->data; if(_alpm_dep_edge(pkg, deppkg) && can_remove_package(db, deppkg, targs, include_explicit)) { _alpm_log(db->handle, PM_LOG_DEBUG, "adding '%s' to the targets\n", @@ -554,7 +554,7 @@ void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit) * an error code without prompting * @return the resolved package **/ -static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, +static alpm_pkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *excluding, int prompt) { alpm_list_t *i, *j; @@ -565,7 +565,7 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, /* 1. literals */ for(i = dbs; i; i = i->next) { - pmpkg_t *pkg = _alpm_db_get_pkgfromcache(i->data, dep->name); + alpm_pkg_t *pkg = _alpm_db_get_pkgfromcache(i->data, dep->name); if(pkg && _alpm_depcmp(pkg, dep) && !_alpm_pkg_find(excluding, pkg->name)) { if(_alpm_pkg_should_ignore(handle, pkg)) { int install = 0; @@ -586,7 +586,7 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, /* 2. satisfiers (skip literals here) */ for(i = dbs; i; i = i->next) { for(j = _alpm_db_get_pkgcache(i->data); j; j = j->next) { - pmpkg_t *pkg = j->data; + alpm_pkg_t *pkg = j->data; if(_alpm_depcmp(pkg, dep) && strcmp(pkg->name, dep->name) != 0 && !_alpm_pkg_find(excluding, pkg->name)) { if(_alpm_pkg_should_ignore(handle, pkg)) { @@ -612,7 +612,7 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, /* first check if one provider is already installed locally */ for(i = providers; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(_alpm_pkghash_find(_alpm_db_get_pkgcache_hash(handle->db_local), pkg->name)) { alpm_list_free(providers); return pkg; @@ -628,7 +628,7 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, providers, dep, NULL, &index); } if(index >= 0 && index < count) { - pmpkg_t *pkg = alpm_list_getdata(alpm_list_nth(providers, index)); + alpm_pkg_t *pkg = alpm_list_getdata(alpm_list_nth(providers, index)); alpm_list_free(providers); return pkg; } @@ -651,13 +651,13 @@ static pmpkg_t *resolvedep(alpm_handle_t *handle, pmdepend_t *dep, * @param handle the context handle * @param dbs an alpm_list_t* of alpm_db_t where the satisfier will be searched * @param depstring package or provision name, versioned or not - * @return a pmpkg_t* satisfying depstring + * @return a alpm_pkg_t* satisfying depstring */ -pmpkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle, +alpm_pkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle, alpm_list_t *dbs, const char *depstring) { pmdepend_t *dep; - pmpkg_t *pkg; + alpm_pkg_t *pkg; CHECK_HANDLE(handle, return NULL); ASSERT(dbs, RET_ERR(handle, PM_ERR_WRONG_ARGS, NULL)); @@ -689,7 +689,7 @@ pmpkg_t SYMEXPORT *alpm_find_dbs_satisfier(alpm_handle_t *handle, * unresolvable dependency, in which case the [*packages] list will be * unmodified by this function */ -int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pkg, +int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t *pkg, alpm_list_t *preferred, alpm_list_t **packages, alpm_list_t *remove, alpm_list_t **data) { @@ -712,7 +712,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pk _alpm_log(handle, PM_LOG_DEBUG, "started resolving dependencies\n"); for(i = alpm_list_last(*packages); i; i = i->next) { - pmpkg_t *tpkg = i->data; + alpm_pkg_t *tpkg = i->data; targ = alpm_list_add(NULL, tpkg); deps = alpm_checkdeps(handle, localpkgs, remove, targ, 0); alpm_list_free(targ); @@ -728,7 +728,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pk } /* check if one of the packages in the [preferred] list already satisfies * this dependency */ - pmpkg_t *spkg = find_dep_satisfier(preferred, missdep); + alpm_pkg_t *spkg = find_dep_satisfier(preferred, missdep); if(!spkg) { /* find a satisfier package in the given repositories */ spkg = resolvedep(handle, missdep, handle->dbs_sync, *packages, 0); diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h index d490ab51..438c803a 100644 --- a/lib/libalpm/deps.h +++ b/lib/libalpm/deps.h @@ -32,11 +32,11 @@ pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep); void _alpm_depmiss_free(pmdepmissing_t *miss); alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, alpm_list_t *targets, int reverse); void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit); -int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, pmpkg_t *pkg, +int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t *pkg, alpm_list_t *preferred, alpm_list_t **packages, alpm_list_t *remove, alpm_list_t **data); pmdepend_t *_alpm_splitdep(const char *depstring); -int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep); +int _alpm_depcmp(alpm_pkg_t *pkg, pmdepend_t *dep); #endif /* _ALPM_DEPS_H */ diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 6fc2e38a..2bc382e4 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -149,7 +149,7 @@ static alpm_mountpoint_t *match_mount_point(const alpm_list_t *mount_points, } static int calculate_removed_size(alpm_handle_t *handle, - const alpm_list_t *mount_points, pmpkg_t *pkg) + const alpm_list_t *mount_points, alpm_pkg_t *pkg) { alpm_list_t *file; @@ -186,7 +186,7 @@ static int calculate_removed_size(alpm_handle_t *handle, } static int calculate_installed_size(alpm_handle_t *handle, - const alpm_list_t *mount_points, pmpkg_t *pkg) + const alpm_list_t *mount_points, alpm_pkg_t *pkg) { int ret=0; struct archive *archive; @@ -283,7 +283,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) if(replaces) { numtargs += replaces; for(targ = trans->remove; targ; targ = targ->next, current++) { - pmpkg_t *local_pkg; + alpm_pkg_t *local_pkg; int percent = (current * 100) / numtargs; PROGRESS(trans, PM_TRANS_PROGRESS_DISKSPACE_START, "", percent, numtargs, current); @@ -294,7 +294,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) } for(targ = trans->add; targ; targ = targ->next, current++) { - pmpkg_t *pkg, *local_pkg; + alpm_pkg_t *pkg, *local_pkg; int percent = (current * 100) / numtargs; PROGRESS(trans, PM_TRANS_PROGRESS_DISKSPACE_START, "", percent, numtargs, current); diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 4de14f8a..efdf1be2 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -43,7 +43,7 @@ */ /** Free a package. */ -int SYMEXPORT alpm_pkg_free(pmpkg_t *pkg) +int SYMEXPORT alpm_pkg_free(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); @@ -56,7 +56,7 @@ int SYMEXPORT alpm_pkg_free(pmpkg_t *pkg) } /** Check the integrity (with md5) of a package from the sync cache. */ -int SYMEXPORT alpm_pkg_checkmd5sum(pmpkg_t *pkg) +int SYMEXPORT alpm_pkg_checkmd5sum(alpm_pkg_t *pkg) { char *fpath; int retval; @@ -85,42 +85,42 @@ int SYMEXPORT alpm_pkg_checkmd5sum(pmpkg_t *pkg) * backend logic that needs lazy access, such as the local database through * a lazy-load cache. However, the defaults will work just fine for fully- * populated package structures. */ -static const char *_pkg_get_filename(pmpkg_t *pkg) { return pkg->filename; } -static const char *_pkg_get_desc(pmpkg_t *pkg) { return pkg->desc; } -static const char *_pkg_get_url(pmpkg_t *pkg) { return pkg->url; } -static time_t _pkg_get_builddate(pmpkg_t *pkg) { return pkg->builddate; } -static time_t _pkg_get_installdate(pmpkg_t *pkg) { return pkg->installdate; } -static const char *_pkg_get_packager(pmpkg_t *pkg) { return pkg->packager; } -static const char *_pkg_get_md5sum(pmpkg_t *pkg) { return pkg->md5sum; } -static const char *_pkg_get_arch(pmpkg_t *pkg) { return pkg->arch; } -static off_t _pkg_get_size(pmpkg_t *pkg) { return pkg->size; } -static off_t _pkg_get_isize(pmpkg_t *pkg) { return pkg->isize; } -static alpm_pkgreason_t _pkg_get_reason(pmpkg_t *pkg) { return pkg->reason; } -static int _pkg_has_scriptlet(pmpkg_t *pkg) { return pkg->scriptlet; } - -static alpm_list_t *_pkg_get_licenses(pmpkg_t *pkg) { return pkg->licenses; } -static alpm_list_t *_pkg_get_groups(pmpkg_t *pkg) { return pkg->groups; } -static alpm_list_t *_pkg_get_depends(pmpkg_t *pkg) { return pkg->depends; } -static alpm_list_t *_pkg_get_optdepends(pmpkg_t *pkg) { return pkg->optdepends; } -static alpm_list_t *_pkg_get_conflicts(pmpkg_t *pkg) { return pkg->conflicts; } -static alpm_list_t *_pkg_get_provides(pmpkg_t *pkg) { return pkg->provides; } -static alpm_list_t *_pkg_get_replaces(pmpkg_t *pkg) { return pkg->replaces; } -static alpm_list_t *_pkg_get_deltas(pmpkg_t *pkg) { return pkg->deltas; } -static alpm_list_t *_pkg_get_files(pmpkg_t *pkg) { return pkg->files; } -static alpm_list_t *_pkg_get_backup(pmpkg_t *pkg) { return pkg->backup; } - -static void *_pkg_changelog_open(pmpkg_t UNUSED *pkg) +static const char *_pkg_get_filename(alpm_pkg_t *pkg) { return pkg->filename; } +static const char *_pkg_get_desc(alpm_pkg_t *pkg) { return pkg->desc; } +static const char *_pkg_get_url(alpm_pkg_t *pkg) { return pkg->url; } +static time_t _pkg_get_builddate(alpm_pkg_t *pkg) { return pkg->builddate; } +static time_t _pkg_get_installdate(alpm_pkg_t *pkg) { return pkg->installdate; } +static const char *_pkg_get_packager(alpm_pkg_t *pkg) { return pkg->packager; } +static const char *_pkg_get_md5sum(alpm_pkg_t *pkg) { return pkg->md5sum; } +static const char *_pkg_get_arch(alpm_pkg_t *pkg) { return pkg->arch; } +static off_t _pkg_get_size(alpm_pkg_t *pkg) { return pkg->size; } +static off_t _pkg_get_isize(alpm_pkg_t *pkg) { return pkg->isize; } +static alpm_pkgreason_t _pkg_get_reason(alpm_pkg_t *pkg) { return pkg->reason; } +static int _pkg_has_scriptlet(alpm_pkg_t *pkg) { return pkg->scriptlet; } + +static alpm_list_t *_pkg_get_licenses(alpm_pkg_t *pkg) { return pkg->licenses; } +static alpm_list_t *_pkg_get_groups(alpm_pkg_t *pkg) { return pkg->groups; } +static alpm_list_t *_pkg_get_depends(alpm_pkg_t *pkg) { return pkg->depends; } +static alpm_list_t *_pkg_get_optdepends(alpm_pkg_t *pkg) { return pkg->optdepends; } +static alpm_list_t *_pkg_get_conflicts(alpm_pkg_t *pkg) { return pkg->conflicts; } +static alpm_list_t *_pkg_get_provides(alpm_pkg_t *pkg) { return pkg->provides; } +static alpm_list_t *_pkg_get_replaces(alpm_pkg_t *pkg) { return pkg->replaces; } +static alpm_list_t *_pkg_get_deltas(alpm_pkg_t *pkg) { return pkg->deltas; } +static alpm_list_t *_pkg_get_files(alpm_pkg_t *pkg) { return pkg->files; } +static alpm_list_t *_pkg_get_backup(alpm_pkg_t *pkg) { return pkg->backup; } + +static void *_pkg_changelog_open(alpm_pkg_t UNUSED *pkg) { return NULL; } static size_t _pkg_changelog_read(void UNUSED *ptr, size_t UNUSED size, - const pmpkg_t UNUSED *pkg, const UNUSED void *fp) + const alpm_pkg_t UNUSED *pkg, const UNUSED void *fp) { return 0; } -static int _pkg_changelog_close(const pmpkg_t UNUSED *pkg, +static int _pkg_changelog_close(const alpm_pkg_t UNUSED *pkg, void UNUSED *fp) { return EOF; @@ -162,168 +162,168 @@ struct pkg_operations default_pkg_ops = { /* Public functions for getting package information. These functions * delegate the hard work to the function callbacks attached to each * package, which depend on where the package was loaded from. */ -const char SYMEXPORT *alpm_pkg_get_filename(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_filename(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_filename(pkg); } -const char SYMEXPORT *alpm_pkg_get_name(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_name(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->name; } -const char SYMEXPORT *alpm_pkg_get_version(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_version(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->version; } -const char SYMEXPORT *alpm_pkg_get_desc(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_desc(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_desc(pkg); } -const char SYMEXPORT *alpm_pkg_get_url(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_url(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_url(pkg); } -time_t SYMEXPORT alpm_pkg_get_builddate(pmpkg_t *pkg) +time_t SYMEXPORT alpm_pkg_get_builddate(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_builddate(pkg); } -time_t SYMEXPORT alpm_pkg_get_installdate(pmpkg_t *pkg) +time_t SYMEXPORT alpm_pkg_get_installdate(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_installdate(pkg); } -const char SYMEXPORT *alpm_pkg_get_packager(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_packager(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_packager(pkg); } -const char SYMEXPORT *alpm_pkg_get_md5sum(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_md5sum(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_md5sum(pkg); } -const char SYMEXPORT *alpm_pkg_get_arch(pmpkg_t *pkg) +const char SYMEXPORT *alpm_pkg_get_arch(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_arch(pkg); } -off_t SYMEXPORT alpm_pkg_get_size(pmpkg_t *pkg) +off_t SYMEXPORT alpm_pkg_get_size(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_size(pkg); } -off_t SYMEXPORT alpm_pkg_get_isize(pmpkg_t *pkg) +off_t SYMEXPORT alpm_pkg_get_isize(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_isize(pkg); } -alpm_pkgreason_t SYMEXPORT alpm_pkg_get_reason(pmpkg_t *pkg) +alpm_pkgreason_t SYMEXPORT alpm_pkg_get_reason(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->get_reason(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_licenses(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_licenses(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_licenses(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_groups(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_groups(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_groups(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_depends(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_depends(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_depends(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_optdepends(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_optdepends(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_optdepends(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_conflicts(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_conflicts(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_conflicts(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_provides(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_provides(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_provides(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_replaces(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_replaces(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_replaces(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_deltas(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_deltas(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_deltas(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_files(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_files(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_files(pkg); } -alpm_list_t SYMEXPORT *alpm_pkg_get_backup(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_get_backup(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; return pkg->ops->get_backup(pkg); } -alpm_db_t SYMEXPORT *alpm_pkg_get_db(pmpkg_t *pkg) +alpm_db_t SYMEXPORT *alpm_pkg_get_db(alpm_pkg_t *pkg) { /* Sanity checks */ ASSERT(pkg != NULL, return NULL); @@ -334,7 +334,7 @@ alpm_db_t SYMEXPORT *alpm_pkg_get_db(pmpkg_t *pkg) } /** Open a package changelog for reading. */ -void SYMEXPORT *alpm_pkg_changelog_open(pmpkg_t *pkg) +void SYMEXPORT *alpm_pkg_changelog_open(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; @@ -343,7 +343,7 @@ void SYMEXPORT *alpm_pkg_changelog_open(pmpkg_t *pkg) /** Read data from an open changelog 'file stream'. */ size_t SYMEXPORT alpm_pkg_changelog_read(void *ptr, size_t size, - const pmpkg_t *pkg, const void *fp) + const alpm_pkg_t *pkg, const void *fp) { ASSERT(pkg != NULL, return 0); pkg->handle->pm_errno = 0; @@ -351,34 +351,34 @@ size_t SYMEXPORT alpm_pkg_changelog_read(void *ptr, size_t size, } /* -int SYMEXPORT alpm_pkg_changelog_feof(const pmpkg_t *pkg, void *fp) +int SYMEXPORT alpm_pkg_changelog_feof(const alpm_pkg_t *pkg, void *fp) { return pkg->ops->changelog_feof(pkg, fp); } */ /** Close a package changelog for reading. */ -int SYMEXPORT alpm_pkg_changelog_close(const pmpkg_t *pkg, void *fp) +int SYMEXPORT alpm_pkg_changelog_close(const alpm_pkg_t *pkg, void *fp) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->changelog_close(pkg, fp); } -int SYMEXPORT alpm_pkg_has_scriptlet(pmpkg_t *pkg) +int SYMEXPORT alpm_pkg_has_scriptlet(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; return pkg->ops->has_scriptlet(pkg); } -static void find_requiredby(pmpkg_t *pkg, alpm_db_t *db, alpm_list_t **reqs) +static void find_requiredby(alpm_pkg_t *pkg, alpm_db_t *db, alpm_list_t **reqs) { const alpm_list_t *i; pkg->handle->pm_errno = 0; for(i = _alpm_db_get_pkgcache(db); i; i = i->next) { - pmpkg_t *cachepkg = i->data; + alpm_pkg_t *cachepkg = i->data; alpm_list_t *j; for(j = alpm_pkg_get_depends(cachepkg); j; j = j->next) { if(_alpm_depcmp(pkg, j->data)) { @@ -392,7 +392,7 @@ static void find_requiredby(pmpkg_t *pkg, alpm_db_t *db, alpm_list_t **reqs) } /** Compute the packages requiring a given package. */ -alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg) +alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(alpm_pkg_t *pkg) { const alpm_list_t *i; alpm_list_t *reqs = NULL; @@ -423,21 +423,21 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg) /** @} */ -pmpkg_t *_alpm_pkg_new(void) +alpm_pkg_t *_alpm_pkg_new(void) { - pmpkg_t* pkg; + alpm_pkg_t* pkg; - CALLOC(pkg, 1, sizeof(pmpkg_t), return NULL); + CALLOC(pkg, 1, sizeof(alpm_pkg_t), return NULL); return pkg; } -pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg) +alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg) { - pmpkg_t *newpkg; + alpm_pkg_t *newpkg; alpm_list_t *i; - CALLOC(newpkg, 1, sizeof(pmpkg_t), goto cleanup); + CALLOC(newpkg, 1, sizeof(alpm_pkg_t), goto cleanup); newpkg->name_hash = pkg->name_hash; STRDUP(newpkg->filename, pkg->filename, goto cleanup); @@ -490,7 +490,7 @@ cleanup: return NULL; } -void _alpm_pkg_free(pmpkg_t *pkg) +void _alpm_pkg_free(alpm_pkg_t *pkg) { if(pkg == NULL) { return; @@ -532,7 +532,7 @@ void _alpm_pkg_free(pmpkg_t *pkg) * Case 2: If pkg is a pkgcache entry (PKG_FROM_CACHE), it won't be freed, * only the transaction specific fields of pkg will be freed. */ -void _alpm_pkg_free_trans(pmpkg_t *pkg) +void _alpm_pkg_free_trans(alpm_pkg_t *pkg) { if(pkg == NULL) { return; @@ -548,7 +548,7 @@ void _alpm_pkg_free_trans(pmpkg_t *pkg) } /* Is spkg an upgrade for localpkg? */ -int _alpm_pkg_compare_versions(pmpkg_t *spkg, pmpkg_t *localpkg) +int _alpm_pkg_compare_versions(alpm_pkg_t *spkg, alpm_pkg_t *localpkg) { return alpm_pkg_vercmp(alpm_pkg_get_version(spkg), alpm_pkg_get_version(localpkg)); @@ -558,15 +558,15 @@ int _alpm_pkg_compare_versions(pmpkg_t *spkg, pmpkg_t *localpkg) */ int _alpm_pkg_cmp(const void *p1, const void *p2) { - pmpkg_t *pkg1 = (pmpkg_t *)p1; - pmpkg_t *pkg2 = (pmpkg_t *)p2; + alpm_pkg_t *pkg1 = (alpm_pkg_t *)p1; + alpm_pkg_t *pkg2 = (alpm_pkg_t *)p2; return strcoll(pkg1->name, pkg2->name); } /* Test for existence of a package in a alpm_list_t* - * of pmpkg_t* + * of alpm_pkg_t* */ -pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) +alpm_pkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) { alpm_list_t *lp; unsigned long needle_hash; @@ -578,7 +578,7 @@ pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) needle_hash = _alpm_hash_sdbm(needle); for(lp = haystack; lp; lp = lp->next) { - pmpkg_t *info = lp->data; + alpm_pkg_t *info = lp->data; if(info) { /* a zero hash will cause a fall-through just in case */ @@ -605,7 +605,7 @@ pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) * * @return 1 if the package should be ignored, 0 otherwise */ -int _alpm_pkg_should_ignore(alpm_handle_t *handle, pmpkg_t *pkg) +int _alpm_pkg_should_ignore(alpm_handle_t *handle, alpm_pkg_t *pkg) { alpm_list_t *groups = NULL; diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index b74d30ef..5edf40de 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -48,33 +48,33 @@ typedef enum _pmpkgfrom_t { * defined default_pkg_ops struct to work just fine for their needs. */ struct pkg_operations { - const char *(*get_filename) (pmpkg_t *); - const char *(*get_desc) (pmpkg_t *); - const char *(*get_url) (pmpkg_t *); - time_t (*get_builddate) (pmpkg_t *); - time_t (*get_installdate) (pmpkg_t *); - const char *(*get_packager) (pmpkg_t *); - const char *(*get_md5sum) (pmpkg_t *); - const char *(*get_arch) (pmpkg_t *); - off_t (*get_size) (pmpkg_t *); - off_t (*get_isize) (pmpkg_t *); - alpm_pkgreason_t (*get_reason) (pmpkg_t *); - int (*has_scriptlet) (pmpkg_t *); - - alpm_list_t *(*get_licenses) (pmpkg_t *); - alpm_list_t *(*get_groups) (pmpkg_t *); - alpm_list_t *(*get_depends) (pmpkg_t *); - alpm_list_t *(*get_optdepends) (pmpkg_t *); - alpm_list_t *(*get_conflicts) (pmpkg_t *); - alpm_list_t *(*get_provides) (pmpkg_t *); - alpm_list_t *(*get_replaces) (pmpkg_t *); - alpm_list_t *(*get_deltas) (pmpkg_t *); - alpm_list_t *(*get_files) (pmpkg_t *); - alpm_list_t *(*get_backup) (pmpkg_t *); - - void *(*changelog_open) (pmpkg_t *); - size_t (*changelog_read) (void *, size_t, const pmpkg_t *, const void *); - int (*changelog_close) (const pmpkg_t *, void *); + const char *(*get_filename) (alpm_pkg_t *); + const char *(*get_desc) (alpm_pkg_t *); + const char *(*get_url) (alpm_pkg_t *); + time_t (*get_builddate) (alpm_pkg_t *); + time_t (*get_installdate) (alpm_pkg_t *); + const char *(*get_packager) (alpm_pkg_t *); + const char *(*get_md5sum) (alpm_pkg_t *); + const char *(*get_arch) (alpm_pkg_t *); + off_t (*get_size) (alpm_pkg_t *); + off_t (*get_isize) (alpm_pkg_t *); + alpm_pkgreason_t (*get_reason) (alpm_pkg_t *); + int (*has_scriptlet) (alpm_pkg_t *); + + alpm_list_t *(*get_licenses) (alpm_pkg_t *); + alpm_list_t *(*get_groups) (alpm_pkg_t *); + alpm_list_t *(*get_depends) (alpm_pkg_t *); + alpm_list_t *(*get_optdepends) (alpm_pkg_t *); + alpm_list_t *(*get_conflicts) (alpm_pkg_t *); + alpm_list_t *(*get_provides) (alpm_pkg_t *); + alpm_list_t *(*get_replaces) (alpm_pkg_t *); + alpm_list_t *(*get_deltas) (alpm_pkg_t *); + alpm_list_t *(*get_files) (alpm_pkg_t *); + alpm_list_t *(*get_backup) (alpm_pkg_t *); + + void *(*changelog_open) (alpm_pkg_t *); + size_t (*changelog_read) (void *, size_t, const alpm_pkg_t *, const void *); + int (*changelog_close) (const alpm_pkg_t *, void *); /* still to add: * checkmd5sum() ? @@ -89,7 +89,7 @@ struct pkg_operations { */ extern struct pkg_operations default_pkg_ops; -struct __pmpkg_t { +struct __alpm_pkg_t { unsigned long name_hash; char *filename; char *name; @@ -137,20 +137,20 @@ struct __pmpkg_t { struct pkg_operations *ops; }; -pmpkg_t* _alpm_pkg_new(void); -pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg); -void _alpm_pkg_free(pmpkg_t *pkg); -void _alpm_pkg_free_trans(pmpkg_t *pkg); +alpm_pkg_t* _alpm_pkg_new(void); +alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg); +void _alpm_pkg_free(alpm_pkg_t *pkg); +void _alpm_pkg_free_trans(alpm_pkg_t *pkg); -pmpkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, +alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, int full, const char *md5sum, const char *base64_sig, pgp_verify_t check_sig); int _alpm_pkg_cmp(const void *p1, const void *p2); -int _alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg); -pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle); -int _alpm_pkg_should_ignore(alpm_handle_t *handle, pmpkg_t *pkg); +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); #endif /* _ALPM_PACKAGE_H */ diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c index 9e98fcd8..2fd82de3 100644 --- a/lib/libalpm/pkghash.c +++ b/lib/libalpm/pkghash.c @@ -128,7 +128,7 @@ static pmpkghash_t *rehash(pmpkghash_t *oldhash) for(i = 0; i < oldhash->buckets; i++) { if(oldhash->hash_table[i] != NULL) { - pmpkg_t *package = oldhash->hash_table[i]->data; + alpm_pkg_t *package = oldhash->hash_table[i]->data; position = get_hash_position(package->name_hash, newhash); @@ -144,7 +144,7 @@ static pmpkghash_t *rehash(pmpkghash_t *oldhash) return newhash; } -static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, pmpkg_t *pkg, int sorted) +static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, alpm_pkg_t *pkg, int sorted) { alpm_list_t *ptr; size_t position; @@ -179,12 +179,12 @@ static pmpkghash_t *pkghash_add_pkg(pmpkghash_t *hash, pmpkg_t *pkg, int sorted) return hash; } -pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, pmpkg_t *pkg) +pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, alpm_pkg_t *pkg) { return pkghash_add_pkg(hash, pkg, 0); } -pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, pmpkg_t *pkg) +pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, alpm_pkg_t *pkg) { return pkghash_add_pkg(hash, pkg, 1); } @@ -200,7 +200,7 @@ static size_t move_one_entry(pmpkghash_t *hash, size_t start, size_t end) * 'start' we can stop this madness. */ while(end != start) { alpm_list_t *i = hash->hash_table[end]; - pmpkg_t *info = i->data; + alpm_pkg_t *info = i->data; size_t new_position = get_hash_position(info->name_hash, hash); if(new_position == start) { @@ -226,8 +226,8 @@ static size_t move_one_entry(pmpkghash_t *hash, size_t start, size_t end) * * @return the resultant hash */ -pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, pmpkg_t *pkg, - pmpkg_t **data) +pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, alpm_pkg_t *pkg, + alpm_pkg_t **data) { alpm_list_t *i; size_t position; @@ -242,7 +242,7 @@ pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, pmpkg_t *pkg, position = pkg->name_hash % hash->buckets; while((i = hash->hash_table[position]) != NULL) { - pmpkg_t *info = i->data; + alpm_pkg_t *info = i->data; if(info->name_hash == pkg->name_hash && strcmp(info->name, pkg->name) == 0) { @@ -295,7 +295,7 @@ void _alpm_pkghash_free(pmpkghash_t *hash) free(hash); } -pmpkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name) +alpm_pkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name) { alpm_list_t *lp; unsigned long name_hash; @@ -310,7 +310,7 @@ pmpkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name) position = name_hash % hash->buckets; while((lp = hash->hash_table[position]) != NULL) { - pmpkg_t *info = lp->data; + alpm_pkg_t *info = lp->data; if(info->name_hash == name_hash && strcmp(info->name, name) == 0) { return info; diff --git a/lib/libalpm/pkghash.h b/lib/libalpm/pkghash.h index 617e60bd..ab8fef0c 100644 --- a/lib/libalpm/pkghash.h +++ b/lib/libalpm/pkghash.h @@ -27,7 +27,7 @@ /** - * @brief A hash table for holding pmpkg_t objects. + * @brief A hash table for holding alpm_pkg_t objects. * * A combination of a hash table and a list, allowing for fast look-up * by package name but also iteration over the packages. @@ -47,13 +47,13 @@ typedef struct __pmpkghash_t pmpkghash_t; pmpkghash_t *_alpm_pkghash_create(size_t size); -pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, pmpkg_t *pkg); -pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, pmpkg_t *pkg); -pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, pmpkg_t *pkg, pmpkg_t **data); +pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, alpm_pkg_t *pkg); +pmpkghash_t *_alpm_pkghash_add_sorted(pmpkghash_t *hash, alpm_pkg_t *pkg); +pmpkghash_t *_alpm_pkghash_remove(pmpkghash_t *hash, alpm_pkg_t *pkg, alpm_pkg_t **data); void _alpm_pkghash_free(pmpkghash_t *hash); -pmpkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name); +alpm_pkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name); #define MAX_HASH_LOAD 0.7 diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 9a56e9b3..bc290736 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -44,7 +44,7 @@ #include "deps.h" #include "handle.h" -int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, pmpkg_t *pkg) +int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) { const char *pkgname; pmtrans_t *trans; @@ -78,7 +78,7 @@ static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp) alpm_list_t *i; for(i = lp; i; i = i->next) { pmdepmissing_t *miss = (pmdepmissing_t *)i->data; - pmpkg_t *info = _alpm_db_get_pkgfromcache(handle->db_local, miss->target); + alpm_pkg_t *info = _alpm_db_get_pkgfromcache(handle->db_local, miss->target); if(info) { if(!_alpm_pkg_find(trans->remove, alpm_pkg_get_name(info))) { _alpm_log(handle, PM_LOG_DEBUG, "pulling %s in target list\n", @@ -107,7 +107,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) for(i = lp; i; i = i->next) { pmdepmissing_t *miss = (pmdepmissing_t *)i->data; void *vpkg; - pmpkg_t *pkg = _alpm_pkg_find(trans->remove, miss->causingpkg); + alpm_pkg_t *pkg = _alpm_pkg_find(trans->remove, miss->causingpkg); if(pkg == NULL) { continue; } @@ -219,7 +219,7 @@ static int can_remove_file(alpm_handle_t *handle, const char *path, /* Helper function for iterating through a package's file and deleting them * Used by _alpm_remove_commit. */ -static void unlink_file(alpm_handle_t *handle, pmpkg_t *info, const char *filename, +static void unlink_file(alpm_handle_t *handle, alpm_pkg_t *info, const char *filename, alpm_list_t *skip_remove, int nosave) { struct stat buf; @@ -283,7 +283,7 @@ static void unlink_file(alpm_handle_t *handle, pmpkg_t *info, const char *filena } int _alpm_upgraderemove_package(alpm_handle_t *handle, - pmpkg_t *oldpkg, pmpkg_t *newpkg) + alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg) { alpm_list_t *skip_remove, *b; alpm_list_t *newfiles, *lp; @@ -355,7 +355,7 @@ db: int _alpm_remove_packages(alpm_handle_t *handle) { - pmpkg_t *info; + alpm_pkg_t *info; alpm_list_t *targ, *lp; size_t pkg_count; pmtrans_t *trans = handle->trans; @@ -365,7 +365,7 @@ int _alpm_remove_packages(alpm_handle_t *handle) for(targ = trans->remove; targ; targ = targ->next) { int position = 0; char scriptlet[PATH_MAX]; - info = (pmpkg_t *)targ->data; + info = (alpm_pkg_t *)targ->data; const char *pkgname = NULL; size_t targcount = alpm_list_count(targ); diff --git a/lib/libalpm/remove.h b/lib/libalpm/remove.h index d4565580..48dc2e9c 100644 --- a/lib/libalpm/remove.h +++ b/lib/libalpm/remove.h @@ -28,7 +28,7 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data); int _alpm_remove_packages(alpm_handle_t *handle); int _alpm_upgraderemove_package(alpm_handle_t *handle, - pmpkg_t *oldpkg, pmpkg_t *newpkg); + alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg); #endif /* _ALPM_REMOVE_H */ diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 0bab1063..35b352be 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -381,7 +381,7 @@ pgp_verify_t _alpm_db_get_sigverify_level(alpm_db_t *db) * @param pkg the package to check * @return a int value : 0 (valid), 1 (invalid), -1 (an error occurred) */ -int SYMEXPORT alpm_pkg_check_pgp_signature(pmpkg_t *pkg) +int SYMEXPORT alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg) { ASSERT(pkg != NULL, return -1); pkg->handle->pm_errno = 0; diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index c60f019c..86cd48ce 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -53,10 +53,10 @@ /** Check for new version of pkg in sync repos * (only the first occurrence is considered in sync) */ -pmpkg_t SYMEXPORT *alpm_sync_newversion(pmpkg_t *pkg, alpm_list_t *dbs_sync) +alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync) { alpm_list_t *i; - pmpkg_t *spkg = NULL; + alpm_pkg_t *spkg = NULL; ASSERT(pkg != NULL, return NULL); pkg->handle->pm_errno = 0; @@ -99,7 +99,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) _alpm_log(handle, PM_LOG_DEBUG, "checking for package upgrades\n"); for(i = _alpm_db_get_pkgcache(db_local); i; i = i->next) { - pmpkg_t *lpkg = i->data; + alpm_pkg_t *lpkg = i->data; if(_alpm_pkg_find(trans->add, lpkg->name)) { _alpm_log(handle, PM_LOG_DEBUG, "%s is already in the target list -- skipping\n", lpkg->name); @@ -111,7 +111,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) for(j = dbs_sync; j; j = j->next) { alpm_db_t *sdb = j->data; /* Check sdb */ - pmpkg_t *spkg = _alpm_db_get_pkgfromcache(sdb, lpkg->name); + alpm_pkg_t *spkg = _alpm_db_get_pkgfromcache(sdb, lpkg->name); if(spkg) { /* 1. literal was found in sdb */ int cmp = _alpm_pkg_compare_versions(spkg, lpkg); @@ -170,7 +170,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* If spkg is already in the target list, we append lpkg to spkg's * removes list */ - pmpkg_t *tpkg = _alpm_pkg_find(trans->add, spkg->name); + alpm_pkg_t *tpkg = _alpm_pkg_find(trans->add, spkg->name); if(tpkg) { /* sanity check, multiple repos can contain spkg->name */ if(tpkg->origin_data.db != sdb) { @@ -211,7 +211,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) * IgnorePkg is also handled. * @param dbs the list of alpm_db_t * * @pram name the name of the group - * @return the list of pmpkg_t * (caller is responsible for alpm_list_free) + * @return the list of alpm_pkg_t * (caller is responsible for alpm_list_free) */ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs, const char *name) @@ -226,7 +226,7 @@ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs, continue; for(j = grp->packages; j; j = j->next) { - pmpkg_t *pkg = j->data; + alpm_pkg_t *pkg = j->data; if(_alpm_pkg_find(ignorelist, alpm_pkg_get_name(pkg))) { continue; @@ -252,7 +252,7 @@ alpm_list_t SYMEXPORT *alpm_find_grp_pkgs(alpm_list_t *dbs, * package. * @param newpkg the new package to upgrade to */ -static int compute_download_size(pmpkg_t *newpkg) +static int compute_download_size(alpm_pkg_t *newpkg) { const char *fname; char *fpath; @@ -325,7 +325,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* build remove list for resolvedeps */ for(i = trans->add; i; i = i->next) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; for(j = spkg->removes; j; j = j->next) { remove = alpm_list_add(remove, j->data); } @@ -339,7 +339,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* Resolve packages in the transaction one at a time, in addition building up a list of packages which could not be resolved. */ for(i = trans->add; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(_alpm_resolvedeps(handle, localpkgs, pkg, trans->add, &resolved, remove, data) == -1) { unresolvable = alpm_list_add(unresolvable, pkg); @@ -376,7 +376,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* Set DEPEND reason for pulled packages */ for(i = resolved; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; if(!_alpm_pkg_find(trans->add, pkg->name)) { pkg->reason = PM_PKG_REASON_DEPEND; } @@ -406,7 +406,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) for(i = deps; i; i = i->next) { pmconflict_t *conflict = i->data; - pmpkg_t *rsync, *sync, *sync1, *sync2; + alpm_pkg_t *rsync, *sync, *sync1, *sync2; /* have we already removed one of the conflicting targets? */ sync1 = _alpm_pkg_find(trans->add, conflict->package1); @@ -470,7 +470,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) we ask the user */ int found = 0; for(j = trans->add; j && !found; j = j->next) { - pmpkg_t *spkg = j->data; + alpm_pkg_t *spkg = j->data; if(_alpm_pkg_find(spkg->removes, conflict->package2)) { found = 1; } @@ -482,8 +482,8 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) _alpm_log(handle, PM_LOG_DEBUG, "package '%s' conflicts with '%s'\n", conflict->package1, conflict->package2); - pmpkg_t *sync = _alpm_pkg_find(trans->add, conflict->package1); - pmpkg_t *local = _alpm_db_get_pkgfromcache(handle->db_local, conflict->package2); + alpm_pkg_t *sync = _alpm_pkg_find(trans->add, conflict->package1); + alpm_pkg_t *local = _alpm_db_get_pkgfromcache(handle->db_local, conflict->package2); int doremove = 0; QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, conflict->package1, conflict->package2, conflict->reason, &doremove); @@ -513,9 +513,9 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* Build trans->remove list */ for(i = trans->add; i; i = i->next) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; for(j = spkg->removes; j; j = j->next) { - pmpkg_t *rpkg = j->data; + alpm_pkg_t *rpkg = j->data; if(!_alpm_pkg_find(trans->remove, rpkg->name)) { _alpm_log(handle, PM_LOG_DEBUG, "adding '%s' to remove list\n", rpkg->name); trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(rpkg)); @@ -541,7 +541,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) } for(i = trans->add; i; i = i->next) { /* update download size field */ - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; if(compute_download_size(spkg) != 0) { ret = -1; goto cleanup; @@ -560,7 +560,7 @@ cleanup: * @param newpkg the new package to upgrade to * @return the size of the download */ -off_t SYMEXPORT alpm_pkg_download_size(pmpkg_t *newpkg) +off_t SYMEXPORT alpm_pkg_download_size(alpm_pkg_t *newpkg) { if(!(newpkg->infolevel & INFRQ_DSIZE)) { compute_download_size(newpkg); @@ -591,7 +591,7 @@ static int apply_deltas(alpm_handle_t *handle) pmtrans_t *trans = handle->trans; for(i = trans->add; i; i = i->next) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; alpm_list_t *delta_path = spkg->delta_path; alpm_list_t *dlts = NULL; @@ -743,7 +743,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) off_t total_size = (off_t)0; /* sum up the download size for each package and store total */ for(i = handle->trans->add; i; i = i->next) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; total_size += spkg->download_size; } handle->totaldlcb(total_size); @@ -754,7 +754,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) alpm_db_t *current = i->data; for(j = handle->trans->add; j; j = j->next) { - pmpkg_t *spkg = j->data; + alpm_pkg_t *spkg = j->data; if(spkg->origin != PKG_FROM_FILE && current == spkg->origin_data.db) { const char *fname = NULL; @@ -821,7 +821,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) } for(j = handle->trans->add; j; j = j->next) { - pmpkg_t *pkg = j->data; + alpm_pkg_t *pkg = j->data; pkg->infolevel &= ~INFRQ_DSIZE; pkg->download_size = 0; } @@ -859,7 +859,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) errors = 0; for(i = trans->add; i; i = i->next, current++) { - pmpkg_t *spkg = i->data; + alpm_pkg_t *spkg = i->data; int percent = (current * 100) / numtargs; const char *filename; char *filepath; @@ -881,7 +881,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) _alpm_log(handle, PM_LOG_DEBUG, "replacing pkgcache entry with package file for target %s\n", spkg->name); - pmpkg_t *pkgfile =_alpm_pkg_load_internal(handle, filepath, 1, spkg->md5sum, + alpm_pkg_t *pkgfile =_alpm_pkg_load_internal(handle, filepath, 1, spkg->md5sum, spkg->base64_sig, check_sig); if(!pkgfile) { errors++; diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 7e7c2558..73dd6a42 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -95,7 +95,7 @@ static alpm_list_t *check_arch(alpm_handle_t *handle, alpm_list_t *pkgs) return NULL; } for(i = pkgs; i; i = i->next) { - pmpkg_t *pkg = i->data; + alpm_pkg_t *pkg = i->data; const char *pkgarch = alpm_pkg_get_arch(pkg); if(pkgarch && strcmp(pkgarch, arch) && strcmp(pkgarch, "any")) { char *string; diff --git a/lib/libalpm/trans.h b/lib/libalpm/trans.h index d9b8e90a..87238e4a 100644 --- a/lib/libalpm/trans.h +++ b/lib/libalpm/trans.h @@ -39,8 +39,8 @@ typedef enum _pmtransstate_t { struct __pmtrans_t { pmtransflag_t flags; pmtransstate_t state; - alpm_list_t *add; /* list of (pmpkg_t *) */ - alpm_list_t *remove; /* list of (pmpkg_t *) */ + alpm_list_t *add; /* list of (alpm_pkg_t *) */ + alpm_list_t *remove; /* list of (alpm_pkg_t *) */ alpm_list_t *skip_remove; /* list of (char *) */ alpm_trans_cb_event cb_event; alpm_trans_cb_conv cb_conv; diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index 8006c74a..614c2fbb 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -28,7 +28,7 @@ #include "alpm_list.h" #include "alpm.h" -#include "package.h" /* pmpkg_t */ +#include "package.h" /* alpm_pkg_t */ #include "handle.h" /* alpm_handle_t */ #include <stdio.h> diff --git a/src/pacman/package.c b/src/pacman/package.c index 32156c53..22b9045e 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -45,7 +45,7 @@ * @param from the type of package we are dealing with * @param extra should we show extra information */ -void dump_pkg_full(pmpkg_t *pkg, enum pkg_from from, int extra) +void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra) { const char *reason; time_t bdate, idate; @@ -192,7 +192,7 @@ static const char *get_backup_file_status(const char *root, /* Display list of backup files and their modification states */ -void dump_pkg_backups(pmpkg_t *pkg) +void dump_pkg_backups(alpm_pkg_t *pkg) { alpm_list_t *i; const char *root = alpm_option_get_root(config->handle); @@ -216,7 +216,7 @@ void dump_pkg_backups(pmpkg_t *pkg) /* List all files contained in a package */ -void dump_pkg_files(pmpkg_t *pkg, int quiet) +void dump_pkg_files(alpm_pkg_t *pkg, int quiet) { const char *pkgname, *root, *filestr; alpm_list_t *i, *pkgfiles; @@ -239,7 +239,7 @@ void dump_pkg_files(pmpkg_t *pkg, int quiet) /* Display the changelog of a package */ -void dump_pkg_changelog(pmpkg_t *pkg) +void dump_pkg_changelog(alpm_pkg_t *pkg) { void *fp = NULL; diff --git a/src/pacman/package.h b/src/pacman/package.h index 7a5e5853..6f71d20e 100644 --- a/src/pacman/package.h +++ b/src/pacman/package.h @@ -29,11 +29,11 @@ enum pkg_from { PKG_FROM_SYNCDB }; -void dump_pkg_full(pmpkg_t *pkg, enum pkg_from from, int extra); +void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra); -void dump_pkg_backups(pmpkg_t *pkg); -void dump_pkg_files(pmpkg_t *pkg, int quiet); -void dump_pkg_changelog(pmpkg_t *pkg); +void dump_pkg_backups(alpm_pkg_t *pkg); +void dump_pkg_files(alpm_pkg_t *pkg, int quiet); +void dump_pkg_changelog(alpm_pkg_t *pkg); #endif /* _PM_PACKAGE_H */ diff --git a/src/pacman/query.c b/src/pacman/query.c index e0ec2c68..2602c114 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -95,7 +95,7 @@ static int search_path(char **filename, struct stat *bufptr) return -1; } -static void print_query_fileowner(const char *filename, pmpkg_t *info) +static void print_query_fileowner(const char *filename, alpm_pkg_t *info) { if(!config->quiet) { printf(_("%s is owned by %s %s\n"), filename, @@ -189,7 +189,7 @@ static int query_fileowner(alpm_list_t *targets) for(i = alpm_db_get_pkgcache(db_local); i && !found; i = alpm_list_next(i)) { alpm_list_t *j; - pmpkg_t *info = alpm_list_getdata(i); + alpm_pkg_t *info = alpm_list_getdata(i); for(j = alpm_pkg_get_files(info); j && !found; j = alpm_list_next(j)) { char *ppath, *pdname; @@ -256,7 +256,7 @@ static int query_search(alpm_list_t *targets) for(i = searchlist; i; i = alpm_list_next(i)) { alpm_list_t *grp; - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(!config->quiet) { printf("local/%s %s", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg)); @@ -307,7 +307,7 @@ static int query_group(alpm_list_t *targets) const alpm_list_t *p; for(p = grp->packages; p; p = alpm_list_next(p)) { - pmpkg_t *pkg = alpm_list_getdata(p); + alpm_pkg_t *pkg = alpm_list_getdata(p); printf("%s %s\n", grp->name, alpm_pkg_get_name(pkg)); } } @@ -335,7 +335,7 @@ static int query_group(alpm_list_t *targets) return ret; } -static int is_foreign(pmpkg_t *pkg) +static int is_foreign(alpm_pkg_t *pkg) { const char *pkgname = alpm_pkg_get_name(pkg); alpm_list_t *j; @@ -344,7 +344,7 @@ static int is_foreign(pmpkg_t *pkg) int match = 0; for(j = sync_dbs; j; j = alpm_list_next(j)) { alpm_db_t *db = alpm_list_getdata(j); - pmpkg_t *findpkg = alpm_db_get_pkg(db, pkgname); + alpm_pkg_t *findpkg = alpm_db_get_pkg(db, pkgname); if(findpkg) { match = 1; break; @@ -356,7 +356,7 @@ static int is_foreign(pmpkg_t *pkg) return 0; } -static int is_unrequired(pmpkg_t *pkg) +static int is_unrequired(alpm_pkg_t *pkg) { alpm_list_t *requiredby = alpm_pkg_compute_requiredby(pkg); if(requiredby == NULL) { @@ -366,7 +366,7 @@ static int is_unrequired(pmpkg_t *pkg) return 0; } -static int filter(pmpkg_t *pkg) +static int filter(alpm_pkg_t *pkg) { /* check if this package was explicitly installed */ if(config->op_q_explicit && @@ -396,7 +396,7 @@ static int filter(pmpkg_t *pkg) /* Loop through the packages. For each package, * loop through files to check if they exist. */ -static int check(pmpkg_t *pkg) +static int check(alpm_pkg_t *pkg) { alpm_list_t *i; const char *root; @@ -446,7 +446,7 @@ static int check(pmpkg_t *pkg) return (errors != 0 ? 1 : 0); } -static int display(pmpkg_t *pkg) +static int display(alpm_pkg_t *pkg) { int ret = 0; @@ -482,7 +482,7 @@ int pacman_query(alpm_list_t *targets) int ret = 0; int match = 0; alpm_list_t *i; - pmpkg_t *pkg = NULL; + alpm_pkg_t *pkg = NULL; alpm_db_t *db_local; /* First: operations that do not require targets */ diff --git a/src/pacman/remove.c b/src/pacman/remove.c index f30f5068..c2490e3b 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -33,7 +33,7 @@ static int remove_target(const char *target) { - pmpkg_t *info; + alpm_pkg_t *info; alpm_db_t *db_local = alpm_option_get_localdb(config->handle); alpm_list_t *p; @@ -53,7 +53,7 @@ static int remove_target(const char *target) return -1; } for(p = grp->packages; p; p = alpm_list_next(p)) { - pmpkg_t *pkg = alpm_list_getdata(p); + alpm_pkg_t *pkg = alpm_list_getdata(p); if(alpm_remove_pkg(config->handle, pkg) == -1) { pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target, alpm_strerror(alpm_errno(config->handle))); @@ -131,7 +131,7 @@ int pacman_remove(alpm_list_t *targets) /* Search for holdpkg in target list */ int holdpkg = 0; for(i = alpm_trans_get_remove(config->handle); i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(alpm_list_find_str(config->holdpkg, alpm_pkg_get_name(pkg))) { pm_printf(PM_LOG_WARNING, _("%s is designated as a HoldPkg.\n"), alpm_pkg_get_name(pkg)); diff --git a/src/pacman/sync.c b/src/pacman/sync.c index 9dde7605..ae28ac97 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -196,7 +196,7 @@ static int sync_cleancache(int level) char path[PATH_MAX]; size_t pathlen; int delete = 1; - pmpkg_t *localpkg = NULL, *pkg = NULL; + alpm_pkg_t *localpkg = NULL, *pkg = NULL; const char *local_name, *local_version; if(strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) { @@ -308,11 +308,11 @@ static int sync_synctree(int level, alpm_list_t *syncs) return (success > 0); } -static void print_installed(alpm_db_t *db_local, pmpkg_t *pkg) +static void print_installed(alpm_db_t *db_local, alpm_pkg_t *pkg) { const char *pkgname = alpm_pkg_get_name(pkg); const char *pkgver = alpm_pkg_get_version(pkg); - pmpkg_t *lpkg = alpm_db_get_pkg(db_local, pkgname); + alpm_pkg_t *lpkg = alpm_db_get_pkg(db_local, pkgname); if(lpkg) { const char *lpkgver = alpm_pkg_get_version(lpkg); if(strcmp(lpkgver,pkgver) == 0) { @@ -348,7 +348,7 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets) } for(j = ret; j; j = alpm_list_next(j)) { alpm_list_t *grp; - pmpkg_t *pkg = alpm_list_getdata(j); + alpm_pkg_t *pkg = alpm_list_getdata(j); if(!config->quiet) { printf("%s/%s %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg), @@ -471,7 +471,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) } for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) { - pmpkg_t *pkg = alpm_list_getdata(k); + alpm_pkg_t *pkg = alpm_list_getdata(k); if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) { dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); @@ -492,7 +492,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) alpm_db_t *db = alpm_list_getdata(j); for(k = alpm_db_get_pkgcache(db); k; k = alpm_list_next(k)) { - pmpkg_t *pkg = alpm_list_getdata(k); + alpm_pkg_t *pkg = alpm_list_getdata(k); if(strcmp(alpm_pkg_get_name(pkg), pkgstr) == 0) { dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); @@ -513,7 +513,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) alpm_db_t *db = alpm_list_getdata(i); for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) { - pmpkg_t *pkg = alpm_list_getdata(j); + alpm_pkg_t *pkg = alpm_list_getdata(j); dump_pkg_full(pkg, PKG_FROM_SYNCDB, config->op_s_info > 1); } } @@ -558,7 +558,7 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) alpm_db_t *db = alpm_list_getdata(i); for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) { - pmpkg_t *pkg = alpm_list_getdata(j); + alpm_pkg_t *pkg = alpm_list_getdata(j); if(!config->quiet) { printf("%s %s %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg), @@ -585,7 +585,7 @@ static alpm_list_t *syncfirst(void) { for(i = config->syncfirst; i; i = alpm_list_next(i)) { char *pkgname = alpm_list_getdata(i); - pmpkg_t *pkg = alpm_db_get_pkg(db_local, pkgname); + alpm_pkg_t *pkg = alpm_db_get_pkg(db_local, pkgname); if(pkg == NULL) { continue; } @@ -610,7 +610,7 @@ static alpm_db_t *get_db(const char *dbname) return NULL; } -static int process_pkg(pmpkg_t *pkg) +static int process_pkg(alpm_pkg_t *pkg) { int ret = alpm_add_pkg(config->handle, pkg); @@ -653,7 +653,7 @@ static int process_group(alpm_list_t *dbs, char *group) for(i = pkgs; i; i = alpm_list_next(i)) { if(array[n++] == 0) continue; - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(process_pkg(pkg) == 1) { ret = 1; @@ -663,7 +663,7 @@ static int process_group(alpm_list_t *dbs, char *group) } } else { for(i = pkgs; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(process_pkg(pkg) == 1) { ret = 1; @@ -678,7 +678,7 @@ cleanup: static int process_targname(alpm_list_t *dblist, char *targname) { - pmpkg_t *pkg = alpm_find_dbs_satisfier(config->handle, dblist, targname); + alpm_pkg_t *pkg = alpm_find_dbs_satisfier(config->handle, dblist, targname); /* #FS#23342 - skip ignored packages when user says no */ if(alpm_errno(config->handle) == PM_ERR_PKG_IGNORED) { diff --git a/src/pacman/upgrade.c b/src/pacman/upgrade.c index c1f72f6d..24420ef0 100644 --- a/src/pacman/upgrade.c +++ b/src/pacman/upgrade.c @@ -74,7 +74,7 @@ int pacman_upgrade(alpm_list_t *targets) /* add targets to the created transaction */ for(i = targets; i; i = alpm_list_next(i)) { char *targ = alpm_list_getdata(i); - pmpkg_t *pkg; + alpm_pkg_t *pkg; if(alpm_pkg_load(config->handle, targ, 1, check_sig, &pkg) != 0) { pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", diff --git a/src/pacman/util.c b/src/pacman/util.c index cdf8b11a..1e6d1e18 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -660,7 +660,7 @@ static alpm_list_t *create_verbose_header(int install) } /* returns package info as list of strings */ -static alpm_list_t *create_verbose_row(pmpkg_t *pkg, int install) +static alpm_list_t *create_verbose_row(alpm_pkg_t *pkg, int install) { char *str; double size; @@ -674,7 +674,7 @@ static alpm_list_t *create_verbose_row(pmpkg_t *pkg, int install) /* old and new versions */ if(install) { - pmpkg_t *oldpkg = alpm_db_get_pkg(ldb, alpm_pkg_get_name(pkg)); + alpm_pkg_t *oldpkg = alpm_db_get_pkg(ldb, alpm_pkg_get_name(pkg)); pm_asprintf(&str, "%s", oldpkg != NULL ? alpm_pkg_get_version(oldpkg) : ""); ret = alpm_list_add(ret, str); @@ -708,10 +708,10 @@ void display_targets(const alpm_list_t *pkgs, int install) /* gather pkg infos */ for(i = pkgs; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); if(install) { - pmpkg_t *lpkg = alpm_db_get_pkg(db_local, alpm_pkg_get_name(pkg)); + alpm_pkg_t *lpkg = alpm_db_get_pkg(db_local, alpm_pkg_get_name(pkg)); dlsize += alpm_pkg_download_size(pkg); if(lpkg) { /* add up size of all removed packages */ @@ -779,7 +779,7 @@ out: free(str); } -static off_t pkg_get_size(pmpkg_t *pkg) +static off_t pkg_get_size(alpm_pkg_t *pkg) { switch(config->op) { case PM_OP_SYNC: @@ -791,7 +791,7 @@ static off_t pkg_get_size(pmpkg_t *pkg) } } -static char *pkg_get_location(pmpkg_t *pkg) +static char *pkg_get_location(alpm_pkg_t *pkg) { alpm_list_t *servers; char *string = NULL; @@ -856,7 +856,7 @@ void print_packages(const alpm_list_t *packages) config->print_format = strdup("%l"); } for(i = packages; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); char *string = strdup(config->print_format); char *temp = string; /* %n : pkgname */ @@ -910,7 +910,7 @@ int str_cmp(const void *s1, const void *s2) return strcmp(s1, s2); } -void display_new_optdepends(pmpkg_t *oldpkg, pmpkg_t *newpkg) +void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg) { alpm_list_t *old = alpm_pkg_get_optdepends(oldpkg); alpm_list_t *new = alpm_pkg_get_optdepends(newpkg); @@ -922,7 +922,7 @@ void display_new_optdepends(pmpkg_t *oldpkg, pmpkg_t *newpkg) alpm_list_free(optdeps); } -void display_optdepends(pmpkg_t *pkg) +void display_optdepends(alpm_pkg_t *pkg) { alpm_list_t *optdeps = alpm_pkg_get_optdepends(pkg); if(optdeps) { @@ -949,7 +949,7 @@ void select_display(const alpm_list_t *pkglist) const char *dbname = NULL; for (i = pkglist; i; i = i->next) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); alpm_db_t *db = alpm_pkg_get_db(pkg); if(!dbname) diff --git a/src/pacman/util.h b/src/pacman/util.h index d8ae7d80..89ab903a 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -58,8 +58,8 @@ void list_display(const char *title, const alpm_list_t *list); void list_display_linebreak(const char *title, const alpm_list_t *list); void display_targets(const alpm_list_t *pkgs, int install); int str_cmp(const void *s1, const void *s2); -void display_new_optdepends(pmpkg_t *oldpkg, pmpkg_t *newpkg); -void display_optdepends(pmpkg_t *pkg); +void display_new_optdepends(alpm_pkg_t *oldpkg, alpm_pkg_t *newpkg); +void display_optdepends(alpm_pkg_t *pkg); void print_packages(const alpm_list_t *packages); void select_display(const alpm_list_t *pkglist); int select_question(int count); diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c index f56063db..dcd849bb 100644 --- a/src/util/cleanupdelta.c +++ b/src/util/cleanupdelta.c @@ -57,7 +57,7 @@ static void checkpkgs(alpm_list_t *pkglist) { alpm_list_t *i, *j; for(i = pkglist; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = alpm_list_getdata(i); + alpm_pkg_t *pkg = alpm_list_getdata(i); alpm_list_t *unused = alpm_pkg_unused_deltas(pkg); for(j = unused; j; j = alpm_list_next(j)) { char *delta = alpm_list_getdata(j); diff --git a/src/util/pactree.c b/src/util/pactree.c index 35ef9439..f677a4de 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -316,9 +316,9 @@ static void print_end(void) } } -static pmpkg_t *get_pkg_from_dbs(alpm_list_t *dbs, const char *needle) { +static alpm_pkg_t *get_pkg_from_dbs(alpm_list_t *dbs, const char *needle) { alpm_list_t *i; - pmpkg_t *ret; + alpm_pkg_t *ret; for(i = dbs; i; i = alpm_list_next(i)) { ret = alpm_db_get_pkg(alpm_list_getdata(i), needle); @@ -332,7 +332,7 @@ static pmpkg_t *get_pkg_from_dbs(alpm_list_t *dbs, const char *needle) { /** * walk dependencies in reverse, showing packages which require the target */ -static void walk_reverse_deps(alpm_list_t *dblist, pmpkg_t *pkg, int depth) +static void walk_reverse_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, int depth) { alpm_list_t *required_by, *i; @@ -364,7 +364,7 @@ static void walk_reverse_deps(alpm_list_t *dblist, pmpkg_t *pkg, int depth) /** * walk dependencies, showing dependencies of the target */ -static void walk_deps(alpm_list_t *dblist, pmpkg_t *pkg, int depth) +static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, int depth) { alpm_list_t *i; @@ -376,7 +376,7 @@ static void walk_deps(alpm_list_t *dblist, pmpkg_t *pkg, int depth) for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) { pmdepend_t *depend = alpm_list_getdata(i); - pmpkg_t *provider = alpm_find_dbs_satisfier(handle, dblist, depend->name); + alpm_pkg_t *provider = alpm_find_dbs_satisfier(handle, dblist, depend->name); if(provider) { const char *provname = alpm_pkg_get_name(provider); @@ -403,7 +403,7 @@ int main(int argc, char *argv[]) int freelist = 0, ret = 0; enum _pmerrno_t err; const char *target_name; - pmpkg_t *pkg; + alpm_pkg_t *pkg; alpm_list_t *dblist = NULL; if(parse_options(argc, argv) != 0) { diff --git a/src/util/testpkg.c b/src/util/testpkg.c index 93d3fccd..972b2f47 100644 --- a/src/util/testpkg.c +++ b/src/util/testpkg.c @@ -42,7 +42,7 @@ int main(int argc, char *argv[]) int retval = 1; /* default = false */ alpm_handle_t *handle; enum _pmerrno_t err; - pmpkg_t *pkg = NULL; + alpm_pkg_t *pkg = NULL; if(argc != 2) { fprintf(stderr, "usage: %s <package file>\n", BASENAME); |