[Debian-l10n-commits] ddtp branch master updated. 20080812.0-136-g756d7ea

Martijn van Oosterhout kleptog-guest at moszumanska.debian.org
Mon Jan 6 23:31:49 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "ddtp".

The branch, master has been updated
       via  756d7ea6b15139b6713c2cb2a7578aedc23a3656 (commit)
       via  d903b08959ffe82ec63850cf91d1e8114d0e2d0d (commit)
       via  230fe33f165df8a06d90389c0c9590d6ea78c882 (commit)
       via  e550aa0adbcab0bbb31343a53e17ca3c30cbd52c (commit)
       via  927137c6ff6e9ce42a56d220e8152173841018a3 (commit)
       via  1e31de438d98fd685a21b993dc01339c03dcc240 (commit)
       via  05d8e0bc8e9884cf385bd0d866c04c5c515cbed1 (commit)
      from  bb62413b584368e84c849ae1e0f6cf74001ae50e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------

http://anonscm.debian.org/gitweb/?p=debian-l10n/ddtp.git;a=commitdiff;h=756d7ea6b15139b6713c2cb2a7578aedc23a3656

commit 756d7ea6b15139b6713c2cb2a7578aedc23a3656
Author: Martijn van Oosterhout <kleptog at svana.org>
Date:   Mon Jan 6 16:11:38 2014 +0000

    Fix base so you stay in HTTPS once there.


http://anonscm.debian.org/gitweb/?p=debian-l10n/ddtp.git;a=commitdiff;h=d903b08959ffe82ec63850cf91d1e8114d0e2d0d

commit d903b08959ffe82ec63850cf91d1e8114d0e2d0d
Author: Martijn van Oosterhout <kleptog at svana.org>
Date:   Sun Sep 15 21:34:53 2013 +0000

    Don't copy script, handled by apache config.


http://anonscm.debian.org/gitweb/?p=debian-l10n/ddtp.git;a=commitdiff;h=230fe33f165df8a06d90389c0c9590d6ea78c882

commit 230fe33f165df8a06d90389c0c9590d6ea78c882
Author: Martijn van Oosterhout <kleptog at svana.org>
Date:   Sun Sep 15 13:05:24 2013 +0000

    Use the scripts out of the repo, rather than some far off directory.


http://anonscm.debian.org/gitweb/?p=debian-l10n/ddtp.git;a=commitdiff;h=e550aa0adbcab0bbb31343a53e17ca3c30cbd52c

commit e550aa0adbcab0bbb31343a53e17ca3c30cbd52c
Author: Martijn van Oosterhout <kleptog at svana.org>
Date:   Sun Sep 15 10:50:39 2013 +0000

    Fix the database connections to use the service rather than the dbname.


http://anonscm.debian.org/gitweb/?p=debian-l10n/ddtp.git;a=commitdiff;h=927137c6ff6e9ce42a56d220e8152173841018a3

commit 927137c6ff6e9ce42a56d220e8152173841018a3
Author: Martijn van Oosterhout <kleptog at svana.org>
Date:   Sun Sep 15 09:48:24 2013 +0000

    Improve error messages.


http://anonscm.debian.org/gitweb/?p=debian-l10n/ddtp.git;a=commitdiff;h=1e31de438d98fd685a21b993dc01339c03dcc240

commit 1e31de438d98fd685a21b993dc01339c03dcc240
Author: Martijn van Oosterhout <kleptog at svana.org>
Date:   Sun Sep 15 09:48:10 2013 +0000

    Remove absolute link.


http://anonscm.debian.org/gitweb/?p=debian-l10n/ddtp.git;a=commitdiff;h=05d8e0bc8e9884cf385bd0d866c04c5c515cbed1

commit 05d8e0bc8e9884cf385bd0d866c04c5c515cbed1
Author: Martijn van Oosterhout <kleptog at svana.org>
Date:   Sat Sep 14 12:26:15 2013 +0000

    Don't use Mail::Sender as it is non-free. MIME::Entity can do the job also.

-----------------------------------------------------------------------

