diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-23 10:03:37 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-23 10:03:37 +0200 |
commit | 337a06f32fb530e0e0884fef2f5f630cca9911a1 (patch) | |
tree | d0687ccd3e9ff527d9c5613fd052cbe0f79bb40a /src | |
parent | 7543ff5973d1afe75b0f4226a3a02cc8d375ad3e (diff) | |
download | wydawca-337a06f32fb530e0e0884fef2f5f630cca9911a1.tar.gz wydawca-337a06f32fb530e0e0884fef2f5f630cca9911a1.tar.bz2 |
Add missing i18n markers
Diffstat (limited to 'src')
-rw-r--r-- | src/builtin.c | 4 | ||||
-rw-r--r-- | src/directive.c | 33 | ||||
-rw-r--r-- | src/diskio.c | 90 | ||||
-rw-r--r-- | src/exec.c | 26 | ||||
-rw-r--r-- | src/gpg.c | 52 | ||||
-rw-r--r-- | src/mail.c | 18 | ||||
-rw-r--r-- | src/method.c | 13 | ||||
-rw-r--r-- | src/null.c | 10 | ||||
-rw-r--r-- | src/process.c | 20 | ||||
-rw-r--r-- | src/sql.c | 18 | ||||
-rw-r--r-- | src/triplet.c | 14 | ||||
-rw-r--r-- | src/verify.c | 22 | ||||
-rw-r--r-- | src/wydawca.c | 11 |
13 files changed, 168 insertions, 163 deletions
diff --git a/src/builtin.c b/src/builtin.c index e5641d1..90b7c2f 100644 --- a/src/builtin.c +++ b/src/builtin.c @@ -76,13 +76,13 @@ cmp_regex (const char *pat, const char *str, int flags) rc = regcomp (®ex, pat, flags); if (rc) { char errbuf[512]; regerror (rc, ®ex, errbuf, sizeof (errbuf)); - logmsg (LOG_ERR, "%s: cannot compile regexp: %s", pat, errbuf); + logmsg (LOG_ERR, _("%s: cannot compile regexp: %s"), pat, errbuf); return 0; } rc = regexec (®ex, str, 0, NULL, 0); regfree (®ex); return rc == 0; @@ -117,13 +117,13 @@ parse_cmp_type (const char *pat, strcmp_fn *cmpfn, int *rf) case 'b': flags |= RF_BASIC; break; default: - logmsg (LOG_NOTICE, "unrecognized comparison flag: %c", *pat); + logmsg (LOG_NOTICE, _("unrecognized comparison flag: %c"), *pat); } } } switch (cmp) { diff --git a/src/directive.c b/src/directive.c index ff020ed..46e3196 100644 --- a/src/directive.c +++ b/src/directive.c @@ -23,13 +23,13 @@ int directive_parse (struct file_triplet *trp) { size_t dcount, i, j; char *p; if (debug_level > 2) - logmsg (LOG_DEBUG, "%s: parsing directive blurb: %s", + logmsg (LOG_DEBUG, _("%s: parsing directive blurb: %s"), trp->file[file_directive].name, trp->blurb); dcount = 0; for (p = trp->blurb; *p; p++) if (*p == '\n') dcount++; @@ -43,13 +43,13 @@ directive_parse (struct file_triplet *trp) if (p) *p++ = 0; if (trim (trp->directive[j]) == 0) /* ignore empty lines */ continue; if (strchr (trp->directive[j], ':') == NULL) { - logmsg (LOG_ERR, "%s: invalid line: %s", + logmsg (LOG_ERR, _("%s: invalid line: %s"), trp->file[file_directive].name, trp->directive[j]); free (trp->directive); trp->directive = NULL; return 1; } j++; @@ -170,28 +170,28 @@ directive_version_in_range_p (struct file_triplet *trp, { const char *val; unsigned version; if (directive_get_value (trp, "version", &val)) { - logmsg (LOG_ERR, "%s: missing `version' directive", + logmsg (LOG_ERR, _("%s: missing `version' directive"), trp->file[file_directive].name); return 0; } if (directive_pack_version (val, &version)) { - logmsg (LOG_ERR, "%s: unparsable version: %s", + logmsg (LOG_ERR, _("%s: unparsable version: %s"), trp->file[file_directive].name, val); return 0; } if (from <= version && version <= to) return 1; - logmsg (LOG_ERR, "%s: version %s is not in the allowed range", + logmsg (LOG_ERR, _("%s: version %s is not in the allowed range"), trp->file[file_directive].name, val); return 0; } enum directive { @@ -253,49 +253,49 @@ verify_directive_format (struct file_triplet *trp) dnum++; switch (dnum) { case 1: if (strcmp (key, "version")) { - logmsg (LOG_ERR, "%s:%d: expected `%s' but found `%s'", + logmsg (LOG_ERR, _("%s:%d: expected `%s' but found `%s'"), trp->file[file_directive].name, n, "version", key); return 1; } break; case 2: if (strcmp (key, "directory")) { - logmsg (LOG_ERR, "%s:%d: expected `%s' but found `%s'", + logmsg (LOG_ERR, _("%s:%d: expected `%s' but found `%s'"), trp->file[file_directive].name, n, "directory", key); return 1; } break; default: if (find_directive (key) == unknown_dir) { - logmsg (LOG_ERR, "%s:%d: unknown directive `%s'", + logmsg (LOG_ERR, _("%s:%d: unknown directive `%s'"), trp->file[file_directive].name, n, key); return 1; } } } if (trp->file[file_dist].name && trp->file[file_signature].name) { const char *filename; if (directive_get_value (trp, "filename", &filename)) { - logmsg (LOG_ERR, "%s: missing `filename' directive", + logmsg (LOG_ERR, _("%s: missing `filename' directive"), trp->file[file_directive].name); return 1; } if (strcmp (filename, trp->file[file_dist].name)) { - logmsg (LOG_ERR, "%s: filename %s does not match actual name", + logmsg (LOG_ERR, _("%s: filename %s does not match actual name"), trp->file[file_dist].name, filename); return 1; } } return 0; } @@ -319,21 +319,21 @@ process_directives (struct file_triplet *trp, struct spool *spool) { case unknown_dir: /* should not happen */ abort (); case comment_dir: - logmsg (LOG_NOTICE, "%s: COMMENT: %s", + logmsg (LOG_NOTICE, _("%s: COMMENT: %s"), trp->file[file_directive].name, val); break; case directory_dir: relative_dir = safe_file_name_alloc (val); if (!relative_dir || relative_dir[0] == '/') { - logmsg (LOG_ERR, "%s: invalid directory: %s", + logmsg (LOG_ERR, _("%s: invalid directory: %s"), trp->file[file_directive].name, val); return 1; } break; case filename_dir: @@ -345,13 +345,14 @@ process_directives (struct file_triplet *trp, struct spool *spool) if (move_file (trp, spool, file_dist, relative_dir) || move_file (trp, spool, file_signature, relative_dir)) return 1; } else { - logmsg (LOG_ERR, "invalid detached signature for %s", trp->name); + logmsg (LOG_ERR, _("invalid detached signature for %s"), + trp->name); return 1; } break; case version_dir: /* Already processed */ @@ -367,22 +368,22 @@ process_directives (struct file_triplet *trp, struct spool *spool) int argc; char **argv; int rc = 0; if ((rc = argcv_get (val, NULL, NULL, &argc, &argv))) { - logmsg (LOG_ERR, "cannot parse symlink value `%s': %s", + logmsg (LOG_ERR, _("cannot parse symlink value `%s': %s"), val, strerror (rc)); return 1; } if (argc != 2) { rc = 1; logmsg (LOG_ERR, - "wrong number of arguments to %s directive: `%s'", + _("wrong number of arguments to %s directive: `%s'"), key, val); } else rc = symlink_file (trp, spool, relative_dir, argv[0], argv[1]); argcv_free (argc, argv); @@ -396,13 +397,13 @@ process_directives (struct file_triplet *trp, struct spool *spool) return 1; } } if (!dry_run_mode && unlink (trp->file[file_directive].name)) { - logmsg (LOG_CRIT, "%s: cannot unlink directive file: %s", + logmsg (LOG_CRIT, _("%s: cannot unlink directive file: %s"), trp->file[file_directive].name, strerror (errno)); } free (relative_dir); UPDATE_STATS (STAT_TRIPLET_SUCCESS); report_finish (); diff --git a/src/diskio.c b/src/diskio.c index 2604c67..69a3cbe 100644 --- a/src/diskio.c +++ b/src/diskio.c @@ -67,48 +67,48 @@ create_hierarchy (char *dir, size_t baselen, uid_t uid, gid_t gid) char *p; if (stat (dir, &st) == 0) { if (!S_ISDIR (st.st_mode)) { - logmsg (LOG_ERR, "component %s is not a directory", dir); + logmsg (LOG_ERR, _("component %s is not a directory"), dir); return 1; } return 0; } else if (errno != ENOENT) { - logmsg (LOG_ERR, "cannot stat file %s: %s", dir, strerror (errno)); + logmsg (LOG_ERR, _("cannot stat file %s: %s"), dir, strerror (errno)); return 1; } p = strrchr (dir, '/'); if (p) { if (p - dir + 1 < baselen) { - logmsg (LOG_ERR, "base directory %s does not exist", dir); + logmsg (LOG_ERR, _("base directory %s does not exist"), dir); return 1; } *p = 0; } rc = create_hierarchy (dir, baselen, uid, gid); if (rc == 0) { if (p) *p = '/'; if (mkdir (dir, MKDIR_PERMISSIONS)) { - logmsg (LOG_ERR, "cannot create directory %s: %s", + logmsg (LOG_ERR, _("cannot create directory %s: %s"), dir, strerror (errno)); rc = 1; } if (chown (dir, uid, gid)) { - logmsg (LOG_NOTICE, "cannot change ownership of %s: %s", + logmsg (LOG_NOTICE, _("cannot change ownership of %s: %s"), dir, strerror (errno)); } } return rc; } @@ -149,29 +149,29 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid) size_t fsize; in_fd = open (file, O_RDONLY); if (in_fd == -1) { - logmsg (LOG_ERR, "cannot open source file %s for reading: %s", + logmsg (LOG_ERR, _("cannot open source file %s for reading: %s"), file, strerror (errno)); return 1; } if (fstat (in_fd, &st)) { - logmsg (LOG_ERR, "cannot stat source file %s: %s", + logmsg (LOG_ERR, _("cannot stat source file %s: %s"), file, strerror (errno)); close (in_fd); return 1; } out_fd = creat (dst_file, CREAT_PERMISSIONS); if (out_fd == -1) { - logmsg (LOG_ERR, "cannot create destination file %s: %s", + logmsg (LOG_ERR, _("cannot create destination file %s: %s"), file, strerror (errno)); close (in_fd); return 1; } buf = NULL; @@ -190,28 +190,28 @@ copy_file (const char *file, const char *dst_file, uid_t uid, gid_t gid) size_t rdbytes; rest = fsize > bufsize ? bufsize : fsize; rdbytes = read (in_fd, buf, rest); if (rdbytes == -1) { - logmsg (LOG_ERR, "unexpected error reading %s: %s", + logmsg (LOG_ERR, _("unexpected error reading %s: %s"), file, strerror (errno)); rc = 1; break; } rest = write (out_fd, buf, rdbytes); if (rest == -1) { - logmsg (LOG_ERR, "unexpected error writing to %s: %s", + logmsg (LOG_ERR, _("unexpected error writing to %s: %s"), dst_file, strerror (errno)); rc = 1; break; } else if (rest != rdbytes) { - logmsg (LOG_ERR, "short write on %s", dst_file); + logmsg (LOG_ERR, _("short write on %s"), dst_file); rc = 1; } fsize -= rdbytes; } free (buf); @@ -233,25 +233,25 @@ do_move_file (const char *file, const char *dst_file, uid_t uid, gid_t gid) if (rename (file, dst_file)) { if (errno == EXDEV) { if (copy_file (file, dst_file, uid, gid)) { - logmsg (LOG_CRIT, "cannot copy %s to %s: %s", + logmsg (LOG_CRIT, _("cannot copy %s to %s: %s"), file, dst_file, strerror (errno)); rc = 1; } else if (unlink (file)) { - logmsg (LOG_ERR, "cannot unlink %s: %s", + logmsg (LOG_ERR, _("cannot unlink %s: %s"), file, strerror (errno)); } } else { - logmsg (LOG_CRIT, "cannot move %s to %s: %s", + logmsg (LOG_CRIT, _("cannot move %s to %s: %s"), file, dst_file, strerror (errno)); rc = 1; } } return rc; } @@ -261,13 +261,13 @@ do_move_file (const char *file, const char *dst_file, uid_t uid, gid_t gid) int tar_append_file (const char *archive, const char *file) { const char *argv[6]; if (debug_level) - logmsg (LOG_DEBUG, "tarring %s to %s", file, archive); + logmsg (LOG_DEBUG, _("tarring %s to %s"), file, archive); if (dry_run_mode) { UPDATE_STATS (STAT_ARCHIVES); return 0; } @@ -283,13 +283,13 @@ tar_append_file (const char *archive, const char *file) case exec_success: UPDATE_STATS (STAT_ARCHIVES); return 0; case exec_fail: case exec_error: - logmsg (LOG_ERR, "cannot archive %s", file); + logmsg (LOG_ERR, _("cannot archive %s"), file); break; } return 1; } @@ -322,54 +322,56 @@ backup_file (const char *dst_file, const char *dst_dir, const char *file, file_name = concat_dir (adir, file, NULL); if (access (file_name, F_OK) == 0) { if (archive->backup_type == no_backups) { if (debug_level) - logmsg (LOG_DEBUG, "removing previous archive file `%s'", + logmsg (LOG_DEBUG, _("removing previous archive file `%s'"), file_name); if (!dry_run_mode && unlink (file_name)) { - logmsg (LOG_ERR, "cannot unlink previous archive file `%s': %s", + logmsg (LOG_ERR, + _("cannot unlink previous archive file `%s': %s"), file_name, strerror (errno)); free (file_name); free (adir); return 1; } } else { char *archive_file_name = find_backup_file_name (file_name, archive->backup_type); if (debug_level) - logmsg (LOG_DEBUG, "backing up previous archive file `%s' to `%s'", + logmsg (LOG_DEBUG, + _("backing up previous archive file `%s' to `%s'"), file_name, archive_file_name); if (!dry_run_mode) { rc = do_move_file (file_name, archive_file_name, uid, gid); if (rc) { - logmsg (LOG_ERR, "backing `%s' up as `%s' failed: %s", + logmsg (LOG_ERR, _("backing `%s' up as `%s' failed: %s"), file_name, archive_file_name, strerror (errno)); free (archive_file_name); free (file_name); free (adir); return 1; } } free (archive_file_name); } } if (debug_level) - logmsg (LOG_DEBUG, "archiving `%s' to `%s'", dst_file, file_name); + logmsg (LOG_DEBUG, _("archiving `%s' to `%s'"), dst_file, file_name); if (!dry_run_mode) { rc = do_move_file (dst_file, file_name, uid, gid); if (rc) - logmsg (LOG_ERR, "archiving `%s' as `%s' failed: %s", + logmsg (LOG_ERR, _("archiving `%s' as `%s' failed: %s"), dst_file, file_name, strerror (errno)); } free (file_name); free (adir); return rc; } @@ -392,13 +394,13 @@ do_archive_file (const char *dst_file, const char *dst_dir, const char *file, case archive_tar: if (tar_append_file (archive->name, dst_file)) return 1; } if (!dry_run_mode && unlink (dst_file)) { - logmsg (LOG_ERR, "Canot unlink file `%s': %s", + logmsg (LOG_ERR, _("canot unlink file `%s': %s"), dst_file, strerror (errno)); return 1; } return 0; } @@ -418,13 +420,13 @@ dir_move_file (struct file_triplet *trp, struct spool *spool, if (!dst_dir) return 1; dst_file = concat_dir (dst_dir, trp->file[file_id].name, NULL); if (debug_level) - logmsg (LOG_DEBUG, "installing %s to %s", trp->file[file_id].name, + logmsg (LOG_DEBUG, _("installing %s to %s"), trp->file[file_id].name, dst_dir); if (access (dst_file, F_OK) == 0) rc = do_archive_file (dst_file, dst_dir, trp->file[file_id].name, &spool->archive, TRIPLET_UID (trp), TRIPLET_GID (trp), reldir); @@ -457,37 +459,37 @@ archive_single_file (struct file_triplet *trp, struct spool *spool, if (!dst_dir) return 1; dst_file = safe_file_name (concat_dir (dst_dir, file_name, NULL)); if (!sub_dir_p (dst_file, spool->dest_dir)) { - logmsg (LOG_ERR, "file to be archived `%s' does not lie under `%s'", + logmsg (LOG_ERR, _("file to be archived `%s' does not lie under `%s'"), dst_file, spool->dest_dir); free (dst_file); free (dst_dir); return 1; } if (access (dst_file, F_OK) == 0) { if (debug_level) - logmsg (LOG_DEBUG, "Archiving file `%s'", dst_file); + logmsg (LOG_DEBUG, _("archiving file `%s'"), dst_file); rc = do_archive_file (dst_file, dst_dir, file_name, &spool->archive, TRIPLET_UID (trp), TRIPLET_GID (trp), reldir); if (rc == 0) UPDATE_STATS (STAT_ARCHIVES); } else if (errno == ENOENT) { if (!noentok) - logmsg (LOG_NOTICE, "Nothing to archive: file `%s' does not exist", + logmsg (LOG_NOTICE, _("nothing to archive: file `%s' does not exist"), dst_file); } else { - logmsg (LOG_ERR, "Canot access file `%s': %s", + logmsg (LOG_ERR, _("canot access file `%s': %s"), dst_file, strerror (errno)); rc = 1; } free (dst_file); free (dst_dir); @@ -547,38 +549,38 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool, if (!dst_dir) return 1; if (save_cwd (&cwd)) { - logmsg (LOG_ERR, "cannot save current directory: %s", + logmsg (LOG_ERR, _("cannot save current directory: %s"), strerror (errno)); return 1; } src = safe_file_name_alloc (wanted_src); if (!src || src[0] == '/') { - logmsg (LOG_ERR, "symlink source `%s' does not lie under `%s'", + logmsg (LOG_ERR, _("symlink source `%s' does not lie under `%s'"), wanted_src, spool->dest_dir); free (src); return 1; } dst = safe_file_name_alloc (wanted_dst); if (!dst || dst[0] == '/') { - logmsg (LOG_ERR, "symlink destination `%s' does not lie under `%s'", + logmsg (LOG_ERR, _("symlink destination `%s' does not lie under `%s'"), wanted_dst, spool->dest_dir); free (src); free (dst); return 1; } if (debug_level) - logmsg (LOG_DEBUG, "symlinking %s to %s in directory %s", + logmsg (LOG_DEBUG, _("symlinking %s to %s in directory %s"), src, dst, dst_dir); if (!dry_run_mode) { char *p = strrchr (dst, '/'); if (p > dst) @@ -595,58 +597,58 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool, *p = '/'; } if (rc == 0) { if (chdir (dst_dir)) - logmsg (LOG_ERR, "cannot change to %s: %s", + logmsg (LOG_ERR, _("cannot change to %s: %s"), dst_dir, strerror (errno)); else { struct stat st; if (lstat (dst, &st) == 0) { if (!S_ISLNK (st.st_mode)) { logmsg (LOG_ERR, - "file %s exists and is not a symbolic link", + _("file %s exists and is not a symbolic link"), dst); rc = 1; } else if (unlink (dst)) { logmsg (LOG_ERR, - "Cannot unlink %s: %s", + _("cannot unlink %s: %s"), dst, strerror (errno)); rc = 1; } } else if (errno != ENOENT) { logmsg (LOG_ERR, - "cannot stat file %s: %s", + _("cannot stat file %s: %s"), dst, strerror (errno)); rc = 1; } if (rc == 0) { rc = symlink (src, dst); if (rc) logmsg (LOG_ERR, - "symlinking %s to %s in directory %s failed: %s", + _("symlinking %s to %s in directory %s failed: %s"), src, dst, dst_dir, strerror (errno)); } } } } if (restore_cwd (&cwd)) { - logmsg (LOG_EMERG, "cannot restore current directory: %s", + logmsg (LOG_EMERG, _("cannot restore current directory: %s"), strerror (errno)); exit (1); } free (src); free (dst); @@ -660,32 +662,32 @@ dir_symlink_file (struct file_triplet *trp, struct spool *spool, static int do_rmsymlink_file (const char *dst_file, int noentok) { struct stat st; if (debug_level) - logmsg (LOG_DEBUG, "Removing symbolic link %s", dst_file); + logmsg (LOG_DEBUG, _("removing symbolic link %s"), dst_file); if (stat (dst_file, &st)) { if (errno == ENOENT) { if (!noentok) - logmsg (LOG_NOTICE, "Symlink `%s' does not exist", dst_file); + logmsg (LOG_NOTICE, _("symlink `%s' does not exist"), dst_file); return 0; } if (!S_ISLNK (st.st_mode)) { - logmsg (LOG_ERR, "Refusing to unlink %s: is not a symlink", + logmsg (LOG_ERR, _("refusing to unlink %s: is not a symlink"), dst_file); return 1; } } if (!dry_run_mode && unlink (dst_file)) { - logmsg (LOG_ERR, "Cannot unlink %s: %s", dst_file, strerror (errno)); + logmsg (LOG_ERR, _("cannot unlink %s: %s"), dst_file, strerror (errno)); return 1; } UPDATE_STATS (STAT_RMSYMLINKS); return 0; } @@ -707,14 +709,14 @@ dir_rmsymlink_file (struct file_triplet *trp, struct spool *spool, if (!dst_dir) return 1; dst_file = safe_file_name (concat_dir (dst_dir, file_name, NULL)); if (!sub_dir_p (dst_file, spool->dest_dir)) { - logmsg (LOG_ERR, "refusing to remove a symlink `%s' that is not " - "located under `%s'", + logmsg (LOG_ERR, _("refusing to remove a symlink `%s' that is not " + "located under `%s'"), dst_file, spool->dest_dir); free (dst_file); free (dst_dir); return 1; } @@ -45,26 +45,26 @@ start_prog (int argc, const char **argv, pid_t *ppid) /* Close unneded descripitors */ for (i = getdtablesize (); i > 2; i--) close (i); execvp (argv[0], (char**) argv); - logmsg (LOG_CRIT, "cannot run %s: %s", argv[0], strerror (errno)); + logmsg (LOG_CRIT, _("cannot run %s: %s"), argv[0], strerror (errno)); exit (1); case -1: - logmsg (LOG_CRIT, "cannot run `%s': fork failed: %s", + logmsg (LOG_CRIT, _("cannot run `%s': fork failed: %s"), argv[0], strerror (errno)); return NULL; default: /* Master process */ close (p[1]); fp = fdopen (p[0], "r"); if (!fp) - logmsg (LOG_ERR, "cannot fdopen: %s", strerror (errno)); + logmsg (LOG_ERR, _("cannot fdopen: %s"), strerror (errno)); *ppid = pid; } return fp; } /* Log everything read from FP as the output from the program PROG, using @@ -72,16 +72,16 @@ start_prog (int argc, const char **argv, pid_t *ppid) void log_output (int prio, const char *prog, FILE *fp) { size_t size = 0; char *buf = NULL; - logmsg (prio, "%s output follows:", prog); + logmsg (prio, _("%s output follows:"), prog); while (getline (&buf, &size, fp) > 0) logmsg (prio, "%s", buf); - logmsg (prio, "end of %s output", prog); + logmsg (prio, _("end of %s output"), prog); free (buf); } /* Execute ARGC/ARGV. Return the exit code in RETCODE. */ enum exec_result wydawca_exec (int argc, const char **argv, int *retcode) @@ -92,31 +92,31 @@ wydawca_exec (int argc, const char **argv, int *retcode) int i; enum exec_result res; fp = start_prog (5, argv, &pid); if (!fp) { - logmsg (LOG_CRIT, "cannot start %s", argv[0]); + logmsg (LOG_CRIT, _("cannot start %s"), argv[0]); return exec_error; } for (i = 0; i < 5 && (npid = waitpid (pid, &status, WNOHANG)) == 0; i++) sleep (1); switch (npid) { case -1: - logmsg (LOG_CRIT, "cannot execute %s: waitpid failed: %s", + logmsg (LOG_CRIT, _("cannot execute %s: waitpid failed: %s"), argv[0], strerror (errno)); fclose (fp); return exec_error; case 0: logmsg (LOG_CRIT, - "cannot execute %s: the process did not respond " - "within 5 seconds: %s", + _("cannot execute %s: the process did not respond " + "within 5 seconds: %s"), argv[0], strerror (errno)); kill (pid, SIGKILL); fclose (fp); return exec_error; default: @@ -126,13 +126,13 @@ wydawca_exec (int argc, const char **argv, int *retcode) if (WIFEXITED (status)) { int rc = WEXITSTATUS (status); if (rc) { res = exec_fail; - logmsg (LOG_ERR, "command %s returned %d", argv[0], rc); + logmsg (LOG_ERR, _("command %s returned %d"), argv[0], rc); log_output (LOG_ERR, argv[0], fp); } else { res = exec_success; if (debug_level > 1) @@ -142,19 +142,19 @@ wydawca_exec (int argc, const char **argv, int *retcode) *retcode = rc; } else { res = exec_error; if (WIFSIGNALED (status)) - logmsg (LOG_ERR, "%s terminated on signal %d", + logmsg (LOG_ERR, _("%s terminated on signal %d"), argv[0], WTERMSIG (status)); else if (WIFSTOPPED (status)) - logmsg (LOG_ERR, "%s stopped on signal %d", + logmsg (LOG_ERR, _("%s stopped on signal %d"), argv[0], WTERMSIG (status)); else - logmsg (LOG_ERR, "%s terminated with unrecognized status", + logmsg (LOG_ERR, _("%s terminated with unrecognized status"), argv[0]); } fclose (fp); return res; } @@ -23,13 +23,14 @@ #define fail_if_err(expr) \ do \ { \ int a = expr; \ if (a) \ { \ - logmsg (LOG_ERR, "%s: GPGME error: %s", #expr, gpgme_strerror (a)); \ + logmsg (LOG_ERR, _("%s: GPGME error: %s"), #expr, \ + gpgme_strerror (a)); \ return 1; \ } \ } \ while (0) static char *homedir; @@ -44,21 +45,21 @@ recursive_rmdir (const char *name) int rc; DIR *dir; struct dirent *ent; if (chdir (name)) { - logmsg (LOG_ERR, "cannot change to directory %s: %s", + logmsg (LOG_ERR, _("cannot change to directory %s: %s"), name, strerror (errno)); return 1; } dir = opendir ("."); if (!dir) { - logmsg (LOG_ERR, "cannot open directory %s: %s", + logmsg (LOG_ERR, _("cannot open directory %s: %s"), name, strerror (errno)); return 1; } for (rc = 0; rc == 0 && (ent = readdir (dir));) { @@ -67,20 +68,20 @@ recursive_rmdir (const char *name) if (strcmp (ent->d_name, ".") == 0 || strcmp (ent->d_name, "..") == 0) continue; if (stat (ent->d_name, &st) && errno != ENOENT) { - logmsg (LOG_ERR, "cannot stat file `%s': %s", + logmsg (LOG_ERR, _("cannot stat file `%s': %s"), name, strerror (errno)); rc = 1; } else if (S_ISDIR (st.st_mode)) rc = rmdir_r (ent->d_name); else if ((rc = unlink (ent->d_name)) != 0 && errno != ENOENT) - logmsg (LOG_ERR, "cannot unlink %s: %s", + logmsg (LOG_ERR, _("cannot unlink %s: %s"), ent->d_name, strerror (errno)); } closedir (dir); return rc; } @@ -91,61 +92,61 @@ rmdir_r (const char *name) { int rc; struct saved_cwd cwd; if (save_cwd (&cwd)) { - logmsg (LOG_ERR, "cannot save current directory: %s", + logmsg (LOG_ERR, _("cannot save current directory: %s"), strerror (errno)); return 1; } rc = recursive_rmdir (name); if (restore_cwd (&cwd)) { - logmsg (LOG_ERR, "cannot restore current directory: %s", + logmsg (LOG_ERR, _("cannot restore current directory: %s"), strerror (errno)); rc = 1; } if (rc == 0 && rmdir (name)) { - logmsg (LOG_ERR, "cannot remove directory %s: %s", + logmsg (LOG_ERR, _("cannot remove directory %s: %s"), name, strerror (errno)); return 1; } return rc; } /* Remove temporary GPG home directory */ static void remove_homedir () { if (debug_level > 1) - logmsg (LOG_DEBUG, "Removing GNUPG home directory: %s", homedir); + logmsg (LOG_DEBUG, _("removing GNUPG home directory: %s"), homedir); if (rmdir_r (homedir)) - logmsg (LOG_CRIT, "Failed to remove GPG directory %s", homedir); + logmsg (LOG_CRIT, _("failed to remove GPG directory %s"), homedir); } /* Create a temporary GPG home directory */ int wydawca_gpg_homedir () { if (homedir) return 0; homedir = xstrdup ("/tmp/wydawca-XXXXXX"); if (!mkdtemp (homedir)) { - logmsg (LOG_CRIT, "cannot create GPG home directory (%s): %s", + logmsg (LOG_CRIT, _("cannot create GPG home directory (%s): %s"), homedir, strerror (errno)); return 1; } atexit (remove_homedir); if (debug_level > 1) - logmsg (LOG_DEBUG, "GNUPG home directory: %s", homedir); + logmsg (LOG_DEBUG, _("GNUPG home directory: %s"), homedir); setenv ("GNUPGHOME", homedir, 1); return 0; } static int gpg_sig_ok_p (gpgme_ctx_t ctx, gpgme_signature_t sig) @@ -164,37 +165,37 @@ gpg_sig_ok_p (gpgme_ctx_t ctx, gpgme_signature_t sig) uid = sig->fpr; switch (gpg_err_code (sig->status)) { case GPG_ERR_NO_ERROR: if (debug_level) - logmsg (LOG_NOTICE, "Good signature from %s", uid); + logmsg (LOG_NOTICE, _("Good signature from %s"), uid); break; case GPG_ERR_BAD_SIGNATURE: - logmsg (LOG_ERR, "BAD signature from %s", uid); + logmsg (LOG_ERR, _("BAD signature from %s"), uid); return 0; case GPG_ERR_NO_PUBKEY: - logmsg (LOG_ERR, "No public key"); + logmsg (LOG_ERR, _("No public key")); return 0; case GPG_ERR_NO_DATA: - logmsg (LOG_ERR, "No signature"); + logmsg (LOG_ERR, _("No signature")); return 0; case GPG_ERR_SIG_EXPIRED: - logmsg (LOG_ERR, "Expired signature from %s", uid); + logmsg (LOG_ERR, _("Expired signature from %s"), uid); return 0; case GPG_ERR_KEY_EXPIRED: - logmsg (LOG_ERR, "Key expired (%s)", uid); + logmsg (LOG_ERR, _("Key expired (%s)"), uid); return 0; default: - logmsg (LOG_ERR, "Unknown signature error"); + logmsg (LOG_ERR, _("Unknown signature error")); return 0; } } return 1; } @@ -242,13 +243,13 @@ verify_directive_signature (struct file_triplet *trp, } } else { rc = 1; UPDATE_STATS (STAT_BAD_SIGNATURE); - logmsg (LOG_ERR, "%s: directive verification failed: %s", + logmsg (LOG_ERR, _("%s: directive verification failed: %s"), trp->name, gpgme_strerror (ec)); } gpgme_data_release (directive_data); gpgme_data_release (key_data); @@ -268,14 +269,14 @@ verify_detached_signature (struct file_triplet *trp, fail_if_err (gpgme_get_engine_info (&info)); while (info && info->protocol != GPGME_PROTOCOL_OpenPGP) info = info->next; if (!info) { logmsg (LOG_CRIT, - "cannot find path to gpg binary (attempting to verify " - "the detached signature for %s", trp->name); + _("cannot find path to gpg binary (attempting to verify " + "the detached signature for %s"), trp->name); return 1; } wydawca_gpg_homedir (); argv[0] = info->file_name; ar |