[debian-edu-commits] debian-edu/ 107/183: Some small improvements to shell scripts: - change some `` expressions to $() where ksh got confused - supress extranous output on stderr when gnustep or gconf isn't installed

Alexander Alemayhu ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:38 UTC 2014


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

ccscanf-guest pushed a commit to branch master
in repository desktop-profiles.

commit cb5df1479e1d459edbc8cc4ca5e951d0627864ba
Author: Bart Cornelis <cobaco at linux.be>
Date:   Fri Jan 6 14:13:33 2006 +0000

    Some small improvements to shell scripts:
    - change some `` expressions to $() where ksh got confused
    - supress extranous output on stderr when gnustep or gconf
      isn't installed
    
    Added note about 'ssh -X' login bug, and added snippet that
    needs to added in /etc/profile (we lack /etc/profile.d)
---
 20desktop-profiles_activateDesktopProfiles | 14 +++++++-------
 README                                     | 20 +++++++++++++++++---
 debian/changelog                           | 16 +++++++++++-----
 debian/rules                               |  1 +
 listingmodule                              |  2 +-
 5 files changed, 37 insertions(+), 16 deletions(-)

diff --git a/20desktop-profiles_activateDesktopProfiles b/20desktop-profiles_activateDesktopProfiles
index 687cb9c..b0d45d2 100644
--- a/20desktop-profiles_activateDesktopProfiles
+++ b/20desktop-profiles_activateDesktopProfiles
@@ -87,7 +87,7 @@ sort_profiles(){
 activate_KDE () {
   KDEDIRS=`echo "$KDEDIRS" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
   if (test "$KDEDIRS"x != x) &&
-     (test "$KDEDIRS" != "`cat $DEFAULT_LISTING | grep "^kde-prefix" | cut --fields 3 --delimiter ";" | sed -e  "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`"); then
+     (test "$KDEDIRS" != "$(cat $DEFAULT_LISTING | grep "^kde-prefix" | cut --fields 3 --delimiter ";" | sed -e  "s/^ *//" -e "s/ *$//" -e "s/ /:/g")"); then
     KDEDIRS=$(sh -c "echo $KDEDIRS");# FORCE expansion of variables in KDEDIRS if any
     export KDEDIRS;
   fi;
@@ -96,7 +96,7 @@ activate_KDE () {
 activate_XDG_CONFIG () {
   XDG_CONFIG_DIRS=`echo "$XDG_CONFIG_DIRS" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
   if (test "$XDG_CONFIG_DIRS"x != x) &&
-     (test "$XDG_CONFIG_DIRS" != "`cat $DEFAULT_LISTING | grep "^default-xdg_config_dirs" | cut --fields 3 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`"); then
+     (test "$XDG_CONFIG_DIRS" != "$(cat $DEFAULT_LISTING | grep "^default-xdg_config_dirs" | cut --fields 3 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g")"); then
     XDG_CONFIG_DIRS=$(sh -c "echo $XDG_CONFIG_DIRS");# FORCE expansion of variables in XDG_CONFIG_DIRS if any
     export XDG_CONFIG_DIRS;
   fi;
@@ -105,7 +105,7 @@ activate_XDG_CONFIG () {
 activate_XDG_DATA () {
   XDG_DATA_DIRS=`echo "$XDG_DATA_DIRS" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
   if (test "$XDG_DATA_DIRS"x != x) &&
-     (test "$XDG_DATA_DIRS" != "`cat $DEFAULT_LISTING | grep "^default-xdg_data_dirs" | cut --fields 3 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`"); then
+     (test "$XDG_DATA_DIRS" != "$(cat $DEFAULT_LISTING | grep "^default-xdg_data_dirs" | cut --fields 3 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g")"); then
     XDG_DATA_DIRS=$(sh -c "echo $XDG_DATA_DIRS");# FORCE expansion of variables in XDG_DATA_DIRS if any
     export XDG_DATA_DIRS;
   fi;
@@ -113,8 +113,8 @@ activate_XDG_DATA () {
 
 activate_ROX () {
   CHOICESPATH=`echo "$CHOICESPATH" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
-  DEFAULT_CHOICES=$(cat $DEFAULT_LISTING | grep '^default-rox-system;' | cut --field 3 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g")
-  DEFAULT_CHOICES="$(cat $DEFAULT_LISTING | grep '^default-rox-user;' | cut --field 3 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"):$DEFAULT_CHOICES"
+  DEFAULT_CHOICES=$(cat $DEFAULT_LISTING | grep '^default-rox-system;' | cut --fields 3 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g")
+  DEFAULT_CHOICES="$(cat $DEFAULT_LISTING | grep '^default-rox-user;' | cut --fields 3 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"):$DEFAULT_CHOICES"
   if (test "$CHOICESPATH"x != x) &&
      (test "$CHOICESPATH" != "$DEFAULT_CHOICES"); then
     CHOICESPATH=$(sh -c "echo $CHOICESPATH");# FORCE expansion of variables in CHOICESPATH if any
@@ -126,7 +126,7 @@ activate_UDE () {
   # don't s/ /:g/ in next line, UDE doesn't currently support combining profile dirs
   UDEDIRS=`echo "$UDEDIRS" | sed -e "s/^ *//" -e "s/ *$//"`
   if (test "$UDEDIRS"x != x) &&
-     (test "$UDEDIRS" != "`cat $DEFAULT_LISTING | grep "^ude-install-dir" | cut --fields 3 --delimiter ";"`"); then
+     (test "$UDEDIRS" != "$(cat $DEFAULT_LISTING | grep "^ude-install-dir" | cut --fields 3 --delimiter ";")"); then
     # Take first dir and break, as UDE currently only supports one dir
     for dir in $UDEDIRS; do 
       UDEdir=$dir;
@@ -199,7 +199,7 @@ activate_GCONF () {
     
     # $XDG_CACHE_HOME is not supposed to contain anything that can't be deleted
     # so we can do this to avoid leaving old generated files from previous logins laying around
-    rm -f $(grep '^# Generated by desktop-profiles package$' $XDG_CACHE_HOME/* | cut --delimiter : --fields 1);
+    rm -f $(grep '^# Generated by desktop-profiles package$' $XDG_CACHE_HOME/* | cut --delimiter ':' --fields 1);
     
     # add marker to generated file, both so we can find it again later, and to indicate origin
     echo "# Generated by desktop-profiles package" > "$MANDATORY_PATH";
diff --git a/README b/README
index 7a05cb9..05e77a8 100644
--- a/README
+++ b/README
@@ -9,9 +9,23 @@ KNOWN BUGS
   files doesn't work correctly if the profile description contains a single 
   quote, it doesn't show the details, and will mess up the metadata file when
   changing it
-- Profiles aren't set when logging in and running programs with 'sss -X', 
-  see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=344030 for more info
-  (basically the xsession.d files aren't run on 'ssh -X'-login
+- 'ssh -X' bug (##344030): 
+  Profiles aren't set when logging in and running programs with 'ssh -X', this
+  is because the Xsession.d script isn't run.
+  
+  A general shell-independ solution seems to be impossible (neither ssh itself
+  nor PAM provides a way to source shell scripts) so the only possible solution
+  would seem to be to adding a shell snippet to the system-wide on-login script
+  for each shell-variant, and have that snippet run the profile activation
+  script when it detects an 'ssh -X' login.
+
+  For bourne-compatible shells (bash, dash, ksh, pdksh, mksh) this means adding
+  a snippet to /etc/profile which in the absence of a /etc/profile.d directory
+  can't be done. Since the base-file maintainer refuses to add such a mechanism
+  (For more info see /usr/share/doc/base-files/FAQ and bug #345921) we're stuck.
+  The file /usr/share/doc/desktop-profiles/examples/profile-snippet contains the 
+  necessary snippet, adding it at the end of /etc/profile will fix this bug for
+  all bourne-compatible shells.
 
 GETTING GCONF PROFILES TO WORK
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/debian/changelog b/debian/changelog
index 844ed2c..96ebaa1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,18 @@
 desktop-profiles (1.4.9) UNRELEASED; urgency=low
 
-  * Added note about profiles not being set on 'ssh -X'-logins to README
+  * Added note about profiles not being set on 'ssh -X' logins to README,
+    also added shell-script-snippet to fix this for bourne-type shells in
+    /usr/share/doc/desktop-profiles/examples (we don't have a /etc/profile.d 
+    so we can't add this automatically)
+  * changed some `` expressions to $() instead, as appearently ksh doens't
+    always accept the former for some reason
   * Added updated Vietnamese debconf translation
-  * When /usr/lib/GNUstep/System/Library/Makefiles/user_home doesn't exist
-    surpress the stderr output noting this
-  * Same for /etc/gconf/1/path
+  * When GNUstep isn't installed don't output message about missing 
+    /usr/lib/GNUstep/System/Library/Makefiles/user_home on stderr.
+  * When gconf isn't installed don't output message aoubt missing
+    /etc/gconf/*/path
 
- -- Bart Cornelis (cobaco) <cobaco at linux.be>  Thu, 22 Dec 2005 13:15:28 +0100
+ -- Bart Cornelis (cobaco) <cobaco at linux.be>  Fri,  6 Jan 2006 14:41:21 +0100
 
 desktop-profiles (1.4.8) unstable; urgency=low
 
diff --git a/debian/rules b/debian/rules
index 17e3ce5..567cdb7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -41,6 +41,7 @@ binary-indep: build install
 	dh_install dh_installlisting profile-manager usr/bin
 	dh_install listingmodule path usr/share/desktop-profiles/
 	dh_link usr/share/desktop-profiles/path usr/share/doc/desktop-profiles/examples/path
+	dh_install profile-snippet usr/share/doc/desktop-profiles/examples
 	dh_install list-desktop-profiles usr/bin/
 	dh_install profile-manager.kmdr usr/share/desktop-profiles/kommander-scripts/
 	dh_install desktop-profiles etc/default
diff --git a/listingmodule b/listingmodule
index db3c27f..cb99239 100644
--- a/listingmodule
+++ b/listingmodule
@@ -137,7 +137,7 @@ for_each_requirement(){
 # returns 1 otherwise
 ###############################################################################
 test_profile_requirements() {
-  PROFILE_REQUIREMENTS="`echo $@ | cut --fields 5 --delimiter ";"`";
+  PROFILE_REQUIREMENTS="$(echo $@ | cut --fields 5 --delimiter ";")";
 
   # no requirements -> met
   if (test "$PROFILE_REQUIREMENTS"x = x); then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/desktop-profiles.git



More information about the debian-edu-commits mailing list