4 * Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org>
5 * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 /* TODO: needed for the libfetch stuff, unfortunately- we should kill it */
25 /* the following two are needed for FreeBSD's libfetch */
26 #include <limits.h> /* PATH_MAX */
27 #if defined(HAVE_SYS_PARAM_H)
28 #include <sys/param.h> /* MAXHOSTNAMELEN */
32 #include <fetch.h> /* fetchLastErrString */
39 const char SYMEXPORT
*alpm_strerrorlast(void)
41 return alpm_strerror(pm_errno
);
44 const char SYMEXPORT
*alpm_strerror(int err
)
49 return _("out of memory!");
51 return _("unexpected system error");
53 return _("insufficient privileges");
54 case PM_ERR_NOT_A_FILE
:
55 return _("could not find or read file");
56 case PM_ERR_NOT_A_DIR
:
57 return _("could not find or read directory");
58 case PM_ERR_WRONG_ARGS
:
59 return _("wrong or NULL argument passed");
60 case PM_ERR_DISK_SPACE
:
61 return _("not enough free disk space");
63 case PM_ERR_HANDLE_NULL
:
64 return _("library not initialized");
65 case PM_ERR_HANDLE_NOT_NULL
:
66 return _("library already initialized");
67 case PM_ERR_HANDLE_LOCK
:
68 return _("unable to lock database");
71 return _("could not open database");
72 case PM_ERR_DB_CREATE
:
73 return _("could not create database");
75 return _("database not initialized");
76 case PM_ERR_DB_NOT_NULL
:
77 return _("database already registered");
78 case PM_ERR_DB_NOT_FOUND
:
79 return _("could not find database");
80 case PM_ERR_DB_VERSION
:
81 return _("database is incorrect version");
83 return _("could not update database");
84 case PM_ERR_DB_REMOVE
:
85 return _("could not remove database entry");
87 case PM_ERR_SERVER_BAD_URL
:
88 return _("invalid url for server");
89 case PM_ERR_SERVER_NONE
:
90 return _("no servers configured for repository");
92 case PM_ERR_TRANS_NOT_NULL
:
93 return _("transaction already initialized");
94 case PM_ERR_TRANS_NULL
:
95 return _("transaction not initialized");
96 case PM_ERR_TRANS_DUP_TARGET
:
97 return _("duplicate target");
98 case PM_ERR_TRANS_NOT_INITIALIZED
:
99 return _("transaction not initialized");
100 case PM_ERR_TRANS_NOT_PREPARED
:
101 return _("transaction not prepared");
102 case PM_ERR_TRANS_ABORT
:
103 return _("transaction aborted");
104 case PM_ERR_TRANS_TYPE
:
105 return _("operation not compatible with the transaction type");
106 case PM_ERR_TRANS_NOT_LOCKED
:
107 return _("transaction commit attempt when database is not locked");
109 case PM_ERR_PKG_NOT_FOUND
:
110 return _("could not find or read package");
111 case PM_ERR_PKG_IGNORED
:
112 return _("operation cancelled due to ignorepkg");
113 case PM_ERR_PKG_INVALID
:
114 return _("invalid or corrupted package");
115 case PM_ERR_PKG_OPEN
:
116 return _("cannot open package file");
117 case PM_ERR_PKG_CANT_REMOVE
:
118 return _("cannot remove all files for package");
119 case PM_ERR_PKG_INVALID_NAME
:
120 return _("package filename is not valid");
121 case PM_ERR_PKG_INVALID_ARCH
:
122 return _("package architecture is not valid");
123 case PM_ERR_PKG_REPO_NOT_FOUND
:
124 return _("could not find repository for target");
126 case PM_ERR_DLT_INVALID
:
127 return _("invalid or corrupted delta");
128 case PM_ERR_DLT_PATCHFAILED
:
129 return _("delta patch failed");
131 case PM_ERR_UNSATISFIED_DEPS
:
132 return _("could not satisfy dependencies");
133 case PM_ERR_CONFLICTING_DEPS
:
134 return _("conflicting dependencies");
135 case PM_ERR_FILE_CONFLICTS
:
136 return _("conflicting files");
138 case PM_ERR_RETRIEVE
:
139 return _("failed to retrieve some files");
141 return _("failed to copy some file");
142 case PM_ERR_INVALID_REGEX
:
143 return _("invalid regular expression");
144 /* Errors from external libraries- our own wrapper error */
145 case PM_ERR_LIBARCHIVE
:
146 /* it would be nice to use archive_error_string() here, but that
147 * requires the archive struct, so we can't. Just use a generic
148 * error string instead. */
149 return _("libarchive error");
150 case PM_ERR_LIBFETCH
:
152 return fetchLastErrString
;
154 /* obviously shouldn't get here... */
155 return _("download library error");
157 case PM_ERR_EXTERNAL_DOWNLOAD
:
158 return _("error invoking external downloader");
161 return _("unexpected error");
165 /* vim: set ts=2 sw=2 noet: */