From 4ce9088a940fda41f2f38a8c9db09fa7e694900f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 7 Mar 2008 19:44:37 +0000 Subject: [PATCH] Add NLS website creation code --- wwwsrc/GNUmakefile | 5 + wwwsrc/contributing.mdwn | 53 +++++++++++ wwwsrc/howto.mdwn | 57 ++++++++++++ wwwsrc/ikiwiki.setup | 158 ++++++++++++++++++++++++++++++++ wwwsrc/index.mdwn | 40 ++++++++ wwwsrc/local.css | 31 +++++++ wwwsrc/sidebar.mdwn | 5 + wwwsrc/status.mdwn.m4 | 25 +++++ wwwtools/nls-status-table | 182 +++++++++++++++++++++++++++++++++++++ wwwtools/pg-make-conflicts | 22 +++++ wwwtools/pg-make-po | 56 ++++++++++++ wwwtools/update-nls-www | 115 +++++++++++++++++++++++ 12 files changed, 749 insertions(+) create mode 100644 wwwsrc/GNUmakefile create mode 100644 wwwsrc/contributing.mdwn create mode 100644 wwwsrc/howto.mdwn create mode 100644 wwwsrc/ikiwiki.setup create mode 100644 wwwsrc/index.mdwn create mode 100644 wwwsrc/local.css create mode 100644 wwwsrc/sidebar.mdwn create mode 100644 wwwsrc/status.mdwn.m4 create mode 100755 wwwtools/nls-status-table create mode 100755 wwwtools/pg-make-conflicts create mode 100755 wwwtools/pg-make-po create mode 100755 wwwtools/update-nls-www diff --git a/wwwsrc/GNUmakefile b/wwwsrc/GNUmakefile new file mode 100644 index 0000000..77bc666 --- /dev/null +++ b/wwwsrc/GNUmakefile @@ -0,0 +1,5 @@ +all: status.mdwn + ikiwiki --setup ikiwiki.setup + +%: %.m4 + m4 -P $< >$@ diff --git a/wwwsrc/contributing.mdwn b/wwwsrc/contributing.mdwn new file mode 100644 index 0000000..58a45f7 --- /dev/null +++ b/wwwsrc/contributing.mdwn @@ -0,0 +1,53 @@ +# Contributing + +This page explains how you can contribute to the PostgreSQL +translation effort. + +## Newcomers + +If you are new, please check on the [[status]] page whether your +language is already being worked on. If so, look into the translation +files near the top to find out where to contact the last translator or +the translation team. Please contact them about contributing. If the +last translator cannot be reached or if it has been a long time since +the last update to the file, you can just take over. But remember +that communicating first avoids duplicate work later. + +In any case, read the [[Howto]] about how to go about filling in the +translations. + +To submit new or updated translation files, submit them to the [Patch +Tracker](http://pgfoundry.org/tracker/?atid=320&group_id=1000064). +One of the registered developers will install your file into the +source code repository. Make sure you specify which branch your file +is for (see below about branches). + +## Registered Developers + +People who have contributed for a while will be registered as +developers and are able to commit their files into the source code +repository by themselves. + +## Release Management + +You can work in several branches. There is a current branch and +several back branches. + +The back branches belong to past releases of PostgreSQL. It is +usually a good idea to finish translations for the recent back +branches first, because those are the ones that people currently use. +When a new back branch release is made (something like 8.0.5 or +8.1.1), updated translations will be included. + +By contrast, the current branch is often under heavy development, +meaning that error messages change, and translation work done today +might become obsolete tomorrow. Therefore, translations in the +current branch should normally only be done during the beta phase or +after a release if no new branch for the development release has been +made yet. (The [[status]] page informs about the status of the +branches.) + +Information about release schedules and so on will also be posted to +the mailing list (see +[mailing lists](http://pgfoundry.org/mail/?group_id=1000064)), which +you are encouraged to read. diff --git a/wwwsrc/howto.mdwn b/wwwsrc/howto.mdwn new file mode 100644 index 0000000..5027a48 --- /dev/null +++ b/wwwsrc/howto.mdwn @@ -0,0 +1,57 @@ +# Howto + +Here is how to get set up for translation work. It is assumed here +that you already know your way around gettext message catalogs. If +you're new to this, read the chapter on NLS in the PostgreSQL +Documentation. + +## Translating + +1. To continue an existing translation, download a new PO file by + following the links in the [[status]] tables. Fill in the file as + much as you want. + +2. To start a new translation, download a POT file by clicking on one + of the catalog names in the left column of the [[status]] tables. + First, fill in all the fields in the header and remove the fuzzy + flag. Particularly, the character set information is very + important and must not be left out! Then fill in the rest of the + file as much as you want. + +3. When you are done editing, *check the file* for errors. If you're + using the Emacs PO mode, press V. From the command line, run + `msgfmt -o /dev/null -v -c yourfile.po`. Or copy the file into the + main PostgreSQL source tree and run `gmake maintainer-check-po`. + If you don't do this, your file might contain bugs that cause + program crashes, which will quickly disenchant users from + PostgreSQL and internationalized software in general. + +4. Submit the resulting file to the [Patch + Tracker](http://pgfoundry.org/tracker/?atid=320&group_id=1000064). + Please do not send patches; send the whole file. If you're + concerned that the file is too big, run it through a compression + program. Also, please send each PO file as a separate attachment; + no tar or zip archives please. Both of these rules make it easier + for the person installing your files. + +## Tools + +Please don't edit the PO files with a plain text editor. You're +making your life unnecessarily hard. There are several tools that +make editing PO files really easy. + +- GNU Emacs and XEmacs have PO editing modes. + +- [KBabel](http://i18n.kde.org/tools/kbabel/) is for those who like + KDE-based tools. + +- [poEdit](http://poedit.sourceforge.net) is yet another tool, which + even works under Windows. + +## Tips + +Check out the home of the [GNU Translation +Project](http://www.iro.umontreal.ca/contrib/po/HTML/). There you can +find out about mailing lists, web sites, and other resources for +translation efforts to your language. Some of these resources are +GNU-oriented, but others are not. diff --git a/wwwsrc/ikiwiki.setup b/wwwsrc/ikiwiki.setup new file mode 100644 index 0000000..bc50dad --- /dev/null +++ b/wwwsrc/ikiwiki.setup @@ -0,0 +1,158 @@ +#!/usr/bin/perl +# Configuration file for ikiwiki. +# Passing this to ikiwiki --setup will make ikiwiki generate wrappers and +# build the wiki. +# +# Remember to re-run ikiwiki --setup any time you edit this file. + +use IkiWiki::Setup::Standard { + wikiname => "PostgreSQL Translation Project", + #adminuser => ["yourname", ], + adminemail => 'peter_e@gmx.net', + + # Be sure to customise these.. + srcdir => ".", + destdir => "../wwwinstall", + + url => "http://pgtranslation.projects.postgresql.org/", + #cgiurl => "http://example.org/ikiwiki.cgi", + #templatedir => "/usr/share/ikiwiki/templates", + #underlaydir => "/usr/share/ikiwiki/basewiki", + + # Subversion stuff. + #rcs => "svn", + #historyurl => "http://svn.example.org/trunk/[[file]]", + #diffurl => "http://svn.example.org/trunk/[[file]]?root=wiki&r1=[[r1]]&r2=[[r2]]", + #svnpath => "trunk", + + # Git stuff. + #rcs => "git", + #historyurl => "http://git.example.org/gitweb.cgi?p=wiki.git;a=history;f=[[file]]", + #diffurl => "http://git.example.org/gitweb.cgi?p=wiki.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]", + #gitorigin_branch => "origin", + #gitmaster_branch => "master", + + # Tla stuff. + #rcs => "tla" + #historyurl => ??, + #diffurl => ??, + + # Mercurial stuff. + #rcs => "mercurial", + #historyurl => "http://localhost:8000/log/tip/[[file]]", # hg serve'd local repository + #diffurl => "http://localhost:8000/?fd=[[r2]];file=[[file]]", + + # Bazaar stuff. + #rcs => "bzr", + #historyurl => "", + #diffurl => "http://example.com/revision?start_revid=[[r2]]#[[file]]-s", # using loggerhead + + # Monotone stuff + #rcs => "monotone", + #mtnkey => "web\@machine.company.com", + #historyurl => "http://viewmtn.example.com/", + #diffurl => "http://viewmtn.example.com/revision/diff/[[r1]]/with/[[r2]]/[[file]]", + # Set if you want the wiki to sync on update and commit. + #mtnsync => 0, + # The path to your workspace (defaults to the srcdir itself) + # e.g. use if your srcdir is a subdirectory of the workspace. + #mtnrootdir => "path/to/root/of/workspace", + # This is a monotone lua hook file used by ikiwiki for + # inserting conflict markers. By default it will use + # mtnrootdir/_MTN/mergerc. This hook will be populated with + # default code the first time you use ikiwiki. You can + # change it to alter how conflict markers are inserted. + #mtnmergerc => "path/to/mergerc", + + wrappers => [ + #{ + # # The cgi wrapper. + # cgi => 1, + # wrapper => "/var/www/wiki/ikiwiki.cgi", + # wrappermode => "06755", + #}, + #{ + # # The svn post-commit wrapper. + # # Note that this will overwrite any existing + # # post-commit hook script, which may not be + # # what you want. + # wrapper => "/svn/wikirepo/hooks/post-commit", + # wrappermode => "04755", + # # Log to syslog since svn post-commit hooks + # # hide output and errors. + # syslog => 1, + #}, + #{ + # # The git post-update wrapper. + # # Note that this will overwrite any existing + # # post-update hook script, which may not be + # # what you want. + # wrapper => "/git/wiki.git/hooks/post-update", + # wrappermode => "06755", + #}, + ], + + # Default to generating rss feeds for blogs? + rss => 1, + # Default to generating atom feeds for blogs? + atom => 1, + # Allow generating feeds even if not generated by default? + #allowrss => 1, + #allowatom => 1, + # Urls to ping with XML-RPC when rss feeds are updated + #pingurl => [qw{http://rpc.technorati.com/rpc/ping}], + # Include discussion links on all pages? + discussion => 1, + # To exclude files matching a regexp from processing. This adds to + # the default exclude list. + exclude => qr/\.m4/, + # To change the extension used for generated html files. + #htmlext => 'htm', + # Time format (for strftime) + timeformat => '%F %T', + # Locale to use. Must be a UTF-8 locale. + #locale => 'en_US.UTF-8', + # Only send cookies over SSL connections. + #sslcookie => 1, + # Logging settings: + #verbose => 1, + syslog => 0, + # To link to user pages in a subdirectory of the wiki. + #userdir => "users", + # To create output files named page.html rather than page/index.html. + #usedirs => 0, + # Simple spam prevention: require an account-creation password. + #account_creation_password => "example", + # Uncomment to force ikiwiki to run with a particular umask. + #umask => 022, + # Default settings for the recentchanges page. + #recentchangespage => "recentchanges", + #recentchangesnum => 100, + + # To add plugins, list them here. + #add_plugins => [qw{goodstuff search wikitext camelcase + # htmltidy fortune sidebar map rst anonok}], + add_plugins => [qw{goodstuff embed inline smiley favicon rawhtml sidebar}], + # If you want to disable any of the default plugins, list them here. + #disable_plugins => [qw{inline htmlscrubber passwordauth openid}], + # To add a directory to the perl search path, use this. + #libdir => "/home/me/.ikiwiki/", + + # For use with the tag plugin, make all tags be located under a + # base page. + #tagbase => "tag", + + # For use with the search plugin if your estseek.cgi is located + # somewhere else. + #estseek => "/usr/lib/estraier/estseek.cgi", + + # For use with the openid plugin, to give an url to a page users + # can use to signup for an OpenID. + #openidsignup => "http://myopenid.com/", + + # For use with the mirrorlist plugin, a list of mirrors. + #mirrorlist => { + # mirror1 => "http://hostname1", + # mirror2 => "http://hostname2/mirror", + #}, +} diff --git a/wwwsrc/index.mdwn b/wwwsrc/index.mdwn new file mode 100644 index 0000000..6137bd3 --- /dev/null +++ b/wwwsrc/index.mdwn @@ -0,0 +1,40 @@ +# PostgreSQL Translation Project + +This page contains some information about the PostgreSQL National +Language Support effort. Please read the [information about NLS in +the PostgreSQL +Documentation](http://developer.postgresql.org/docs/postgres/nls.html) +for background and technical information. Some of the information on +this page may eventually be migrated there as it stabilizes. There's +also the [GNU Gettext +Manual](http://www.gnu.org/manual/software/gettext/html_chapter/gettext_toc.html), +which is only partially relevant for us, but it might be good to look +at anyway. + +## Status + +The [[status]] tables shows which areas of the PostgreSQL source are +prepared for translation, and the progress of those translations. +There you can also download freshly baked PO files that are merged up +against the latest program sources. No PostgreSQL source tree is +needed for translation work. + + +## Communicating + +If you have any questions about the PostgreSQL translation project, +including + +- you want to start a new translation or continue an existing one and + you want to avoid duplicating your work with someone else, + +- you're looking for other people who want to work with you on + translating, + +- you're having technical questions about tools, the source tree, the + meaning of terms, etc., + +then write to the mailing list +. More information about our +[mailing lists](http://pgfoundry.org/mail/?group_id=1000064) is +available. diff --git a/wwwsrc/local.css b/wwwsrc/local.css new file mode 100644 index 0000000..ff3d9d2 --- /dev/null +++ b/wwwsrc/local.css @@ -0,0 +1,31 @@ +BODY { + margin: 0; +} + +H1 { + color: #EC5800; +} + +H2 { + border-bottom: solid 10px #0092C3; +} + +#content { + padding-left: 1em; + padding-right: 1em; +} + +.note { + background-color: #F5F5F5; + margin: 1ex 3ex; + padding: 0.5ex 1ex; + border: solid 1px #EFEFEF; +} + +#sidebar { + background-color: #0092C3; +} + +div#sidebar a { + color: white; +} diff --git a/wwwsrc/sidebar.mdwn b/wwwsrc/sidebar.mdwn new file mode 100644 index 0000000..7b8b878 --- /dev/null +++ b/wwwsrc/sidebar.mdwn @@ -0,0 +1,5 @@ +- [[Index]] +- [[Status]] +- [[Howto]] +- [[Contributing]] +- [PgFoundry site](http://www.pgfoundry.org/projects/pgtranslation/) diff --git a/wwwsrc/status.mdwn.m4 b/wwwsrc/status.mdwn.m4 new file mode 100644 index 0000000..6dc5f83 --- /dev/null +++ b/wwwsrc/status.mdwn.m4 @@ -0,0 +1,25 @@ +m4_changequote({,})m4_dnl +# NLS Status Tables + +The tables below shows which areas of the PostgreSQL source are +prepared for translation, and the progress of those translations. The +numbers are percents of translated messages. By following the links, +you can download freshly baked PO files that are merged up against the +latest program sources. No PostgreSQL source tree is needed for +translation work. + +You can work in several branches. Please follow the rumors on the +hackers list about when a branch is about to be released. Also note +that working on the current branch might on occasion be a waste of +time if some developer is planning to rewrite most of the message +handling, for example. Please check on the hackers list first. When +you submit updates, please specify the branch. + +[[toc levels="2"]] + +m4_sinclude(statustables/table-current.html) +m4_sinclude(statustables/table-8.3-branch.html) +m4_sinclude(statustables/table-8.2-branch.html) +m4_sinclude(statustables/table-8.1-branch.html) +m4_sinclude(statustables/table-8.0-branch.html) +m4_sinclude(statustables/table-7.4-branch.html) diff --git a/wwwtools/nls-status-table b/wwwtools/nls-status-table new file mode 100755 index 0000000..c00f7b0 --- /dev/null +++ b/wwwtools/nls-status-table @@ -0,0 +1,182 @@ +#! /usr/bin/perl -w + +# Prerequisites: +# Input files given as argument (e.g., *.po) +# set URL with -U option + +use strict; + +use File::Basename; +use Getopt::Std; +use POSIX qw(:math_h); + +my $msgfmt = $ENV{'MSGFMT'} || 'msgfmt'; + +my %opts; +getopts('t:U:', \%opts) or die; +my $title = $opts{'t'}; +my $po_url = $opts{'U'} || 'po'; + +my $everything; +my $errors; + +my %languages = ( + 'af' => 'Afrikaans', + 'cs' => 'Czech', + 'de' => 'German', + 'es' => 'Spanish', + 'fa' => 'Farsi', + 'fr' => 'French', + 'hr' => 'Croatian', + 'hu' => 'Hungarian', + 'it' => 'Italian', + 'ko' => 'Korean', + 'nb' => 'Norwegian Bokmål', + 'nl' => 'Dutch', + 'pl' => 'Polish', + 'pt_BR' => 'Portuguese (Brazil)', + 'ro' => 'Romanian', + 'ru' => 'Russian', + 'sk' => 'Slovak', + 'sl' => 'Slovene', + 'sv' => 'Swedish', + 'ta' => 'Tamil', + 'tr' => 'Turkish', + 'zh_CN' => 'Chinese (simplified)', + 'zh_TW' => 'Chinese (traditional)', +); + + +if (!@ARGV) { + die "gotta give me at least one file\n"; +} + +# read in counts + +my @catalogs; +my %catalog_count; + +foreach (@ARGV) { + /(\w+).pot/ && do { + my $catname = $1; + + push @catalogs, $catname; + + my $tmp = `LC_ALL=C $msgfmt -o /dev/null -v $_ 2>&1`; + $tmp =~ /(\d+) untranslated/ and $catalog_count{$catname} = $1; + + next; + }; + + /(\w+)-(\w+).po$/ || next; + my $catalogname = $1; + my $lang = $2; + + my $tmp = `LC_ALL=C $msgfmt -o /dev/null -v $_ 2>&1`; + $tmp =~ /(\d+) translated/ and $everything->{"$catalogname"}{"$lang"} = $1; + if (-f "$_.err") { + $errors->{"$catalogname"}{"$lang"} = 1; + } +} + +# compute all distinct languages available +my @all_lang = (); + +foreach my $catalog (@catalogs) { + foreach my $lang (keys %{$everything->{$catalog}}) { + if (not grep($_ eq $lang, @all_lang)) { + push @all_lang, $lang; + } + } +} + +@all_lang = sort @all_lang; + +print "

