Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r1383 -
      trunk/src/target/OM-2007/applications/openmoko-taskmanager/src
      ([EMAIL PROTECTED])
   2. r1384 -
      trunk/src/target/OM-2007/applications/openmoko-taskmanager/src
      ([EMAIL PROTECTED])
   3. r1385 - trunk/oe/packages/openmoko-pim/files
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-03-16 07:39:08 +0100 (Fri, 16 Mar 2007)
New Revision: 1383

Modified:
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/list_view.c
Log:
bug fixed: list_view.c::moko_add_window:pixbuf pointer free error 

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/list_view.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/list_view.c  
2007-03-16 03:24:40 UTC (rev 1382)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/list_view.c  
2007-03-16 06:39:08 UTC (rev 1383)
@@ -160,7 +160,8 @@
 
 /* Destruction */
 void 
-moko_task_list_clear(MokoTaskList *l) { 
+moko_task_list_clear(MokoTaskList *l) 
+{ 
     if (!l) g_free (l);
 }
 
@@ -173,28 +174,30 @@
 
     name = moko_get_window_name(dpy, w);
     if (!strcmp (name, "Openmoko-taskmanager"))
-       {
+    {
        g_free (name);
        return;
-       }
+    }
 
     icon = moko_get_window_icon (dpy, w);
     gtk_list_store_append (list_store, &iter);
     gtk_list_store_set (list_store, &iter, TEXT_COL, name, OBJECT_COL, w, -1);
 
-    if (icon) {
+    if (icon) 
+       {
         GdkPixbuf *icons = gdk_pixbuf_scale_simple (icon, 160, 160, 
GDK_INTERP_BILINEAR);
         gtk_list_store_set (list_store, &iter, PIXBUF_COL, icons, -1);
-       gdk_pixbuf_unref (icons);
-        }
+           gdk_pixbuf_unref (icons);
+    }
     else if (default_icon) 
         gtk_list_store_set (list_store, &iter, PIXBUF_COL, default_icon, -1);
     else
            g_error ("Failed to load %s's icon", name);
 
-    gdk_pixbuf_unref (icon);
+    if (icon)
+           gdk_pixbuf_unref (icon);
     g_free (name);
-   }
+}
 
 void 
 moko_update_store_list (Display *dpy, GtkListStore *list_store)
@@ -214,13 +217,15 @@
        gboolean found = FALSE;
        Window w;
        gtk_tree_model_get (GTK_TREE_MODEL (list_store), &iter, OBJECT_COL, &w, 
-1);
-       for (i=0; i<nr; i++) {
-           if (list[i] == w) {
+       for (i=0; i<nr; i++) 
+               {
+           if (list[i] == w) 
+                       {
                p[i] = 1;
                found = TRUE;
                break;
-               }
            }
+       }
        if (found)
            more = gtk_tree_model_iter_next (GTK_TREE_MODEL (list_store), 
&iter);
        else
@@ -229,10 +234,11 @@
     while (more);
     }
     
-    for (i=0; i<nr; i++) {
+    for (i=0; i<nr; i++) 
+       {
        if (p[i] == 0 && list[i] != my_win)
            moko_add_window (dpy, list[i], list_store);
-       }
+       }
 
        g_free (p);
 }




--- End Message ---
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-03-16 08:33:27 +0100 (Fri, 16 Mar 2007)
New Revision: 1384

Modified:
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/xatoms.c
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/xatoms.h
Log:
small modify

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c  
2007-03-16 06:39:08 UTC (rev 1383)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c  
2007-03-16 07:33:27 UTC (rev 1384)
@@ -38,7 +38,7 @@
 }
 
 gboolean
-moko_wm_cmd (GtkWidget *w, GtkWidget *list_view, int task)
+moko_wm_cmd (MokoTaskManager *tm, GtkWidget *list_view, int task)
 {
     GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW 
(list_view));
     GtkTreeIter iter;
