Re: apt i18n patches
On Thu, 29 Aug 2002, Michael Piefel wrote:
> I sent in some new patches in June, they are in bug report 95933. What
> do you think of them? You have not included them, but didn't explicitely
> reject them either.
Perhaps this patch will do what you want.
It seems to be OK for me:
wakko{jgg}~/work/apt/build/bin#echo Dir::Locale "../locale/"\; > apt.conf
wakko{jgg}~/work/apt/build/bin#APT_CONFIG=./apt.conf LANG=de_DE ./apt-get
apt für linux i386 kompiliert am Sep 15 2002 17:16:26
Aufruf: apt-get [optionen] befehl
apt-get [optionen] install|remove pkg1 [pkg2 ...]
apt-get [optionen] source pkg1 [pkg2 ...]
apt-get ist ein einfaches Kommandozeilenwerkzeug zum Herunterladen
und Installieren von Paketen. Die am häufigsten benutzten Befehle
sind update und install.
[..]
However, the translations included in 95933 do not apply very well to CVS,
there appear to be many serious errors.
Jason
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/Makefile ./Makefile
--- /tmp/apt/Makefile Tue Feb 20 00:03:16 2001
+++ ./Makefile Sun Sep 15 17:14:55 2002
@@ -18,6 +18,7 @@
$(MAKE) -C ftparchive $@
$(MAKE) -C dselect $@
$(MAKE) -C doc $@
+ $(MAKE) -C po $@
# Some very common aliases
.PHONY: maintainer-clean dist-clean distclean pristine sanity
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/apt-pkg/init.cc ./apt-pkg/init.cc
--- /tmp/apt/apt-pkg/init.cc Wed Dec 5 00:22:39 2001
+++ ./apt-pkg/init.cc Sun Sep 15 17:28:16 2002
@@ -93,7 +93,13 @@
if (Cnf.FindB("Debug::pkgInitConfig",false) == true)
Cnf.Dump();
-
+
+ if (Cnf.Exists("Dir::Locale"))
+ {
+ bindtextdomain(DOMAIN,Cnf.FindDir("Dir::Locale").c_str());
+ bindtextdomain(textdomain(0),Cnf.FindDir("Dir::Locale").c_str());
+ }
+
return true;
}
/*}}}*/
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/apt-pkg/makefile ./apt-pkg/makefile
--- /tmp/apt/apt-pkg/makefile Sun Nov 4 10:09:18 2001
+++ ./apt-pkg/makefile Sat Sep 14 00:04:15 2002
@@ -9,12 +9,14 @@
# Bring in the default rules
include ../buildlib/defaults.mak
-# The library name, don't forget to update init.h
+# The library name, don't forget to update init.h and the copy in
+# methods/makefile - FIXME
LIBRARY=apt-pkg
LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
MAJOR=3.3
MINOR=0
SLIBS=$(PTHREADLIB)
+DOMAIN:=libapt-pkg$(MAJOR)
# Source code for the contributed non-core things
SOURCE = contrib/mmap.cc contrib/error.cc contrib/strutl.cc \
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/configure.in ./configure.in
--- /tmp/apt/configure.in Sun Jun 17 23:56:32 2001
+++ ./configure.in Sun Sep 15 17:16:14 2002
@@ -17,8 +17,10 @@
AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.5.4")
-AC_DEFINE_UNQUOTED(PACKAGE,"apt")
+AC_DEFINE_UNQUOTED(VERSION,"")
+PACKAGE="apt"
+AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
+AC_SUBST(PACKAGE)
dnl Check the archs, we want the target type.
AC_CANONICAL_SYSTEM
@@ -162,5 +164,14 @@
rc_GLIBC_VER
rc_LIBSTDCPP_VER
ah_GCC3DEP
+
+dnl FIXME: There is no reason for this bit to do all the configure tests it
+dnl ends up doing. Maybe replace it with a simple AC_CHECK_HEADER and
+dnl AC_PATH_PROG.
+ALL_LINGUAS="da de en_GB es fr hu it nl no_NO pl pt_BR ru sv zh_TW"
+AM_GNU_GETTEXT
+AC_DEFINE_UNQUOTED(USE_NLS, $USE_NLS)
+AC_DEFINE_UNQUOTED(USE_INCLUDED_LIBINTL, $USE_INCLUDED_LIBINTL)
+AC_PATH_PROG(BASH, bash)
AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make -s dirs)
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/debian/apt.substvars ./debian/apt.substvars
--- /tmp/apt/debian/apt.substvars Wed Dec 31 17:00:00 1969
+++ ./debian/apt.substvars Sun Sep 15 17:17:17 2002
@@ -0,0 +1 @@
+shlibs:Depends=libc6 (>= 2.2.4-4), libstdc++2.10-glibc2.2 (>= 1:2.95.4-0.010810)
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/debian/changelog ./debian/changelog
--- /tmp/apt/debian/changelog Sun Jul 7 22:23:58 2002
+++ ./debian/changelog Sun Sep 15 17:17:06 2002
@@ -43,8 +43,9 @@
* 'apt-get update' no longer does 'Building Dependency Tree'.
* When matching regexs allways print a message. Change regex activation
charset. Closes: #147817
+ * Don't die if lines in sources.list are too long. Closes: #146846
- --
+ -- Jason Gunthorpe <jgg@debian.org> Sun, 15 Sep 2002 17:16:59 -0600
apt (0.5.4) unstable; urgency=low
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/debian/rules ./debian/rules
--- /tmp/apt/debian/rules Sun Sep 15 16:51:57 2002
+++ ./debian/rules Sun Sep 15 16:52:20 2002
@@ -168,6 +168,7 @@
cp $(BLD)/bin/methods/* debian/apt/usr/lib/apt/methods/
cp $(BLD)/scripts/dselect/* debian/apt/usr/lib/dpkg/methods/apt/
+ cp -r $(BLD)/locale debian/apt/usr/
# Copy the guides
dh_installdocs -p$@ $(BLD)/docs/guide*.text $(BLD)/docs/guide*.html \
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/debian/shlibs.local ./debian/shlibs.local
--- /tmp/apt/debian/shlibs.local Wed Dec 31 17:00:00 1969
+++ ./debian/shlibs.local Sun Sep 15 17:17:10 2002
@@ -0,0 +1,2 @@
+libapt-pkg-libc6.2-3-2 3.3 libapt-pkg-libc6.2-3-2-3.3
+libapt-inst-libc6.2-3-2 1.0 libapt-inst-libc6.2-3-2-1.0
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/dselect/install ./dselect/install
--- /tmp/apt/dselect/install Tue Feb 20 00:03:17 2001
+++ ./dselect/install Sat Sep 14 17:40:47 2002
@@ -1,4 +1,7 @@
-#!/bin/sh
+#!/bin/bash
+
+# Set the textdomain for the translations using $"..."
+TEXTDOMAIN="apt"
# Get the configuration from /etc/apt/apt.conf
CLEAN="prompt"
@@ -26,7 +29,7 @@
case $2 in
Y|y) defp="[Y/n]" def=y;;
N|n) defp="[y/N]" def=n;;
- *) echo "Bad default setting!" 1>&2; exit 1;;
+ *) echo $"Bad default setting!" 1>&2; exit 1;;
esac
else
defp="[y/N]" def=n
@@ -45,7 +48,7 @@
if [ x$WAIT = "xtrue" ]; then
$APTGET $OPTS "$APT_OPT0" "$APT_OPT1" -d dselect-upgrade
- echo "Press enter to continue." && read RES
+ echo $"Press enter to continue." && read RES
$APTGET $OPTS "$APT_OPT0" "$APT_OPT1" dselect-upgrade
RES=$?
else
@@ -77,28 +80,28 @@
case `echo $CLEAN | tr '[:upper:]' '[:lower:]'` in
auto)
$APTGET "$APT_OPT0" "$APT_OPT1" autoclean &&
- echo "Press enter to continue." && read RES && exit 0;
+ echo $"Press enter to continue." && read RES && exit 0;
;;
always)
$APTGET "$APT_OPT0" "$APT_OPT1" clean &&
- echo "Press enter to continue." && read RES && exit 0;
+ echo $"Press enter to continue." && read RES && exit 0;
;;
prompt)
exec 3>&1
- if [ `yesno "Do you want to erase any previously downloaded .deb files?" y` = y ]; then
+ if [ `yesno $"Do you want to erase any previously downloaded .deb files?" y` = y ]; then
$APTGET "$APT_OPT0" "$APT_OPT1" clean &&
- echo "Press enter to continue." && read RES && exit 0;
+ echo $"Press enter to continue." && read RES && exit 0;
fi
;;
*)
;;
esac
else
- echo "Some errors occurred while unpacking. I'm going to configure the"
- echo "packages that were installed. This may result in duplicate errors"
- echo "or errors caused by missing dependencies. This is OK, only the errors"
- echo "above this message are important. Please fix them and run [I]nstall again"
- echo "Press enter to continue."
+ echo $"Some errors occurred while unpacking. I'm going to configure the"
+ echo $"packages that were installed. This may result in duplicate errors"
+ echo $"or errors caused by missing dependencies. This is OK, only the errors"
+ echo $"above this message are important. Please fix them and run [I]nstall again"
+ echo $"Press enter to continue."
read RES && $DPKG "$DPKG_OPTS" --configure -a
exit 100
fi
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/dselect/makefile ./dselect/makefile
--- /tmp/apt/dselect/makefile Thu Dec 3 00:26:52 1998
+++ ./dselect/makefile Sat Sep 14 17:44:29 2002
@@ -9,4 +9,8 @@
SOURCE = desc.apt install names setup update
TO = $(BUILD)/scripts/dselect
include $(COPY_H)
-
+
+LOCAL = dselect
+SOURCE = install update
+TYPE = sh
+include $(PODOMAIN_H)
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/dselect/update ./dselect/update
--- /tmp/apt/dselect/update Mon Mar 12 18:45:36 2001
+++ ./dselect/update Sat Sep 14 17:40:47 2002
@@ -1,6 +1,9 @@
-#!/bin/sh
+#!/bin/bash
set -e
+# Set the textdomain for the translations using $"..."
+TEXTDOMAIN="apt"
+
# Get the configuration from /etc/apt/apt.conf
CLEAN="prompt"
OPTS="-f"
@@ -24,7 +27,7 @@
STATUS=1
if $APTGET $OPTS "$APT_OPT0" "$APT_OPT1" update
then
- echo "Merging Available information"
+ echo $"Merging Available information"
rm -f $CACHEDIR/available
$APTCACHE dumpavail > $CACHEDIR/available
$DPKG "$DPKG_OPTS" --update-avail $CACHEDIR/available
@@ -39,7 +42,7 @@
fi
if [ x$PROMPT = "xtrue" ]; then
- echo "Press enter to continue." && read RES;
+ echo $"Press enter to continue." && read RES;
fi
exit $STATUS
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/methods/makefile ./methods/makefile
--- /tmp/apt/methods/makefile Sun Mar 11 15:37:35 2001
+++ ./methods/makefile Sat Sep 14 00:04:15 2002
@@ -6,6 +6,10 @@
include ../buildlib/defaults.mak
BIN := $(BIN)/methods
+# FIXME..
+LIB_APT_PKG_MAJOR = 3.3
+DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR)
+
# The file method
PROGRAM=file
SLIBS = -lapt-pkg
diff -urN --exclude build* --exclude CVS --exclude *.m4 --exclude configure --exclude *.po --exclude python /tmp/apt/po/makefile ./po/makefile
--- /tmp/apt/po/makefile Wed Dec 31 17:00:00 1969
+++ ./po/makefile Sat Sep 14 18:04:01 2002
@@ -0,0 +1,70 @@
+# -*- make -*-
+
+# This will compile the gettext message catalogues.
+
+# The other make files drop file lists in build/po/domains/DOMAIN/* which
+# is then picked up by this make file to define all the domains and all the
+# source files that compose each domain. It then produces the POT files
+# and then filters the PO files through the per-domain POT file to create
+# the input to msgformat, which is then dumped into a locale directory.
+
+BASE=..
+SUBDIR=po
+
+# Bring in the default rules
+include ../buildlib/defaults.mak
+
+DOMAINS = $(notdir $(wildcard $(PO_DOMAINS)/*))
+POTFILES := $(addsuffix .pot,$(addprefix $(PO)/,$(DOMAINS)))
+
+# Construct a list of all mo files for all domains under $(PO_DOMAINS)
+MOFILES := $(patsubst %.gmo,%.mo,$(CATALOGS))
+MOFILES := $(foreach D,$(DOMAINS),$(addprefix $(PO_DOMAINS)/$(D)/,$(MOFILES)))
+LANG_POFILES := $(patsubst %.mo,%.po,$(MOFILES))
+LINGUAS := $(patsubst %.gmo,%,$(CATALOGS))
+
+GETDOMAIN = $(filter $(DOMAINS),$(subst /, ,$(1)))
+# Generate the list of files from the bits the other make files dropped
+# and produce the .pot file.
+$(POTFILES) : $(PO)/%.pot :
+ echo Generating POT file $@
+ echo $@ : $(wildcard $(PO)/domains/$*/*.*list) $(addprefix $(BASE)/,$(shell cat $(wildcard $(PO)/domains/$*/*.srclist))) > $@.d
+# From sh source
+ cat $(PO)/domains/$*/*.shlist 2> /dev/null | (cd $(BASE) && xargs -n1 bash --dump-po-strings) > $(PO)/domains/$*/sh.pot
+# From C/C++ source
+ cat $(PO)/domains/$*/*.srclist > $(PO)/POTFILES_$*.in
+ $(XGETTEXT) --default-domain=$* --directory=$(BASE) \
+ --add-comments --foreign --keyword=_ --keyword=N_ \
+ --files-from=$(PO)/POTFILES_$*.in -o $(PO)/domains/$*/c.pot
+ rm -f $(PO)/POTFILES_$*.in
+ $(MSGCOMM) --more-than=0 $(PO)/domains/$*/c.pot $(PO)/domains/$*/sh.pot --output=$@
+
+$(PO)/$(PACKAGE)-all.pot: $(POTFILES)
+ $(MSGCOMM) --more-than=0 $(POTFILES) --output=$@
+
+# Filter the complete translation with the domain specific file to produce
+# only the subtext needed for this domain
+# We cannot express the dependencies required for this directly with a pattern
+# rule, so we use the .d hack.
+$(LANG_POFILES) : %.po :
+ echo Generating $@
+ echo $@ : $(notdir $@) $(PO)/$(call GETDOMAIN,$*).pot > $(PO)/$(call GETDOMAIN,$*)_$(notdir $@).d
+ $(MSGMERGE) $(notdir $@) $(PO)/$(call GETDOMAIN,$*).pot -o $@
+
+$(MOFILES) : %.mo : %.po
+ echo Generating $(LOCALE)/$(notdir $*)/LC_MESSAGES/$(call GETDOMAIN,$*).mo
+ $(GMSGFMT) --statistics -o $@ $<
+ mkdir -p $(LOCALE)/$(notdir $*)/LC_MESSAGES/
+ cp $@ $(LOCALE)/$(notdir $*)/LC_MESSAGES/$(call GETDOMAIN,$*).mo
+
+binary: $(POTFILES) $(PO)/$(PACKAGE)-all.pot $(MOFILES)
+
+clean: clean/local
+clean/local:
+ rm -f $(MOFILES) $(LANG_POFILES) $(PO)/*.d
+
+# Include the dependencies that are available
+The_DFiles = $(wildcard $(PO)/*.d)
+ifneq ($(words $(The_DFiles)),0)
+include $(The_DFiles)
+endif
Reply to: