[X2Go-Commits] [x2goserver] 01/02: x2goserver/sbin/x2godbadmin: whitespace only.
git-admin at x2go.org
git-admin at x2go.org
Fri Feb 23 02:15:00 CET 2018
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch feature/mysql-backend
in repository x2goserver.
commit d6f7a95b5c36f1df66ac8871a7e072cecb1a0f93
Author: Mihai Moldovan <ionic at ionic.de>
Date: Thu Feb 22 05:01:53 2018 +0100
x2goserver/sbin/x2godbadmin: whitespace only.
---
debian/changelog | 1 +
x2goserver/sbin/x2godbadmin | 62 ++++++++++++++++++++++-----------------------
2 files changed, 31 insertions(+), 32 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 99c85fb..3597721 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -59,6 +59,7 @@ x2goserver (4.1.0.1-0x2go1) UNRELEASED; urgency=medium
- x2goserver-common/Makefile: stage tmpfiles.d config file into
${PREFIX}/lib/. File should not be modified by users.
- x2goserver-common/: move etc/tmpfiles.d to lib/tmpfiles.d.
+ - x2goserver/sbin/x2godbadmin: whitespace only.
* debian/{control,compat}:
+ Bump DH compat level to 9.
* debian/:
diff --git a/x2goserver/sbin/x2godbadmin b/x2goserver/sbin/x2godbadmin
index 30f63f6..9e5d3c2 100755
--- a/x2goserver/sbin/x2godbadmin
+++ b/x2goserver/sbin/x2godbadmin
@@ -77,11 +77,10 @@ if ($Config->param("backend") eq 'sqlite')
{
if ( ! -e $dbfile)
{
-
$createdb = 1;
-
- } else {
-
+ }
+ else
+ {
# Update the session DB file
my $dbh=DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 1, PrintError => 0, PrintWarn => 1, RaiseError => 1 }) or die $_;
my $coltest;
@@ -92,11 +91,11 @@ if ($Config->param("backend") eq 'sqlite')
$dbh->prepare("
select tekictrl_port from sessions
");
- } catch {
+ }
+ catch
+ {
print "ADDING: tekictrl_port column to table sessions\n";
- $sth=$dbh->prepare("
- alter table sessions add column 'tekictrl_port' int
- ");
+ $sth=$dbh->prepare("alter table sessions add column 'tekictrl_port' int");
$sth->execute();
$sth->finish();
};
@@ -104,14 +103,12 @@ if ($Config->param("backend") eq 'sqlite')
# Update missing column on sessions table: tekidata_port
try
{
- $dbh->prepare("
- select tekidata_port from sessions
- ");
- } catch {
+ $dbh->prepare("select tekidata_port from sessions");
+ }
+ catch
+ {
print "ADDING: tekidata_port column to table sessions\n";
- $sth=$dbh->prepare("
- alter table sessions add column 'tekidata_port' int
- ");
+ $sth=$dbh->prepare("alter table sessions add column 'tekidata_port' int");
$sth->execute();
$sth->finish();
};
@@ -165,9 +162,7 @@ if ($Config->param("backend") eq 'sqlite')
$sth->execute() or die;
$sth->finish();
- my $sth=$dbh->prepare("
- create table messages(mess_id varchar(20) primary key, message text)
- ");
+ my $sth=$dbh->prepare("create table messages(mess_id varchar(20) primary key, message text)");
$sth->execute() or die;
$sth->finish();
@@ -272,7 +267,8 @@ if ($updatedb)
my $dbh;
until (
$dbh = DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1, RaiseError => 0, PrintError => 0})
- ) {
+ )
+ {
$createdb = 1;
last;
};
@@ -284,11 +280,11 @@ if ($updatedb)
my $sth_tekidata;
my $sth_update;
try {
- $sth_tekictrl = $dbh->prepare("
- select tekictrl_port from sessions
- ");
+ $sth_tekictrl = $dbh->prepare("select tekictrl_port from sessions");
$sth_tekictrl->execute();
- } catch {
+ }
+ catch
+ {
print "ADDING: tekictrl_port column to table sessions\n";
$sth_tekictrl = $dbh->prepare("
alter table sessions
@@ -299,11 +295,11 @@ if ($updatedb)
$update_views_n_rules = 1;
};
try {
- $sth_tekidata = $dbh->prepare("
- select tekidata_port from sessions
- ");
+ $sth_tekidata = $dbh->prepare("select tekidata_port from sessions");
$sth_tekidata->execute();
- } catch {
+ }
+ catch
+ {
print "ADDING: tekidata_port column to table sessions\n";
$sth_tekidata=$dbh->prepare("
alter table sessions
@@ -350,7 +346,9 @@ if ($updatedb)
undef $dbh;
}
exit(0);
- } else {
+ }
+ else
+ {
print "No session DB found. Use --createdb instead of --updatedb.\n";
}
}
@@ -457,7 +455,9 @@ sub add_user()
{
print "Cannot find user ($user)\n";
return;
- } elsif ($name eq "root") {
+ }
+ elsif ($name eq "root")
+ {
print "The super-user \"root\" is not allowed to use X2Go\n";
return;
}
@@ -604,9 +604,7 @@ sub create_tables()
");
$sth->execute() or die;
- $sth=$dbh->prepare("
- create table messages(mess_id varchar(20) primary key, message text)
- ");
+ $sth=$dbh->prepare("create table messages(mess_id varchar(20) primary key, message text)");
$sth->execute() or die;
$sth=$dbh->prepare("
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
More information about the x2go-commits
mailing list