summaryrefslogtreecommitdiff
path: root/lib/libalpm/util.c
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2006-05-15 02:19:57 +0000
committerJudd Vinet <judd@archlinux.org>2006-05-15 02:19:57 +0000
commitbb787e26ee01f961c76fbe4e568275a66e80009f (patch)
tree6b16de3f1d21f018ea1f2a0e53fc38562c4e89b1 /lib/libalpm/util.c
parent3d3a29a80849f2aaa0baff93c1ae4478276e2b54 (diff)
downloadpacman-bb787e26ee01f961c76fbe4e568275a66e80009f.tar.xz
first stage of i18n stuff from VMiklos
Diffstat (limited to 'lib/libalpm/util.c')
-rw-r--r--lib/libalpm/util.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 49580c36..f85f5ce3 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -32,6 +32,7 @@
#include <time.h>
#include <syslog.h>
#include <sys/wait.h>
+#include <libintl.h>
#ifdef CYGWIN
#include <limits.h> /* PATH_MAX */
#endif
@@ -223,7 +224,7 @@ int _alpm_unpack(char *archive, const char *prefix, const char *fn)
while(!th_read(tar)) {
if(fn && strcmp(fn, th_get_pathname(tar))) {
if(TH_ISREG(tar) && tar_skip_regfile(tar)) {
- _alpm_log(PM_LOG_ERROR, "bad tar archive: %s", archive);
+ _alpm_log(PM_LOG_ERROR, _("bad tar archive: %s"), archive);
tar_close(tar);
return(1);
}
@@ -231,7 +232,7 @@ int _alpm_unpack(char *archive, const char *prefix, const char *fn)
}
snprintf(expath, PATH_MAX, "%s/%s", prefix, th_get_pathname(tar));
if(tar_extract_file(tar, expath)) {
- _alpm_log(PM_LOG_ERROR, "could not extract %s (%s)", th_get_pathname(tar), strerror(errno));
+ _alpm_log(PM_LOG_ERROR, _("could not extract %s (%s)"), th_get_pathname(tar), strerror(errno));
}
if(fn) break;
}
@@ -379,7 +380,7 @@ int _alpm_runscriptlet(char *root, char *installfn, char *script, char *ver, cha
}
snprintf(tmpdir, PATH_MAX, "%stmp/alpm_XXXXXX", root);
if(mkdtemp(tmpdir) == NULL) {
- _alpm_log(PM_LOG_ERROR, "could not create temp directory");
+ _alpm_log(PM_LOG_ERROR, _("could not create temp directory"));
return(1);
}
_alpm_unpack(installfn, tmpdir, ".INSTALL");
@@ -399,17 +400,17 @@ int _alpm_runscriptlet(char *root, char *installfn, char *script, char *ver, cha
/* save the cwd so we can restore it later */
if(getcwd(cwd, PATH_MAX) == NULL) {
- _alpm_log(PM_LOG_ERROR, "could not get current working directory");
+ _alpm_log(PM_LOG_ERROR, _("could not get current working directory"));
/* in case of error, cwd content is undefined: so we set it to something */
cwd[0] = 0;
}
/* just in case our cwd was removed in the upgrade operation */
if(chdir(root) != 0) {
- _alpm_log(PM_LOG_ERROR, "could not change directory to %s (%s)", root, strerror(errno));
+ _alpm_log(PM_LOG_ERROR, _("could not change directory to %s (%s)"), root, strerror(errno));
}
- _alpm_log(PM_LOG_FLOW2, "executing %s script...", script);
+ _alpm_log(PM_LOG_FLOW2, _("executing %s script..."), script);
if(oldver) {
snprintf(cmdline, PATH_MAX, "source %s %s %s %s",
@@ -422,28 +423,28 @@ int _alpm_runscriptlet(char *root, char *installfn, char *script, char *ver, cha
pid = fork();
if(pid == -1) {
- _alpm_log(PM_LOG_ERROR, "could not fork a new process (%s)", strerror(errno));
+ _alpm_log(PM_LOG_ERROR, _("could not fork a new process (%s)"), strerror(errno));
retval = 1;
goto cleanup;
}
if(pid == 0) {
- _alpm_log(PM_LOG_DEBUG, "chrooting in %s", root);
+ _alpm_log(PM_LOG_DEBUG, _("chrooting in %s"), root);
if(chroot(root) != 0) {
- _alpm_log(PM_LOG_ERROR, "could not change the root directory (%s)", strerror(errno));
+ _alpm_log(PM_LOG_ERROR, _("could not change the root directory (%s)"), strerror(errno));
return(1);
}
if(chdir("/") != 0) {
- _alpm_log(PM_LOG_ERROR, "could not change directory to / (%s)", strerror(errno));
+ _alpm_log(PM_LOG_ERROR, _("could not change directory to / (%s)"), strerror(errno));
return(1);
}
umask(0022);
- _alpm_log(PM_LOG_DEBUG, "executing \"%s\"", cmdline);
+ _alpm_log(PM_LOG_DEBUG, _("executing \"%s\""), cmdline);
execl("/bin/sh", "sh", "-c", cmdline, (char *)0);
exit(0);
} else {
if(waitpid(pid, 0, 0) == -1) {
- _alpm_log(PM_LOG_ERROR, "call to waitpid failed (%s)", strerror(errno));
+ _alpm_log(PM_LOG_ERROR, _("call to waitpid failed (%s)"), strerror(errno));
retval = 1;
goto cleanup;
}
@@ -451,7 +452,7 @@ int _alpm_runscriptlet(char *root, char *installfn, char *script, char *ver, cha
cleanup:
if(strlen(tmpdir) && _alpm_rmrf(tmpdir)) {
- _alpm_log(PM_LOG_WARNING, "could not remove tmpdir %s", tmpdir);
+ _alpm_log(PM_LOG_WARNING, _("could not remove tmpdir %s"), tmpdir);
}
if(strlen(cwd)) {
chdir(cwd);