+2003-09-13 Bruno Haible <bruno@clisp.org>
+
+ * PACKAGING: Add envsubst related files and gettext.sh.
+
2003-08-23 Bruno Haible <bruno@clisp.org>
* version.sh: Bump version number to 0.12.2.
-Version 0.12.2 - August 2003
+Version 0.12.2 - September 2003
* Programming languages support:
- Shell:
xgettext now also supports shell scripts. It recognizes invocations of
- the programs 'gettext' and 'ngettext' as well as the GNU bash builtin
- syntax $"...".
+ the programs 'gettext', 'ngettext', the functions 'eval_gettext',
+ 'eval_ngettext', as well as the deprecated GNU bash builtin syntax $"...".
+ New function library:
+ gettext.sh - shell functions for internationalized shell scripts.
+ New program:
+ envsubst - substitutes environment variables in shell format strings.
- Perl:
xgettext now also supports Perl.
$prefix/bin/gettext
$prefix/bin/ngettext
+ $prefix/bin/envsubst
+ $prefix/bin/gettext.sh
$prefix/share/man/man1/gettext.1
$prefix/share/man/man1/ngettext.1
+ $prefix/share/man/man1/envsubst.1
$prefix/share/doc/gettext/gettext.1.html
$prefix/share/doc/gettext/ngettext.1.html
+ $prefix/share/doc/gettext/envsubst.1.html
$prefix/share/locale/*/LC_MESSAGES/gettext-runtime.mo
$prefix/lib/libintl.* (not installed on glibc systems)
-Version 0.12.2 - August 2003
+Version 0.12.2 - September 2003
* On those few platforms (NetBSD and Woe32) for which the native
printf()/fprintf()/... functions don't support POSIX/XSI format strings
with positions, replacements are provided through <libintl.h>.
+
+* New function library:
+ gettext.sh - shell functions for internationalized shell scripts
+* New program:
+ envsubst - substitutes environment variables in shell format strings
\f
Version 0.12 - May 2003
+2003-09-13 Bruno Haible <bruno@clisp.org>
+
+ * envsubst.x: New file.
+ * Makefile.am (man_aux): Add envsubst.x.
+ (man_MAN1OTHER): New variable.
+ (man_MAN1): Add $(man_MAN1OTHER).
+ (man_HTMLOTHER): Add envsubst.1.html.
+ (EXTRA_DIST, MAINTAINERCLEANFILES): Add $(man_MAN1OTHER).
+ (envsubst.1): New rule.
+ (envsubst.1.html): New rule.
+
2003-05-22 Bruno Haible <bruno@clisp.org>
* gettext-0.12.1 released.
# A manual page for each of the bin_PROGRAMS in src/Makefile.am.
-man_aux = gettext.x ngettext.x
+man_aux = gettext.x ngettext.x envsubst.x
# Likewise, plus additional manual pages for the libintl functions.
man_MAN1GEN = gettext.1 ngettext.1
man_MAN1IN = gettext.1.in ngettext.1.in
-man_MAN1 = $(man_MAN1GEN)
+man_MAN1OTHER = envsubst.1
+man_MAN1 = $(man_MAN1GEN) $(man_MAN1OTHER)
man_MAN3 = gettext.3 ngettext.3 \
textdomain.3 bindtextdomain.3 bind_textdomain_codeset.3
man_MAN3IN = gettext.3.in ngettext.3.in \
man_HTMLGEN = gettext.1.html ngettext.1.html
man_HTMLIN = gettext.1.html.in ngettext.1.html.in
man_HTMLOTHER = \
+envsubst.1.html \
gettext.3.html ngettext.3.html \
textdomain.3.html bindtextdomain.3.html bind_textdomain_codeset.3.html
man_HTML = $(man_HTMLGEN) $(man_HTMLOTHER)
-EXTRA_DIST += help2man $(man_aux) $(man_MAN1IN) $(man_MAN3) $(man_MAN3IN) $(man_MAN3LINK) $(man_HTMLIN) $(man_HTMLOTHER)
+EXTRA_DIST += help2man $(man_aux) $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_MAN3IN) $(man_MAN3LINK) $(man_HTMLIN) $(man_HTMLOTHER)
CLEANFILES = $(man_MAN1GEN) $(man_HTMLGEN)
-MAINTAINERCLEANFILES = $(man_MAN1IN) $(man_MAN3) $(man_HTMLIN) $(man_HTMLOTHER)
+MAINTAINERCLEANFILES = $(man_MAN1IN) $(man_MAN1OTHER) $(man_MAN3) $(man_HTMLIN) $(man_HTMLOTHER)
PERL = @PERL@
RM = rm -f
ngettext.1.in: ngettext.x
IN_HELP2MAN=1 $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/ngettext$(EXEEXT) $(srcdir)/ngettext.x ngettext.1.in
+envsubst.1: envsubst.x
+ $(SHELL) x-to-1 "$(PERL)" "$(HELP2MAN)" ../src/envsubst$(EXEEXT) $(srcdir)/envsubst.x envsubst.1
+
# Depend on version.sh to get version number changes.
$(man_MAN1): help2man $(top_srcdir)/../version.sh
$(MAN2HTML) `if test -f ngettext.1.in; then echo .; else echo $(srcdir); fi`/ngettext.1.in | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
+envsubst.1.html: envsubst.1
+ $(MAN2HTML) `if test -f envsubst.1; then echo .; else echo $(srcdir); fi`/envsubst.1 | sed -e '/CreationDate:/d' > t-$@
+ mv t-$@ $@
+
gettext.3.html: gettext.3.in
$(MAN2HTML) $(srcdir)/gettext.3.in | sed -e '/CreationDate:/d' > t-$@
mv t-$@ $@
+2003-09-13 Bruno Haible <bruno@clisp.org>
+
+ * envsubst.c: New file.
+ * gettext.sh: New file.
+ * Makefile.am (bin_PROGRAMS): Add envsubst.
+ (envsubst_SOURCES, envsubst_CFLAGS, envsubst_LDFLAGS): New variables.
+ (all-local): Depend on gettext.sh.
+ (install-data-local, uninstall-local): New rules, for gettext.sh.
+ * Makefile.msvc (PROGRAMS): Add envsubst.exe.
+ (envsubst_OBJECTS): New variable.
+ (envsubst.obj, envsubst.exe): New rules.
+ (install): Install also envsubst.exe and gettext.sh.
+ (uninstall): Uninstall also envsubst.exe and gettext.sh.
+ * Makefile.vms (PROGRAMS): Add envsubst.exe.
+ (envsubst_OBJECTS): New variable.
+ (envsubst.obj, envsubst.exe): New rules.
+ (install): Install also envsubst.exe and gettext.sh.
+ (uninstall): Uninstall also envsubst.exe and gettext.sh.
+
2003-09-13 Bruno Haible <bruno@clisp.org>
Fix behaviour of "<program> --help > /dev/full".
AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
EXTRA_DIST =
-bin_PROGRAMS = gettext ngettext
+bin_PROGRAMS = gettext ngettext envsubst
localedir = $(datadir)/locale
# Source dependencies.
gettext_SOURCES = gettext.c
ngettext_SOURCES = ngettext.c
+envsubst_SOURCES = envsubst.c
# Link dependencies.
LDADD = ../lib/libgrt.a @LTLIBINTL@
# Specify installation directory, for --enable-relocatable.
gettext_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
ngettext_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
+envsubst_CFLAGS = -DINSTALLDIR=\"$(bindir)\"
if RELOCATABLE_VIA_LD
gettext_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
ngettext_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
+envsubst_LDFLAGS = `$(RELOCATABLE_LDFLAGS) $(bindir)`
endif
+# Special rule for installing gettext.sh in $(bindir).
+# automake doesn't handle "bin_DATA = gettext.sh".
+all-local: gettext.sh
+install-data-local: all-local
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ $(INSTALL_DATA) $(srcdir)/gettext.sh $(DESTDIR)$(bindir)/gettext.sh
+uninstall-local: all-local
+ $(RM) $(DESTDIR)$(bindir)/gettext.sh
+
# Support for relocatability.
RELOCATABLE_LIBRARY_PATH = $(libdir)
RELOCATABLE_SRC_DIR = $(top_srcdir)/../gettext-tools/lib
SHELL = /bin/sh
-PROGRAMS = gettext.exe ngettext.exe
+PROGRAMS = gettext.exe ngettext.exe envsubst.exe
gettext_OBJECTS = gettext.obj
ngettext_OBJECTS = ngettext.obj
+envsubst_OBJECTS = envsubst.obj
LDADD =
all : $(PROGRAMS)
ngettext.obj : ngettext.c
$(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c ngettext.c
+envsubst.obj : envsubst.c
+ $(CC) $(INCLUDES) $(CFLAGS) -DINSTALLPREFIX=\"$(IIprefix)\" -DINSTALLDIR=\"$(IIbindir)\" -c envsubst.c
+
gettext.exe : $(gettext_OBJECTS)
$(CC) $(MFLAGS) $(DEBUGFLAGS) $(gettext_OBJECTS) ..\lib\grt.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Fegettext.exe
ngettext.exe : $(ngettext_OBJECTS)
$(CC) $(MFLAGS) $(DEBUGFLAGS) $(ngettext_OBJECTS) ..\lib\grt.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Fengettext.exe
+envsubst.exe : $(envsubst_OBJECTS)
+ $(CC) $(MFLAGS) $(DEBUGFLAGS) $(ngettext_OBJECTS) ..\lib\grt.lib ..\intl\intl.lib $(libdir)\iconv.lib $(LDADD) -Feenvsubst.exe
+
install : all force
-mkdir $(prefix)
-mkdir $(exec_prefix)
-mkdir $(bindir)
$(INSTALL_PROGRAM) gettext.exe $(bindir)\gettext.exe
$(INSTALL_PROGRAM) ngettext.exe $(bindir)\ngettext.exe
+ $(INSTALL_PROGRAM) envsubst.exe $(bindir)\envsubst.exe
+ $(INSTALL_DATA) gettext.sh $(bindir)\gettext.sh
installdirs : force
-mkdir $(prefix)
uninstall : force
$(RM) $(bindir)\gettext.exe
$(RM) $(bindir)\ngettext.exe
+ $(RM) $(bindir)\envsubst.exe
+ $(RM) $(bindir)\gettext.sh
check : all
#### End of system configuration section. ####
-PROGRAMS = gettext.exe, ngettext.exe
+PROGRAMS = gettext.exe, ngettext.exe, envsubst.exe
gettext_OBJECTS = gettext.obj
ngettext_OBJECTS = ngettext.obj
+envsubst_OBJECTS = envsubst.obj
all : $(PROGRAMS)
write sys$output "Nothing else to be done for 'all'."
ngettext.obj : ngettext.c
$(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS),"INSTALLPREFIX=""$(prefix)]""","INSTALLDIR=""$(bindir)]""") ngettext.c
+envsubst.obj : envsubst.c
+ $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS),"INSTALLPREFIX=""$(prefix)]""","INSTALLDIR=""$(bindir)]""") envsubst.c
+
libiconv.opt :
if f$search("sys$library:libiconv.olb") .nes. "" then $(LN) [-.-.vms]with-libiconv.opt libiconv.opt
if f$search("sys$library:libiconv.olb") .eqs. "" then $(LN) [-.-.vms]without-libiconv.opt libiconv.opt
ngettext.exe : $(ngettext_OBJECTS),libiconv.opt
link /executable=ngettext.exe $(ngettext_OBJECTS),[-.lib]grt.olb/lib,[-.intl]intl.olb/lib,$(LDADD)
+envsubst.exe : $(envsubst_OBJECTS),libiconv.opt
+ link /executable=envsubst.exe $(envsubst_OBJECTS),[-.lib]grt.olb/lib,[-.intl]intl.olb/lib,$(LDADD)
+
install : all
create /directory $(prefix)]
create /directory $(exec_prefix)]
create /directory $(bindir)]
$(INSTALL_PROGRAM) gettext.exe $(bindir)]gettext.exe
$(INSTALL_PROGRAM) ngettext.exe $(bindir)]ngettext.exe
+ $(INSTALL_PROGRAM) envsubst.exe $(bindir)]envsubst.exe
+ $(INSTALL_DATA) gettext.sh $(bindir)]gettext.sh
installdirs :
create /directory $(prefix)]
uninstall :
$(RM) $(bindir)]gettext.exe;
$(RM) $(bindir)]ngettext.exe;
+ $(RM) $(bindir)]envsubst.exe;
+ $(RM) $(bindir)]gettext.sh;
check : all
write sys$output "Nothing else to be done for 'check'."
+2003-09-13 Bruno Haible <bruno@clisp.org>
+
+ * lang-sh: Source gettext.sh.
+ (echo, eval_gettext, eval_ngettext): Remove definitions.
+ * lang-bash: Source gettext.sh.
+ (echo, eval_ngettext): Remove definitions.
+
2003-09-13 Bruno Haible <bruno@clisp.org>
* format-sh-1: Update to match stricter format string definition.
cat <<\EOF > prog.sh
#! /bin/bash
-# Find a way to echo strings without interpreting backslash.
-if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
- echo='echo'
-else
- if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
- echo='printf %s\n'
- else
- echo_func () {
- cat <<EOT
-$*
-EOT
- }
- echo='echo_func'
- fi
-fi
-
n=$1
+. gettext.sh
+
TEXTDOMAIN=prog
export TEXTDOMAIN
TEXTDOMAINDIR=.
export TEXTDOMAINDIR
-eval_ngettext () {
- _string=`ngettext "$1" "$2" "$3"`
- eval _string="\"$_string\""
- $echo "$_string"
-}
-
$echo $"'Your command, please?', asked the waiter."
$echo "`eval_ngettext "a piece of cake" "\\$n pieces of cake" $n`"
cat <<\EOF > prog.sh
#! /bin/sh
-# Find a way to echo strings without interpreting backslash.
-if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
- echo='echo'
-else
- if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
- echo='printf %s\n'
- else
- echo_func () {
- cat <<EOT
-$*
-EOT
- }
- echo='echo_func'
- fi
-fi
-
n=$1
+. gettext.sh
+
TEXTDOMAIN=prog
export TEXTDOMAIN
TEXTDOMAINDIR=.
export TEXTDOMAINDIR
-eval_gettext () {
- _string=`gettext "$1"`
- eval _string="\"$_string\""
- $echo "$_string"
-}
-
-eval_ngettext () {
- _string=`ngettext "$1" "$2" "$3"`
- eval _string="\"$_string\""
- $echo "$_string"
-}
-
$echo "`gettext \"'Your command, please?', asked the waiter.\"`"
$echo "`eval_ngettext \"a piece of cake\" \"\\$n pieces of cake\" $n`"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
msgid "'Your command, please?', asked the waiter."
-msgstr "«Votre commande, s'il vous plait», dit le garçon."
+msgstr "Votre commande, s'il vous plait, dit le gar�n."
# Les gateaux allemands sont les meilleurs du monde.
#, sh-format
tmpfiles="$tmpfiles prog.ok prog.out"
: ${DIFF=diff}
cat <<\EOF > prog.ok
-«Votre commande, s'il vous plait», dit le garçon.
+Votre commande, s'il vous plait, dit le gar�n.
2 morceaux de gateau
EOF