]> git.pld-linux.org Git - packages/gdm.git/blob - gdm-desktop.patch
- merged 2.6.0.0 from DEVEL
[packages/gdm.git] / gdm-desktop.patch
1 diff -uNr gdm-2.2.5.4.orig/gui/acinclude.m4 gdm-2.2.5.4/gui/acinclude.m4
2 --- gdm-2.2.5.4.orig/acinclude.m4       Thu Jan  1 01:00:00 1970
3 +++ gdm-2.2.5.4/acinclude.m4    Tue Dec  2 22:38:16 2003
4 @@ -0,0 +1,299 @@
5 +## xml-i18n-tools.m4 - Configure xml-i18n-tools for the target system. -*-Shell-script-*-
6 +## Copyright (C) 2001 Eazel, Inc.
7 +## Author: Maciej Stachowiak <mjs@noisehavoc.org>
8 +##
9 +## This program is free software; you can redistribute it and/or modify
10 +## it under the terms of the GNU General Public License as published by
11 +## the Free Software Foundation; either version 2 of the License, or
12 +## (at your option) any later version.
13 +##
14 +## This program is distributed in the hope that it will be useful, but
15 +## WITHOUT ANY WARRANTY; without even the implied warranty of
16 +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 +## General Public License for more details.
18 +##
19 +## You should have received a copy of the GNU General Public License
20 +## along with this program; if not, write to the Free Software
21 +## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 +##
23 +## As a special exception to the GNU General Public License, if you
24 +## distribute this file as part of a program that contains a
25 +## configuration script generated by Autoconf, you may include it under
26 +## the same distribution terms that you use for the rest of that program.
27 +
28 +AC_DEFUN(XML_I18N_TOOLS_NEWER_THAN_0_9,[ true ])
29 +
30 +dnl AC_PROG_XML_I18N_TOOLS([MINIMUM-VERSION [,"G2" if always using --utf8] ])
31 +# serial 1 AC_PROG_XML_I18N_TOOLS
32 +AC_DEFUN(AC_PROG_XML_I18N_TOOLS,
33 +[
34 +  AC_DEFUN(X18T_PFORG1,  dnl and -u for G2
35 +        ifelse([$2],[G2],[ -u ], [ -p ]))
36 +  AC_DEFUN(X18T_XML_KIND, 
37 +        ifelse([$2],[G2],[ -u ],[ $(XML_I18N_XML_KIND) ]))
38 +  AC_DEFUN(X18T_KEYS_KIND, 
39 +        ifelse([$2],[G2],[ -u ],[ $(XML_I18N_KEYS_KIND) ]))
40 +
41 +  XML_I18N_MERGE_DESKTOP_RULE='%.desktop:   %.desktop.in   $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -d -u X18T_PFORG1'
42 +XML_I18N_MERGE_DIRECTORY_RULE='%.directory: %.directory.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -d -u X18T_PFORG1'
43 +     XML_I18N_MERGE_KEYS_RULE='%.keys:      %.keys.in      $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -k X18T_KEYS_KIND'
44 +      XML_I18N_MERGE_OAF_RULE='%.oaf:       %.oaf.in       $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -o -p'
45 +     XML_I18N_MERGE_PONG_RULE='%.pong:      %.pong.in      $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -x X18T_PFORG1'
46 +   XML_I18N_MERGE_SERVER_RULE='%.server:    %.server.in    $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -o -u'
47 +    XML_I18N_MERGE_SHEET_RULE='%.sheet:     %.sheet.in     $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -x -u'
48 +XML_I18N_MERGE_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -d X18T_PFORG1'
49 +      XML_I18N_MERGE_XML_RULE='%.xml:       %.xml.in       $(top_builddir)/xml-i18n-merge $(wildcard $(top_srcdir)/po/*.po) ; $(top_builddir)/xml-i18n-merge $(top_srcdir)/po $< [$]@ -x X18T_XML_KIND'
50 +
51 +AC_SUBST(XML_I18N_MERGE_DESKTOP_RULE)
52 +AC_SUBST(XML_I18N_MERGE_DIRECTORY_RULE)
53 +AC_SUBST(XML_I18N_MERGE_KEYS_RULE)
54 +AC_SUBST(XML_I18N_MERGE_OAF_RULE)
55 +AC_SUBST(XML_I18N_MERGE_PONG_RULE)
56 +AC_SUBST(XML_I18N_MERGE_SERVER_RULE)
57 +AC_SUBST(XML_I18N_MERGE_SHEET_RULE)
58 +AC_SUBST(XML_I18N_MERGE_SOUNDLIST_RULE)
59 +AC_SUBST(XML_I18N_MERGE_XML_RULE)
60 +
61 +# Use the tools built into the package, not the ones that are installed.
62 +
63 +XML_I18N_EXTRACT='$(top_builddir)/xml-i18n-extract'
64 +AC_SUBST(XML_I18N_EXTRACT)dnl
65 +
66 +XML_I18N_MERGE='$(top_builddir)/xml-i18n-merge'
67 +AC_SUBST(XML_I18N_MERGE)dnl
68 +
69 +XML_I18N_UPDATE='$(top_builddir)/xml-i18n-update'
70 +AC_SUBST(XML_I18N_UPDATE)dnl
71 +
72 +AC_PATH_PROG(INTLTOOL_PERL, perl)
73 +if test -z "$INTLTOOL_PERL"; then
74 +   AC_MSG_ERROR([perl not found; required for xml-i18n-tools])
75 +fi
76 +if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
77 +   AC_MSG_ERROR([perl 5.x required for xml-i18n-tools])
78 +fi
79 +
80 +dnl Remove Intltool [] tags from po/POTFILES
81 +dnl
82 +ifdef([AC_DIVERSION_ICMDS],[
83 +  AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
84 +      changequote(,)
85 +      mv -f po/POTFILES po/POTFILES.tmp
86 +      sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
87 +      rm -f po/POTFILES.tmp
88 +      changequote([,])
89 +  AC_DIVERT_POP()
90 +],[
91 +  ifdef([AC_CONFIG_COMMANDS_PRE],[
92 +    AC_CONFIG_COMMANDS_PRE([
93 +        changequote(,)
94 +        mv -f po/POTFILES po/POTFILES.tmp
95 +        sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
96 +        rm -f po/POTFILES.tmp
97 +        changequote([,])
98 +    ])
99 +  ])
100 +])
101 +
102 +dnl  manually sed perl in so people don't have to put the xml-i18n-tools scripts in their 
103 +dnl  AC_OUTPUT
104 +AC_OUTPUT_COMMANDS([
105 +sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/xml-i18n-extract.in > xml-i18n-extract.out
106 +if cmp -s xml-i18n-extract xml-i18n-extract.out 2>/dev/null; then
107 +  rm -f xml-i18n-extract.out
108 +else
109 +  mv -f xml-i18n-extract.out xml-i18n-extract
110 +fi
111 +chmod ugo+x xml-i18n-extract
112 +chmod u+w xml-i18n-extract
113 +
114 +sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/xml-i18n-merge.in > xml-i18n-merge.out
115 +if cmp -s xml-i18n-merge xml-i18n-merge.out 2>/dev/null; then
116 +  rm -f xml-i18n-merge.out
117 +else
118 +  mv -f xml-i18n-merge.out xml-i18n-merge
119 +fi
120 +chmod ugo+x xml-i18n-merge
121 +chmod u+w xml-i18n-merge
122 +
123 +sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/xml-i18n-update.in > xml-i18n-update.out
124 +if cmp -s xml-i18n-update xml-i18n-update.out 2>/dev/null; then
125 +  rm -f xml-i18n-update.out
126 +else
127 +  mv -f xml-i18n-update.out xml-i18n-update
128 +fi
129 +chmod ugo+x xml-i18n-update
130 +chmod u+w xml-i18n-update
131 +], INTLTOOL_PERL=${INTLTOOL_PERL})
132 +
133 +# Redirect the config.log output again, so that the ltconfig log is not
134 +# clobbered by the next message.
135 +exec 5>>./config.log
136 +])
137 +
138 +dnl old names
139 +AC_DEFUN(AM_PROG_XML_I18N_TOOLS, [indir([AC_PROG_XML_I18N_TOOLS])])dnl
140 +# Configure paths for ESD
141 +# Manish Singh    98-9-30
142 +# stolen back from Frank Belew
143 +# stolen from Manish Singh
144 +# Shamelessly stolen from Owen Taylor
145 +
146 +dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
147 +dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
148 +dnl
149 +AC_DEFUN(AM_PATH_ESD,
150 +[dnl 
151 +dnl Get the cflags and libraries from the esd-config script
152 +dnl
153 +AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
154 +            esd_prefix="$withval", esd_prefix="")
155 +AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
156 +            esd_exec_prefix="$withval", esd_exec_prefix="")
157 +AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
158 +                   , enable_esdtest=yes)
159 +
160 +  if test x$esd_exec_prefix != x ; then
161 +     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
162 +     if test x${ESD_CONFIG+set} != xset ; then
163 +        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
164 +     fi
165 +  fi
166 +  if test x$esd_prefix != x ; then
167 +     esd_args="$esd_args --prefix=$esd_prefix"
168 +     if test x${ESD_CONFIG+set} != xset ; then
169 +        ESD_CONFIG=$esd_prefix/bin/esd-config
170 +     fi
171 +  fi
172 +
173 +  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
174 +  min_esd_version=ifelse([$1], ,0.2.5,$1)
175 +  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
176 +  no_esd=""
177 +  if test "$ESD_CONFIG" = "no" ; then
178 +    no_esd=yes
179 +  else
180 +    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
181 +    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
182 +
183 +    esd_major_version=`$ESD_CONFIG $esd_args --version | \
184 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
185 +    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
186 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
187 +    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
188 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
189 +    if test "x$enable_esdtest" = "xyes" ; then
190 +      ac_save_CFLAGS="$CFLAGS"
191 +      ac_save_LIBS="$LIBS"
192 +      CFLAGS="$CFLAGS $ESD_CFLAGS"
193 +      LIBS="$LIBS $ESD_LIBS"
194 +dnl
195 +dnl Now check if the installed ESD is sufficiently new. (Also sanity
196 +dnl checks the results of esd-config to some extent
197 +dnl
198 +      rm -f conf.esdtest
199 +      AC_TRY_RUN([
200 +#include <stdio.h>
201 +#include <stdlib.h>
202 +#include <string.h>
203 +#include <esd.h>
204 +
205 +char*
206 +my_strdup (char *str)
207 +{
208 +  char *new_str;
209 +  
210 +  if (str)
211 +    {
212 +      new_str = malloc ((strlen (str) + 1) * sizeof(char));
213 +      strcpy (new_str, str);
214 +    }
215 +  else
216 +    new_str = NULL;
217 +  
218 +  return new_str;
219 +}
220 +
221 +int main ()
222 +{
223 +  int major, minor, micro;
224 +  char *tmp_version;
225 +
226 +  system ("touch conf.esdtest");
227 +
228 +  /* HP/UX 9 (%@#!) writes to sscanf strings */
229 +  tmp_version = my_strdup("$min_esd_version");
230 +  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
231 +     printf("%s, bad version string\n", "$min_esd_version");
232 +     exit(1);
233 +   }
234 +
235 +   if (($esd_major_version > major) ||
236 +      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
237 +      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
238 +    {
239 +      return 0;
240 +    }
241 +  else
242 +    {
243 +      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
244 +      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
245 +      printf("*** best to upgrade to the required version.\n");
246 +      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
247 +      printf("*** to point to the correct copy of esd-config, and remove the file\n");
248 +      printf("*** config.cache before re-running configure\n");
249 +      return 1;
250 +    }
251 +}
252 +
253 +],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
254 +       CFLAGS="$ac_save_CFLAGS"
255 +       LIBS="$ac_save_LIBS"
256 +     fi
257 +  fi
258 +  if test "x$no_esd" = x ; then
259 +     AC_MSG_RESULT(yes)
260 +     ifelse([$2], , :, [$2])     
261 +  else
262 +     AC_MSG_RESULT(no)
263 +     if test "$ESD_CONFIG" = "no" ; then
264 +       echo "*** The esd-config script installed by ESD could not be found"
265 +       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
266 +       echo "*** your path, or set the ESD_CONFIG environment variable to the"
267 +       echo "*** full path to esd-config."
268 +     else
269 +       if test -f conf.esdtest ; then
270 +        :
271 +       else
272 +          echo "*** Could not run ESD test program, checking why..."
273 +          CFLAGS="$CFLAGS $ESD_CFLAGS"
274 +          LIBS="$LIBS $ESD_LIBS"
275 +          AC_TRY_LINK([
276 +#include <stdio.h>
277 +#include <esd.h>
278 +],      [ return 0; ],
279 +        [ echo "*** The test program compiled, but did not run. This usually means"
280 +          echo "*** that the run-time linker is not finding ESD or finding the wrong"
281 +          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
282 +          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
283 +          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
284 +          echo "*** is required on your system"
285 +         echo "***"
286 +          echo "*** If you have an old version installed, it is best to remove it, although"
287 +          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
288 +        [ echo "*** The test program failed to compile or link. See the file config.log for the"
289 +          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
290 +          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
291 +          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
292 +          CFLAGS="$ac_save_CFLAGS"
293 +          LIBS="$ac_save_LIBS"
294 +       fi
295 +     fi
296 +     ESD_CFLAGS=""
297 +     ESD_LIBS=""
298 +     ifelse([$3], , :, [$3])
299 +  fi
300 +  AC_SUBST(ESD_CFLAGS)
301 +  AC_SUBST(ESD_LIBS)
302 +  rm -f conf.esdtest
303 +])
304 diff -ur gdm-2.2.5.4.orig/gui/gdmconfig.desktop.in gdm-2.2.5.4/gui/gdmconfig.desktop.in
305 --- gdm-2.2.5.4.orig/gui/gdmconfig.desktop.in   Thu May  3 22:22:22 2001
306 +++ gdm-2.2.5.4/gui/gdmconfig.desktop.in        Fri Jan  2 15:19:42 2004
307 @@ -4,5 +4,7 @@
308  TryExec=gdmconfig
309  Exec=gdmconfig
310  Icon=gdm.xpm
311 -Terminal=0
312 +Terminal=false
313  Type=Application
314 +Encoding=UTF-8
315 +# vi: encoding=utf-8
316 diff -ur gdm-2.2.5.4.orig/gui/gdmflexiserver-xnest.desktop.in gdm-2.2.5.4/gui/gdmflexiserver-xnest.desktop.in
317 --- gdm-2.2.5.4.orig/gui/gdmflexiserver-xnest.desktop.in        Sun Aug 19 03:15:09 2001
318 +++ gdm-2.2.5.4/gui/gdmflexiserver-xnest.desktop.in     Fri Jan  2 15:19:37 2004
319 @@ -6,5 +6,7 @@
320  TryExec=Xnest
321  Exec=gdmflexiserver --xnest
322  Icon=
323 -Terminal=0
324 +Terminal=false
325  Type=Application
326 +Encoding=UTF-8
327 +# vi: encoding=utf-8
328 diff -ur gdm-2.2.5.4.orig/gui/gdmflexiserver.desktop.in gdm-2.2.5.4/gui/gdmflexiserver.desktop.in
329 --- gdm-2.2.5.4.orig/gui/gdmflexiserver.desktop.in      Wed Aug 22 14:06:11 2001
330 +++ gdm-2.2.5.4/gui/gdmflexiserver.desktop.in   Fri Jan  2 15:19:40 2004
331 @@ -3,5 +3,7 @@
332  _Comment=Log in as another user without loging out
333  Exec=gdmflexiserver
334  Icon=
335 -Terminal=0
336 +Terminal=false
337  Type=Application
338 +Encoding=UTF-8
339 +# vi: encoding=utf-8
340 diff -ur gdm-2.2.5.4.orig/gui/gdmphotosetup.desktop.in gdm-2.2.5.4/gui/gdmphotosetup.desktop.in
341 --- gdm-2.2.5.4.orig/gui/gdmphotosetup.desktop.in       Fri May 18 00:43:06 2001
342 +++ gdm-2.2.5.4/gui/gdmphotosetup.desktop.in    Fri Jan  2 15:19:43 2004
343 @@ -4,5 +4,7 @@
344  TryExec=gdmphotosetup
345  Exec=gdmphotosetup
346  Icon=
347 -Terminal=0
348 +Terminal=false
349  Type=Application
350 +Encoding=UTF-8
351 +# vi: encoding=utf-8
352 diff -ur gdm-2.2.5.5/xml-i18n-extract.in~ gdm-2.2.5.5/xml-i18n-extract.in
353 --- gdm-2.2.5.5/xml-i18n-extract.in~    Sat Jan  3 15:21:06 2004
354 +++ gdm-2.2.5.5/xml-i18n-extract.in     Sat Jan  3 15:21:06 2004
355 @@ -1,39 +1,45 @@
356 -#!@XML_I18N_TOOLS_PERL@ -w 
357 +#!@INTLTOOL_PERL@ -w 
358  # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4  -*-
359  
360  #
361 -#  The XML Translation Extractor
362 +#  The Intltool Message Extractor
363  #
364 -#  Copyright (C) 2000 Free Software Foundation.
365 +#  Copyright (C) 2000-2001 Free Software Foundation.
366  #
367 -#  This library is free software; you can redistribute it and/or
368 +#  Intltool is free software; you can redistribute it and/or
369  #  modify it under the terms of the GNU General Public License as
370  #  published by the Free Software Foundation; either version 2 of the
371  #  License, or (at your option) any later version.
372  #
373 -#  This script is distributed in the hope that it will be useful,
374 +#  Intltool is distributed in the hope that it will be useful,
375  #  but WITHOUT ANY WARRANTY; without even the implied warranty of
376  #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
377  #  General Public License for more details.
378  #
379  #  You should have received a copy of the GNU General Public License
380 -#  along with this library; if not, write to the Free Software
381 +#  along with this program; if not, write to the Free Software
382  #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
383  #
384 +#  As a special exception to the GNU General Public License, if you
385 +#  distribute this file as part of a program that contains a
386 +#  configuration script generated by Autoconf, you may include it under
387 +#  the same distribution terms that you use for the rest of that program.
388 +#
389  #  Authors: Kenneth Christiansen <kenneth@gnu.org>
390 -#           Darin Adler <darin@eazel.com>
391 +#           Darin Adler <darin@bentspoon.com>
392  #
393  
394  ## Release information
395 -my $PROGRAM      = "xml-i18n-extract";
396 -my $PACKAGE      = "xml-i18n-tools";
397 -my $VERSION      = "0.9";
398 +my $PROGRAM      = "intltool-extract";
399 +my $PACKAGE      = "intltool";
400 +my $VERSION      = "0.11.1";
401  
402  ## Script options - Enable by setting value to 1
403 -my $ENABLE_INI   = "1"; ## desktop and alike files
404 -my $ENABLE_KEYS  = "1"; ## mimetype descriptions
405 -my $ENABLE_GLADE = "1"; ## glade files
406 -my $ENABLE_XML          = "1"; ## generic xml files
407 +my $ENABLE_INI    = "1"; ## desktop and alike files
408 +my $ENABLE_KEYS   = "1"; ## mimetype descriptions
409 +my $ENABLE_GLADE  = "1"; ## glade files
410 +my $ENABLE_XML           = "1"; ## generic xml files
411 +my $ENABLE_SCHEME = "1"; ## scheme files
412  
413  ## Loaded modules
414  use strict; 
415 @@ -55,6 +61,9 @@
416  my $input;
417  my %messages = ();
418  
419 +## Use this instead of \w for XML files to handle more possible characters.
420 +my $w = "[-A-Za-z0-9._:]";
421 +
422  ## Always print first
423  $| = 1;
424  
425 @@ -62,7 +71,7 @@
426  GetOptions (
427             "type=s"     => \$TYPE_ARG,
428              "local|l"    => \$LOCAL_ARG,
429 -            "help|h|?"   => \$HELP_ARG,
430 +            "help|h"     => \$HELP_ARG,
431              "version|v"  => \$VERSION_ARG,
432              "update"     => \$UPDATE_ARG,
433             "quiet|q"    => \$QUIET_ARG,
434 @@ -145,7 +154,6 @@
435  
436  ## Sub for printing error messages
437  sub error{
438 -#   print "xml-i18n-extract: invalid option @ARGV\n";
439      print "Try `${PROGRAM} --help' for more information.\n";
440      exit;
441  }
442 @@ -180,6 +188,7 @@
443      &type_keys;
444      &type_xml;
445      &type_glade;
446 +    &type_scheme;
447  }
448  
449  sub type_ini {
450 @@ -219,12 +228,16 @@
451          
452          if ($gettext_type eq "xml"){
453  
454 -            while ($input =~ /[\t\n\s]_\w+=\"([^\"]+)\"/sg) {
455 +            while ($input =~ /[\t\n\s]_$w+=\"([^\"]+)\"/sg) {
456                  $messages{$1} = [];
457              }
458  
459 -            while ($input =~ /<_(\w+)>([^<]+)<\/_\1>/sg) {
460 -                $messages{$2} = [];
461 +            while ($input =~ /<_($w+)>([^<]+)<\/_\1>/sg) {
462 +               $_ = $2;
463 +               s/\s+/ /g;
464 +               s/^ //;
465 +               s/ $//;
466 +                $messages{$_} = [];
467              }
468  
469         }
470 @@ -240,7 +253,7 @@
471          if ($gettext_type eq "glade"){
472  
473              my $translate = "label|title|text|format|copyright|comments|
474 -                             preview_text|tooltip";
475 +                             preview_text|tooltip|message";
476  
477              while ($input =~ /<($translate)>([^<]+)<\/($translate)>/sg) {
478  
479 @@ -264,6 +277,21 @@
480  
481  }
482  
483 +sub type_scheme {
484 +
485 +    if ($ENABLE_SCHEME) {
486 +
487 +       ### For translatable scheme files ###
488 +
489 +       if ($gettext_type eq "scheme"){
490 +
491 +           while ($input =~ /_\(?"((?:[^"\\]+|\\.)*)"\)?/sg) {
492 +               $messages{$1} = [];
493 +           }
494 +       }
495 +    }
496 +}
497 +
498  sub msg_write {
499      
500      foreach my $message (sort keys %messages) { 
501 diff -ur gdm-2.2.5.5/xml-i18n-merge.in~ gdm-2.2.5.5/xml-i18n-merge.in
502 --- gdm-2.2.5.5/xml-i18n-merge.in~      Sat Jan  3 15:21:07 2004
503 +++ gdm-2.2.5.5/xml-i18n-merge.in       Sat Jan  3 15:21:07 2004
504 @@ -1,35 +1,41 @@
505 -#!@XML_I18N_TOOLS_PERL@ -w
506 +#!@INTLTOOL_PERL@ -w
507  
508  #
509 -#  The XML Translation Merge Tool
510 +#  The Intltool Message Merger
511  #
512  #  Copyright (C) 2000 Free Software Foundation.
513  #  Copyright (C) 2000, 2001 Eazel, Inc
514  #
515 -#  This library is free software; you can redistribute it and/or
516 +#  Intltool is free software; you can redistribute it and/or
517  #  modify it under the terms of the GNU General Public License as
518  #  published by the Free Software Foundation; either version 2 of the
519  #  License, or (at your option) any later version.
520  #
521 -#  This script is distributed in the hope that it will be useful,
522 +#  Intltool is distributed in the hope that it will be useful,
523  #  but WITHOUT ANY WARRANTY; without even the implied warranty of
524  #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
525  #  General Public License for more details.
526  #
527  #  You should have received a copy of the GNU General Public License
528 -#  along with this library; if not, write to the Free Software
529 +#  along with this program; if not, write to the Free Software
530  #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
531  #
532 -#  Authors:  Maciej Stachowiak <mjs@eazel.com>
533 +#  As a special exception to the GNU General Public License, if you
534 +#  distribute this file as part of a program that contains a
535 +#  configuration script generated by Autoconf, you may include it under
536 +#  the same distribution terms that you use for the rest of that program.
537 +#
538 +#  Authors:  Maciej Stachowiak <mjs@noisehavoc.org>
539  #            Kenneth Christiansen <kenneth@gnu.org>
540 -#            Darin Adler <darin@eazel.com>
541 +#            Darin Adler <darin@bentspoon.com>
542 +#
543 +#  Proper XML UTF-8ification written by Cyrille Chepelov <chepelov@calixo.net>
544  #
545 -
546  
547  ## Release information
548 -my $PROGRAM      = "xml-i18n-merge";
549 -my $PACKAGE      = "xml-i18n-tools";
550 -my $VERSION      = "0.9";
551 +my $PROGRAM      = "intltool-merge";
552 +my $PACKAGE      = "intltool";
553 +my $VERSION      = "0.11.1";
554  
555  ## Script options - Enable by setting value to 1
556  my $ENABLE_XML   = "1";
557 @@ -40,24 +46,27 @@
558  use Getopt::Long;
559  
560  ## Scalars used by the option stuff
561 -my $HELP_ARG   = "0";
562 +my $HELP_ARG = "0";
563  my $VERSION_ARG = "0";
564  my $OAF_STYLE_ARG = "0";
565  my $XML_STYLE_ARG = "0";
566  my $KEYS_STYLE_ARG = "0";
567  my $DESKTOP_STYLE_ARG = "0";
568  my $QUIET_ARG = "0";
569 -
570 +my $PASS_THROUGH_ARG = "0";
571 +my $UTF8_ARG = "0";
572  
573  ## Handle options
574  GetOptions (
575 -           "help|h|?" => \$HELP_ARG,
576 +           "help|h" => \$HELP_ARG,
577             "version|v" => \$VERSION_ARG,
578              "quiet|q" => \$QUIET_ARG,
579             "oaf-style|o" => \$OAF_STYLE_ARG,
580             "xml-style|x" => \$XML_STYLE_ARG,
581             "keys-style|k" => \$KEYS_STYLE_ARG,
582 -           "desktop-style|d" => \$DESKTOP_STYLE_ARG
583 +           "desktop-style|d" => \$DESKTOP_STYLE_ARG,
584 +            "pass-through|p" => \$PASS_THROUGH_ARG,
585 +            "utf8|u" => \$UTF8_ARG
586             ) or &error;
587  
588  
589 @@ -69,6 +78,10 @@
590  my %po_files_by_lang = ();
591  my %translations = ();
592  
593 +# Use this instead of \w for XML files to handle more possible characters.
594 +my $w = "[-A-Za-z0-9._:]";
595 +
596 +
597  &split_on_argument;
598  
599  
600 @@ -79,7 +92,6 @@
601  
602      if ($VERSION_ARG) {
603         &version;
604 -
605      } elsif ($HELP_ARG) {
606         &help;
607      } elsif ($OAF_STYLE_ARG && @ARGV > 2) {
608 @@ -88,11 +100,13 @@
609         &preparation;
610         &oaf_merge_translations;
611      } elsif ($XML_STYLE_ARG && @ARGV > 2) {
612 +        &utf8_sanity_check;
613         &place_normal;
614         &message;
615         &preparation;
616         &xml_merge_translations;
617      } elsif ($KEYS_STYLE_ARG && @ARGV > 2) {
618 +        &utf8_sanity_check;
619          &place_normal;
620          &message;
621          &preparation;
622 @@ -107,6 +121,13 @@
623      }  
624  }    
625  
626 +sub utf8_sanity_check {
627 +    if (!$UTF8_ARG) {
628 +        if (!$PASS_THROUGH_ARG) {
629 +            $PASS_THROUGH_ARG="1";
630 +        }
631 +    }
632 +}
633  
634  sub place_normal {
635      $PO_DIR = $ARGV[0];
636 @@ -136,16 +157,18 @@
637      print "  -q, --quiet                  quiet mode\n";
638      print "  -o, --oaf-style              includes translations in the oaf style\n";
639      print "  -x, --xml-style              includes translations in the xml style\n";
640 -    print "  -k, --keys-style            includes translations in the keys style\n";
641 +    print "  -k, --keys-style             includes translations in the keys style\n";
642      print "  -d, --desktop-style          includes translations in the desktop style\n";
643 -    print "\nReport bugs to <mjs\@eazel.com>.\n";
644 +    print "  -u, --utf8                   convert all strings to UTF-8 before merging\n";
645 +    print "  -p, --pass-through           use strings as found in .po files, without\n";
646 +    print "                               conversion (STRONGLY unrecommended with -x)\n";
647 +    print "\nReport bugs to bugzilla.gnome.org, module intltool or xml-i18n-tools-list\@gnome.org>\n";
648      exit;
649  }
650  
651  
652  ## Sub for printing error messages
653  sub error{
654 -#   print "xml-i18n-merge: invalid option @ARGV\n";
655      print "Try `${PROGRAM} --help' for more information.\n";
656      exit;
657  }
658 @@ -156,7 +179,6 @@
659  }
660  
661  
662 -
663  sub preparation {
664     &gather_po_files;
665     &create_translation_database;   
666 @@ -184,6 +206,28 @@
667      return $tmp; 
668  }
669  
670 +sub get_po_encoding
671 +{
672 +    my ($in_po_file) = @_;
673 +    my $encoding = "";
674 +
675 +    open IN_PO_FILE, $in_po_file;
676 +    
677 +    while (<IN_PO_FILE>) {
678 +        ## example: "Content-Type: text/plain; charset=ISO-8859-1\n"
679 +        if (/Content-Type\:.*charset=([-a-zA-Z0-9]+)\\n/) {
680 +            $encoding = $1; 
681 +            last;
682 +        }
683 +    }
684 +    close IN_PO_FILE;
685 +    
686 +    if (!$encoding) {
687 +        print ("Warning: no encoding found in $in_po_file. Assuming ISO-8859-1\n");
688 +        $encoding = "ISO-8859-1";
689 +    }
690 +    return $encoding
691 +}
692  
693  sub create_translation_database
694  {
695 @@ -191,18 +235,23 @@
696  
697         my $po_file = $po_files_by_lang{$lang};
698  
699 -       open PO_FILE, "<$po_file";      
700 +        if ($UTF8_ARG) {
701 +            my $encoding = get_po_encoding($po_file);
702 +            open PO_FILE, "iconv -f $encoding -t UTF-8 $po_file|";     
703 +        } else {
704 +            open PO_FILE, "<$po_file"; 
705 +        }
706  
707          while (<PO_FILE>) {
708              if (/^#,.*fuzzy/) {
709                  $_ = <PO_FILE>; next;
710              }
711              if (/^msgid "(.*)"/ ) {
712 -               my $msgid = $1;
713 +               my $msgid = unescape_po_string($1);
714                  $_ = <PO_FILE>;
715                 
716                 if (/^msgstr "(.+)"/) {
717 -                   my $msgstr = $1;
718 +                   my $msgstr = unescape_po_string($1);
719                     $translations{$lang . "|" . $msgid} = $msgstr; 
720                     # print "[$lang]$msgstr\n";
721                 }
722 @@ -211,6 +260,28 @@
723      }
724  }
725  
726 +sub unescape_one_sequence
727 +{
728 +    my ($sequence) = @_;
729 +
730 +    return "\\" if $sequence eq "\\\\";
731 +    return "\"" if $sequence eq "\\\"";
732 +
733 +    # gettext also handles \n, \t, \b, \r, \f, \v, \a, \xxx (octal),
734 +    # \xXX (hex) and has a comment saying they want to handle \u and \U.
735 +
736 +    return $sequence;
737 +}
738 +
739 +sub unescape_po_string
740 +{
741 +    my ($string) = @_;
742 +
743 +    $string =~ s/(\\.)/unescape_one_sequence($1)/eg;
744 +
745 +    return $string;
746 +}
747 +
748  sub lookup_translations 
749  {
750      my ($value) = @_;
751 @@ -260,16 +331,30 @@
752  {
753      my ($pre_encoded) = @_;
754  
755 -    $pre_encoded =~ s/\\(.)/$1/g;
756      my @list_of_chars = unpack ('C*', $pre_encoded);
757  
758 -    return join ('', map (&entity_encode_int, @list_of_chars));
759 +    if ($PASS_THROUGH_ARG) {
760 +        return join ('', map (&entity_encode_int_even_high_bit, @list_of_chars));
761 +    } else {
762 +        return join ('', map (&entity_encode_int_minimalist, @list_of_chars));
763 +    }
764 +}
765 +
766 +sub entity_encode_int_minimalist
767 +{
768 +    if ($_ == 34) { return "&quot;" }
769 +    elsif ($_ == 38) { return "&amp;" }
770 +    elsif ($_ == 39) { return "&apos;" }
771 +    elsif ($_ == 60) { return "&lt;" }
772 +    elsif ($_ == 62) { return "&gt;" }
773 +    return chr $_;
774  }
775  
776 -sub entity_encode_int
777 +sub entity_encode_int_even_high_bit
778  {
779 -    if ($_ > 127 || $_ == 34 || $_ == 38) {
780 -       return "&#" . $_ . ";";
781 +    if ($_ > 127 || $_ == 34 || $_ == 38 || $_ == 39 || $_ == 60 || $_ == 62) {
782 +        # the ($_ > 127) should probably be removed  
783 +       return "&#" . $_ . ";"; 
784      } else {
785         return chr $_;
786      }
787 @@ -290,18 +375,18 @@
788  
789      open OUTPUT, ">$OUTFILE";
790  
791 -    while ($xml_source =~ /[ \t]*<[^<]*\s_\w+="[^"]*"[^<]*>/m) {
792 -        print OUTPUT $`;
793 +    while ($xml_source =~ /[ \t]*<[^<]*\s_$w+="[^"]*"[^<]*>/m) { #"
794 +        print OUTPUT $`; #` 
795          my $orig_node = $&;
796 -       $xml_source = $';
797 +       $xml_source = $'; #'
798  
799          my $non_translated_line = $orig_node;
800 -        $non_translated_line =~ s/_(\w+)="/$1="/;
801 +        $non_translated_line =~ s/_($w+)="/$1="/;
802              
803          my $new_node = $non_translated_line;
804              
805          my $value_str = $orig_node;
806 -        $value_str =~ s/.*_\w+="([^"]*)".*/$1/s;
807 +        $value_str =~ s/.*_$w+="([^"]*)".*/$1/s; #"
808  
809          if ($value_str) {
810              my %value_translation_map = entity_encode_translations
811 @@ -312,7 +397,7 @@
812                      
813                  my $translated_line = $orig_node;
814                  $translated_line =~ s/name="([^"]*)"/name="$1-$key"/;
815 -                $translated_line =~ s/(\s*)_(\w+)="[^"]*"/$1$2="$translation"/;
816 +                $translated_line =~ s/(\s*)_($w+)="[^"]*"/$1$2="$translation"/;
817  
818                  $new_node .= "\n$translated_line";
819              }
820 @@ -345,22 +430,25 @@
821  
822      # First just unmark for translation all empty nodes
823      # for example <_foo/> is just replaced by <foo/>
824 -    $xml_source =~ s/<_(\w+)\/>/<$1\/>/mg;
825 +    $xml_source =~ s|<_($w+)/>|<$1/>|mg;
826  
827 -    # Support for XML <_foo>blah</_foo> style translations
828 -    while ($xml_source =~ /([ \t]*)<_(\w+)>([^<]+)<\/_\2>/m) {
829 +    # Support for <_foo>blah</_foo> style translations
830 +    while ($xml_source =~ m|([ \t]*)<_($w+)>(.*?)</_\2>|s) {
831          print OUTPUT $`;
832 -       $xml_source = $';
833 +       my $remainder = $'; #'
834  
835          my $spaces = $1;
836          my $tag_name = $2;
837          my $value_str = $3;
838  
839          my $non_translated_line = "$spaces<$tag_name>$value_str</$tag_name>";
840 -            
841          my $new_node = $non_translated_line;
842  
843          if ($value_str) {
844 +           $value_str =~ s/\s+/ /g;
845 +            $value_str =~ s/^ //;
846 +            $value_str =~ s/ $//;
847 +
848              my %value_translation_map = entity_encode_translations
849                  (lookup_translations ($value_str));
850  
851 @@ -371,7 +459,7 @@
852              }
853          }
854  
855 -       $xml_source = $new_node . $xml_source;
856 +       $xml_source = $new_node . $remainder;
857      }
858  
859      print OUTPUT $xml_source;
860 @@ -421,7 +509,6 @@
861  sub desktop_merge_translations
862  {
863      open INPUT, "<${FILE}";
864 -
865      open OUTPUT, ">${OUTFILE}";
866  
867      while (<INPUT>) {
868 diff -ur gdm-2.2.5.5/xml-i18n-update.in~ gdm-2.2.5.5/xml-i18n-update.in
869 --- gdm-2.2.5.5/xml-i18n-update.in~     Sat Jan  3 15:21:07 2004
870 +++ gdm-2.2.5.5/xml-i18n-update.in      Sat Jan  3 15:21:07 2004
871 @@ -1,29 +1,34 @@
872 -#!@XML_I18N_TOOLS_PERL@ -w
873 +#!@INTLTOOL_PERL@ -w
874  
875 -#  The GNOME Translation Update Tool
876 +#  The Intltool Message Updater
877  #
878  #  Copyright (C) 2000 Free Software Foundation.
879  #
880 -#  This library is free software; you can redistribute it and/or
881 +#  Intltool is free software; you can redistribute it and/or
882  #  modify it under the terms of the GNU General Public License as
883  #  published by the Free Software Foundation; either version 2 of the
884  #  License, or (at your option) any later version.
885  #
886 -#  This script is distributed in the hope that it will be useful,
887 +#  Intltool is distributed in the hope that it will be useful,
888  #  but WITHOUT ANY WARRANTY; without even the implied warranty of
889  #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
890  #  General Public License for more details.
891  #
892  #  You should have received a copy of the GNU General Public License
893 -#  along with this library; if not, write to the Free Software
894 +#  along with this program; if not, write to the Free Software
895  #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
896  #
897 +#  As a special exception to the GNU General Public License, if you
898 +#  distribute this file as part of a program that contains a
899 +#  configuration script generated by Autoconf, you may include it under
900 +#  the same distribution terms that you use for the rest of that program.
901 +#
902  #  Author(s): Kenneth Christiansen
903  
904  ## Release information
905 -my $PROGRAM  = "xml-i18n-update";
906 -my $VERSION  = "0.9";
907 -my $_PACKAGE = "xml-i18n-tools";
908 +my $PROGRAM  = "intltool-update";
909 +my $VERSION  = "0.11.1";
910 +my $_PACKAGE = "intltool";
911  
912  ## Loaded modules
913  use strict;
914 @@ -50,6 +55,7 @@
915  "xml(\.in)*|".         # .in is not required
916  "ui|".
917  "glade(\.in)*|".       # .in is not required
918 +"scm(\.in)*|".         # .in is not required
919  "desktop(\.in)+|".
920  "directory(\.in)+|".
921  "soundlist(\.in)+|".
922 @@ -57,6 +63,7 @@
923  "oaf(\.in)+|".
924  "server(\.in)+|".
925  "etspec|".
926 +"sheet(\.in)+|".
927  "pong(\.in)+";
928  
929  my $PACKAGE = &find_package_name;
930 @@ -73,7 +80,7 @@
931  
932  ## Handle options
933  GetOptions (
934 -           "help|h|?"          => \$HELP_ARG,
935 +           "help|h"            => \$HELP_ARG,
936             "version|v"         => \$VERSION_ARG,
937             "dist|d"            => \$DIST_ARG,
938             "pot|p"             => \$POT_ARG,
939 @@ -153,7 +160,7 @@
940     if ($type =~ /\[type: (gettext\/[^\]].*)]/) {
941          $gettext_type=$1;
942     }
943 -   elsif ($type =~ /(?:xml(\.in)*|ui|oaf(?:\.in)+|pong(?:\.in)+|etspec)$/) {
944 +   elsif ($type =~ /(?:xml(\.in)*|ui|oaf(?:\.in)+|server(?:\.in)+|sheet(?:\.in)+|pong(?:\.in)+|etspec)$/) {
945          $gettext_type="gettext\/xml";
946     }
947     elsif ($type =~ /glade(\.in)*$/) {
948 @@ -162,6 +169,9 @@
949     elsif ($type =~ /(?:desktop(?:\.in)+|directory(?:\.in)+|soundlist(?:\.in)+)$/) {
950          $gettext_type="gettext\/ini";
951     }
952 +   elsif ($type =~ /scm(\.in)*$/) {
953 +        $gettext_type="gettext\/scheme";
954 +   }
955     elsif ($type =~ /keys(\.in)+$/) {
956          $gettext_type="gettext\/keys";
957     }
958 @@ -216,7 +226,7 @@
959      find sub { push @buf_i18n_xml, "$File::Find::name" if /\.($xml_extension)$/ }, "..";
960  
961      open(POTFILES, "POTFILES.in") || die "$PROGRAM:  there's no POTFILES.in!!!\n";
962 -    @buf_potfiles = <POTFILES>;
963 +    @buf_potfiles = grep /^[^#]/, <POTFILES>;
964  
965      print "Searching for missing translatable files...\n";
966  
967 @@ -297,17 +307,17 @@
968  
969  sub gen_headers
970  {
971 -    my $XML_I18N_EXTRACT = `which xml-i18n-extract 2>/dev/null`;
972 -    chomp $XML_I18N_EXTRACT;
973 +    my $EXTRACT = `which intltool-extract 2>/dev/null`;
974 +    chomp $EXTRACT;
975  
976 -    $XML_I18N_EXTRACT = $ENV{"XML_I18N_EXTRACT"} if $ENV{"XML_I18N_EXTRACT"};
977 +    $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"};
978  
979      ## Generate the .h header files, so we can allow glade and
980      ## xml translation support
981 -    if (! -s $XML_I18N_EXTRACT)
982 +    if (! -s $EXTRACT)
983      {
984 -       print "\n *** The xml-i18n-extract script wasn't found!"
985 -            ."\n *** Without this xml-i18n-update can not generate files.\n";
986 +       print "\n *** The intltool-extract script wasn't found!"
987 +            ."\n *** Without this intltool-update can not generate files.\n";
988         exit;
989      }
990      else
991 @@ -317,7 +327,7 @@
992             chomp;
993  
994             ## Find xml files in POTFILES.in and generate the
995 -           ## files with help from the xml-i18n-extract script
996 +           ## files with help from the extract script
997  
998            my $gettext_type=&determine_type($1);
999  
1000 @@ -326,9 +336,9 @@
1001                 my $filename = "../$_";
1002  
1003                 if ($VERBOSE){
1004 -                   system($XML_I18N_EXTRACT, "--update", "--type=$gettext_type", $filename);
1005 +                   system($EXTRACT, "--update", "--type=$gettext_type", $filename);
1006                 } else {
1007 -                  system($XML_I18N_EXTRACT, "--update", "--type=$gettext_type", "--quiet", $filename);
1008 +                  system($EXTRACT, "--update", "--type=$gettext_type", "--quiet", $filename);
1009                 }
1010             }
1011         }
1012 @@ -358,7 +368,7 @@
1013                         ."&& mv $PACKAGE\.po \.\/$PACKAGE\.pot \)";
1014  
1015      system("xgettext", "--default-domain\=$PACKAGE", "--directory\=\.\.",
1016 -          "--add-comments", "--keyword\=\_", "--keyword\=N\_",
1017 +          "--add-comments", "--keyword\=\_", "--keyword\=N\_", "--keyword\=U\_",
1018            "--files-from\=\.\/POTFILES\.in");
1019  
1020      system($gettext_test);
This page took 0.095542 seconds and 3 git commands to generate.