[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force XFree86 SVN commit: r1695 - in trunk/debian: . po scripts



Author: branden
Date: 2004-07-29 02:22:25 -0500 (Thu, 29 Jul 2004)
New Revision: 1695

Added:
   trunk/debian/po/pothead.in
   trunk/debian/scripts/debconf-updatepo
Modified:
   trunk/debian/CHANGESETS
   trunk/debian/README
   trunk/debian/changelog
   trunk/debian/rules
Log:
Provide local, hacked version of debconf-updatepo (in debian/scripts) that
doesn't destroy the comment and header block of debian/po/templates.pot.
Add "pristine" comment and header file in debian/po, add debian/rules
targets to handle PO and POT file updates using our local script, and
document the recommended procedure in debian/README.  Hopefully the real
debconf-updatepo will be fixed soon.


Modified: trunk/debian/CHANGESETS
===================================================================
--- trunk/debian/CHANGESETS	2004-07-28 22:09:30 UTC (rev 1694)
+++ trunk/debian/CHANGESETS	2004-07-29 07:22:25 UTC (rev 1695)
@@ -172,4 +172,12 @@
 Always link glxinfo with g++ (patch 031).
     1693
 
+Provide local, hacked version of debconf-updatepo (in debian/scripts) that
+doesn't destroy the comment and header block of debian/po/templates.pot.
+Add "pristine" comment and header file in debian/po, add debian/rules
+targets to handle PO and POT file updates using our local script, and
+document the recommended procedure in debian/README.  Hopefully the real
+debconf-updatepo will be fixed soon.
+    1695
+
 vim:set ai et sts=4 sw=4 tw=80:

Modified: trunk/debian/README
===================================================================
--- trunk/debian/README	2004-07-28 22:09:30 UTC (rev 1694)
+++ trunk/debian/README	2004-07-29 07:22:25 UTC (rev 1695)
@@ -123,4 +123,17 @@
   validate".  It is highly recommended that this be done before making an
   official package release.
 
+po:
+  This directory contains translations of debconf templates.  See the
+  po-debconf(7) manpage for more information.
+
+  NOTE: At present, this package needs to use its own modified version of
+  debconf-updatepo, which is kept in debian/scripts.  The "updatepo" target in
+  the debian/rules file will take care of running this modified version for you.
+
+  WARNING: The "updatepo" target should be invoked any time the
+  debian/*.templates files change or a debian/po/*.po translation file is
+  updated.  If it is not, dh_installdebconf will run the stock debconf-updatepo
+  script in a way which will clobber important data.
+
 vim:set ai et sw=2 sts=2 tw=80:

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2004-07-28 22:09:30 UTC (rev 1694)
+++ trunk/debian/changelog	2004-07-29 07:22:25 UTC (rev 1695)
@@ -119,6 +119,13 @@
     10646-1-encoded fonts less strongly.  Add zh_CN.UTF-8 XLC_LOCALE file.
     Update MANIFEST and .install files accordingly.  (Closes: #255701)
 
+  * Provide local, hacked version of debconf-updatepo (in debian/scripts) that
+    doesn't destroy the comment and header block of debian/po/templates.pot.
+    Add "pristine" comment and header file in debian/po, add debian/rules
+    targets to handle PO and POT file updates using our local script, and
+    document the recommended procedure in debian/README.  Hopefully the real
+    debconf-updatepo will be fixed soon.
+
   Changes by Fabio M. Di Nitto and Branden Robinson:
 
   * Support building only the parts of the source tree needed by
@@ -151,7 +158,7 @@
 
   * Get glxinfo to link properly with g++ (instead of adding -lstdc++).
 
- -- Branden Robinson <branden@debian.org>  Wed, 21 Jul 2004 19:27:57 -0500
+ -- Branden Robinson <branden@debian.org>  Thu, 29 Jul 2004 02:17:09 -0500
 
 xfree86 (4.3.0.dfsg.1-6) unstable; urgency=low
 

Added: trunk/debian/po/pothead.in
===================================================================
--- trunk/debian/po/pothead.in	2004-07-28 22:09:30 UTC (rev 1694)
+++ trunk/debian/po/pothead.in	2004-07-29 07:22:25 UTC (rev 1695)
@@ -0,0 +1,30 @@
+# debconf templates for xfree86 package
+#
+# $Id$
+#
+# Copyright:
+# Branden Robinson, 2000--2004
+#
+# This file is distributed under the same license as the xfree86 package.
+# Please see debian/copyright.
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf is available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: SOURCE_VERSION\n"
+"Report-Msgid-Bugs-To: debian-x@lists.debian.org\n"
+"POT-Creation-Date: DATE\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"


Property changes on: trunk/debian/po/pothead.in
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/debian/rules
===================================================================
--- trunk/debian/rules	2004-07-28 22:09:30 UTC (rev 1694)
+++ trunk/debian/rules	2004-07-29 07:22:25 UTC (rev 1695)
@@ -141,7 +141,8 @@
 	rm -rf imports debian/local/xlibmesa-drm-source/modules
 	dh_clean debian/local/xserver-wrapper debian/local/FAQ.gz \
 	         debian/local/xterm.faq.gz debian/shlibs.local \
-	         debian/MANIFEST.$(ARCH) debian/MANIFEST.$(ARCH).new
+	         debian/MANIFEST.$(ARCH) debian/MANIFEST.$(ARCH).new \
+	         debian/po/pothead
 
 # All 'important' targets have 2 lines.  The one that is run by
 # dpkg-buildpackage or the user, and the one that does the actual work.  This
@@ -189,6 +190,16 @@
 debian/shlibs.local:
 	cat debian/*.shlibs > $@
 
+# Generate the debconf templates POT file header.
+debian/po/pothead: debian/po/pothead.in
+	sed -e 's/SOURCE_VERSION/$(SOURCE_VERSION)/' \
+	  -e 's/DATE/$(shell date "+%Y-%m-%d %H:%M:%S%z"/)' \
+	  <debian/po/pothead.in >$@
+
+# Update POT and PO files.
+updatepo: debian/po/pothead
+	debian/scripts/debconf-updatepo --pot-header=pothead --verbose
+
 configure: $(STAMP_DIR)/configure
 $(STAMP_DIR)/configure: $(patched)
 	dh_testdir
@@ -594,6 +605,7 @@
 
 .PHONY: default
 .PHONY: genscripts cleanscripts
+.PHONY: updatepo
 .PHONY: patch-audit
 .PHONY: clean configure install
 .PHONY: build build-arch-only build-all real-build

Added: trunk/debian/scripts/debconf-updatepo
===================================================================
--- trunk/debian/scripts/debconf-updatepo	2004-07-28 22:09:30 UTC (rev 1694)
+++ trunk/debian/scripts/debconf-updatepo	2004-07-29 07:22:25 UTC (rev 1695)
@@ -0,0 +1,197 @@
+#!/bin/sh
+
+# This is a replacement for the real debconf-updatepo, which unfortunately
+# mangles our debian/po/templates.pot file beyond recognition.
+
+#  Copyright (C) 2002-2004  Denis Barbier <barbier@debian.org>
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or (at
+#  your option) any later version.
+#
+#  This program 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.,
+#  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Branden Robinson, 2004-07-28
+
+PROGNAME=${0##*/}
+
+usage() {
+        cat <<EOF
+Usage: $PROGNAME [OPTIONS]
+Options:
+  -h,  --help          display this help message
+  -v,  --verbose       enable verbose mode
+  --podir=DIR          specify PO directory (searched by default in
+                       debian/po, ./po and ../po)
+  --pot-header=FILE    replace beginning of generated POT file with FILE
+                       (relative to PO directory)
+  --skip-pot           skip POT file; update only PO files
+EOF
+}
+
+trace () {
+        if [ -n "$verbose" ]
+        then
+                echo "$PROGNAME: $*" >&2
+        fi
+}
+
+error () {
+        echo "$PROGNAME: error: $*" >&2
+        exit 1
+}
+
+die () {
+        error "$*"
+        exit 1
+}
+
+repair_header () {
+        if [ $# -ne 2 ]
+        then
+                die "repair_header() needs 2 arguments; got $#"
+        fi
+
+        trace "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX: repairing header of $2"
+        ( cat "$1"; sed -n '/^$/,$p' "$2" ) >"$2.new" && mv "$2.new" "$2"
+}
+
+: ${PODEBCONF_LIB=/usr/share/intltool-debian}
+INTLTOOL_EXTRACT=${PODEBCONF_LIB}/intltool-extract
+export INTLTOOL_EXTRACT
+
+#  See intltool-extract
+INTLTOOL_DEBIAN_TYPE=po-debconf
+export INTLTOOL_DEBIAN_TYPE
+
+# Prevent automatic conversion to UTF-8 by Perl.
+unset LANGUAGE LANG LC_ALL LC_CTYPE
+
+help=
+verbose=
+podir=
+pot_header=
+skip_pot=
+
+for option
+do
+        if [ -n "$prev" ]; then
+                eval "$prev=\$option"
+                prev=
+                shift
+                continue
+        fi
+        optarg=$(expr "$option" : '[^=]*=\(.*\)')
+        case $option in
+            -h | --h | --help )
+                help=1 ;;
+            -v | --v | --verbose )
+                verbose=--verbose ;;
+            --podir )
+                prev=podir ;;
+            --podir=* )
+                podir="$optarg" ;;
+            --pot-header=* )
+                pot_header="$optarg" ;;
+            --skip-pot )
+                skip_pot=1 ;;
+            -* )
+                error "unknown option $option"
+                usage >&2
+                exit 1 ;;
+            * ) break ;;
+        esac
+        shift
+done
+
+if [ -n "$help" ]
+then
+        usage
+        exit 0
+fi
+
+if [ -z "$podir" ]
+then
+        for d in debian/po po ../po
+        do
+                if [ -d $d ]
+                then
+                        podir=$d
+                        break
+                fi
+        done
+fi
+
+if [ -z "$podir" ]
+then
+        die "No PO directory found; use --podir to specify location"
+fi
+
+if [ ! -d "$podir" ]
+then
+        die "PO directory $podir is not a directory"
+fi
+
+if [ ! -f "$podir/POTFILES.in" ]
+then
+        die "$podir/POTFILES.in does not exist"
+fi
+
+trace "PO directory is $podir"
+
+cd "$podir"
+
+if [ -f debian.pot ]
+then
+        domain=debian
+else
+        domain=templates
+fi
+
+if [ -z "$skip_pot" ]; then
+        cmd="\"$PODEBCONF_LIB/intltool-update\" \"$verbose\" --gettext-package=\"$domain\" --pot"
+        eval trace "$cmd"
+        if ! eval $cmd
+        then
+                die "intltool-update failed"
+        fi
+
+        # Repair the header of the POT file if necessary.
+        trace "\$pot_header is $pot_header"
+        if [ -n "$pot_header" ]
+        then
+                repair_header "$pot_header" "$domain.pot"
+        fi
+else
+        trace "skipping update of $domain.pot"
+fi
+
+for lang in *.po
+do
+        if [ "$lang" = "*.po" ]
+        then
+                break
+        fi
+
+        if sed -e '1,/^msgid/d' -e ':t /^msgstr/,${N;/\nmsgid/q;bt;};' "$lang" \
+          | grep charset=CHARSET >/dev/null 2>&1; then
+                echo "$podir/$lang: missing charset; file skipped" >&2
+                continue
+        fi
+
+        lang=${lang%.po}
+        "$PODEBCONF_LIB/intltool-update" --dist $verbose --gettext-package=$domain $lang || exit 1
+done
+
+rm -f messages.mo 2>/dev/null
+
+# vim:set ai et sts=8 sw=8 tw=80:


Property changes on: trunk/debian/scripts/debconf-updatepo
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Id



Reply to: