make alpm_strerror binding friendly
I'm currently working on python bindings for alpm written in pyrex. While working i found that declaring alpm_strerror as char * alpm_strerror (void) instead of char * alpm_strerror (int err) and then using pm_errno in the implementation instead of err, could make it more bindings-friendly. Dan: cleaned up and added void to declaration. Instead of replacing existing function, add a new function called 'alpm_strerrorlast(void)'. Signed-off-by: Stefano Esposito <stefano.esposito87@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
f21c45c0dd
commit
27acdc2c94
8 changed files with 39 additions and 33 deletions
|
@ -461,6 +461,7 @@ enum _pmerrno_t {
|
||||||
extern enum _pmerrno_t pm_errno;
|
extern enum _pmerrno_t pm_errno;
|
||||||
|
|
||||||
const char *alpm_strerror(int err);
|
const char *alpm_strerror(int err);
|
||||||
|
const char *alpm_strerrorlast(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,11 @@
|
||||||
#include "alpm.h"
|
#include "alpm.h"
|
||||||
|
|
||||||
/* TODO does this really need a file all on its own? */
|
/* TODO does this really need a file all on its own? */
|
||||||
|
const char SYMEXPORT *alpm_strerrorlast(void)
|
||||||
|
{
|
||||||
|
return alpm_strerror(pm_errno);
|
||||||
|
}
|
||||||
|
|
||||||
const char SYMEXPORT *alpm_strerror(int err)
|
const char SYMEXPORT *alpm_strerror(int err)
|
||||||
{
|
{
|
||||||
switch(err) {
|
switch(err) {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#define _ALPM_ERROR_H
|
#define _ALPM_ERROR_H
|
||||||
|
|
||||||
#define RET_ERR(err, ret) do { pm_errno = (err); \
|
#define RET_ERR(err, ret) do { pm_errno = (err); \
|
||||||
_alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerror(err)); \
|
_alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerrorlast()); \
|
||||||
return(ret); } while(0)
|
return(ret); } while(0)
|
||||||
|
|
||||||
#endif /* _ALPM_ERROR_H */
|
#endif /* _ALPM_ERROR_H */
|
||||||
|
|
|
@ -42,7 +42,7 @@ static int add_cleanup(void)
|
||||||
int ret = alpm_trans_release();
|
int ret = alpm_trans_release();
|
||||||
if(ret != 0) {
|
if(ret != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("failed to release transaction (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("failed to release transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ int pacman_add(alpm_list_t *targets)
|
||||||
if(alpm_trans_init(transtype, config->flags, cb_trans_evt,
|
if(alpm_trans_init(transtype, config->flags, cb_trans_evt,
|
||||||
cb_trans_conv, cb_trans_progress) == -1) {
|
cb_trans_conv, cb_trans_progress) == -1) {
|
||||||
/* TODO: error messages should be in the front end, not the back */
|
/* TODO: error messages should be in the front end, not the back */
|
||||||
fprintf(stderr, _("error: %s\n"), alpm_strerror(pm_errno));
|
fprintf(stderr, _("error: %s\n"), alpm_strerrorlast());
|
||||||
if(pm_errno == PM_ERR_HANDLE_LOCK) {
|
if(pm_errno == PM_ERR_HANDLE_LOCK) {
|
||||||
/* TODO this and the 2 other places should probably be on stderr */
|
/* TODO this and the 2 other places should probably be on stderr */
|
||||||
printf(_(" if you're sure a package manager is not already\n"
|
printf(_(" if you're sure a package manager is not already\n"
|
||||||
|
@ -120,7 +120,7 @@ int pacman_add(alpm_list_t *targets)
|
||||||
char *targ = alpm_list_getdata(i);
|
char *targ = alpm_list_getdata(i);
|
||||||
if(alpm_trans_addtarget(targ) == -1) {
|
if(alpm_trans_addtarget(targ) == -1) {
|
||||||
fprintf(stderr, _("error: failed to add target '%s' (%s)"), targ,
|
fprintf(stderr, _("error: failed to add target '%s' (%s)"), targ,
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
add_cleanup();
|
add_cleanup();
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ int pacman_add(alpm_list_t *targets)
|
||||||
/* TODO: No, compute nothing. This is stupid. */
|
/* TODO: No, compute nothing. This is stupid. */
|
||||||
if(alpm_trans_prepare(&data) == -1) {
|
if(alpm_trans_prepare(&data) == -1) {
|
||||||
fprintf(stderr, _("error: failed to prepare transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to prepare transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
switch(pm_errno) {
|
switch(pm_errno) {
|
||||||
case PM_ERR_UNSATISFIED_DEPS:
|
case PM_ERR_UNSATISFIED_DEPS:
|
||||||
for(i = data; i; i = alpm_list_next(i)) {
|
for(i = data; i; i = alpm_list_next(i)) {
|
||||||
|
@ -197,7 +197,7 @@ int pacman_add(alpm_list_t *targets)
|
||||||
|
|
||||||
/* Step 3: perform the installation */
|
/* Step 3: perform the installation */
|
||||||
if(alpm_trans_commit(NULL) == -1) {
|
if(alpm_trans_commit(NULL) == -1) {
|
||||||
fprintf(stderr, _("error: failed to commit transaction (%s)\n"), alpm_strerror(pm_errno));
|
fprintf(stderr, _("error: failed to commit transaction (%s)\n"), alpm_strerrorlast());
|
||||||
add_cleanup();
|
add_cleanup();
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ static void cleanup(int signum)
|
||||||
|
|
||||||
/* free alpm library resources */
|
/* free alpm library resources */
|
||||||
if(alpm_release() == -1) {
|
if(alpm_release() == -1) {
|
||||||
pm_printf(PM_LOG_ERROR, alpm_strerror(pm_errno));
|
pm_printf(PM_LOG_ERROR, alpm_strerrorlast());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free memory */
|
/* free memory */
|
||||||
|
@ -331,7 +331,7 @@ static int parseargs(int argc, char *argv[])
|
||||||
case 1007:
|
case 1007:
|
||||||
if(alpm_option_add_cachedir(optarg) != 0) {
|
if(alpm_option_add_cachedir(optarg) != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("problem adding cachedir '%s' (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("problem adding cachedir '%s' (%s)\n"),
|
||||||
optarg, alpm_strerror(pm_errno));
|
optarg, alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -355,7 +355,7 @@ static int parseargs(int argc, char *argv[])
|
||||||
case 'b':
|
case 'b':
|
||||||
if(alpm_option_set_dbpath(optarg) != 0) {
|
if(alpm_option_set_dbpath(optarg) != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("problem setting dbpath '%s' (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("problem setting dbpath '%s' (%s)\n"),
|
||||||
optarg, alpm_strerror(pm_errno));
|
optarg, alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
config->have_dbpath = 1;
|
config->have_dbpath = 1;
|
||||||
|
@ -389,7 +389,7 @@ static int parseargs(int argc, char *argv[])
|
||||||
case 'r':
|
case 'r':
|
||||||
if(alpm_option_set_root(optarg) != 0) {
|
if(alpm_option_set_root(optarg) != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("problem setting root '%s' (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("problem setting root '%s' (%s)\n"),
|
||||||
optarg, alpm_strerror(pm_errno));
|
optarg, alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
config->have_root = 1;
|
config->have_root = 1;
|
||||||
|
@ -614,7 +614,7 @@ static int _parseconfig(const char *file, const char *givensection,
|
||||||
if(!config->have_dbpath) {
|
if(!config->have_dbpath) {
|
||||||
if(alpm_option_set_dbpath(ptr) != 0) {
|
if(alpm_option_set_dbpath(ptr) != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("problem setting dbpath '%s' (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("problem setting dbpath '%s' (%s)\n"),
|
||||||
ptr, alpm_strerror(pm_errno));
|
ptr, alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
pm_printf(PM_LOG_DEBUG, "config: dbpath: %s\n", ptr);
|
pm_printf(PM_LOG_DEBUG, "config: dbpath: %s\n", ptr);
|
||||||
|
@ -622,7 +622,7 @@ static int _parseconfig(const char *file, const char *givensection,
|
||||||
} else if(strcmp(key, "CacheDir") == 0 || strcmp(upperkey, "CACHEDIR") == 0) {
|
} else if(strcmp(key, "CacheDir") == 0 || strcmp(upperkey, "CACHEDIR") == 0) {
|
||||||
if(alpm_option_add_cachedir(ptr) != 0) {
|
if(alpm_option_add_cachedir(ptr) != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("problem adding cachedir '%s' (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("problem adding cachedir '%s' (%s)\n"),
|
||||||
ptr, alpm_strerror(pm_errno));
|
ptr, alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
pm_printf(PM_LOG_DEBUG, "config: cachedir: %s\n", ptr);
|
pm_printf(PM_LOG_DEBUG, "config: cachedir: %s\n", ptr);
|
||||||
|
@ -631,7 +631,7 @@ static int _parseconfig(const char *file, const char *givensection,
|
||||||
if(!config->have_root) {
|
if(!config->have_root) {
|
||||||
if(alpm_option_set_root(ptr) != 0) {
|
if(alpm_option_set_root(ptr) != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("problem setting root '%s' (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("problem setting root '%s' (%s)\n"),
|
||||||
ptr, alpm_strerror(pm_errno));
|
ptr, alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
pm_printf(PM_LOG_DEBUG, "config: rootdir: %s\n", ptr);
|
pm_printf(PM_LOG_DEBUG, "config: rootdir: %s\n", ptr);
|
||||||
|
@ -640,7 +640,7 @@ static int _parseconfig(const char *file, const char *givensection,
|
||||||
if(!config->have_logfile) {
|
if(!config->have_logfile) {
|
||||||
if(alpm_option_set_logfile(ptr) != 0) {
|
if(alpm_option_set_logfile(ptr) != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("problem setting logfile '%s' (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("problem setting logfile '%s' (%s)\n"),
|
||||||
ptr, alpm_strerror(pm_errno));
|
ptr, alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
pm_printf(PM_LOG_DEBUG, "config: logfile: %s\n", ptr);
|
pm_printf(PM_LOG_DEBUG, "config: logfile: %s\n", ptr);
|
||||||
|
@ -736,7 +736,7 @@ int main(int argc, char *argv[])
|
||||||
/* initialize library */
|
/* initialize library */
|
||||||
if(alpm_initialize() == -1) {
|
if(alpm_initialize() == -1) {
|
||||||
pm_printf(PM_LOG_ERROR, _("failed to initialize alpm library (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("failed to initialize alpm library (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
cleanup(EXIT_FAILURE);
|
cleanup(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -812,7 +812,7 @@ int main(int argc, char *argv[])
|
||||||
db_local = alpm_db_register_local();
|
db_local = alpm_db_register_local();
|
||||||
if(db_local == NULL) {
|
if(db_local == NULL) {
|
||||||
pm_printf(PM_LOG_ERROR, _("could not register 'local' database (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("could not register 'local' database (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
cleanup(EXIT_FAILURE);
|
cleanup(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ static int remove_cleanup(void)
|
||||||
int ret = alpm_trans_release();
|
int ret = alpm_trans_release();
|
||||||
if(ret != 0) {
|
if(ret != 0) {
|
||||||
pm_printf(PM_LOG_ERROR, _("failed to release transaction (%s)\n"),
|
pm_printf(PM_LOG_ERROR, _("failed to release transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ int pacman_remove(alpm_list_t *targets)
|
||||||
if(alpm_trans_init(PM_TRANS_TYPE_REMOVE, config->flags,
|
if(alpm_trans_init(PM_TRANS_TYPE_REMOVE, config->flags,
|
||||||
cb_trans_evt, cb_trans_conv, cb_trans_progress) == -1) {
|
cb_trans_evt, cb_trans_conv, cb_trans_progress) == -1) {
|
||||||
fprintf(stderr, _("error: failed to init transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to init transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
if(pm_errno == PM_ERR_HANDLE_LOCK) {
|
if(pm_errno == PM_ERR_HANDLE_LOCK) {
|
||||||
printf(_(" if you're sure a package manager is not already\n"
|
printf(_(" if you're sure a package manager is not already\n"
|
||||||
" running, you can remove %s.\n"), alpm_option_get_lockfile());
|
" running, you can remove %s.\n"), alpm_option_get_lockfile());
|
||||||
|
@ -113,7 +113,7 @@ int pacman_remove(alpm_list_t *targets)
|
||||||
if(alpm_trans_addtarget(targ) == -1) {
|
if(alpm_trans_addtarget(targ) == -1) {
|
||||||
printf("failed.\n");
|
printf("failed.\n");
|
||||||
fprintf(stderr, _("error: failed to add target '%s' (%s)\n"), targ,
|
fprintf(stderr, _("error: failed to add target '%s' (%s)\n"), targ,
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
remove_cleanup();
|
remove_cleanup();
|
||||||
FREELIST(finaltargs);
|
FREELIST(finaltargs);
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -123,7 +123,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(&data) == -1) {
|
if(alpm_trans_prepare(&data) == -1) {
|
||||||
fprintf(stderr, _("error: failed to prepare transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to prepare transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
switch(pm_errno) {
|
switch(pm_errno) {
|
||||||
case PM_ERR_UNSATISFIED_DEPS:
|
case PM_ERR_UNSATISFIED_DEPS:
|
||||||
for(i = data; i; i = alpm_list_next(i)) {
|
for(i = data; i; i = alpm_list_next(i)) {
|
||||||
|
@ -167,7 +167,7 @@ int pacman_remove(alpm_list_t *targets)
|
||||||
/* Step 3: actually perform the removal */
|
/* Step 3: actually perform the removal */
|
||||||
if(alpm_trans_commit(NULL) == -1) {
|
if(alpm_trans_commit(NULL) == -1) {
|
||||||
fprintf(stderr, _("error: failed to commit transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to commit transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
remove_cleanup();
|
remove_cleanup();
|
||||||
FREELIST(finaltargs);
|
FREELIST(finaltargs);
|
||||||
return(1);
|
return(1);
|
||||||
|
|
|
@ -205,7 +205,7 @@ static int sync_synctree(int level, alpm_list_t *syncs)
|
||||||
alpm_db_get_name(db), downloadLastErrString);
|
alpm_db_get_name(db), downloadLastErrString);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, _("error: failed to update %s (%s)\n"),
|
fprintf(stderr, _("error: failed to update %s (%s)\n"),
|
||||||
alpm_db_get_name(db), alpm_strerror(pm_errno));
|
alpm_db_get_name(db), alpm_strerrorlast());
|
||||||
}
|
}
|
||||||
} else if(ret == 1) {
|
} else if(ret == 1) {
|
||||||
printf(_(" %s is up to date\n"), alpm_db_get_name(db));
|
printf(_(" %s is up to date\n"), alpm_db_get_name(db));
|
||||||
|
@ -498,7 +498,7 @@ int pacman_sync(alpm_list_t *targets)
|
||||||
if(alpm_trans_init(PM_TRANS_TYPE_SYNC, config->flags, cb_trans_evt,
|
if(alpm_trans_init(PM_TRANS_TYPE_SYNC, config->flags, cb_trans_evt,
|
||||||
cb_trans_conv, cb_trans_progress) == -1) {
|
cb_trans_conv, cb_trans_progress) == -1) {
|
||||||
fprintf(stderr, _("error: failed to init transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to init transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
if(pm_errno == PM_ERR_HANDLE_LOCK) {
|
if(pm_errno == PM_ERR_HANDLE_LOCK) {
|
||||||
printf(_(" if you're sure a package manager is not already\n"
|
printf(_(" if you're sure a package manager is not already\n"
|
||||||
" running, you can remove %s.\n"), alpm_option_get_lockfile());
|
" running, you can remove %s.\n"), alpm_option_get_lockfile());
|
||||||
|
@ -522,7 +522,7 @@ int pacman_sync(alpm_list_t *targets)
|
||||||
printf(_(":: Starting full system upgrade...\n"));
|
printf(_(":: Starting full system upgrade...\n"));
|
||||||
alpm_logaction("starting full system upgrade");
|
alpm_logaction("starting full system upgrade");
|
||||||
if(alpm_trans_sysupgrade() == -1) {
|
if(alpm_trans_sysupgrade() == -1) {
|
||||||
fprintf(stderr, _("error: %s\n"), alpm_strerror(pm_errno));
|
fprintf(stderr, _("error: %s\n"), alpm_strerrorlast());
|
||||||
retval = 1;
|
retval = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -548,18 +548,18 @@ int pacman_sync(alpm_list_t *targets)
|
||||||
if(yesno(_(":: Cancel current operation? [Y/n] "))) {
|
if(yesno(_(":: Cancel current operation? [Y/n] "))) {
|
||||||
if(alpm_trans_release() == -1) {
|
if(alpm_trans_release() == -1) {
|
||||||
fprintf(stderr, _("error: failed to release transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to release transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
retval = 1;
|
retval = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if(alpm_trans_init(PM_TRANS_TYPE_SYNC, config->flags,
|
if(alpm_trans_init(PM_TRANS_TYPE_SYNC, config->flags,
|
||||||
cb_trans_evt, cb_trans_conv, cb_trans_progress) == -1) {
|
cb_trans_evt, cb_trans_conv, cb_trans_progress) == -1) {
|
||||||
fprintf(stderr, _("error: failed to init transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to init transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
if(alpm_trans_addtarget("pacman") == -1) {
|
if(alpm_trans_addtarget("pacman") == -1) {
|
||||||
fprintf(stderr, _("error: pacman: %s\n"), alpm_strerror(pm_errno));
|
fprintf(stderr, _("error: pacman: %s\n"), alpm_strerrorlast());
|
||||||
retval = 1;
|
retval = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -584,7 +584,7 @@ int pacman_sync(alpm_list_t *targets)
|
||||||
}
|
}
|
||||||
if(pm_errno != PM_ERR_PKG_NOT_FOUND) {
|
if(pm_errno != PM_ERR_PKG_NOT_FOUND) {
|
||||||
fprintf(stderr, _("'error: %s': %s\n"),
|
fprintf(stderr, _("'error: %s': %s\n"),
|
||||||
(char *)i->data, alpm_strerror(pm_errno));
|
(char *)i->data, alpm_strerrorlast());
|
||||||
retval = 1;
|
retval = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -646,7 +646,7 @@ int pacman_sync(alpm_list_t *targets)
|
||||||
alpm_list_t *data;
|
alpm_list_t *data;
|
||||||
if(alpm_trans_prepare(&data) == -1) {
|
if(alpm_trans_prepare(&data) == -1) {
|
||||||
fprintf(stderr, _("error: failed to prepare transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to prepare transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
switch(pm_errno) {
|
switch(pm_errno) {
|
||||||
alpm_list_t *i;
|
alpm_list_t *i;
|
||||||
case PM_ERR_UNSATISFIED_DEPS:
|
case PM_ERR_UNSATISFIED_DEPS:
|
||||||
|
@ -722,7 +722,7 @@ int pacman_sync(alpm_list_t *targets)
|
||||||
/* Step 3: actually perform the installation */
|
/* Step 3: actually perform the installation */
|
||||||
if(alpm_trans_commit(&data) == -1) {
|
if(alpm_trans_commit(&data) == -1) {
|
||||||
fprintf(stderr, _("error: failed to commit transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to commit transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
switch(pm_errno) {
|
switch(pm_errno) {
|
||||||
alpm_list_t *i;
|
alpm_list_t *i;
|
||||||
case PM_ERR_FILE_CONFLICTS:
|
case PM_ERR_FILE_CONFLICTS:
|
||||||
|
@ -764,7 +764,7 @@ cleanup:
|
||||||
}
|
}
|
||||||
if(alpm_trans_release() == -1) {
|
if(alpm_trans_release() == -1) {
|
||||||
fprintf(stderr, _("error: failed to release transaction (%s)\n"),
|
fprintf(stderr, _("error: failed to release transaction (%s)\n"),
|
||||||
alpm_strerror(pm_errno));
|
alpm_strerrorlast());
|
||||||
retval = 1;
|
retval = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(alpm_initialize() == -1) {
|
if(alpm_initialize() == -1) {
|
||||||
fprintf(stderr, "cannot initilize alpm: %s\n", alpm_strerror(pm_errno));
|
fprintf(stderr, "cannot initilize alpm: %s\n", alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(alpm_release() == -1) {
|
if(alpm_release() == -1) {
|
||||||
fprintf(stderr, "error releasing alpm: %s\n", alpm_strerror(pm_errno));
|
fprintf(stderr, "error releasing alpm: %s\n", alpm_strerrorlast());
|
||||||
}
|
}
|
||||||
|
|
||||||
return(retval);
|
return(retval);
|
||||||
|
|
Loading…
Add table
Reference in a new issue