[Debian-l10n-commits] r1210 - in /ddtp-web: file2Translation.pl file2Translation.sh logrotate.config update.sh update0.5.sh

grisu at users.alioth.debian.org grisu at users.alioth.debian.org
Thu Aug 14 23:58:30 UTC 2008


Author: grisu
Date: Thu Aug 14 23:58:29 2008
New Revision: 1210

URL: http://svn.debian.org/wsvn/?sc=1&rev=1210
Log:

   * file2Translation.sh
   * file2Translation.pl
      * generate the Translation files with the news files from
        ftp-master
   * update.sh
      * add logrotate
      * use file2Translation.sh
      * generate general Packagefile
   * update0.5.sh
      * use file2Translation.sh
   * logrotate.config
      * add logrotate config


Added:
    ddtp-web/file2Translation.pl   (with props)
    ddtp-web/file2Translation.sh   (with props)
    ddtp-web/logrotate.config
    ddtp-web/update0.5.sh   (with props)
Modified:
    ddtp-web/update.sh

Added: ddtp-web/file2Translation.pl
URL: http://svn.debian.org/wsvn/ddtp-web/file2Translation.pl?rev=1210&op=file
==============================================================================
--- ddtp-web/file2Translation.pl (added)
+++ ddtp-web/file2Translation.pl Thu Aug 14 23:58:29 2008
@@ -1,0 +1,89 @@
+#!/usr/bin/perl
+
+use diagnostics;
+use strict;
+
+my $dists= shift(@ARGV);
+my $lang= shift(@ARGV); 
+
+my $description_id;
+my $translation;
+
+use DBI;
+use Digest::MD5 qw(md5_hex);
+
+my @DSN = ("DBI:Pg:dbname=ddtp", "", "");
+
+my $dbh = DBI->connect(@DSN,
+    { PrintError => 0,
+      RaiseError => 1,
+      AutoCommit => 0,
+    });
+
+die $DBI::errstr unless $dbh;
+
+
+my $package;
+my $description_md5;
+
+sub get_description_ids {
+	my $tag= shift(@_);
+
+	my @description_ids;
+	my $package;
+	my $version;
+
+	open (PACKAGELIST, "<Packages/packagelist-$tag");
+	while (<PACKAGELIST>) {
+		chomp;
+		($package,$version) = split (/ /);
+		#print "^$package^$version^";
+		my $sth = $dbh->prepare("SELECT description_id FROM description_tb WHERE package=? and description_id in (SELECT description_id FROM version_tb WHERE version=?)");
+		$sth->execute($package,$version);
+		while(($description_id) = $sth->fetchrow_array) {
+			#print "  -> $description_id\n";
+			push @description_ids,$description_id;
+		}
+	}
+	close (PACKAGELIST);
+
+	return @description_ids;
+}
+
+sub get_translation {
+	my $description_id= shift(@_);
+	my $lang= shift(@_);
+
+	my $translation;
+
+	my $sth = $dbh->prepare("SELECT translation FROM translation_tb WHERE description_id=? and language=?");
+	$sth->execute($description_id,$lang);
+	($translation) = $sth->fetchrow_array;
+	if ($translation and (( $translation =~ tr/\n/\n/ )<2)) {
+		undef $translation;
+	}
+	return $translation;
+}
+
+sub get_packageinfos {
+	my $description_id= shift(@_);
+
+	my $package;
+	my $description_md5;
+
+	my $sth = $dbh->prepare("SELECT package,description_md5 FROM description_tb WHERE description_id=?");
+	$sth->execute($description_id);
+	($package,$description_md5) = $sth->fetchrow_array;
+	return ($package,$description_md5);
+}
+
+foreach (get_description_ids($dists)) {
+	$description_id=$_;
+	$translation=get_translation($description_id,$lang);
+	if ($translation) {
+		($package,$description_md5)=get_packageinfos($description_id);
+		print "Package: $package\n";
+		print "Description-md5: $description_md5\n";
+		print "Description-$lang: $translation\n";
+	}
+}

Propchange: ddtp-web/file2Translation.pl
------------------------------------------------------------------------------
    svn:executable = *

