A few final changes for the 3.0.6 release
[pacman.git] / lib / libalpm / error.c
blobece8a521d2074494eecf75bc3744e85f32849f21
1 /*
2 * error.c
3 *
4 * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
5 * Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
6 * Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
7 * Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 * USA.
25 #include "config.h"
27 #include <libintl.h>
29 /* libalpm */
30 #include "error.h"
31 #include "util.h"
32 #include "alpm.h"
34 /* TODO does this really need a file all on its own? */
35 char SYMEXPORT *alpm_strerror(int err)
37 switch(err) {
38 /* System */
39 case PM_ERR_MEMORY:
40 return _("out of memory!");
41 case PM_ERR_SYSTEM:
42 return _("unexpected system error");
43 case PM_ERR_BADPERMS:
44 return _("insufficient privileges");
45 case PM_ERR_NOT_A_FILE:
46 return _("could not find or read file");
47 case PM_ERR_WRONG_ARGS:
48 return _("wrong or NULL argument passed");
49 /* Interface */
50 case PM_ERR_HANDLE_NULL:
51 return _("library not initialized");
52 case PM_ERR_HANDLE_NOT_NULL:
53 return _("library already initialized");
54 case PM_ERR_HANDLE_LOCK:
55 return _("unable to lock database");
56 /* Databases */
57 case PM_ERR_DB_OPEN:
58 return _("could not open database");
59 case PM_ERR_DB_CREATE:
60 return _("could not create database");
61 case PM_ERR_DB_NULL:
62 return _("database not initialized");
63 case PM_ERR_DB_NOT_NULL:
64 return _("database already registered");
65 case PM_ERR_DB_NOT_FOUND:
66 return _("could not find database");
67 case PM_ERR_DB_WRITE:
68 return _("could not update database");
69 case PM_ERR_DB_REMOVE:
70 return _("could not remove database entry");
71 /* Servers */
72 case PM_ERR_SERVER_BAD_URL:
73 return _("invalid url for server");
74 /* Configuration */
75 case PM_ERR_OPT_LOGFILE:
76 case PM_ERR_OPT_DBPATH:
77 case PM_ERR_OPT_LOCALDB:
78 case PM_ERR_OPT_SYNCDB:
79 case PM_ERR_OPT_USESYSLOG:
80 return _("could not set parameter");
81 /* Transactions */
82 case PM_ERR_TRANS_NOT_NULL:
83 return _("transaction already initialized");
84 case PM_ERR_TRANS_NULL:
85 return _("transaction not initialized");
86 case PM_ERR_TRANS_DUP_TARGET:
87 return _("duplicate target");
88 case PM_ERR_TRANS_NOT_INITIALIZED:
89 return _("transaction not initialized");
90 case PM_ERR_TRANS_NOT_PREPARED:
91 return _("transaction not prepared");
92 case PM_ERR_TRANS_ABORT:
93 return _("transaction aborted");
94 case PM_ERR_TRANS_TYPE:
95 return _("operation not compatible with the transaction type");
96 case PM_ERR_TRANS_COMMITING:
97 return _("could not commit transaction");
98 case PM_ERR_TRANS_DOWNLOADING:
99 return _("could not download all files");
100 /* Packages */
101 case PM_ERR_PKG_NOT_FOUND:
102 return _("could not find or read package");
103 case PM_ERR_PKG_INVALID:
104 return _("invalid or corrupted package");
105 case PM_ERR_PKG_OPEN:
106 return _("cannot open package file");
107 case PM_ERR_PKG_LOAD:
108 return _("cannot load package data");
109 case PM_ERR_PKG_INSTALLED:
110 return _("package already installed");
111 case PM_ERR_PKG_CANT_FRESH:
112 return _("package not installed or lesser version");
113 case PM_ERR_PKG_CANT_REMOVE:
114 return _("cannot remove all files for package");
115 case PM_ERR_PKG_INVALID_NAME:
116 return _("package name is not valid");
117 case PM_ERR_PKG_CORRUPTED:
118 return _("corrupted package");
119 case PM_ERR_PKG_REPO_NOT_FOUND:
120 return _("no such repository");
121 /* Groups */
122 case PM_ERR_GRP_NOT_FOUND:
123 return _("group not found");
124 /* Dependencies */
125 case PM_ERR_UNSATISFIED_DEPS:
126 return _("could not satisfy dependencies");
127 case PM_ERR_CONFLICTING_DEPS:
128 return _("conflicting dependencies");
129 case PM_ERR_FILE_CONFLICTS:
130 return _("conflicting files");
131 /* Miscellaenous */
132 case PM_ERR_USER_ABORT:
133 return _("user aborted the operation");
134 case PM_ERR_INTERNAL_ERROR:
135 return _("internal error");
136 case PM_ERR_LIBARCHIVE_ERROR:
137 return _("libarchive error");
138 case PM_ERR_DISK_FULL:
139 return _("not enough space on disk");
140 case PM_ERR_PKG_HOLD:
141 /* TODO wow this is not descriptive at all... what does this mean? */
142 return _("not confirmed");
143 /* Configuration file */
144 case PM_ERR_CONF_BAD_SECTION:
145 return _("bad configuration section name");
146 case PM_ERR_CONF_LOCAL:
147 return _("'local' is reserved and cannot be used as a repository name");
148 case PM_ERR_CONF_BAD_SYNTAX:
149 return _("syntax error in config file");
150 case PM_ERR_CONF_DIRECTIVE_OUTSIDE_SECTION:
151 return _("all directives must belong to a section");
152 case PM_ERR_INVALID_REGEX:
153 return _("invalid regular expression");
154 /* Downloading */
155 case PM_ERR_CONNECT_FAILED:
156 return _("connection to remote host failed");
157 /* Unknown error! */
158 default:
159 return _("unexpected error");
163 /* vim: set ts=2 sw=2 noet: */