Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/error.c')
-rw-r--r--lib/libalpm/error.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c
index 21fbb48f..1e4e705b 100644
--- a/lib/libalpm/error.c
+++ b/lib/libalpm/error.c
@@ -20,28 +20,21 @@
#include "config.h"
-/* TODO: needed for the libfetch stuff, unfortunately- we should kill it */
-#include <stdio.h>
-/* the following two are needed for FreeBSD's libfetch */
-#include <limits.h> /* PATH_MAX */
-#if defined(HAVE_SYS_PARAM_H)
-#include <sys/param.h> /* MAXHOSTNAMELEN */
-#endif
-
-#ifdef HAVE_LIBFETCH
-#include <fetch.h> /* fetchLastErrString */
+#ifdef HAVE_LIBCURL
+#include <curl/curl.h>
#endif
/* libalpm */
#include "util.h"
#include "alpm.h"
+#include "handle.h"
-const char SYMEXPORT *alpm_strerrorlast(void)
+enum _pmerrno_t SYMEXPORT alpm_errno(pmhandle_t *handle)
{
- return alpm_strerror(pm_errno);
+ return handle->pm_errno;
}
-const char SYMEXPORT *alpm_strerror(int err)
+const char SYMEXPORT *alpm_strerror(enum _pmerrno_t err)
{
switch(err) {
/* System */
@@ -77,6 +70,8 @@ const char SYMEXPORT *alpm_strerror(int err)
return _("database already registered");
case PM_ERR_DB_NOT_FOUND:
return _("could not find database");
+ case PM_ERR_DB_INVALID:
+ return _("invalid or corrupted database");
case PM_ERR_DB_VERSION:
return _("database is incorrect version");
case PM_ERR_DB_WRITE:
@@ -122,6 +117,13 @@ const char SYMEXPORT *alpm_strerror(int err)
return _("package architecture is not valid");
case PM_ERR_PKG_REPO_NOT_FOUND:
return _("could not find repository for target");
+ /* Signatures */
+ case PM_ERR_SIG_MISSINGDIR:
+ return _("signature directory not configured correctly");
+ case PM_ERR_SIG_INVALID:
+ return _("invalid PGP signature");
+ case PM_ERR_SIG_UNKNOWN:
+ return _("unknown PGP signature");
/* Deltas */
case PM_ERR_DLT_INVALID:
return _("invalid or corrupted delta");
@@ -137,8 +139,6 @@ const char SYMEXPORT *alpm_strerror(int err)
/* Miscellaenous */
case PM_ERR_RETRIEVE:
return _("failed to retrieve some files");
- case PM_ERR_WRITE:
- return _("failed to copy some file");
case PM_ERR_INVALID_REGEX:
return _("invalid regular expression");
/* Errors from external libraries- our own wrapper error */
@@ -147,13 +147,10 @@ const char SYMEXPORT *alpm_strerror(int err)
* requires the archive struct, so we can't. Just use a generic
* error string instead. */
return _("libarchive error");
- case PM_ERR_LIBFETCH:
-#ifdef HAVE_LIBFETCH
- return fetchLastErrString;
-#else
- /* obviously shouldn't get here... */
+ case PM_ERR_LIBCURL:
return _("download library error");
-#endif
+ case PM_ERR_GPGME:
+ return _("gpgme error");
case PM_ERR_EXTERNAL_DOWNLOAD:
return _("error invoking external downloader");
/* Unknown error! */