@@ -81,7 +81,7 @@
 {
     if (!tm)
        return;
-    moko_wm_cmd (GTK_WIDGET (tm), 
+    moko_wm_cmd (tm, 
                        GTK_WIDGET (tm->l->list_view), MB_CMD_ACTIVATE_CLIENT);
 }
 
@@ -90,7 +90,7 @@
 {
     if (!tm)
        return;
-    moko_wm_cmd (GTK_WIDGET (tm), 
+    moko_wm_cmd (tm, 
                        GTK_WIDGET (tm->l->list_view), MB_CMD_REMOVE_CLIENT);
 }
 

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/xatoms.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/xatoms.c     
2007-03-16 06:39:08 UTC (rev 1383)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/xatoms.c     
2007-03-16 07:33:27 UTC (rev 1384)
@@ -28,6 +28,8 @@
        "_NET_CLIENT_LIST",
        "_NET_CLIENT_LIST_STACKING",
        "_NET_ACTIVE_WINDOW",
+       "_NET_CLOSE_WINDOW",
+       "_NET_SHOW_DESKTOP",
        "WM_STATE",
        "_NET_WM_WINDOW_TYPE",
        "_NET_WM_WINDOW_TYPE_DESKTOP",

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/xatoms.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/xatoms.h     
2007-03-16 06:39:08 UTC (rev 1383)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/xatoms.h     
2007-03-16 07:33:27 UTC (rev 1384)
@@ -31,6 +31,8 @@
        _NET_CLIENT_LIST,
        _NET_CLIENT_LIST_STACKING,
        _NET_ACTIVE_WINDOW,
+    _NET_CLOSE_WINDOW,
+       _NET_SHOW_DESKTOP,
        WM_STATE,
        _NET_WM_WINDOW_TYPE,
        _NET_WM_WINDOW_TYPE_DESKTOP,




--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-03-16 09:13:27 +0100 (Fri, 16 Mar 2007)
New Revision: 1385

Added:
   trunk/oe/packages/openmoko-pim/files/index.theme
   trunk/oe/packages/openmoko-pim/files/intltool-update.in
   trunk/oe/packages/openmoko-pim/files/stock_contact.png
   trunk/oe/packages/openmoko-pim/files/stock_person.png
Log:
oe/openmoko-pim: add files from OE upstream to make it build again
NOTE: please guys, test compiling before adding recipes overloading OE ones to 
our buildserver


Added: trunk/oe/packages/openmoko-pim/files/index.theme
===================================================================
--- trunk/oe/packages/openmoko-pim/files/index.theme    2007-03-16 07:33:27 UTC 
(rev 1384)
+++ trunk/oe/packages/openmoko-pim/files/index.theme    2007-03-16 08:13:27 UTC 
(rev 1385)
@@ -0,0 +1,654 @@
+[Icon Theme]
+Name=Hicolor
+Comment=Fallback icon theme
+Hidden=true
+Directories=192x192/apps,128x128/actions,128x128/apps,128x128/devices,128x128/filesystems,128x128/mimetypes,96x96/actions,96x96/apps,96x96/devices,96x96/filesystems,96x96/mimetypes,72x72/apps,64x64/actions,64x64/apps,64x64/devices,64x64/filesystems,64x64/mimetypes,48x48/actions,48x48/apps,48x48/devices,48x48/filesystems,48x48/mimetypes,36x36/apps,32x32/actions,32x32/apps,32x32/devices,32x32/filesystems,32x32/mimetypes,22x22/actions,22x22/apps,22x22/devices,22x22/filesystems,22x22/mimetypes,16x16/actions,16x16/apps,16x16/devices,16x16/filesystems,16x16/mimetypes,scalable/actions,scalable/apps,scalable/devices,scalable/filesystems,scalable/mimetypes,16x16/stock/chart,16x16/stock/code,16x16/stock/data,16x16/stock/document,16x16/stock/form,16x16/stock/generic,16x16/stock/image,16x16/stock/io,16x16/stock/media,16x16/stock/navigation,16x16/stock/net,16x16/stock/object,16x16/stock/table,16x16/stock/text,24x24/actions,24x24/apps,24x24/devices,24x24/filesystems,24x24/mimetypes,24x24/stock/chart,24x24/stock/code,24x24/stock/data,24x24/stock/document,24x24/stock/form,24x24/stock/generic,24x24/stock/image,24x24/stock/io,24x24/stock/media,24x24/stock/navigation,24x24/stock/net,24x24/stock/object,24x24/stock/table,24x24/stock/text,32x32/stock/chart,32x32/stock/code,32x32/stock/data,32x32/stock/document,32x32/stock/form,32x32/stock/generic,32x32/stock/image,32x32/stock/io,32x32/stock/media,32x32/stock/navigation,32x32/stock/net,32x32/stock/object,32x32/stock/table,32x32/stock/text,36x36/stock/chart,36x36/stock/code,36x36/stock/data,36x36/stock/document,36x36/stock/form,36x36/stock/generic,36x36/stock/image,36x36/stock/io,36x36/stock/media,36x36/stock/navigation,36x36/stock/net,36x36/stock/object,36x36/stock/table,36x36/stock/text,48x48/stock/chart,48x48/stock/code,48x48/stock/data,48x48/stock/document,48x48/stock/form,48x48/stock/generic,48x48/stock/image,48x48/stock/io,48x48/stock/media,48x48/stock/navigation,48x48/stock/net,48x48/stock/object,48x48/stock/table,48x48/stock/text,scalable/emblems,192x192/emblems,96x96/emblems,72x72/emblems,48x48/emblems,36x36/emblems,24x24/emblems,16x16/emblems,12x12/emblems
+
+[16x16/actions]
+Size=16
+Context=Actions
+Type=Threshold
+
+[16x16/apps]
+Size=16
+Context=Applications
+Type=Threshold
+
+[16x16/devices]
+Size=16
+Context=Devices
+Type=Threshold
+
+[16x16/filesystems]
+Size=16
+Context=FileSystems
+Type=Threshold
+
+[16x16/mimetypes]
+Size=16
+Context=MimeTypes
+Type=Threshold
+
+[22x22/actions]
+Size=22
+Context=Actions
+Type=Threshold
+
+[22x22/apps]
+Size=22
+Context=Applications
+Type=Threshold
+
+[22x22/devices]
+Size=22
+Context=Devices
+Type=Threshold
+
+[22x22/filesystems]
+Size=22
+Context=FileSystems
+Type=Threshold
+
+[22x22/mimetypes]
+Size=22
+Context=MimeTypes
+Type=Threshold
+
+[24x24/actions]
+Size=24
+Context=Actions
+Type=Threshold
+
+[24x24/apps]
+Size=24
+Context=Applications
+Type=Threshold
+
+[24x24/devices]
+Size=24
+Context=Devices
+Type=Threshold
+
+[24x24/filesystems]
+Size=24
+Context=FileSystems
+Type=Threshold
+
+[24x24/mimetypes]
+Size=24
+Context=MimeTypes
+Type=Threshold
+
+[32x32/actions]
+Size=32
+Context=Actions
+Type=Threshold
+
+[32x32/apps]
+Size=32
+Context=Applications
+Type=Threshold
+
+[32x32/devices]
+Size=32
+Context=Devices
+Type=Threshold
+
+[32x32/filesystems]
+Size=32
+Context=FileSystems
+Type=Threshold
+
+[32x32/mimetypes]
+Size=32
+Context=MimeTypes
+Type=Threshold
+
+[36x36/apps]
+Size=36
+Context=Applications
+Type=Threshold
+
+[48x48/actions]
+Size=48
+Context=Actions
+Type=Threshold
+
+[48x48/apps]
+Size=48
+Context=Applications
+Type=Threshold
+
+[48x48/devices]
+Size=48
+Context=Devices
+Type=Threshold
+
+[48x48/filesystems]
+Size=48
+Context=FileSystems
+Type=Threshold
+
+[48x48/mimetypes]
+Size=48
+Context=MimeTypes
+Type=Threshold
+
+[64x64/actions]
+Size=64
+Context=Actions
+Type=Threshold
+
+[64x64/apps]
+Size=64
+Context=Applications
+Type=Threshold
+
+[64x64/devices]
+Size=64
+Context=Devices
+Type=Threshold
+
+[64x64/filesystems]
+Size=64
+Context=FileSystems
+Type=Threshold
+
+[64x64/mimetypes]
+Size=64
+Context=MimeTypes
+Type=Threshold
+
+[72x72/apps]
+Size=72
+Context=Applications
+Type=Threshold
+
+[96x96/actions]
+Size=96
+Context=Actions
+Type=Threshold
+
+[96x96/apps]
+Size=96
+Context=Applications
+Type=Threshold
+
+[96x96/devices]
+Size=96
+Context=Devices
+Type=Threshold
+
+[96x96/filesystems]
+Size=96
+Context=FileSystems
+Type=Threshold
+
+[96x96/mimetypes]
+Size=96
+Context=MimeTypes
+Type=Threshold
+
+[128x128/actions]
+Size=128
+Context=Actions
+Type=Threshold
+
+[128x128/apps]
+Size=128
+Context=Applications
+Type=Threshold
+
+[128x128/devices]
+Size=128
+Context=Devices
+Type=Threshold
+
+[128x128/filesystems]
+Size=128
+Context=FileSystems
+Type=Threshold
+
+[128x128/mimetypes]
+Size=128
+Context=MimeTypes
+Type=Threshold
+
+[192x192/apps]
+Size=192
+Context=Applications
+Type=Threshold
+
+
+[scalable/actions]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Actions
+Type=Scalable
+
+[scalable/apps]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Applications
+Type=Scalable
+
+[scalable/devices]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Devices
+Type=Scalable
+
+[scalable/filesystems]
+MinSize=1
+Size=128
+MaxSize=256
+Context=FileSystems
+Type=Scalable
+
+[scalable/mimetypes]
+MinSize=1
+Size=128
+MaxSize=256
+Context=MimeTypes
+Type=Scalable
+
+[16x16/stock/chart]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/code]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/data]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/document]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/form]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/generic]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/image]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/io]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/media]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/navigation]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/net]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/object]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/table]
+Size=16
+Context=Stock
+Type=Threshold
+
+[16x16/stock/text]
+Size=16
+Context=Stock
+Type=Threshold
+
+[24x24/stock/chart]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/code]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/data]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/document]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/form]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/generic]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/image]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/io]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/media]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/navigation]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/net]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/object]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/table]
+Size=24
+Context=Stock
+Type=Threshold
+
+[24x24/stock/text]
+Size=24
+Context=Stock
+Type=Threshold
+
+[32x32/stock/chart]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/code]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/data]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/document]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/form]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/generic]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/image]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/io]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/media]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/navigation]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/net]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/object]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/table]
+Size=32
+Context=Stock
+Type=Threshold
+
+[32x32/stock/text]
+Size=32
+Context=Stock
+Type=Threshold
+
+[36x36/stock/chart]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/code]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/data]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/document]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/form]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/generic]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/image]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/io]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/media]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/navigation]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/net]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/object]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/table]
+Size=36
+Context=Stock
+Type=Threshold
+
+[36x36/stock/text]
+Size=36
+Context=Stock
+Type=Threshold
+
+[48x48/stock/chart]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/code]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/data]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/document]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/form]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/generic]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/image]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/io]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/media]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/navigation]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/net]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/object]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/table]
+Size=48
+Context=Stock
+Type=Threshold
+
+[48x48/stock/text]
+Size=48
+Context=Stock
+Type=Threshold
+
+[scalable/emblems]
+MinSize=1
+Size=128
+MaxSize=256
+Context=Emblems
+Type=Scalable
+
+[192x192/emblems]
+Size=192
+Context=Emblems
+Type=Threshold
+
+[96x96/emblems]
+Size=96
+Context=Emblems
+Type=Threshold
+
+[72x72/emblems]
+Size=72
+Context=Emblems
+Type=Threshold
+
+[48x48/emblems]
+Size=48
+Context=Emblems
+Type=Threshold
+
+[36x36/emblems]
+Size=36
+Context=Emblems
+Type=Threshold
+
+[24x24/emblems]
+Size=24
+Context=Emblems
+Type=Threshold
+
+[16x16/emblems]
+Size=16
+Context=Emblems
+Type=Threshold
+
+[12x12/emblems]
+Size=12
+Context=Emblems
+Type=Threshold
+