Added: ddtp-web/file2Translation.sh
URL: http://svn.debian.org/wsvn/ddtp-web/file2Translation.sh?rev=1210&op=file
==============================================================================
--- ddtp-web/file2Translation.sh (added)
+++ ddtp-web/file2Translation.sh Thu Aug 14 23:58:29 2008
@@ -1,0 +1,45 @@
+#!/bin/bash -e
+
+cd ~ddtp
+
+# Fetch active langs from database
+LANGS=`psql ddtp -q -A -t -c "select distinct language from translation_tb"`
+
+DISTS="lenny sid"
+
+mkdir -p packagelist
+cd packagelist
+for distribution in $DISTS etch md5sum timestamp timestamp.gpg
+do
+	rm -f $distribution
+	wget -q -m -nd http://ftp-master.debian.org/i18n/$distribution
+done
+md5sum --check md5sum
+cd ..
+
+rm -rf Translation-files_new
+
+for distribution in $DISTS
+do
+	sed -e "s/ [^ ][^ ]*$//" < packagelist/$distribution | sort | uniq > Packages/packagelist-$distribution
+	for lang in $LANGS
+	do
+		mkdir -p Translation-files_new/dists/$distribution/main/i18n/ 
+		./file2Translation.pl $distribution $lang > Translation-files_new/dists/$distribution/main/i18n/Translation-$lang
+		echo `date`: create the $distribution/Translation-$lang
+	done
+	cp packagelist/timestamp packagelist/timestamp.gpg Translation-files_new/
+	cd Translation-files_new
+	sha256sum dists/$distribution/main/i18n/Translation-* >> SHA256SUMS
+	cd $OLDPWD
+done
+
+rm -rf ./Translation-files_to-check
+cp -a ./Translation-files_new/ ./Translation-files_to-check
+
+./ddtp-dinstall/ddtp_i18n_check.sh ./Translation-files_to-check/ ./packagelist/
+
+rm -rf Translation-files
+mv Translation-files_new Translation-files
+
+/srv/scripts/ddtp_dinstall.sh

Propchange: ddtp-web/file2Translation.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: ddtp-web/logrotate.config
URL: http://svn.debian.org/wsvn/ddtp-web/logrotate.config?rev=1210&op=file
==============================================================================
--- ddtp-web/logrotate.config (added)
+++ ddtp-web/logrotate.config Thu Aug 14 23:58:29 2008
@@ -1,0 +1,33 @@
+/org/ddtp.debian.net/pg_dump/pg_ddts.dump.gz {
+	daily
+	missingok
+	rotate 52
+	nocompress
+	notifempty
+	#create 640 ddtp debian-i18n-users
+}
+
+/org/ddtp.debian.net/ddts/log/mailin {
+	weekly
+	missingok
+	rotate 52
+	notifempty
+	#create 640 ddtp debian-i18n-users
+}
+
+/org/ddtp.debian.net/ddts/log/mailparser.err.log {
+	daily
+	missingok
+	rotate 52
+	compress
+	notifempty
+	#create 640 ddtp debian-i18n-users
+}
+/org/ddtp.debian.net/ddts/log/mailparser.log {
+	daily
+	missingok
+	rotate 52
+	compress
+	notifempty
+	#create 640 ddtp debian-i18n-users
+}

Modified: ddtp-web/update.sh
URL: http://svn.debian.org/wsvn/ddtp-web/update.sh?rev=1210&op=diff
==============================================================================
--- ddtp-web/update.sh (original)
+++ ddtp-web/update.sh Thu Aug 14 23:58:29 2008
@@ -2,9 +2,11 @@
 
 cd ~ddtp
 
+./Packages2packages_tb.sh
 ./Packages2db.sh
 ./db2web.sh
-./db2Translation.sh
+# ./db2Translation.sh
+./file2Translation.sh
 
 # Regenerate the stats files
 /home/kleptog/stats/ddts-stats sid >/dev/null
@@ -12,3 +14,7 @@
 /home/kleptog/stats/ddts-stats etch >/dev/null
 
 #cp -a /home/grisu/public_html/ddtp/* /var/www/ddtp/
+
+/usr/sbin/logrotate --state /org/ddtp.debian.net/lib/logrotate.state /org/ddtp.debian.net/logrotate.config
+
+date

Added: ddtp-web/update0.5.sh
URL: http://svn.debian.org/wsvn/ddtp-web/update0.5.sh?rev=1210&op=file
==============================================================================
--- ddtp-web/update0.5.sh (added)
+++ ddtp-web/update0.5.sh Thu Aug 14 23:58:29 2008
@@ -1,0 +1,20 @@
+#!/bin/bash
+
+cd ~ddtp
+
+#./Packages2packages_tb.sh
+#./Packages2db.sh
+./db2web.sh
+# ./db2Translation.sh
+./file2Translation.sh
+
+# Regenerate the stats files
+/home/kleptog/stats/ddts-stats sid >/dev/null
+/home/kleptog/stats/ddts-stats lenny >/dev/null
+/home/kleptog/stats/ddts-stats etch >/dev/null
+
+#cp -a /home/grisu/public_html/ddtp/* /var/www/ddtp/
+
+#/usr/sbin/logrotate --state /org/ddtp.debian.net/lib/logrotate.state /org/ddtp.debian.net/logrotate.config
+
+date

Propchange: ddtp-web/update0.5.sh
------------------------------------------------------------------------------
    svn:executable = *




More information about the Debian-l10n-commits mailing list