[debian-edu-commits] debian-edu/ 27/183: Added defaults file,
Alexander Alemayhu
ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:30 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 e507e3b962c167540c53a53651c8e93229e2b63c
Author: Bart Cornelis <cobaco at linux.be>
Date: Thu Nov 11 20:17:20 2004 +0000
Added defaults file,
and ability to disable profile kinds completely through it
---
20desktop-profiles_activateDesktopProfiles | 191 +++++++++++++++++------------
debian/rules | 1 +
desktop-profiles | 74 +++++++++++
3 files changed, 186 insertions(+), 80 deletions(-)
diff --git a/20desktop-profiles_activateDesktopProfiles b/20desktop-profiles_activateDesktopProfiles
index 594e587..701135c 100644
--- a/20desktop-profiles_activateDesktopProfiles
+++ b/20desktop-profiles_activateDesktopProfiles
@@ -2,28 +2,44 @@
#
# Script to activate profiles (i.e. conditional setup) for the various desktop
# environments in Debian based on the data in the *.listing files in the
-# /etc/desktop-profiles directory.
+# /etc/desktop-profiles directory. Sourced by /etc/X11/Xsession.
#
# See the desktop-profiles (7) man page for an overview of how this works
#
# (c) 2004 Bart Cornelis <cobaco AT skolelinux no>
###############################################################################
-# Where do we look for .listing files
-LISTINGS_DIR="/etc/desktop-profiles";
-
-# Where do we place the generated path file for gnome (if any)
-PROFILE_PATH_FILES_DIR="/var/cache/desktop-profiles/"
-
# get utility functions for working with .listing files
LIB=/usr/share/desktop-profiles/listingmodule;
if (test -r $LIB); then
. $LIB;
else
- echo "Shell library $LIB is missing! Aborting.";
- exit 1;
+ # errormsg is defined in /etc/X11/Xsession, which sources this script
+ errormsg "Shell library $LIB is missing! No desktop profiles will be activated.";
fi;
+
+#################################
+# Check if user set any defaults
+#################################
+if (test -r /etc/default/desktop-profiles); then
+ . /etc/default/desktop-profiles;
+fi;
+
+#################################################
+# Make sure the variable we need are initialized
+#################################################
+ LISTINGS_DIR=${LISTINGS_DIR:-'/etc/desktop-profiles'}
+ PROFILE_PATH_FILES_DIR=${PROFILE_PATH_FILES_DIR:-'/var/cache/desktop-profiles/'}
+
+ # if nothing specified use by default
+ USE_KDE_PROFILES=${USE_KDE_PROFILE:-'true'}
+ USE_XDG_PROFILES=${USE_XDG_PROFILE:-'true'}
+ USE_ROX_PROFILES=${USE_ROX_PROFILE:-'true'}
+ USE_UDE_PROFILES=${USE_UDE_PROFILE:-'true'}
+ USE_GCONF_PROFILES=${USE_GCONF_PROFILE:-'true'}
+
+
#################################################
# $1 = Profile-kind
# (KDE, ROX, GCONF, XDG_DATA or XDG_CONFIG)
@@ -51,84 +67,99 @@ get_profiles() {
###########################################################################
# Activate Profiles
+# -> if there was no setting disabling the profile kind
# -> not setting variables if they would be empty or equal to the default
# -> not generating gconf path files if they won't be included
###########################################################################
-#if variable empty or = default -> no need to set it
-KDEDIRS=`get_profiles KDE | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
-if (test "$KDEDIRS"x != x) &&
- (test "$KDEDIRS" != "`cat $LISTINGS_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 $LISTINGS_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 $LISTINGS_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;
+if(test "$USE_KDE_PROFILES" = "true"); then
+ KDEDIRS=`get_profiles KDE | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
+ if (test "$KDEDIRS"x != x) &&
+ (test "$KDEDIRS" != "`cat $LISTINGS_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;
+fi;
-CHOICESPATH=`get_profiles ROX | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
-DEFAULT_CHOICES=$(cat $LISTINGS_DIR/default.listing | grep '^default-rox-system;' | cut --field 2 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g")
-DEFAULT_CHOICES="$(cat $LISTINGS_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" != "$DEFAULT_CHOICES"); then
- CHOICESPATH=$(sh -c "echo $CHOICESPATH");# FORCE expansion of variables in CHOICESPATH if any
- export CHOICESPATH;
-fi;
+if(test "$USE_XDG_PROFILES" = "true"); then
+ 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 $LISTINGS_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;
-# don't s/ /:g/ in next line, UDE doesn't currently support combining profile dirs
-UDEDIRS=`get_profiles UDE | sed -e "s/^ *//" -e "s/ *$//"`
-if (test "$UDEDIRS"x != x) &&
- (test "$UDEDIRS" != "`cat $LISTINGS_DIR/default.listing | grep "^ude-install-dir" | cut --fields 2 --delimiter ";"`"); then
- # Take first dir and break, as UDE currently only supports one dir
- for dir in $UDEDIRS; do
- UDEdir=$dir;
- break;
- done;
- UDEdir=$(sh -c "echo $UDEdir");# FORCE expansion of variables in UDEdir if any
- export UDEdir;
-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 $LISTINGS_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;
+fi;
-# HACK WARNING:
-#
-# While GCONF allows multiple "configuration sources", there seems to be no clean way to
-# make the used "configuration sources" dependend on a condition (such as group membership).
-# One dirty way to get this ability is to generate a path file at login which will include
-# directives activating the profiles that have their requirements met.
-#
-# NOTE: this alone isn't enough, the system-wide path file (/etc/gconf/<gconf-version>/path)
-# needs to contain a include directive for this generated file. (preferably it should
-# contain _only_ that include directive setting everything else up through profiles)
+if(test "$USE_ROX_PROFILES" = "true"); then
+ CHOICESPATH=`get_profiles ROX | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g"`
+ DEFAULT_CHOICES=$(cat $LISTINGS_DIR/default.listing | grep '^default-rox-system;' | cut --field 2 --delimiter ";" | sed -e "s/^ *//" -e "s/ *$//" -e "s/ /:/g")
+ DEFAULT_CHOICES="$(cat $LISTINGS_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" != "$DEFAULT_CHOICES"); then
+ CHOICESPATH=$(sh -c "echo $CHOICESPATH");# FORCE expansion of variables in CHOICESPATH if any
+ export CHOICESPATH;
+ fi;
+fi;
-# only generate path files for user if it will be included
-if (grep '/var/cache/desktop-profiles/\$(USER)_mandatory.path' /etc/gconf/2/path 2>&1 > /dev/null ) ||
- (grep '/var/cache/desktop-profiles/\$(USER)_defaults.path' /etc/gconf/2/path 2>&1 > /dev/null ) ||
- (grep '/var/cache/desktop-profiles/\$(USER)_mandatory.path' /etc/gconf/1/path 2>&1 > /dev/null ) ||
- (grep '/var/cache/desktop-profiles/\$(USER)_defaults.path' /etc/gconf/1/path 2>&1 > /dev/null ); then
+if(test "$USE_UDE_PROFILES" = "true"); then
+ # don't s/ /:g/ in next line, UDE doesn't currently support combining profile dirs
+ UDEDIRS=`get_profiles UDE | sed -e "s/^ *//" -e "s/ *$//"`
+ if (test "$UDEDIRS"x != x) &&
+ (test "$UDEDIRS" != "`cat $LISTINGS_DIR/default.listing | grep "^ude-install-dir" | cut --fields 2 --delimiter ";"`"); then
+ # Take first dir and break, as UDE currently only supports one dir
+ for dir in $UDEDIRS; do
+ UDEdir=$dir;
+ break;
+ done;
+ UDEdir=$(sh -c "echo $UDEdir");# FORCE expansion of variables in UDEdir if any
+ export UDEdir;
+ fi;
+fi;
- INCLUDED_HOME=false;
- echo "# Generated by desktop-profiles package" > "$PROFILE_PATH_FILES_DIR/${USER}_mandatory.path";
- echo "# Generated by desktop-profiles package" > "$PROFILE_PATH_FILES_DIR/${USER}_defaults.path";
+if(test "$USE_GCONF_PROFILES" = "true"); then
+ # HACK WARNING:
+ #
+ # While GCONF allows multiple "configuration sources", there seems to be no clean way to
+ # make the used "configuration sources" dependend on a condition (such as group membership).
+ # One dirty way to get this ability is to generate a path file at login which will include
+ # directives activating the profiles that have their requirements met.
+ #
+ # NOTE: this alone isn't enough, the system-wide path file (/etc/gconf/<gconf-version>/path)
+ # needs to contain a include directive for this generated file. (preferably it should
+ # contain _only_ that include directive setting everything else up through profiles)
- get_profiles GCONF | while read LINE; do
- if (test "$LINE" != 'xml:readwrite:$(HOME)/.gconf'); then
- if (test $INCLUDED_HOME = false); then
- echo $LINE >> "$PROFILE_PATH_FILES_DIR/${USER}_mandatory.path";
- else
- echo $LINE >> "$PROFILE_PATH_FILES_DIR/${USER}_defaults.path";
- fi;
- else
- INCLUDED_HOME=true;
- fi
- done;
+ # only generate path files for user if it will be included
+ if (grep '/var/cache/desktop-profiles/\$(USER)_mandatory.path' /etc/gconf/2/path 2>&1 > /dev/null ) ||
+ (grep '/var/cache/desktop-profiles/\$(USER)_defaults.path' /etc/gconf/2/path 2>&1 > /dev/null ) ||
+ (grep '/var/cache/desktop-profiles/\$(USER)_mandatory.path' /etc/gconf/1/path 2>&1 > /dev/null ) ||
+ (grep '/var/cache/desktop-profiles/\$(USER)_defaults.path' /etc/gconf/1/path 2>&1 > /dev/null ); then
+
+ INCLUDED_HOME=false;
+ echo "# Generated by desktop-profiles package" > "$PROFILE_PATH_FILES_DIR/${USER}_mandatory.path";
+ echo "# Generated by desktop-profiles package" > "$PROFILE_PATH_FILES_DIR/${USER}_defaults.path";
+
+ get_profiles GCONF | while read LINE; do
+ if (test "$LINE" != 'xml:readwrite:$(HOME)/.gconf'); then
+ if (test $INCLUDED_HOME = false); then
+ echo $LINE >> "$PROFILE_PATH_FILES_DIR/${USER}_mandatory.path";
+ else
+ echo $LINE >> "$PROFILE_PATH_FILES_DIR/${USER}_defaults.path";
+ fi;
+ else
+ INCLUDED_HOME=true;
+ fi
+ done;
+ fi;
fi;
+
+echo ${KDEDIRS}
+echo $XDG_CONFIG_DIRS
+echo $XDG_DATA_DIRS
+echo $CHOICESPATH
+echo $UDEdir
diff --git a/debian/rules b/debian/rules
index ae344fb..3f24673 100755
--- a/debian/rules
+++ b/debian/rules
@@ -35,6 +35,7 @@ binary-indep: build install
dh_installman desktop-profiles.7
dh_install listingmodule usr/share/desktop-profiles/
dh_install list-desktop-profiles usr/bin/
+ dh_install desktop-profiles etc/default
dh_install 20desktop-profiles_activateDesktopProfiles etc/X11/Xsession.d/
dh_install default.listing etc/desktop-profiles/
dh_installdebconf
diff --git a/desktop-profiles b/desktop-profiles
new file mode 100644
index 0000000..1be23d1
--- /dev/null
+++ b/desktop-profiles
@@ -0,0 +1,74 @@
+# Settings for the shell scripts of the desktop-profiles package
+# (those scripts wil source this file).
+#
+# Should only contain shell variables and comments
+###################################################################
+
+# probably not a good idea to change this one
+# tells the various scripts where to find the .listing files
+LISTINGS_DIR=/etc/desktop-profiles
+
+#################################
+# SETTINGS FOR xsession.d script
+#################################
+# Note: you probably don't want to disable a profile kind unless you are sure
+# your users won't run any programs of the corresponding desktop
+
+# uncomment to have the xsession.d script ignore kde profiles
+#USE_KDE_PROFILES=false
+
+# uncomment to have the xsession.d script ignore xdg profiles
+#USE_XDG_PROFILES=false
+
+# uncomment to have the xsession.d script ignore rox profiles
+#USE_ROX_PROFILES=false
+
+# uncomment to have the xsession.d script ignore ude profiles
+#USE_UDE_PROFILES=false
+
+# uncomment to have the xsession.d script ignore gconf(gnome) profiles
+#USE_GCONF_PROFILES=false
+
+#####################################
+# SETTINGS FOR list-desktop-profiles
+#####################################
+
+# also use specified .listing files not in LISTINGS_DIR
+#EXTRA_LISTINGS=
+
+# which field do we sort on by default?
+#SORT_KEY=1
+
+# any extra arguments to be passed to sort
+# (when sorting on precedence this defaults to
+# '--general-numeric-sort --reverse')
+#SORT_ARGS=
+
+# default regexp to be applied to the profiles' name field
+#NAME_FILTER=
+
+# default regexp to be applied to the profiles' location field
+#LOCATION_FILTER=
+
+# numerical test to be done on the profiles' precedence value
+# (e.g. '-gt 0', '-ge 0', or '-lt 50')
+# `test $PRECEDENCE $PRECEDENCE_FILTER` needs to be true
+#PRECEDENCE_FILTER=
+
+# default regexp to be applied to the profiles' requirements field
+#REQUIREMENT_FILTER=
+
+# default regexp to be applied to the profiles' kind field
+#KIND_FILTER=
+
+# default regexp to be applied to the profiles' description field
+#DESCRIPTION_FILTER=
+
+# Set the default profile formatstring
+# You may use the variables NAME, LOCATION, PRECEDENCE, REQUIREMENT, KIND,
+# DESCRIPTION, FILE variables. The first 6 refer to the respective fields off
+# the profile, while FILE refers to the .listing file the profile is in.
+#
+# Characters interpreted specially by the shell (such as ';') need escaping.
+#FORMAT='$NAME\;$DESCRIPTION\;$PRECEDENCE\;$REQUIREMENTS\;$KIND\;$DESCRIPTION'
+
--
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