mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Rename pmerrno_t to alpm_errno_t
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
1059df7486
commit
ddad400900
@ -47,9 +47,9 @@
|
|||||||
* @return a context handle on success, NULL on error, err will be set if provided
|
* @return a context handle on success, NULL on error, err will be set if provided
|
||||||
*/
|
*/
|
||||||
alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath,
|
alpm_handle_t SYMEXPORT *alpm_initialize(const char *root, const char *dbpath,
|
||||||
enum _pmerrno_t *err)
|
enum _alpm_errno_t *err)
|
||||||
{
|
{
|
||||||
enum _pmerrno_t myerr;
|
enum _alpm_errno_t myerr;
|
||||||
const char *lf = "db.lck";
|
const char *lf = "db.lck";
|
||||||
size_t lockfilelen;
|
size_t lockfilelen;
|
||||||
alpm_handle_t *myhandle = _alpm_handle_new();
|
alpm_handle_t *myhandle = _alpm_handle_new();
|
||||||
|
@ -983,7 +983,7 @@ char *alpm_compute_md5sum(const char *name);
|
|||||||
/** @addtogroup alpm_api_errors Error Codes
|
/** @addtogroup alpm_api_errors Error Codes
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
enum _pmerrno_t {
|
enum _alpm_errno_t {
|
||||||
PM_ERR_MEMORY = 1,
|
PM_ERR_MEMORY = 1,
|
||||||
PM_ERR_SYSTEM,
|
PM_ERR_SYSTEM,
|
||||||
PM_ERR_BADPERMS,
|
PM_ERR_BADPERMS,
|
||||||
@ -1048,16 +1048,16 @@ enum _pmerrno_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Returns the current error code from the handle. */
|
/** Returns the current error code from the handle. */
|
||||||
enum _pmerrno_t alpm_errno(alpm_handle_t *handle);
|
enum _alpm_errno_t alpm_errno(alpm_handle_t *handle);
|
||||||
|
|
||||||
/** Returns the string corresponding to an error number. */
|
/** Returns the string corresponding to an error number. */
|
||||||
const char *alpm_strerror(enum _pmerrno_t err);
|
const char *alpm_strerror(enum _alpm_errno_t err);
|
||||||
|
|
||||||
/* End of alpm_api_errors */
|
/* End of alpm_api_errors */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
alpm_handle_t *alpm_initialize(const char *root, const char *dbpath,
|
alpm_handle_t *alpm_initialize(const char *root, const char *dbpath,
|
||||||
enum _pmerrno_t *err);
|
enum _alpm_errno_t *err);
|
||||||
int alpm_release(alpm_handle_t *handle);
|
int alpm_release(alpm_handle_t *handle);
|
||||||
const char *alpm_version(void);
|
const char *alpm_version(void);
|
||||||
|
|
||||||
|
@ -29,12 +29,12 @@
|
|||||||
#include "alpm.h"
|
#include "alpm.h"
|
||||||
#include "handle.h"
|
#include "handle.h"
|
||||||
|
|
||||||
enum _pmerrno_t SYMEXPORT alpm_errno(alpm_handle_t *handle)
|
enum _alpm_errno_t SYMEXPORT alpm_errno(alpm_handle_t *handle)
|
||||||
{
|
{
|
||||||
return handle->pm_errno;
|
return handle->pm_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char SYMEXPORT *alpm_strerror(enum _pmerrno_t err)
|
const char SYMEXPORT *alpm_strerror(enum _alpm_errno_t err)
|
||||||
{
|
{
|
||||||
switch(err) {
|
switch(err) {
|
||||||
/* System */
|
/* System */
|
||||||
|
@ -303,7 +303,7 @@ static char *canonicalize_path(const char *path) {
|
|||||||
return new_path;
|
return new_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum _pmerrno_t _alpm_set_directory_option(const char *value,
|
enum _alpm_errno_t _alpm_set_directory_option(const char *value,
|
||||||
char **storage, int must_exist)
|
char **storage, int must_exist)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
@ -72,7 +72,7 @@ struct __alpm_handle_t {
|
|||||||
pgp_verify_t sigverify; /* Default signature verification level */
|
pgp_verify_t sigverify; /* Default signature verification level */
|
||||||
|
|
||||||
/* error code */
|
/* error code */
|
||||||
enum _pmerrno_t pm_errno;
|
enum _alpm_errno_t pm_errno;
|
||||||
};
|
};
|
||||||
|
|
||||||
alpm_handle_t *_alpm_handle_new(void);
|
alpm_handle_t *_alpm_handle_new(void);
|
||||||
@ -81,7 +81,7 @@ void _alpm_handle_free(alpm_handle_t *handle);
|
|||||||
int _alpm_handle_lock(alpm_handle_t *handle);
|
int _alpm_handle_lock(alpm_handle_t *handle);
|
||||||
int _alpm_handle_unlock(alpm_handle_t *handle);
|
int _alpm_handle_unlock(alpm_handle_t *handle);
|
||||||
|
|
||||||
enum _pmerrno_t _alpm_set_directory_option(const char *value,
|
enum _alpm_errno_t _alpm_set_directory_option(const char *value,
|
||||||
char **storage, int must_exist);
|
char **storage, int must_exist);
|
||||||
|
|
||||||
#endif /* _ALPM_HANDLE_H */
|
#endif /* _ALPM_HANDLE_H */
|
||||||
|
@ -420,7 +420,7 @@ static int _add_mirror(alpm_db_t *db, char *value)
|
|||||||
static int setup_libalpm(void)
|
static int setup_libalpm(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
enum _pmerrno_t err;
|
enum _alpm_errno_t err;
|
||||||
alpm_handle_t *handle;
|
alpm_handle_t *handle;
|
||||||
|
|
||||||
pm_printf(PM_LOG_DEBUG, "setup_libalpm called\n");
|
pm_printf(PM_LOG_DEBUG, "setup_libalpm called\n");
|
||||||
|
@ -102,7 +102,7 @@ int pacman_remove(alpm_list_t *targets)
|
|||||||
|
|
||||||
/* Step 2: prepare the transaction based on its type, targets and flags */
|
/* Step 2: prepare the transaction based on its type, targets and flags */
|
||||||
if(alpm_trans_prepare(config->handle, &data) == -1) {
|
if(alpm_trans_prepare(config->handle, &data) == -1) {
|
||||||
enum _pmerrno_t err = alpm_errno(config->handle);
|
enum _alpm_errno_t err = alpm_errno(config->handle);
|
||||||
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),
|
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),
|
||||||
alpm_strerror(err));
|
alpm_strerror(err));
|
||||||
switch(err) {
|
switch(err) {
|
||||||
|
@ -615,7 +615,7 @@ static int process_pkg(alpm_pkg_t *pkg)
|
|||||||
int ret = alpm_add_pkg(config->handle, pkg);
|
int ret = alpm_add_pkg(config->handle, pkg);
|
||||||
|
|
||||||
if(ret == -1) {
|
if(ret == -1) {
|
||||||
enum _pmerrno_t err = alpm_errno(config->handle);
|
enum _alpm_errno_t err = alpm_errno(config->handle);
|
||||||
if(err == PM_ERR_TRANS_DUP_TARGET
|
if(err == PM_ERR_TRANS_DUP_TARGET
|
||||||
|| err == PM_ERR_PKG_IGNORED) {
|
|| err == PM_ERR_PKG_IGNORED) {
|
||||||
/* just skip duplicate or ignored targets */
|
/* just skip duplicate or ignored targets */
|
||||||
@ -763,7 +763,7 @@ static int sync_trans(alpm_list_t *targets)
|
|||||||
|
|
||||||
/* Step 2: "compute" the transaction based on targets and flags */
|
/* Step 2: "compute" the transaction based on targets and flags */
|
||||||
if(alpm_trans_prepare(config->handle, &data) == -1) {
|
if(alpm_trans_prepare(config->handle, &data) == -1) {
|
||||||
enum _pmerrno_t err = alpm_errno(config->handle);
|
enum _alpm_errno_t err = alpm_errno(config->handle);
|
||||||
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),
|
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),
|
||||||
alpm_strerror(err));
|
alpm_strerror(err));
|
||||||
switch(err) {
|
switch(err) {
|
||||||
@ -830,7 +830,7 @@ static int sync_trans(alpm_list_t *targets)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(alpm_trans_commit(config->handle, &data) == -1) {
|
if(alpm_trans_commit(config->handle, &data) == -1) {
|
||||||
enum _pmerrno_t err = alpm_errno(config->handle);
|
enum _alpm_errno_t err = alpm_errno(config->handle);
|
||||||
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"),
|
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"),
|
||||||
alpm_strerror(err));
|
alpm_strerror(err));
|
||||||
switch(err) {
|
switch(err) {
|
||||||
|
@ -94,7 +94,7 @@ int pacman_upgrade(alpm_list_t *targets)
|
|||||||
/* Step 2: "compute" the transaction based on targets and flags */
|
/* Step 2: "compute" the transaction based on targets and flags */
|
||||||
/* TODO: No, compute nothing. This is stupid. */
|
/* TODO: No, compute nothing. This is stupid. */
|
||||||
if(alpm_trans_prepare(config->handle, &data) == -1) {
|
if(alpm_trans_prepare(config->handle, &data) == -1) {
|
||||||
enum _pmerrno_t err = alpm_errno(config->handle);
|
enum _alpm_errno_t err = alpm_errno(config->handle);
|
||||||
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),
|
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to prepare transaction (%s)\n"),
|
||||||
alpm_strerror(err));
|
alpm_strerror(err));
|
||||||
switch(err) {
|
switch(err) {
|
||||||
@ -162,7 +162,7 @@ int pacman_upgrade(alpm_list_t *targets)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(alpm_trans_commit(config->handle, &data) == -1) {
|
if(alpm_trans_commit(config->handle, &data) == -1) {
|
||||||
enum _pmerrno_t err = alpm_errno(config->handle);
|
enum _alpm_errno_t err = alpm_errno(config->handle);
|
||||||
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"),
|
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to commit transaction (%s)\n"),
|
||||||
alpm_strerror(err));
|
alpm_strerror(err));
|
||||||
switch(err) {
|
switch(err) {
|
||||||
|
@ -60,7 +60,7 @@ int trans_init(alpm_transflag_t flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ret == -1) {
|
if(ret == -1) {
|
||||||
enum _pmerrno_t err = alpm_errno(config->handle);
|
enum _alpm_errno_t err = alpm_errno(config->handle);
|
||||||
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to init transaction (%s)\n"),
|
pm_fprintf(stderr, PM_LOG_ERROR, _("failed to init transaction (%s)\n"),
|
||||||
alpm_strerror(err));
|
alpm_strerror(err));
|
||||||
if(err == PM_ERR_HANDLE_LOCK) {
|
if(err == PM_ERR_HANDLE_LOCK) {
|
||||||
|
@ -96,7 +96,7 @@ static void usage(void) {
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
const char *dbpath = DBPATH;
|
const char *dbpath = DBPATH;
|
||||||
enum _pmerrno_t err;
|
enum _alpm_errno_t err;
|
||||||
int a = 1;
|
int a = 1;
|
||||||
alpm_list_t *dbnames = NULL;
|
alpm_list_t *dbnames = NULL;
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ static void walk_deps(alpm_list_t *dblist, alpm_pkg_t *pkg, int depth)
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int freelist = 0, ret = 0;
|
int freelist = 0, ret = 0;
|
||||||
enum _pmerrno_t err;
|
enum _alpm_errno_t err;
|
||||||
const char *target_name;
|
const char *target_name;
|
||||||
alpm_pkg_t *pkg;
|
alpm_pkg_t *pkg;
|
||||||
alpm_list_t *dblist = NULL;
|
alpm_list_t *dblist = NULL;
|
||||||
|
@ -180,7 +180,7 @@ static void usage(void) {
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
enum _pmerrno_t err;
|
enum _alpm_errno_t err;
|
||||||
const char *dbpath = DBPATH;
|
const char *dbpath = DBPATH;
|
||||||
int a = 1;
|
int a = 1;
|
||||||
alpm_list_t *dbnames = NULL;
|
alpm_list_t *dbnames = NULL;
|
||||||
|
@ -41,7 +41,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
int retval = 1; /* default = false */
|
int retval = 1; /* default = false */
|
||||||
alpm_handle_t *handle;
|
alpm_handle_t *handle;
|
||||||
enum _pmerrno_t err;
|
enum _alpm_errno_t err;
|
||||||
alpm_pkg_t *pkg = NULL;
|
alpm_pkg_t *pkg = NULL;
|
||||||
|
|
||||||
if(argc != 2) {
|
if(argc != 2) {
|
||||||
|
Loading…
Reference in New Issue
Block a user