The branch, master has been updated via 25d1db94c24f593a690617969293072fcdbaa8bc (commit) via ebc2b466843dec399a96b98b49321849433e8755 (commit) from 619a267ca99e024c2cbd940d51a694db823b20e6 (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 ----------------------------------------------------------------- commit 25d1db94c24f593a690617969293072fcdbaa8bc Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 17 10:53:36 2012 +0200 move source_environment function into Perl package, use File::BaseDir for XDG_CONFIG_HOME detection commit ebc2b466843dec399a96b98b49321849433e8755 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 17 10:33:35 2012 +0200 Detect i18n name of Desktop folder via XDG_DESKTOP_DIR environment variable. ----------------------------------------------------------------------- Summary of changes: X2Go/Server.pm | 24 +++++++++++++++++++++--- X2Go/{Server.pm => Utils.pm} | 17 +++++++++++++++++ debian/changelog | 2 ++ x2goserver/bin/x2gomountdirs | 12 +++++++++++- 4 files changed, 51 insertions(+), 4 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@obviously-nice.de> # Copyright (C) 2007-2012 Heinz-Markus Graesing <heinz-m.graesing@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/debian/changelog b/debian/changelog index ce793ee..5b761ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ x2goserver (3.2.0.0-0~x2go1) UNRELEASED; urgency=low Makefile installation. - Fix new SQLite3 wrapper for db_getmounts Perl call. - Fix list output in new SQLite3 wrapper. + - Detect i18n name of Desktop folder via XDG_DESKTOP_DIR environment + variable. * /debian/control: + Package X2Go::Log in separate package: libx2go-log-perl. + Package X2Go::Server::DB in separate package: libx2go-server-db-perl. diff --git a/x2goserver/bin/x2gomountdirs b/x2goserver/bin/x2gomountdirs index d806a3f..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'); @@ -106,6 +108,8 @@ 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"; +source xdg_config_home(),"/user-dirs.dirs"; + if (! -e $mdir) { mkdir($mdir); @@ -267,7 +271,13 @@ for (my $i=0;$i<@dirs;$i++) if (! $printspool && ! $mimeboxspool && ! $useplasmoid ) { - my $fname="$ENV{'HOME'}/Desktop"; + my $fname; + if ( $ENV{'XDG_DESKTOP_DIR'} ) + { + $fname=$ENV{'XDG_DESKTOP_DIR'}; + } else { + $fname="$ENV{'HOME'}/Desktop"; + } 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).