[debian-edu-commits] debian-edu/ 15/183: Don't hardcode the priority of the ROX user settings (instead use 1000 as precedence value)

Alexander Alemayhu ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:29 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 fa16f7fc4abb028ee2a3f592754a41f394617b51
Author: Bart Cornelis <cobaco at linux.be>
Date:   Thu Oct 21 19:51:12 2004 +0000

    Don't hardcode the priority of the ROX user settings (instead use 1000 as
    precedence value)
    
    Allow to use environment variables when specifying the profile root
    (needed as the root of default-rox-user is $HOME/CHOICES)
---
 20desktop-profiles_activateDesktopProfiles | 17 ++++++++++-------
 default.listing                            | 11 +++++++----
 desktop-profiles.7                         |  2 +-
 3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/20desktop-profiles_activateDesktopProfiles b/20desktop-profiles_activateDesktopProfiles
index 6c0df13..fe076e3 100644
--- a/20desktop-profiles_activateDesktopProfiles
+++ b/20desktop-profiles_activateDesktopProfiles
@@ -70,14 +70,14 @@ test_requirement(){
 }
 
 ##########################################################
-# filter the profiles 
+# filter the profiles listed in the given files $@
 # -> output only those for which the requirements are met
 ##########################################################
 get_profiles_with_fulfilled_requirements () {
   #####################
   #for each profile do
   #####################
-  cat `ls $PROFILE_DIR/*.listing` | grep -v ^# | while read PROFILE; do
+  cat $@ | grep -v ^# | while read PROFILE; do
     PROFILE_REQUIREMENTS="`echo $PROFILE | cut --fields 4 --delimiter ";"`";
 
     #########################################################
@@ -137,7 +137,7 @@ get_profiles() {
   #################
   # order profiles
   #################
-  get_profiles_with_fulfilled_requirements | sort --reverse --general-numeric-sort --field-separator=";" --key 3 | \
+  get_profiles_with_fulfilled_requirements `ls $PROFILE_DIR/*.listing` | sort --reverse --general-numeric-sort --field-separator=";" --key 3 | \
   while read PROFILE; do
     ############################################################
     # output the profile-root if this is the right profile kind
@@ -159,27 +159,30 @@ get_profiles() {
 KDEDIRS=`get_profiles KDE | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
 if (test "$KDEDIRS"x != x) &&
    (test "$KDEDIRS" != "`cat $PROFILE_DIR/default.listing | grep "^kde-prefix" | cut --fields 2 --delimiter ";"`"); then
+  KDEDIRS=$(sh -c "echo $KDEDIRS");# FORCE expansion of variables in KDEDIRS if any
   export KDEDIRS;
 fi;
 
 XDG_CONFIG_DIRS=`get_profiles XDG_CONFIG | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
 if (test "$XDG_CONFIG_DIRS"x != x) &&
    (test "$XDG_CONFIG_DIRS" != "`cat $PROFILE_DIR/default.listing | grep "^default-xdg_config_dirs" | cut --fields 2 --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;
 
 XDG_DATA_DIRS=`get_profiles XDG_DATA | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
 if (test "$XDG_DATA_DIRS"x != x) &&
    (test "$XDG_DATA_DIRS" != "`cat $PROFILE_DIR/default.listing | grep "^default-xdg_data_dirs" | cut --fields 2 --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;
 
 CHOICESPATH=`get_profiles ROX | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
+DEFAULT_CHOICES=`get_profiles_with_fulfilled_requirements $PROFILE_DIR/default.listing | grep '^default-rox-system;' | cut --field 2 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
+DEFAULT_CHOICES="$(get_profiles_with_fulfilled_requirements $PROFILE_DIR/default.listing | grep '^default-rox-user;' | cut --field 2 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g" ):$DEFAULT_CHOICES"
 if (test "$CHOICESPATH"x != x) &&
-   (test "$CHOICESPATH" != "`cat $PROFILE_DIR/default.listing | grep "^default-choicespath" | cut --fields 2 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`"); then
-  # Rox doesn't have a seperate variable for the user settings, they need to be added here
-  # -> add default location for ROX user settings 
-  CHOICESPATH=${HOME}/Choices:$CHOICESPATH
+   (test "$CHOICESPATH" != "$DEFAULT_CHOICES"); then
+  CHOICESPATH=$(sh -c "echo $CHOICESPATH");# FORCE expansion of variables in CHOICESPATH if any
   export CHOICESPATH;
 fi;
 
diff --git a/default.listing b/default.listing
index b3ec98e..e5aa40d 100644
--- a/default.listing
+++ b/default.listing
@@ -4,9 +4,11 @@
 #
 # - CHOICESPATH (the ROX variable) defaults to 
 #   ${HOME}/Choices:/usr/local/share/Choices:/usr/share/Choices
-#   -> we don't add the first dir with the user-settings here, the dir with the
-#      userspecific settings is added as the first dir in CHOICESPATH by
-#      the Xsession.d script
+#   
+#   -> We split this in user settings and system-settings with the user settings
+#      having an very high precedence (1000) so they should normally always be 
+#      used (NOTE: if the ROX profile with the highest precedence isn't 
+#      writeable their could be problems)
 #
 # See the desktop-profiles (7) man page for details about the format of this 
 # file, and how it will be used
@@ -14,7 +16,8 @@
 kde-prefix;/usr;;;KDE;System-wide kde stuff on Debian (stuff in PREFIX)
 default-xdg_config_dirs;/etc/xdg;;;XDG_CONFIG;Default config location defined by XDG Base Directory Specification
 default-xdg_data_dirs;/usr/local/share /usr/share;;;XDG_DATA;Default data locations defined by XDG Base Directory Specification
-default-choicespath;/usr/local/share/Choices /usr/share/Choices;;;ROX;Default locations for non-user settings of ROX programs
+default-rox-system;/usr/local/share/Choices /usr/share/Choices;;;ROX;Default locations for non-user settings of ROX programs
+default-rox-user;${HOME}/Choices;1000;;ROX;Default ROX user settings (should normally take precedence over everything else)
 
 gconf-mandatory;xml:readonly:/etc/gconf/gconf.xml.mandatory;3;;GCONF;Configuration source with the mandatory system-wide settings
 gconf-user-path;include $(HOME)/.gconf.path;2;;GCONF;Extra configuration sources specified by the user
diff --git a/desktop-profiles.7 b/desktop-profiles.7
index 1cc58d3..adaf23d 100644
--- a/desktop-profiles.7
+++ b/desktop-profiles.7
@@ -31,7 +31,7 @@ Empty lines and lines starting with \'#\' (i.e. comment lines) are ignored. All
 .IP \(bu 4
 .B 2nd field: 
 .IP 
-Location of the root of the profile directory tree, may contain more then 1 directory (in which case directies should be separated with spaces).
+Location of the root of the profile directory tree, may contain more then 2 directory (in which case directies should be separated with spaces). Variables may be used in the directory root instances (e.g. $HOME/.extra_config could be a profile root directory). 
 .IP
 Except for Gconf profiles, which use the this field to contain exactly one directive to be included in the generated path file (directives are either \'xml:(readonly|readwrite):<profile-root>\', or \'include <some-path-file>' ).
 .IP \(bu 4

-- 
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