[X2Go-Commits] x2goserver.git - build-baikal (branch) updated: 3.1.1.3-69-g25d1db9
X2Go dev team
git-admin at x2go.org
Fri Jan 3 18:05:00 CET 2014
The branch, build-baikal has been updated
via 25d1db94c24f593a690617969293072fcdbaa8bc (commit)
from ebc2b466843dec399a96b98b49321849433e8755 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
X2Go/Server.pm | 24 +++++++++++++++++++++---
X2Go/{Server.pm => Utils.pm} | 17 +++++++++++++++++
x2goserver/bin/x2gomountdirs | 27 +++------------------------
3 files changed, 41 insertions(+), 27 deletions(-)
copy X2Go/{Server.pm => Utils.pm} (75%)
The diff of changes is:
diff --git a/X2Go/Server.pm b/X2Go/Server.pm
index 17a07cc..86ba0d7 100644
--- a/X2Go/Server.pm
+++ b/X2Go/Server.pm
@@ -20,19 +20,37 @@
# Copyright (C) 2007-2012 Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
# Copyright (C) 2007-2012 Heinz-Markus Graesing <heinz-m.graesing at obviously-nice.de>
-package X2Go::Server;
+package X2Go::Utils;
=head1 NAME
-X2Go::Server - X2Go Server package for Perl
+X2Go::Utils - X2Go utilities and helper functions for Perl
=head1 DESCRIPTION
-X2Go::Server Perl package.
+X2Go::Utils Perl package.
=cut
use strict;
use base 'Exporter';
+OUR @EXPORT = ('source_environment');
+
+sub source_environment {
+ my $name = shift;
+
+ open my $fh, "<", $name
+ or die "could not open $name: $!";
+
+ while (<$fh>) {
+ chomp;
+ my ($k, $v) = split /=/, $_, 2;
+ $v =~ s/^(['"])(.*)\1/$2/; #' fix highlighter
+ $v =~ s/\$([a-zA-Z]\w*)/$ENV{$1}/g;
+ $v =~ s/`(.*?)`/`$1`/ge; #dangerous
+ $ENV{$k} = $v;
+ }
+}
+
1;
diff --git a/X2Go/Server.pm b/X2Go/Utils.pm
similarity index 75%
copy from X2Go/Server.pm
copy to X2Go/Utils.pm
index 17a07cc..fc6e92c 100644
--- a/X2Go/Server.pm
+++ b/X2Go/Utils.pm
@@ -35,4 +35,21 @@ X2Go::Server Perl package.
use strict;
use base 'Exporter';
+sub source_environment {
+ my $name = shift;
+
+ open my $fh, "<", $name
+ or die "could not open $name: $!";
+
+ while (<$fh>) {
+ chomp;
+ my ($k, $v) = split /=/, $_, 2;
+ $v =~ s/^(['"])(.*)\1/$2/; #' fix highlighter
+ $v =~ s/\$([a-zA-Z]\w*)/$ENV{$1}/g;
+ $v =~ s/`(.*?)`/`$1`/ge; #dangerous
+ $ENV{$k} = $v;
+ }
+}
+
+
1;
diff --git a/x2goserver/bin/x2gomountdirs b/x2goserver/bin/x2gomountdirs
index 6c7c83e..f6ca8f5 100755
--- a/x2goserver/bin/x2gomountdirs
+++ b/x2goserver/bin/x2gomountdirs
@@ -22,8 +22,10 @@
use strict;
use Sys::Syslog qw( :standard :macros );
+use File::BaseDir qw(xdg_config_home);
use X2Go::Server::DB qw(db_insertmount db_deletemount);
+use X2Go::Utils qw(source_environment);
use X2Go::Log qw(loglevel);
openlog($0,'cons,pid','user');
@@ -32,22 +34,6 @@ setlogmask( LOG_UPTO(loglevel()) );
syslog('info', "x2gomountdirs has been called with options: @ARGV");
-sub source {
- my $name = shift;
-
- open my $fh, "<", $name
- or die "could not open $name: $!";
-
- while (<$fh>) {
- chomp;
- my ($k, $v) = split /=/, $_, 2;
- $v =~ s/^(['"])(.*)\1/$2/; #' fix highlighter
- $v =~ s/\$([a-zA-Z]\w*)/$ENV{$1}/g;
- $v =~ s/`(.*?)`/`$1`/ge; #dangerous
- $ENV{$k} = $v;
- }
-}
-
my $tmp_dir = '/tmp';
my $type=shift;
@@ -122,14 +108,7 @@ my $spooldir="$tmp_dir/.x2go-$ENV{'USER'}/spool";
my $mimeboxdir_lnk="$ENV{'HOME'}/.x2go/C-$session/mimebox";
my $mimeboxdir="$tmp_dir/.x2go-$ENV{'USER'}/mimebox";
-my $xdg_config;
-if ( $ENV{'XDG_CONFIG_HOME'} )
-{
- $xdg_config = $ENV{'XDG_CONFIG_HOME'};
-} else {
- $xdg_config = "$ENV{'HOME'}/.config";
-}
-source "$xdg_config/user-dirs.dirs";
+source xdg_config_home(),"/user-dirs.dirs";
if (! -e $mdir)
{
hooks/post-receive
--
x2goserver.git (X2Go Server)
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 "x2goserver.git" (X2Go Server).
More information about the x2go-commits
mailing list