[X2Go-Commits] [x2goserver] 01/01: Only call $dbh->sqlite_busy_timeout() if the $dbh object is capable of that. Works around a too-old DBD::SQLite package on SLE 11.x.

git-admin at x2go.org git-admin at x2go.org
Wed Feb 4 22:21:52 CET 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch release/4.0.1.x
in repository x2goserver.

commit 566efcc76e6739bbdbc5726286d5ac2173837796
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Feb 4 22:18:28 2015 +0100

    Only call $dbh->sqlite_busy_timeout() if the $dbh object is capable of that. Works around a too-old DBD::SQLite package on SLE 11.x.
---
 debian/changelog                    |    2 ++
 x2goserver/lib/x2gosqlitewrapper.pl |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index f0dad45..78894e7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -67,6 +67,8 @@ x2goserver (4.0.1.19-0x2go1) UNRELEASED; urgency=medium
     - Fix wrong evocation of x2gosyslog ("error" -> "err").
     - Use "undef $dbh" instead of "$dbh->disconnect()". Fixes SQLite3 issues on
       SLE 11.x.
+    - Only call $dbh->sqlite_busy_timeout() if the $dbh object is capable of
+      that. Works around a too-old DBD::SQLite package on SLE 11.x.
   * debian/control:
     + Add D (x2goserver): libfile-which-perl.
     + Add C (x2goserver: x2godesktopsharing (<< 3.1.1.2-0~). (Fixes: #700).
diff --git a/x2goserver/lib/x2gosqlitewrapper.pl b/x2goserver/lib/x2gosqlitewrapper.pl
index 1a1867d..f8fd046 100755
--- a/x2goserver/lib/x2gosqlitewrapper.pl
+++ b/x2goserver/lib/x2gosqlitewrapper.pl
@@ -91,7 +91,12 @@ my ($uname, $pass, $uid, $pgid, $quota, $comment, $gcos, $homedir, $shell, $expi
 my $realuser=$uname;
 
 my $dbh=DBI->connect("dbi:SQLite:dbname=$dbfile","","",{sqlite_use_immediate_transaction => 1, AutoCommit => 1, }) or die $_;
-$dbh->sqlite_busy_timeout( 2000 );
+
+# on SLE 11.x the sqlite_busy_timeout function does not exist, trying to work around that...
+if ( $dbh->can('sqlite_busy_timeout') )
+{
+	$dbh->sqlite_busy_timeout( 2000 );
+}
 
 my $cmd=shift or die "command not specified";
 my $rc=0;

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list