summaryrefslogtreecommitdiff
path: root/setfacl
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2002-11-29 03:23:54 +0000
committerNathan Scott <nathans@sgi.com>2002-11-29 03:23:54 +0000
commit49db9e71590ecc898412aade1148b5fa67d9ea6c (patch)
tree1cfaeea9de74452e81055ba65327f143675eccbb /setfacl
parent5ac373ae34147102183650992748a71b15ce5d7c (diff)
downloadacl-49db9e71590ecc898412aade1148b5fa67d9ea6c.tar.gz
acl package changes to support I18N.
Diffstat (limited to 'setfacl')
-rw-r--r--setfacl/Makefile1
-rw-r--r--setfacl/do_set.c12
-rw-r--r--setfacl/setfacl.c63
3 files changed, 40 insertions, 36 deletions
diff --git a/setfacl/Makefile b/setfacl/Makefile
index 44a71fe..5364705 100644
--- a/setfacl/Makefile
+++ b/setfacl/Makefile
@@ -37,7 +37,6 @@ LTCOMMAND = setfacl
CFILES = setfacl.c do_set.c sequence.c parse.c
HFILES = sequence.h parse.h
-LCFLAGS = -DPKG_NAME=\"$(PKG_NAME)\" -DLOCALEDIR=\"$(gnulocaledir)\"
LLDLIBS = $(LIBATTR) $(LIBACL)
LTDEPENDENCIES = $(LIBACL)
diff --git a/setfacl/do_set.c b/setfacl/do_set.c
index 9d0a4c5..ddd3748 100644
--- a/setfacl/do_set.c
+++ b/setfacl/do_set.c
@@ -37,7 +37,6 @@
#include "parse.h"
#include <libintl.h>
-#define _(String) gettext (String)
extern const char *progname;
@@ -379,8 +378,8 @@ do_set(
goto fail;
if (error > 0) {
acl_text = acl_to_any_text(acl, NULL, ',', 0);
- fprintf(stderr, _("%s: %s: Malformed access ACL `%s': "
- "%s at entry %d\n"), progname, path_p,
+ fprintf(stderr, gettext("%s: %s: Malformed access ACL "
+ "`%s': %s at entry %d\n"), progname, path_p,
acl_text, acl_error(error), which_entry+1);
acl_free(acl_text);
errors++;
@@ -406,7 +405,7 @@ do_set(
goto fail;
if (error > 0) {
acl_text = acl_to_any_text(default_acl, NULL, ',', 0);
- fprintf(stderr, _("%s: %s: Malformed default ACL "
+ fprintf(stderr, gettext("%s: %s: Malformed default ACL "
"`%s': %s at entry %d\n"),
progname, path_p, acl_text,
acl_error(error), which_entry+1);
@@ -468,8 +467,9 @@ do_set(
}
} else {
if (acl_entries(default_acl) != 0) {
- fprintf(stderr, _("%s: %s: Only directories "
- "can have default ACLs\n"),
+ fprintf(stderr, gettext(
+ "%s: %s: Only directories "
+ "can have default ACLs\n"),
progname, path_p);
errors++;
goto cleanup;
diff --git a/setfacl/setfacl.c b/setfacl/setfacl.c
index 0dad1ab..79f5e8f 100644
--- a/setfacl/setfacl.c
+++ b/setfacl/setfacl.c
@@ -36,7 +36,6 @@
#include <locale.h>
#include <libintl.h>
-#define _(String) gettext (String)
extern int
do_set(
@@ -140,13 +139,15 @@ restore(
if (path_p == NULL) {
if (filename) {
- fprintf(stderr, _("%s: %s: No filename found "
- "in line %d, aborting\n"),
+ fprintf(stderr, gettext(
+ "%s: %s: No filename found "
+ "in line %d, aborting\n"),
progname, filename, backup_line);
} else {
- fprintf(stderr, _("%s: No filename found in "
- "line %d of standard input, "
- "aborting\n"),
+ fprintf(stderr, gettext(
+ "%s: No filename found in "
+ "line %d of standard input, "
+ "aborting\n"),
progname, backup_line);
}
goto getout;
@@ -165,7 +166,7 @@ restore(
SEQ_PARSE_MULTI,
&line, NULL);
if (error != 0) {
- fprintf(stderr, _("%s: %s: %s in line %d\n"),
+ fprintf(stderr, gettext("%s: %s: %s in line %d\n"),
progname, filename, strerror(errno), line);
goto getout;
}
@@ -188,7 +189,7 @@ restore(
if (!opt_test &&
(uid != ACL_UNDEFINED_ID || gid != ACL_UNDEFINED_ID)) {
if (chown(path_p, uid, gid) != 0) {
- fprintf(stderr, _("%s: %s: Cannot change "
+ fprintf(stderr, gettext("%s: %s: Cannot change "
"owner/group: %s\n"),
progname, path_p, strerror(errno));
status = 1;
@@ -226,11 +227,11 @@ fail:
void help(void)
{
- printf(_("%s %s -- set file access control lists\n"),
+ printf(gettext("%s %s -- set file access control lists\n"),
progname, VERSION);
- printf(_("Usage: %s %s\n"),
+ printf(gettext("Usage: %s %s\n"),
progname, cmd_line_spec);
- printf(_(
+ printf(gettext(
" -m, --modify=acl modify the current ACL(s) of file(s)\n"
" -M, --modify-file=file read ACL entries to modify from file\n"
" -x, --remove=acl remove entries from the ACL(s) of file(s)\n"
@@ -239,18 +240,18 @@ void help(void)
" -k, --remove-default remove the default ACL\n"));
#if !POSIXLY_CORRECT
if (!posixly_correct) {
- printf(_(
+ printf(gettext(
" --set=acl set the ACL of file(s), replacing the current ACL\n"
" --set-file=file read ACL entries to set from file\n"
" --mask do recalculate the effective rights mask\n"));
}
#endif
- printf(_(
+ printf(gettext(
" -n, --no-mask don't recalculate the effective rights mask\n"
" -d, --default operations apply to the default ACL\n"));
#if !POSIXLY_CORRECT
if (!posixly_correct) {
- printf(_(
+ printf(gettext(
" -R, --recursive recurse into subdirectories\n"
" -L, --logical logical walk, follow symbolic links\n"
" -P, --physical physical walk, do not follow symbolic links\n"
@@ -258,7 +259,7 @@ void help(void)
" --test test mode (ACLs are not modified)\n"));
}
#endif
- printf(_(
+ printf(gettext(
" --version print version and exit\n"
" --help this help text\n"));
}
@@ -353,23 +354,23 @@ int main(int argc, char *argv[])
#if POSIXLY_CORRECT
cmd_line_options = POSIXLY_CMD_LINE_OPTIONS;
- cmd_line_spec = _(POSIXLY_CMD_LINE_SPEC);
+ cmd_line_spec = gettext(POSIXLY_CMD_LINE_SPEC);
#else
if (getenv(POSIXLY_CORRECT_STR))
posixly_correct = 1;
if (!posixly_correct) {
cmd_line_options = CMD_LINE_OPTIONS;
- cmd_line_spec = _(CMD_LINE_SPEC);
+ cmd_line_spec = gettext(CMD_LINE_SPEC);
} else {
cmd_line_options = POSIXLY_CMD_LINE_OPTIONS;
- cmd_line_spec = _(POSIXLY_CMD_LINE_SPEC);
+ cmd_line_spec = gettext(POSIXLY_CMD_LINE_SPEC);
}
#endif
setlocale(LC_MESSAGES, "");
- bindtextdomain(PKG_NAME, LOCALEDIR);
- textdomain(PKG_NAME);
-
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
while ((opt = getopt_long(argc, argv, cmd_line_options,
long_options, NULL)) != -1) {
/* we remember the two REMOVE_ACL commands of the set
@@ -466,11 +467,13 @@ int main(int argc, char *argv[])
seq_cmd, parse_mode) != 0) {
if (which < 0 ||
(size_t) which >= strlen(optarg)) {
- fprintf(stderr, _("%s: Option "
+ fprintf(stderr, gettext(
+ "%s: Option "
"-%c incomplete\n"),
progname, opt);
} else {
- fprintf(stderr, _("%s: Option "
+ fprintf(stderr, gettext(
+ "%s: Option "
"-%c: %s near "
"character %d\n"),
progname, opt,
@@ -554,15 +557,17 @@ int main(int argc, char *argv[])
errno = EINVAL;
if (file != stdin) {
- fprintf(stderr, _("%s: %s in "
- "line %d of file %s\n"),
+ fprintf(stderr, gettext(
+ "%s: %s in line "
+ "%d of file %s\n"),
progname,
strerror(errno),
lineno,
optarg);
} else {
- fprintf(stderr, _("%s: %s in "
- "line %d of standard "
+ fprintf(stderr, gettext(
+ "%s: %s in line "
+ "%d of standard "
"input\n"), progname,
strerror(errno),
lineno);
@@ -669,9 +674,9 @@ int main(int argc, char *argv[])
goto cleanup;
synopsis:
- fprintf(stderr, _("Usage: %s %s\n"),
+ fprintf(stderr, gettext("Usage: %s %s\n"),
progname, cmd_line_spec);
- fprintf(stderr, _("Try `%s --help' for more information.\n"),
+ fprintf(stderr, gettext("Try `%s --help' for more information.\n"),
progname);
status = 2;
goto cleanup;