Added: trunk/oe/packages/openmoko-pim/files/intltool-update.in
===================================================================
--- trunk/oe/packages/openmoko-pim/files/intltool-update.in     2007-03-16 
07:33:27 UTC (rev 1384)
+++ trunk/oe/packages/openmoko-pim/files/intltool-update.in     2007-03-16 
08:13:27 UTC (rev 1385)
@@ -0,0 +1,1089 @@
[EMAIL PROTECTED]@
+# -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4  -*-
+
+#
+#  The Intltool Message Updater
+#
+#  Copyright (C) 2000-2003 Free Software Foundation.
+#
+#  Intltool is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License 
+#  version 2 published by the Free Software Foundation.
+#
+#  Intltool is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#  As a special exception to the GNU General Public License, if you
+#  distribute this file as part of a program that contains a
+#  configuration script generated by Autoconf, you may include it under
+#  the same distribution terms that you use for the rest of that program.
+#
+#  Authors: Kenneth Christiansen <[EMAIL PROTECTED]>
+#           Maciej Stachowiak
+#           Darin Adler <[EMAIL PROTECTED]>
+
+## Release information
+my $PROGRAM = "intltool-update";
+my $VERSION = "0.35.0";
+my $PACKAGE = "intltool";
+
+## Loaded modules
+use strict;
+use Getopt::Long;
+use Cwd;
+use File::Copy;
+use File::Find;
+
+## Scalars used by the option stuff
+my $HELP_ARG      = 0;
+my $VERSION_ARG    = 0;
+my $DIST_ARG      = 0;
+my $POT_ARG       = 0;
+my $HEADERS_ARG    = 0;
+my $MAINTAIN_ARG   = 0;
+my $REPORT_ARG     = 0;
+my $VERBOSE       = 0;
+my $GETTEXT_PACKAGE = "";
+my $OUTPUT_FILE    = "";
+
+my @languages;
+my %varhash = ();
+my %po_files_by_lang = ();
+
+# Regular expressions to categorize file types.
+# FIXME: Please check if the following is correct
+
+my $xml_support =
+"xml(?:\\.in)*|".      # http://www.w3.org/XML/ (Note: .in is not required)
+"ui|".                 # Bonobo specific - User Interface desc. files
+"lang|".               # ?
+"glade2?(?:\\.in)*|".  # Glade specific - User Interface desc. files (Note: 
.in is not required)
+"scm(?:\\.in)*|".      # ? (Note: .in is not required)
+"oaf(?:\\.in)+|".      # DEPRECATED: Replaces by Bonobo .server files 
+"etspec|".             # ?
+"server(?:\\.in)+|".   # Bonobo specific
+"sheet(?:\\.in)+|".    # ?
+"schemas(?:\\.in)+|".  # GConf specific
+"pong(?:\\.in)+|".     # DEPRECATED: PONG is not used [by GNOME] any longer.
+"kbd(?:\\.in)+";       # GOK specific. 
+
+my $ini_support =
+"icon(?:\\.in)+|".     # http://www.freedesktop.org/Standards/icon-theme-spec
+"desktop(?:\\.in)+|".  # http://www.freedesktop.org/Standards/menu-spec
+"caves(?:\\.in)+|".    # GNOME Games specific
+"directory(?:\\.in)+|".        # http://www.freedesktop.org/Standards/menu-spec
+"soundlist(?:\\.in)+|".        # GNOME specific
+"keys(?:\\.in)+|".     # GNOME Mime database specific
+"theme(?:\\.in)+|".    # http://www.freedesktop.org/Standards/icon-theme-spec
+"service(?:\\.in)+";    # DBus specific
+
+my $buildin_gettext_support = 
+"c|y|cs|cc|cpp|c\\+\\+|h|hh|gob|py";
+
+## Always flush buffer when printing
+$| = 1;
+
+## Sometimes the source tree will be rooted somewhere else.
+my $SRCDIR = ".";
+my $POTFILES_in;
+
+$SRCDIR = $ENV{"srcdir"} if $ENV{"srcdir"};
+$POTFILES_in = "<$SRCDIR/POTFILES.in";
+
+my $devnull = ($^O eq 'MSWin32' ? 'NUL:' : '/dev/null');
+
+## Handle options
+GetOptions 
+(
+ "help"               => \$HELP_ARG,
+ "version"            => \$VERSION_ARG,
+ "dist|d"             => \$DIST_ARG,
+ "pot|p"              => \$POT_ARG,
+ "headers|s"          => \$HEADERS_ARG,
+ "maintain|m"         => \$MAINTAIN_ARG,
+ "report|r"           => \$REPORT_ARG,
+ "verbose|x"          => \$VERBOSE,
+ "gettext-package|g=s" => \$GETTEXT_PACKAGE,
+ "output-file|o=s"     => \$OUTPUT_FILE,
+ ) or &Console_WriteError_InvalidOption;
+
+&Console_Write_IntltoolHelp if $HELP_ARG;
+&Console_Write_IntltoolVersion if $VERSION_ARG;
+
+my $arg_count = ($DIST_ARG > 0)
+    + ($POT_ARG > 0)
+    + ($HEADERS_ARG > 0)
+    + ($MAINTAIN_ARG > 0)
+    + ($REPORT_ARG > 0);
+
+&Console_Write_IntltoolHelp if $arg_count > 1;
+
+# --version and --help don't require a module name
+my $MODULE = $GETTEXT_PACKAGE || &FindPackageName || "unknown";
+
+if ($POT_ARG)
+{
+    &GenerateHeaders;
+    &GeneratePOTemplate;
+}
+elsif ($HEADERS_ARG)
+{
+    &GenerateHeaders;
+}
+elsif ($MAINTAIN_ARG)
+{
+    &FindLeftoutFiles;
+}
+elsif ($REPORT_ARG)
+{
+    &GenerateHeaders;
+    &GeneratePOTemplate;
+    &Console_Write_CoverageReport;
+}
+elsif ((defined $ARGV[0]) && $ARGV[0] =~ /^[a-z]/)
+{
+    my $lang = $ARGV[0];
+
+    ## Report error if the language file supplied
+    ## to the command line is non-existent
+    &Console_WriteError_NotExisting("$SRCDIR/$lang.po")
+        if ! -s "$SRCDIR/$lang.po";
+
+    if (!$DIST_ARG)
+    {
+       print "Working, please wait..." if $VERBOSE;
+       &GenerateHeaders;
+       &GeneratePOTemplate;
+    }
+    &POFile_Update ($lang, $OUTPUT_FILE);
+    &Console_Write_TranslationStatus ($lang, $OUTPUT_FILE);
+} 
+else 
+{
+    &Console_Write_IntltoolHelp;
+}
+
+exit;
+
+#########
+
+sub Console_Write_IntltoolVersion
+{
+    print <<_EOF_;
+${PROGRAM} (${PACKAGE}) $VERSION
+Written by Kenneth Christiansen, Maciej Stachowiak, and Darin Adler.
+
+Copyright (C) 2000-2003 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+_EOF_
+    exit;
+}
+
+sub Console_Write_IntltoolHelp
+{
+    print <<_EOF_;
+Usage: ${PROGRAM} [OPTION]... LANGCODE
+Updates PO template files and merge them with the translations.
+
+Mode of operation (only one is allowed):
+  -p, --pot                   generate the PO template only
+  -s, --headers               generate the header files in POTFILES.in
+  -m, --maintain              search for left out files from POTFILES.in
+  -r, --report                display a status report for the module
+  -d, --dist                  merge LANGCODE.po with existing PO template
+
+Extra options:
+  -g, --gettext-package=NAME  override PO template name, useful with --pot
+  -o, --output-file=FILE      write merged translation to FILE
+  -x, --verbose               display lots of feedback
+      --help                  display this help and exit
+      --version               output version information and exit
+
+Examples of use:
+${PROGRAM} --pot    just create a new PO template
+${PROGRAM} xy       create new PO template and merge xy.po with it
+
+Report bugs to http://bugzilla.gnome.org/ (product name "$PACKAGE")
+or send email to <[EMAIL PROTECTED]>.
+_EOF_
+    exit;
+}
+
+sub echo_n
+{
+    my $str = shift;
+    my $ret = `echo "$str"`;
+
+    $ret =~ s/\n$//; # do we need the "s" flag?
+
+    return $ret;
+}
+
+sub POFile_DetermineType ($) 
+{
+   my $type = $_;
+   my $gettext_type;
+
+   my $xml_regex     = "(?:" . $xml_support . ")";
+   my $ini_regex     = "(?:" . $ini_support . ")";
+   my $buildin_regex = "(?:" . $buildin_gettext_support . ")";
+
+   if ($type =~ /\[type: gettext\/([^\]].*)]/) 
+   {
+       $gettext_type=$1;
+   }
+   elsif ($type =~ /schemas(\.in)+$/) 
+   {
+       $gettext_type="schemas";
+   }
+   elsif ($type =~ /glade2?(\.in)*$/) 
+   {
+       $gettext_type="glade";
+   }
+   elsif ($type =~ /scm(\.in)*$/) 
+   {
+       $gettext_type="scheme";
+   }
+   elsif ($type =~ /keys(\.in)+$/) 
+   {
+       $gettext_type="keys";
+   }
+
+   # bucket types
+
+   elsif ($type =~ /$xml_regex$/) 
+   {
+       $gettext_type="xml";
+   }
+   elsif ($type =~ /$ini_regex$/) 
+   { 
+       $gettext_type="ini";
+   }
+   elsif ($type =~ /$buildin_regex$/) 
+   {
+       $gettext_type="buildin";
+   }
+   else
+   { 
+       $gettext_type="unknown"; 
+   }
+
+   return "gettext\/$gettext_type";
+}
+
+sub TextFile_DetermineEncoding ($) 
+{
+    my $gettext_code="ASCII"; # All files are ASCII by default
+    my $filetype=`file $_ | cut -d ' ' -f 2`;
+
+    if ($? eq "0")
+    {
+       if ($filetype =~ /^(ISO|UTF)/)
+       {
+           chomp ($gettext_code = $filetype);
+       }
+       elsif ($filetype =~ /^XML/)
+       {
+           $gettext_code="UTF-8"; # We asume that .glade and other .xml files 
are UTF-8
+       }
+    }
+
+    return $gettext_code;
+}
+
+sub isNotValidMissing
+{
+    my ($file) = @_;
+
+    return if $file =~ /^\{arch\}\/.*$/;
+    return if $file =~ /^$varhash{"PACKAGE"}-$varhash{"VERSION"}\/.*$/;
+}
+
+sub FindLeftoutFiles
+{
+    my (@buf_i18n_plain,
+       @buf_i18n_xml,
+       @buf_i18n_xml_unmarked,
+       @buf_i18n_ini,
+       @buf_potfiles,
+       @buf_potfiles_ignore,
+       @buf_allfiles,
+       @buf_allfiles_sorted,
+       @buf_potfiles_sorted
+    );
+
+    ## Search and find all translatable files
+    find sub { 
+       push @buf_i18n_plain,        "$File::Find::name" if 
/\.($buildin_gettext_support)$/;
+       push @buf_i18n_xml,          "$File::Find::name" if /\.($xml_support)$/;
+       push @buf_i18n_ini,          "$File::Find::name" if /\.($ini_support)$/;
+       push @buf_i18n_xml_unmarked, "$File::Find::name" if 
/\.(schemas(\.in)+)$/;
+       }, "..";
+
+
+    open POTFILES, $POTFILES_in or die "$PROGRAM:  there's no POTFILES.in!\n";
+    @buf_potfiles = grep !/^(#|\s*$)/, <POTFILES>;
+    close POTFILES;
+
+    foreach (@buf_potfiles) {
+       s/^\[.*]\s*//;
+    }
+
+    print "Searching for missing translatable files...\n" if $VERBOSE;
+
+    ## Check if we should ignore some found files, when
+    ## comparing with POTFILES.in
+    foreach my $ignore ("POTFILES.skip", "POTFILES.ignore")
+    {
+       (-s $ignore) or next;
+
+       if ("$ignore" eq "POTFILES.ignore")
+       {
+           print "The usage of POTFILES.ignore is deprecated. Please consider 
moving the\n".
+                 "content of this file to POTFILES.skip.\n";
+       }
+
+       print "Found $ignore: Ignoring files...\n" if $VERBOSE;
+       open FILE, "<$ignore" or die "ERROR: Failed to open $ignore!\n";
+           
+       while (<FILE>)
+       {
+           push @buf_potfiles_ignore, $_ unless /^(#|\s*$)/;
+       }
+       close FILE;
+
+       @buf_potfiles = (@buf_potfiles_ignore, @buf_potfiles);
+    }
+
+    foreach my $file (@buf_i18n_plain)
+    {
+       my $in_comment = 0;
+       my $in_macro = 0;
+
+       open FILE, "<$file";
+       while (<FILE>)
+       {
+           # Handle continued multi-line comment.
+           if ($in_comment)
+           {
+               next unless s-.*\*/--;
+               $in_comment = 0;
+           }
+
+           # Handle continued macro.
+           if ($in_macro)
+           {
+               $in_macro = 0 unless /\\$/;
+               next;
+           }
+
+           # Handle start of macro (or any preprocessor directive).
+           if (/^\s*\#/)
+           {
+               $in_macro = 1 if /^([^\\]|\\.)*\\$/;
+               next;
+           }
+
+           # Handle comments and quoted text.
+           while (m-(/\*|//|\'|\")-) # \' and \" keep emacs perl mode happy
+           {
+               my $match = $1;
+               if ($match eq "/*")
+               {
+                   if (!s-/\*.*?\*/--)
+                   {
+                       s-/\*.*--;
+                       $in_comment = 1;
+                   }
+               }
+               elsif ($match eq "//")
+               {
+                   s-//.*--;
+               }
+               else # ' or "
+               {
+                   if (!s-$match([^\\]|\\.)*?$match-QUOTEDTEXT-)
+                   {
+                       warn "mismatched quotes at line $. in $file\n";
+                       s-$match.*--;
+                   }
+               }
+           }       
+
+           if (/\.GetString ?\(QUOTEDTEXT/)
+           {
+                if (defined isNotValidMissing (unpack("x3 A*", $file))) {
+                    ## Remove the first 3 chars and add newline
+                    push @buf_allfiles, unpack("x3 A*", $file) . "\n";
+                }
+               last;
+           }
+
+           if (/_\(QUOTEDTEXT/)
+           {
+                if (defined isNotValidMissing (unpack("x3 A*", $file))) {
+                    ## Remove the first 3 chars and add newline
+                    push @buf_allfiles, unpack("x3 A*", $file) . "\n";
+                }
+               last;
+           }
+       }
+       close FILE;
+    }
+
+    foreach my $file (@buf_i18n_xml) 
+    {
+       open FILE, "<$file";
+       
+       while (<FILE>) 
+       {
+           # FIXME: share the pattern matching code with intltool-extract
+           if (/\s_[-A-Za-z0-9._:]+\s*=\s*\"([^"]+)\"/ || /<_[^>]+>/ || 
/translatable=\"yes\"/)
+           {
+                if (defined isNotValidMissing (unpack("x3 A*", $file))) {
+                    push @buf_allfiles, unpack("x3 A*", $file) . "\n";
+                }
+               last;
+           }
+       }
+       close FILE;
+    }
+
+    foreach my $file (@buf_i18n_ini)
+    {
+       open FILE, "<$file";
+       while (<FILE>) 
+       {
+           if (/_(.*)=/)
+           {
+                if (defined isNotValidMissing (unpack("x3 A*", $file))) {
+                    push @buf_allfiles, unpack("x3 A*", $file) . "\n";
+                }
+               last;
+           }
+       }
+       close FILE;
+    }
+
+    foreach my $file (@buf_i18n_xml_unmarked)
+    {
+        if (defined isNotValidMissing (unpack("x3 A*", $file))) {
+            push @buf_allfiles, unpack("x3 A*", $file) . "\n";
+        }
+    }
+
+
+    @buf_allfiles_sorted = sort (@buf_allfiles);
+    @buf_potfiles_sorted = sort (@buf_potfiles);
+
+    my %in2;
+    foreach (@buf_potfiles_sorted) 
+    {
+       $in2{$_} = 1;
+    }
+
+    my @result;
+
+    foreach (@buf_allfiles_sorted)
+    {
+       if (!exists($in2{$_}))
+       {
+           push @result, $_
+       }
+    }
+
+    my @buf_potfiles_notexist;
+
+    foreach (@buf_potfiles_sorted)
+    {
+       chomp (my $dummy = $_);
+       if ("$dummy" ne "" and ! -f "../$dummy")
+       {
+           push @buf_potfiles_notexist, $_;
+       }
+    }
+
+    ## Save file with information about the files missing
+    ## if any, and give information about this procedure.
+    if (@result + @buf_potfiles_notexist > 0)
+    {
+       if (@result) 
+       {
+           print "\n" if $VERBOSE;
+           unlink "missing";
+           open OUT, ">missing";
+           print OUT @result;
+           close OUT;
+           warn "\e[1mThe following files contain translations and are 
currently not in use. Please\e[0m\n".
+                "\e[1mconsider adding these to the POTFILES.in file, located 
in the po/ directory.\e[0m\n\n";
+           print STDERR @result, "\n";
+           warn "If some of these files are left out on purpose then please 
add them to\n".
+                "POTFILES.skip instead of POTFILES.in. A file 
\e[1m'missing'\e[0m containing this list\n".
+                "of left out files has been written in the current 
directory.\n";
+       }
+       if (@buf_potfiles_notexist)
+       {
+           unlink "notexist";
+           open OUT, ">notexist";
+           print OUT @buf_potfiles_notexist;
+           close OUT;
+           warn "\n" if ($VERBOSE or @result);
+           warn "\e[1mThe following files do not exist anymore:\e[0m\n\n";
+           warn @buf_potfiles_notexist, "\n";
+           warn "Please remove them from POTFILES.in or POTFILES.skip. A file 
\e[1m'notexist'\e[0m\n".
+                "containing this list of absent files has been written in the 
current directory.\n";
+       }
+    }
+
+    ## If there is nothing to complain about, notify the user
+    else {
+       print "\nAll files containing translations are present in 
POTFILES.in.\n" if $VERBOSE;
+    }
+}
+
+sub Console_WriteError_InvalidOption
+{
+    ## Handle invalid arguments
+    print STDERR "Try `${PROGRAM} --help' for more information.\n";
+    exit 1;
+}
+
+sub GenerateHeaders
+{
+    my $EXTRACT = "@INTLTOOL_EXTRACT@";
+    chomp $EXTRACT;
+
+    $EXTRACT = $ENV{"INTLTOOL_EXTRACT"} if $ENV{"INTLTOOL_EXTRACT"};
+
+    ## Generate the .h header files, so we can allow glade and
+    ## xml translation support
+    if (! -x "$EXTRACT")
+    {
+       print STDERR "\n *** The intltool-extract script wasn't found!"
+            ."\n *** Without it, intltool-update can not generate files.\n";
+       exit;
+    }
+    else
+    {
+       open (FILE, $POTFILES_in) or die "$PROGRAM: POTFILES.in not found.\n";
+       
+       while (<FILE>) 
+       {
+          chomp;
+          next if /^\[\s*encoding/;
+
+          ## Find xml files in POTFILES.in and generate the
+          ## files with help from the extract script
+
+          my $gettext_type= &POFile_DetermineType ($1);
+
+          if (/\.($xml_support|$ini_support)$/ || /^\[/)
+          {
+              s/^\[[^\[].*]\s*//;
+
+              my $filename = "../$_";
+
+              if ($VERBOSE)
+              {
+                  system ($EXTRACT, "--update", "--srcdir=$SRCDIR",
+                          "--type=$gettext_type", $filename);
+              } 
+              else 
+              {
+                  system ($EXTRACT, "--update", "--type=$gettext_type", 
+                          "--srcdir=$SRCDIR", "--quiet", $filename);
+              }
+          }
+       }
+       close FILE;
+   }
+}
+
+#
+# Generate .pot file from POTFILES.in
+#
+sub GeneratePOTemplate
+{
+    my $XGETTEXT = $ENV{"XGETTEXT"} || "@INTLTOOL_XGETTEXT@";
+    my $XGETTEXT_ARGS = $ENV{"XGETTEXT_ARGS"} || '';
+    chomp $XGETTEXT;
+
+    if (! -x $XGETTEXT)
+    {
+       print STDERR " *** xgettext is not found on this system!\n".
+                    " *** Without it, intltool-update can not extract 
strings.\n";
+       exit;
+    }
+
+    print "Building $MODULE.pot...\n" if $VERBOSE;
+
+    open INFILE, $POTFILES_in;
+    unlink "POTFILES.in.temp";
+    open OUTFILE, ">POTFILES.in.temp" or die("Cannot open POTFILES.in.temp for 
writing");
+
+    my $gettext_support_nonascii = 0;
+
+    # checks for GNU gettext >= 0.12
+    my $dummy = `$XGETTEXT --version --from-code=UTF-8 >$devnull 2>$devnull`;
+    if ($? == 0)
+    {
+       $gettext_support_nonascii = 1;
+    }
+    else
+    {
+       # urge everybody to upgrade gettext
+       print STDERR "WARNING: This version of gettext does not support 
extracting non-ASCII\n".
+                    "         strings. That means you should install a version 
of gettext\n".
+                    "         that supports non-ASCII strings (such as GNU 
gettext >= 0.12),\n".
+                    "         or have to let non-ASCII strings untranslated. 
(If there is any)\n";
+    }
+
+    my $encoding = "ASCII";
+    my $forced_gettext_code;
+    my @temp_headers;
+    my $encoding_problem_is_reported = 0;
+
+    while (<INFILE>) 
+    {
+       next if (/^#/ or /^\s*$/);
+
+       chomp;
+
+       my $gettext_code;
+
+       if (/^\[\s*encoding:\s*(.*)\s*\]/)
+       {
+           $forced_gettext_code=$1;
+       }
+       elsif (/\.($xml_support|$ini_support)$/ || /^\[/)
+       {
+           s/^\[.*]\s*//;
+            print OUTFILE "../$_.h\n";
+           push @temp_headers, "../$_.h";
+           $gettext_code = &TextFile_DetermineEncoding ("../$_.h") if 
($gettext_support_nonascii and not defined $forced_gettext_code);
+       } 
+       else 
+       {
+           if ($SRCDIR eq ".") {
+               print OUTFILE "../$_\n";
+           } else {
+               print OUTFILE "$SRCDIR/../$_\n";
+           }
+           $gettext_code = &TextFile_DetermineEncoding ("../$_") if 
($gettext_support_nonascii and not defined $forced_gettext_code);
+       }
+
+       next if (! $gettext_support_nonascii);
+
+       if (defined $forced_gettext_code)
+       {
+           $encoding=$forced_gettext_code;
+       }
+       elsif (defined $gettext_code and "$encoding" ne "$gettext_code")
+       {
+           if ($encoding eq "ASCII")
+           {
+               $encoding=$gettext_code;
+           }
+           elsif ($gettext_code ne "ASCII")
+           {
+               # Only report once because the message is quite long
+               if (! $encoding_problem_is_reported)
+               {
+                   print STDERR "WARNING: You should use the same file 
encoding for all your project files,\n".
+                                "         but $PROGRAM thinks that most of the 
source files are in\n".
+                                "         $encoding encoding, while \"$_\" is 
(likely) in\n".
+                                "         $gettext_code encoding. If you are 
sure that all translatable strings\n".
+                                "         are in same encoding (say UTF-8), 
please \e[1m*prepend*\e[0m the following\n".
+                                "         line to POTFILES.in:\n\n".
+                                "                 [encoding: UTF-8]\n\n".
+                                "         and make sure that configure.in/ac 
checks for $PACKAGE >= 0.27 .\n".
+                                "(such warning message will only be reported 
once.)\n";
+                   $encoding_problem_is_reported = 1;
+               }
+           }
+       }
+    }
+
+    close OUTFILE;
+    close INFILE;
+
+    unlink "$MODULE.pot";
+    my @xgettext_argument=("$XGETTEXT",
+                          "--add-comments",
+                          "--directory\=\.",
+                          "--output\=$MODULE\.pot",
+                          "--files-from\=\.\/POTFILES\.in\.temp");
+    my $XGETTEXT_KEYWORDS = &FindPOTKeywords;
+    push @xgettext_argument, $XGETTEXT_KEYWORDS;
+    my $MSGID_BUGS_ADDRESS = &FindMakevarsBugAddress;
+    push @xgettext_argument, "--msgid-bugs-address\=$MSGID_BUGS_ADDRESS" if 
$MSGID_BUGS_ADDRESS;
+    push @xgettext_argument, "--from-code\=$encoding" if 
($gettext_support_nonascii);
+    push @xgettext_argument, $XGETTEXT_ARGS if $XGETTEXT_ARGS;
+    my $xgettext_command = join ' ', @xgettext_argument;
+
+    # intercept xgettext error message
+    print "Running $xgettext_command\n" if $VERBOSE;
+    my $xgettext_error_msg = `$xgettext_command 2>\&1`;
+    my $command_failed = $?;
+
+    unlink "POTFILES.in.temp";
+
+    print "Removing generated header (.h) files..." if $VERBOSE;
+    unlink foreach (@temp_headers);
+    print "done.\n" if $VERBOSE;
+
+    if (! $command_failed)
+    {
+       if (! -e "$MODULE.pot")
+       {
+           print "None of the files in POTFILES.in contain strings marked for 
translation.\n" if $VERBOSE;
+       }
+       else
+       {
+           print "Wrote $MODULE.pot\n" if $VERBOSE;
+       }
+    }
+    else
+    {
+       if ($xgettext_error_msg =~ /--from-code/)
+       {
+           # replace non-ASCII error message with a more useful one.
+           print STDERR "ERROR: xgettext failed to generate PO template file 
because there is non-ASCII\n".
+                        "       string marked for translation. Please make 
sure that all strings marked\n".
+                        "       for translation are in uniform encoding (say 
UTF-8), then \e[1m*prepend*\e[0m the\n".
+                        "       following line to POTFILES.in and rerun 
$PROGRAM:\n\n".
+                        "           [encoding: UTF-8]\n\n";
+       }
+       else
+       {
+           print STDERR "$xgettext_error_msg";
+           if (-e "$MODULE.pot")
+           {
+               # is this possible?
+               print STDERR "ERROR: xgettext failed but still managed to 
generate PO template file.\n".
+                            "       Please consult error message above if 
there is any.\n";
+           }
+           else
+           {
+               print STDERR "ERROR: xgettext failed to generate PO template 
file. Please consult\n".
+                            "       error message above if there is any.\n";
+           }
+       }
+       exit (1);
+    }
+}
+
+sub POFile_Update
+{
+    -f "$MODULE.pot" or die "$PROGRAM: $MODULE.pot does not exist.\n";
+
+    my $MSGMERGE = $ENV{"MSGMERGE"} || "@INTLTOOL_MSGMERGE@";
+    my ($lang, $outfile) = @_;
+
+    print "Merging $SRCDIR/$lang.po with $MODULE.pot..." if $VERBOSE;
+
+    my $infile = "$SRCDIR/$lang.po";
+    $outfile = "$SRCDIR/$lang.po" if ($outfile eq "");
+
+    # I think msgmerge won't overwrite old file if merge is not successful
+    system ("$MSGMERGE", "-o", $outfile, $infile, "$MODULE.pot");
+}
+
+sub Console_WriteError_NotExisting
+{
+    my ($file) = @_;
+
+    ## Report error if supplied language file is non-existing
+    print STDERR "$PROGRAM: $file does not exist!\n";
+    print STDERR "Try '$PROGRAM --help' for more information.\n";
+    exit;
+}
+
+sub GatherPOFiles
+{
+    my @po_files = glob ("./*.po");
+
+    @languages = map (&POFile_GetLanguage, @po_files);
+
+    foreach my $lang (@languages) 
+    {
+       $po_files_by_lang{$lang} = shift (@po_files);
+    }
+}
+
+sub POFile_GetLanguage ($)
+{
+    s/^(.*\/)?(.+)\.po$/$2/;
+    return $_;
+}
+
+sub Console_Write_TranslationStatus
+{
+    my ($lang, $output_file) = @_;
+    my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
+
+    $output_file = "$SRCDIR/$lang.po" if ($output_file eq "");
+
+    system ("$MSGFMT", "-o", "$devnull", "--verbose", $output_file);
+}
+
+sub Console_Write_CoverageReport
+{
+    my $MSGFMT = $ENV{"MSGFMT"} || "@INTLTOOL_MSGFMT@";
+
+    &GatherPOFiles;
+
+    foreach my $lang (@languages) 
+    {
+       print "$lang: ";
+       &POFile_Update ($lang, "");
+    }
+
+    print "\n\n * Current translation support in $MODULE \n\n";
+
+    foreach my $lang (@languages)
+    {
+       print "$lang: ";
+       system ("$MSGFMT", "-o", "$devnull", "--verbose", "$SRCDIR/$lang.po");
+    }
+}
+
+sub SubstituteVariable
+{
+    my ($str) = @_;
+    
+    # always need to rewind file whenever it has been accessed
+    seek (CONF, 0, 0);
+
+    # cache each variable. varhash is global to we can add
+    # variables elsewhere.
+    while (<CONF>)
+    {
+       if (/^(\w+)=(.*)$/)
+       {
+           ($varhash{$1} = $2) =~  s/^["'](.*)["']$/$1/;
+       }
+    }
+    
+    if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
+    {
+       my $rest = $3;
+       my $untouched = $1;
+       my $sub = "";
+        # Ignore recursive definitions of variables
+        $sub = $varhash{$2} if defined $varhash{$2} and $varhash{$2} !~ 
/\${?$2}?/;
+
+       return SubstituteVariable ("$untouched$sub$rest");
+    }
+    
+    # We're using Perl backticks ` and "echo -n" here in order to 
+    # expand any shell escapes (such as backticks themselves) in every variable
+    return echo_n ($str);
+}
+
+sub CONF_Handle_Open
+{
+    my $base_dirname = getcwd();
+    $base_dirname =~ [EMAIL PROTECTED]/@@;
+
+    my ($conf_in, $src_dir);
+
+    if ($base_dirname =~ /^po(-.+)?$/) 
+    {
+       if (-f "Makevars") 
+       {
+           my $makefile_source;
+
+           local (*IN);
+           open (IN, "<Makevars") || die "can't open Makevars: $!";
+
+           while (<IN>) 
+           {
+               if (/^top_builddir[ \t]*=/) 
+               {
+                   $src_dir = $_;
+                   $src_dir =~ s/^top_builddir[ \t]*=[ \t]*([^ \t\n\r]*)/$1/;
+
+                   chomp $src_dir;
+                    if (-f "$src_dir" . "/configure.ac") {
+                        $conf_in = "$src_dir" . "/configure.ac" . "\n";
+                    } else {
+                        $conf_in = "$src_dir" . "/configure.in" . "\n";
+                    }
+                   last;
+               }
+           }
+           close IN;
+
+           $conf_in || die "Cannot find top_builddir in Makevars.";
+       }
+       elsif (-f "../configure.ac") 
+       {
+           $conf_in = "../configure.ac";
+       } 
+       elsif (-f "../configure.in") 
+       {
+           $conf_in = "../configure.in";
+       } 
+       else 
+       {
+           my $makefile_source;
+
+           local (*IN);
+           open (IN, "<Makefile") || return;
+
+           while (<IN>) 
+           {
+               if (/^top_srcdir[ \t]*=/) 
+               {
+                   $src_dir = $_;                  
+                   $src_dir =~ s/^top_srcdir[ \t]*=[ \t]*([^ \t\n\r]*)/$1/;
+
+                   chomp $src_dir;
+                   $conf_in = "$src_dir" . "/configure.in" . "\n";
+
+                   last;
+               }
+           }
+           close IN;
+
+           $conf_in || die "Cannot find top_srcdir in Makefile.";
+       }
+
+       open (CONF, "<$conf_in");
+    }
+    else
+    {
+       print STDERR "$PROGRAM: Unable to proceed.\n" .
+                    "Make sure to run this script inside the po directory.\n";
+       exit;
+    }
+}
+
+sub FindPackageName
+{
+    my $version;
+    my $domain = &FindMakevarsDomain;
+    my $name = $domain || "untitled";
+
+    &CONF_Handle_Open;
+
+    my $conf_source; {
+       local (*IN);
+       open (IN, "<&CONF") || return $name;
+       seek (IN, 0, 0);
+       local $/; # slurp mode
+       $conf_source = <IN>;
+       close IN;
+    }
+
+    # priority for getting package name:
+    # 1. GETTEXT_PACKAGE
+    # 2. first argument of AC_INIT (with >= 2 arguments)
+    # 3. first argument of AM_INIT_AUTOMAKE (with >= 2 argument)
+
+    # /^AM_INIT_AUTOMAKE\([\s\[]*([^,\)\s\]]+)/m 
+    # the \s makes this not work, why?
+    if ($conf_source =~ /^AM_INIT_AUTOMAKE\(([^,\)]+),([^,\)]+)/m)
+    {
+       ($name, $version) = ($1, $2);
+       $name    =~ s/[\[\]\s]//g;
+       $version =~ s/[\[\]\s]//g;
+       $varhash{"PACKAGE_NAME"} = $name if (not $name =~ 
/\${?AC_PACKAGE_NAME}?/);
+       $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+       $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ 
/\${?AC_PACKAGE_VERSION}?/);
+       $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+    }
+    
+    if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)/m) 
+    {
+       ($name, $version) = ($1, $2);
+       $name    =~ s/[\[\]\s]//g;
+       $version =~ s/[\[\]\s]//g;
+       $varhash{"PACKAGE_NAME"} = $name if (not $name =~ 
/\${?AC_PACKAGE_NAME}?/);
+       $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+       $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ 
/\${?AC_PACKAGE_VERSION}?/);
+       $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+    }
+
+    # \s makes this not work, why?
+    $name = $1 if $conf_source =~ /^GETTEXT_PACKAGE=\[?([^\n\]]+)/m;
+    
+    # m4 macros AC_PACKAGE_NAME, AC_PACKAGE_VERSION etc. have same value
+    # as corresponding $PACKAGE_NAME, $PACKAGE_VERSION etc. shell variables.
+    $name =~ s/\bAC_PACKAGE_/\$PACKAGE_/g;
+
+    $name = $domain if $domain;
+
+    $name = SubstituteVariable ($name);
+    $name =~ s/^["'](.*)["']$/$1/;
+
+    return $name if $name;
+}
+
+
+sub FindPOTKeywords
+{
+
+    my $keywords = "--keyword\=\_ --keyword\=N\_ --keyword\=U\_ 
--keyword\=Q\_";
+    my $varname = "XGETTEXT_OPTIONS";
+    my $make_source; {
+       local (*IN);
+       open (IN, "<Makevars") || (open(IN, "<Makefile.in.in") && ($varname = 
"XGETTEXT_KEYWORDS")) || return $keywords;
+       seek (IN, 0, 0);
+       local $/; # slurp mode
+       $make_source = <IN>;
+       close IN;
+    }
+
+    $keywords = $1 if $make_source =~ /^$varname[ ]*=\[?([^\n\]]+)/m;
+    
+    return $keywords;
+}
+
+sub FindMakevarsDomain
+{
+
+    my $domain = "";
+    my $makevars_source; { 
+       local (*IN);
+       open (IN, "<Makevars") || return $domain;
+       seek (IN, 0, 0);
+       local $/; # slurp mode
+       $makevars_source = <IN>;
+       close IN;
+    }
+
+    $domain = $1 if $makevars_source =~ /^DOMAIN[ ]*=\[?([^\n\]\$]+)/m;
+    $domain =~ s/^\s+//;
+    $domain =~ s/\s+$//;
+    
+    return $domain;
+}
+
+sub FindMakevarsBugAddress
+{
+
+    my $address = "";
+    my $makevars_source; { 
+       local (*IN);
+       open (IN, "<Makevars") || return undef;
+       seek (IN, 0, 0);
+       local $/; # slurp mode
+       $makevars_source = <IN>;
+       close IN;
+    }
+
+    $address = $1 if $makevars_source =~ /^MSGID_BUGS_ADDRESS[ 
]*=\[?([^\n\]\$]+)/m;
+    $address =~ s/^\s+//;
+    $address =~ s/\s+$//;
+    
+    return $address;
+}

Added: trunk/oe/packages/openmoko-pim/files/stock_contact.png
===================================================================
(Binary files differ)


Property changes on: trunk/oe/packages/openmoko-pim/files/stock_contact.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/oe/packages/openmoko-pim/files/stock_person.png
===================================================================
(Binary files differ)


Property changes on: trunk/oe/packages/openmoko-pim/files/stock_person.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to