Summary of changes:
 db2web.sh                             |  3 +--
 ddt.cgi                               |  2 +-
 ddtp-dinstall/checks/ddtp_dinstall.sh |  2 +-
 ddtss/DDTSS_Pg.pm                     | 26 --------------------------
 ddtss/Pg_BDB.pm                       |  2 +-
 ddtss/ddts_lib.pm                     |  2 +-
 ddtss/ddtss-cgi                       | 33 ++++++++++++++++++++++-----------
 file2Translation.sh                   |  2 +-
 stat.pl                               |  8 ++++----
 9 files changed, 32 insertions(+), 48 deletions(-)

diff --git a/db2web.sh b/db2web.sh
index a532a9e..888362c 100755
--- a/db2web.sh
+++ b/db2web.sh
@@ -20,7 +20,7 @@ do
 done
 
 echo "<hr>" >> www/index.html.new
-echo "<a href=\"http://ddtp.debian.net/ddtss/index.cgi/\">to the ddtss (a web interface for the ddtp)<a/><br>" >> www/index.html.new
+echo "<a href=\"/ddtss/index.cgi/\">to the ddtss (a web interface for the ddtp)<a/><br>" >> www/index.html.new
 echo "Daily description translation stats for <a href='stats/stats-squeeze.html'>Squeeze</a>, <a href='stats/stats-wheezy.html'>Wheezy</a>, <a href='stats/stats-jessie.html'>Jessie</a>  and <a href='stats/stats-sid.html'>Sid</a>" >> www/index.html.new
 echo "<hr>" >> www/index.html.new
 echo "<a href=\"http://www.debian.org/international/l10n/ddtp\">Documentation about DDTP and DDTSS<a/>" >> www/index.html.new
@@ -71,7 +71,6 @@ gnuplot ../lib/all-stat.gnuplot
 cd ..
 
 mv www/index.html.new www/index.html