$title

\n" if $title; +print "

Last update: ".`date -u +'%Y-%m-%d %H:%M:%S'`." UTC

\n"; + +print "\n\n"; +print "\n"; +print "\n"; +print "\n"; +print "\n"; +print "\n"; +foreach (@all_lang) { + print "\n"; +} +print "\n"; +print "\n\n"; + +my %langavg; + +foreach my $catalog (sort @catalogs) { + my @catavg; + + print "\n"; + + print "\n"; + + foreach my $lang (@all_lang) { + print "\n"; + } + + print "\n"; + + print "\n\n"; +} + +my @totalavg; +print "\n"; +print "\n"; +foreach my $lang (@all_lang) { + print "\n"; +} + +print "\n"; + +print "\n\n"; + +print "
$_".scalar(@all_lang)."
"; + print "$catalog"; + print "
(".$catalog_count{$catalog}." strings)"; + print "
"; + my $trans = $everything->{$catalog}{$lang}; + if (defined $trans and $trans>0) { + my $total = $catalog_count{$catalog}; + my $pct = floor($trans/$total * 100); + printf "%.0f", $pct; + + push @{$langavg{"$lang"}}, $pct; + push @catavg, $pct; + + if ($errors->{"$catalog"}{"$lang"}) { + print " (E)"; + } + } elsif ($errors->{"$catalog"}{"$lang"}) { + print " (E)"; + } else { + print " "; + } + print ""; + printf "%d", scalar(@catavg); + if (@catavg) { + printf " (%.0f)", floor(list_sum(@catavg)/scalar(@catavg)); + } + print "
". scalar(@catalogs) .""; + if (@{$langavg{$lang}}) { + printf "%d (%.0f)", scalar(@{$langavg{$lang}}), floor(list_sum(@{$langavg{$lang}})/scalar(@{$langavg{$lang}})); + push @totalavg, @{$langavg{$lang}}; + } + print ""; +printf "%d (%.0f)", scalar(@totalavg), floor(list_sum(@totalavg)/scalar(@totalavg)); +print "
\n"; + + + +sub list_sum { + my $total; + foreach (@_) { + $total += $_; + } + return $total; +} diff --git a/wwwtools/pg-make-conflicts b/wwwtools/pg-make-conflicts new file mode 100755 index 0000000..e338bbf --- /dev/null +++ b/wwwtools/pg-make-conflicts @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +branch=$1 +MYDIR=$2 +WEBDIR=$3 + +export PYTHONPATH=$MYDIR/usr/lib/python2.4/site-packages/ + +for langdir in $MYDIR/cvs/messages-$branch/*; do + lang=$(basename $langdir) + [ $lang = CVS ] && continue + + for mode in '' 'invert'; do + outdir=$WEBDIR/conflicts/$branch/$lang${mode:+"@$mode"} + mkdir -p $outdir + rm -f $outdir/*.po + $MYDIR/usr/bin/poconflicts ${mode:+"--$mode"} $MYDIR/cvs/messages-$branch/$lang/*.po $outdir || : + rmdir -p $outdir || : + done +done diff --git a/wwwtools/pg-make-po b/wwwtools/pg-make-po new file mode 100755 index 0000000..b344977 --- /dev/null +++ b/wwwtools/pg-make-po @@ -0,0 +1,56 @@ +#! /usr/bin/perl -w + +# Prerequisites: +# GNU make (envar GMAKE) +# msgmerge (envar MSGMERGE) +# msgfmt (envar MSGFMT) +# Source tree updated and distprep'ed +# Input files specified as arguments +# Output directory specified by -o option +# Produces various output on stderr + +use strict; + +use Getopt::Std; +use File::Basename; + +my %opts; +getopts('o:', \%opts) or die; +my $outdir = $opts{'o'} || '.'; + +my $gmake = $ENV{'GMAKE'} || 'gmake'; +my $msgmerge = $ENV{'MSGMERGE'} || 'msgmerge'; +my $msgfmt = $ENV{'MSGFMT'} || 'msgfmt'; + +foreach (@ARGV) { + my $dirname = dirname($_); + open NLSMK, "<$_" or die "could not open $_: $!\n"; + + my $catalogname; + my @languages; + my $lang; + + while () { + /^CATALOG_NAME\s*:?=\s*(\S+)\s*$/ and $catalogname = $1; + /^AVAIL_LANGUAGES\s*:?=\s*(.*)$/ and $lang = $1; + } + + close NLSMK; + + @languages = split /\s+/, $lang; + + system("$gmake -C $dirname init-po") == 0 or die "$!\n"; + system("cp -f $dirname/po/$catalogname.pot $outdir/$catalogname.pot") == 0 or die "$!\n"; + print STDERR "* $catalogname\n"; + foreach $lang (@languages) { + print STDERR "$lang: "; + if (system("$msgmerge $dirname/po/$lang.po $dirname/po/$catalogname.pot -o $outdir/$catalogname-$lang.po") != 0) { + system("$msgmerge $dirname/po/$lang.po $dirname/po/$catalogname.pot -o $outdir/$catalogname-$lang.po 2>$outdir/$catalogname-$lang.po.err 1>/dev/null"); + system("cp $dirname/po/$lang.po $outdir/$catalogname-$lang.po") if (! -f "$outdir/$catalogname-$lang.po"); + } else { + if (system("$msgfmt -o /dev/null -v -c $outdir/$catalogname-$lang.po >/dev/null 2>&1") != 0) { + system("$msgfmt -o /dev/null -v -c $outdir/$catalogname-$lang.po 2>$outdir/$catalogname-$lang.po.err 1>/dev/null"); + } + } + } +} diff --git a/wwwtools/update-nls-www b/wwwtools/update-nls-www new file mode 100755 index 0000000..ac134ef --- /dev/null +++ b/wwwtools/update-nls-www @@ -0,0 +1,115 @@ +#!/bin/sh + +set -e +set -x + +active_branches="current 8.3-branch 8.2-branch 8.1-branch 8.0-branch 7.4-branch" + +date + +me=$(basename $0) +mydir=$(cd $(dirname $0) && pwd) +topdir=$(cd $mydir && cd .. && pwd) + +PATH=$topdir:$mydir:$PATH + +GMAKE=$(which gmake || which make 2>/dev/null) +export GMAKE + +cvsdir=$topdir/cvs +statusdir=$topdir/status +wwwsrcdir=$topdir/wwwsrc +wwwbuilddir=$topdir/wwwbuild +wwwinstalldir=$topdir/wwwinstall + +rm -rf $wwwbuilddir +cp -R $wwwsrcdir $wwwbuilddir + +create_cvsco() { + local dir=$1 + local prefix=$2 + local branch=$3 + local repo=$4 + local module=$5 + + mkdir -p $dir + pushd $dir >/dev/null + + tagname=`echo $branch | sed 's/\(.\)\.\(.\)-branch/REL\1_\2_STABLE/'` + + trap 'rm -f $tmp; '"rm -rf $prefix-$branch" EXIT ERR SIGHUP SIGINT SIGPIPE SIGTERM + + if [ ! -d $prefix-$branch ]; then + touch FORCE-$branch + cvs -q -d $repo checkout -P $module + mv $module $prefix-$branch + if [ $branch != current ]; then + tmp=`mktemp -t "$me"` + pushd $prefix-$branch >/dev/null + cvs -q update -d -P -r $tagname 2>$tmp || grep 'no such tag' "$tmp" + popd >/dev/null + rm "$tmp" + fi + fi + + popd >/dev/null +} + + +[ $(ps x | grep $0 | grep -v grep | wc -l) -gt 2 ] && exit 77 + +donesomething=false + + +for branch in $active_branches; do + create_cvsco $cvsdir postgresql $branch :pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot pgsql + create_cvsco $cvsdir messages $branch :pserver:anonymous@cvs.pgfoundry.org:/cvsroot/pgtranslation messages + + tmp=`mktemp -t "$me"` + trap 'rm -f $tmp' EXIT ERR SIGHUP SIGINT SIGPIPE SIGTERM + + pushd $cvsdir/postgresql-$branch >/dev/null + test -f GNUmakefile && $GMAKE --silent maintainer-clean + cvs -q update | tee "$tmp" + popd >/dev/null + + if [ -d "$cvsdir/messages-$branch" ]; then + (cd $cvsdir/messages-$branch; cvs -q update) | tee -a "$tmp" + cp-po $cvsdir/messages-$branch $cvsdir/postgresql-$branch + fi + + if [ -f "$cvsdir/FORCE-$branch" ]; then + rm "$cvsdir/FORCE-$branch" + else + egrep -q '^(U|P) ' "$tmp" || rm -f "$tmp" && continue + fi + + rm -f "$tmp" + + pushd $cvsdir/postgresql-$branch + ./configure --enable-nls --without-readline --without-zlib --silent + popd + + mkdir -p $statusdir/$branch/po + rm -rf $statusdir/$branch/po/* + + files=`find $cvsdir/postgresql-$branch -name nls.mk` + pg-make-po -o $statusdir/$branch/po $files + + mkdir -p $wwwbuilddir/statustables + nls-status-table -t "$(echo $branch | sed 's/^c/C/;s/-b/ B/')" -U statustables/po-$branch $statusdir/$branch/po/*.pot $statusdir/$branch/po/*.po >$wwwbuilddir/statustables/table-$branch.html + + mkdir -p $wwwinstalldir/statustables + cp -R $statusdir/$branch/po $wwwinstalldir/statustables/po-$branch + +# pg-make-conflicts $branch $topdir $wwwinstalldir + + donesomething=true +done + +date + +$donesomething || exit 77 + +$GMAKE -C $wwwbuilddir all +#rsync -L -r --delete $wwwinstalldir/ pgfoundry.org:/home/pgfoundry.org/groups/pgtranslation/htdocs/ -- 2.39.5