[X2Go-Commits] x2goserver.git - build-main (branch) updated: 3.1.1.4-10-gfe8874e

X2Go dev team git-admin at x2go.org
Wed Dec 4 06:18:25 CET 2013


The branch, build-main has been updated
       via  fe8874ec148a015f0bff75407e00aa1b9ee9a99a (commit)
      from  abf5ce667307f34bfb034c4ff19dee74665c37e8 (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:
 x2goserver/bin/x2gomountdirs      |   12 +++---------
 x2goserver/bin/x2goumount-session |   30 +++++++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 10 deletions(-)

The diff of changes is:
diff --git a/x2goserver/bin/x2gomountdirs b/x2goserver/bin/x2gomountdirs
index a25b0b7..f346a03 100755
--- a/x2goserver/bin/x2gomountdirs
+++ b/x2goserver/bin/x2gomountdirs
@@ -22,6 +22,7 @@
 
 use strict;
 use Sys::Syslog qw( :standard :macros );
+use File::BaseDir qw( xdg_config_home );
 
 use lib `echo -n \$(x2gobasepath)/lib/x2go`;
 use x2godbwrapper;
@@ -123,14 +124,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_environment xdg_config_home(),"/user-dirs.dirs";
 
 if (! -e $mdir)
 {
@@ -296,7 +290,7 @@ for (my $i=0;$i<@dirs;$i++)
 				my $fname;
 				if ( $ENV{'XDG_DESKTOP_DIR'} )
 				{
-					$fname=$ENV{'XDG_DESKTOP_DIR'};
+					$fname="$ENV{'XDG_DESKTOP_DIR'}";
 				} else {
 					$fname="$ENV{'HOME'}/Desktop";
 				}
diff --git a/x2goserver/bin/x2goumount-session b/x2goserver/bin/x2goumount-session
index 01d3857..1185872 100755
--- a/x2goserver/bin/x2goumount-session
+++ b/x2goserver/bin/x2goumount-session
@@ -23,6 +23,7 @@
 use strict;
 use Sys::Hostname;
 use Sys::Syslog qw( :standard :macros );
+use File::BaseDir qw( xdg_config_home );
 
 use lib `echo -n \$(x2gobasepath)/lib/x2go`;
 use x2godbwrapper; 
@@ -34,6 +35,24 @@ setlogmask( LOG_UPTO(x2gologlevel()) );
 
 syslog('info', "x2goumount-session has been called with options: @ARGV");
 
+# this function is a code duplication from x2gomountdirs and it will go away with
+# X2Go Server 3.2.0.0 (as the code has been moved into X2Go::Utils already in Vcs).
+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;
+    }
+}
+
 my $tmp_dir = '/tmp';
 
 my $session=shift;
@@ -45,6 +64,8 @@ my $mdir="$tmp_dir/.x2go-$ENV{'USER'}/media";
 my $spooldir="$tmp_dir/.x2go-$ENV{'USER'}/spool";
 my $mimeboxdir="$tmp_dir/.x2go-$ENV{'USER'}/mimebox";
 
+source_environment xdg_config_home(),"/user-dirs.dirs";
+
 if ($only_path)
 {
 	$only_path=~s/\/ramdrive\/mnt\///;
@@ -156,7 +177,14 @@ break:
 		$remote=~s/ /_/g;
 		$remote=~s/\\040/_/g;
 		$remote=(split(":","$remote"))[1];
-		$remote="$ENV{'HOME'}/Desktop/$remote";
+		my $desktopdir;
+		if ( $ENV{'XDG_DESKTOP_DIR'} )
+		{
+			$desktopdir="$ENV{'XDG_DESKTOP_DIR'}";
+		} else {
+			$desktopdir="$ENV{'HOME'}/Desktop";
+		}
+		$remote="$desktopdir/$remote";
 
 		my $current_desktop = 'NONE';
 		if (($session =~ m/_stDGNOME_dp/) && system("x2gofeature X2GO_GNOMEBINDINGS >/dev/null") == 0)


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