-cp -a ddt.cgi www
 mkdir -p www/gnuplot
 cp -a gnuplot/* www/gnuplot
 
diff --git a/ddt.cgi b/ddt.cgi
index f38fab9..b7e09e9 100755
--- a/ddt.cgi
+++ b/ddt.cgi
@@ -11,7 +11,7 @@ use Text::Diff;
 my $cgi = new CGI;
 $cgi->charset("UTF-8");
 
-my @DSN = ("DBI:Pg:dbname=ddtp", "", "");
+my @DSN = ("DBI:Pg:service=ddtp", "", "");
 
 my $dbh = DBI->connect(@DSN,
     { PrintError => 0,
diff --git a/ddtp-dinstall/checks/ddtp_dinstall.sh b/ddtp-dinstall/checks/ddtp_dinstall.sh
index 6f6521c..95702df 100755
--- a/ddtp-dinstall/checks/ddtp_dinstall.sh
+++ b/ddtp-dinstall/checks/ddtp_dinstall.sh
@@ -15,7 +15,7 @@
 
 TIMESTAMP=$(date +%Y%m%d_%H%M%S)
 
-DDTP_I18N_CHECK=/srv/scripts/ddtp_i18n_check.sh
+DDTP_I18N_CHECK=$(dirname $(readlink -f $0))/ddtp_i18n_check.sh
 
 TRANSLATION_FILES=/srv/ddtp.debian.net/Translation-files
 PACKAGE_LISTS=/srv/ddtp.debian.net/packagelist
diff --git a/ddtss/DDTSS_Pg.pm b/ddtss/DDTSS_Pg.pm
index bbfd8b5..4b71f6b 100644
--- a/ddtss/DDTSS_Pg.pm
+++ b/ddtss/DDTSS_Pg.pm
@@ -4,7 +4,6 @@ use POSIX qw(strftime);
 use Pg_BDB;
 use Data::Dumper;
 use Text::Iconv;
-use Mail::Sender;
 use Algorithm::Diff::XS qw(compact_diff);
 
 use ddts_lib;
@@ -963,31 +962,6 @@ sub process_data
   DDTSS_Log( $db, "$lang/packages/$package/log", time()." processed from todo" );
 }
 
-# Setup Mail::Sender object
-# No longer used for the sending/receiving of data, but it is used for sending verification emails for accounts
-sub setup_email_connection
-{
-  my $db = shift;
-  my ($from,$to,$mailserver,$emaildebug);
-  $db->get("config/clientemail",$from);
-  $db->get("config/serveremail",$to);
-  $db->get("config/mailserver",$mailserver);
-  $db->get("config/debugemail",$emaildebug);
-  
-  if( not defined $mailserver )
-  { $mailserver = "127.0.0.1" }
-  
-  my $sender = new Mail::Sender { smtp => $mailserver, 
-                                 from => $from, 
-                                 to => $to, 
-#                                 to => "<ddtss\@kleptog.org>", 
-                                 subject => 'nothing', 
-                                 on_errors => 'die',
-                                 (defined $emaildebug ? (bcc => $emaildebug) : ()) };
-                               
-  return $sender;
-}
-
 sub DDTSS_Get_commonpackages
 {
   #my $db = shift;
diff --git a/ddtss/Pg_BDB.pm b/ddtss/Pg_BDB.pm
index 7aad35e..44c517e 100644
--- a/ddtss/Pg_BDB.pm
+++ b/ddtss/Pg_BDB.pm
@@ -5,7 +5,7 @@ package Pg_BDB;
 use DBI;
 use DBD::Pg qw(:pg_types);
 #DBI->trace(1);
-my @DSN = ("DBI:Pg:dbname=ddtp", "", "");
+my @DSN = ("DBI:Pg:service=ddtp", "", "");
 
 my ($_dbh, $_inuse);
 sub _get_handle()
diff --git a/ddtss/ddts_lib.pm b/ddtss/ddts_lib.pm
index fcbcb00..b64c0dc 100644
--- a/ddtss/ddts_lib.pm
+++ b/ddtss/ddts_lib.pm
@@ -13,7 +13,7 @@ use Text::Iconv;
 
 #my $start= shift(@ARGV);
 
-my @DSN = ("DBI:Pg:dbname=ddtp", "", "");
+my @DSN = ("DBI:Pg:service=ddtp", "", "");
 
 my $dbh = DBI->connect(@DSN,
     { PrintError => 0,
diff --git a/ddtss/ddtss-cgi b/ddtss/ddtss-cgi
index 492aae0..363cf63 100755
--- a/ddtss/ddtss-cgi
+++ b/ddtss/ddtss-cgi
@@ -7,6 +7,7 @@ use lib '/org/ddtp.debian.net/ddtss';
 use DDTSS_Pg;
 use LWP::Simple;
 #use Text::Iconv;
+use MIME::Entity;
 use CGI qw/escapeHTML/;
 use Encode;
 use Digest::MD5 qw(md5_hex);
@@ -69,6 +70,7 @@ my $path = $ENV{PATH_INFO} || '/';
 # Later $self is overwritten for the per language page, so keep a copy of the real thing
 my $self = $ENV{SCRIPT_NAME} || 'local';
 my $http_host = $ENV{HTTP_HOST} || 'local';
+my $http_proto = $ENV{HTTPS} ? "https" : "http";
 
 if( defined $q->param("_charset_") and uc($q->param("_charset_")) ne "UTF-8" )
 {
@@ -696,7 +698,7 @@ sub main_display
   DDTSS_Close($db);
   
   print $q->header( -type =>'text/html', -charset => "UTF-8", -refresh => "240; url=$self", -expires => '+10s', -cookie => $usercookie ),
-        $q->start_html( -title => "DDTSS ($lang)", @html_headers, -xbase => "http://$http_host$self/" );
+        $q->start_html( -title => "DDTSS ($lang)", @html_headers, -xbase => "$http_proto://$http_host$self/" );
 
   print $q->h1("DDTSS for $lang");
 #  print $q->p({-style=>'color: #ff0000'}, "Scheduled downtime: 08:00-10:00 UTC on 5 June 2011");
@@ -1881,17 +1883,26 @@ sub display_createlogin
     $db->put( "aliases/$alias/key", $key );
 
     # We want to unlock the database before trying to send the message
-    my $sender = setup_email_connection($db);
-    
+
+    my ($from,$emaildebug);
+    $db->get("config/clientemail",$from);
+    $db->get("config/debugemail",$emaildebug);
+
+    my $email = MIME::Entity->build( Type => 'text/plain',
+                                     From => $from,
+                                     To => $email,
+#                                    To => "<ddtss\@kleptog.org>",
+                                     Subject => 'Confirm DDTSS account',
+                                     (defined $emaildebug ? (Bcc => $emaildebug) : ()),
+                                     Data => "To confirm you account ($alias) on the DDTSS, please follow this link\n".
+                                             "http://$http_host$self/verifylogin?a=$alias&k=$key\n\n".
+                                             "If you did not create an account, please ignore this email.\n".
+                                             "DDTSS (Debian Distributed Translation Server Satelite)\n" );
+
+    $email->send();
+
     DDTSS_Close($db);
-    
-    $sender->MailMsg({to => $email, 
-                      subject => 'Confirm DDTSS account', 
-                      msg => "To confirm you account ($alias) on the DDTSS, please follow this link\n".
-                             "http://$http_host$self/verifylogin?a=$alias&k=$key\n\n".
-                             "If you did not create an account, please ignore this email.\n".
-                             "DDTSS (Debian Distributed Translation Server Satelite)\n"});
-    
+
     goto_main_display("Logon creation succesful, email sent.");
     return;
   }
diff --git a/file2Translation.sh b/file2Translation.sh
index 1c7228e..6b6fe0a 100755
--- a/file2Translation.sh
+++ b/file2Translation.sh
@@ -50,4 +50,4 @@ cp -a ./Translation-files_new/ ./Translation-files_to-check
 rm -rf Translation-files
 mv Translation-files_new Translation-files
 
-/srv/scripts/ddtp_dinstall.sh
+./ddtp-dinstall/ddtp_dinstall.sh
diff --git a/stat.pl b/stat.pl
index 9525167..77d8bab 100755
--- a/stat.pl
+++ b/stat.pl
@@ -52,7 +52,7 @@ $sth->execute;
 	print "$d_count package descriptions;<br>\n";
 	print "<br>\n";
 
-	open  (FILE, ">>$logdir/stat")            or die "log-file";
+	open  (FILE, ">>$logdir/stat")            or die "Could not open $logdir/stat ($!)";
 	printf FILE "%s %5d\n", $time, $d_count;
 	close (FILE);
 
@@ -63,7 +63,7 @@ $sth->execute;
 	print "$a_count package descriptions are active;<br>\n";
 	print "<br>\n";
 
-	open  (FILE, ">>$logdir/stat-uptodate")            or die "log-file";
+	open  (FILE, ">>$logdir/stat-uptodate")            or die "Could not open $logdir/stat-uptodate ($!)";
 	printf FILE "%s %5d\n", $time, $a_count;
 	close (FILE);
 
@@ -89,11 +89,11 @@ while(($lang) = $sth->fetchrow_array) {
 
 	print "lang $lang has $ta_count ($pa_count) active translations from $t_count translations;<br>\n";
 
-	open  (FILE, ">>$logdir/stat-$lang")            or die "log-file";
+	open  (FILE, ">>$logdir/stat-$lang")            or die "Could not open $logdir/stat-$lang ($!)";
 	printf FILE "%s %5d\n", $time, $t_count;
 	close (FILE);
 
-	open  (FILE, ">>$logdir/stat-trans-sid-$lang")            or die "log-file";
+	open  (FILE, ">>$logdir/stat-trans-sid-$lang")            or die "Could not open $logdir/stat-trans-sid-$lang ($!)";
 	printf FILE "%s %5d %5d %5d\n", $time, $a_count, $ta_count, $pa_count ;
 	close (FILE);
 }
-----------------------------------------------------------------------


hooks/post-receive
-- 
ddtp



More information about the Debian-l10n-commits mailing list