[debian-edu-commits] debian-edu/ 85/183: Updated README and Changelog
Alexander Alemayhu
ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:36 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 ee48120e33f2e6833855b223e4742decc20df7ad
Author: Bart Cornelis <cobaco at linux.be>
Date: Thu Aug 4 07:07:25 2005 +0000
Updated README and Changelog
---
README | 36 +++--
debian/changelog | 25 +++-
path2desktop-profiles-metadata | 333 -----------------------------------------
3 files changed, 40 insertions(+), 354 deletions(-)
diff --git a/README b/README
index b23af1d..794455b 100644
--- a/README
+++ b/README
@@ -7,7 +7,7 @@ KNOWN BUGS
=-=-=-=-=-=
- The profile-manager.kmdr script is only guaranteed to work with the KDE 3.3
kommander package, it's known to _not_ work (correctly) with the KDE 3.4
- package (the convienence script warns of this, and exits)
+ package at the moment (the convenience script warns of this, and exits)
- The profile-manager.kmdr script doesn't work correctly if the profile
description contains a single quote, it doesn't show the details, and will
@@ -22,25 +22,31 @@ using the default path files). The advantages being:
easily
- being able to use the same mechanism to control crossdesktop configuration
(XDG_CONFIG profiles), or profiles for profiles for other desktops.
+- allowing packages (and thus Custom Debian Distros) to add profiles in a
+ standard way and without needing to mess with the conffiles of other packages
In order for this to work you need to change the default system-wide gconf
path file (/etc/gconf/2/path) to:
- at a minimum include the following 2 directives
- include $(XDG_CACHE_HOME)/$(MANDATORY_PATH)
- include $(XDG_CACHE_HOME)/$(DEFAULTS_PATH)
+ include $(ENV_MANDATORY_PATH)
+ include $(ENV_DEFAULTS_PATH)
respectively before and after any user-controlled sources are included.
--ideally you'd have just those 2 directives and the user-controlled sources in
- the system-wide path file, managing any additional configuration sources with
- desktop-profiles.
-
-The easiest way to get there is to use the conversion script
-(/usr/sbin/path2desktop-profiles-metadata). That script will generate metadata
-for all your currently activated configuration sources, and will replace the
-global path file with /usr/share/desktop-profiles/path.
-Running the script should not produce any user-visible changes, only make it so that
-you as admin can manage all configuration sources through desktop-profiles.
-The script will create a backup of all files it messes with, so you can always go
-back to the previous situation (by restoring the global path file in /etc/gconf/2/)
+- ideally you'd use the example path file in /usr/share/desktop-profiles (which
+ contains just those 2 directives and the user-controlled sources) as the
+ system-wide path file, and manage any additional configuration sources with
+ desktop-profiles.
+
+The easiest way to convert the management of all your current sources to
+desktop-profiles is to use the conversion script (/usr/sbin/path2listing).
+That script will generate metadata for all your currently activated
+configuration sources, and will replace the global path file with
+/usr/share/desktop-profiles/path.
+
+Running the conversion script should not produce any user-visible changes,
+only make it so that you as admin can manage all configuration sources through
+desktop-profiles, but just to be on the safe side it will create a backup of
+all files it messes with (-> you can always go back to the pre-desktop-profiles
+situation by restoring the backed-up global path file in /etc/gconf/2/)
NOTE FOR DEBIAN-EDU USERS
=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/debian/changelog b/debian/changelog
index 1725403..a04820a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,13 +1,26 @@
desktop-profiles (1.4.7) UNRELEASED; urgency=low
- * Removed hook to change global path file from installation postinst script
- There is now a conversion script that will move over all configuration
- sources (including those added by admin) over to being managed by
- desktop-profiles (Closes: 309871, 311113)
+ * Added a conversion script (to be run manually by admin) that will:
+ - generate the metadata needed to manage all currently used configuration
+ sources (including those added by the admin) through the mechanism
+ provided by this package
+ - replace (unless you tell it not to) the global path file by one that
+ assumes all configuration sources are managed through desktop-profiles
+ - creates backup copies of everything it changes
+ * Removed the hook that allowed changing the global path file from within
+ the postinst maintainer script, instead we now just tell the admin that
+ the global path file needs changing, and point him to the conversion
+ script (Closes: 309871, 311113)
* Added French translation by Jean-Luc Coulon (f5ibh) and the French
translation team (Closes: 312437)
-
- -- Bart Cornelis (cobaco) <cobaco at linux.be> Thu, 9 Jun 2005 16:57:12 +0200
+ * Added Vietnamese translation send in by Clytie Siddall
+ <clytie at riverland.net.au>, also corrected some spelling mistakes in the
+ English strings that she noticed (Closes: 313510)
+ * Change to debian-policy version 3.6.2
+ * Adapted creation of profile-manager.pot so that translators don't have
+ to do unnecesary work
+
+ -- Bart Cornelis (cobaco) <cobaco at linux.be> Wed, 3 Aug 2005 18:32:58 +0200
desktop-profiles (1.4.6) unstable; urgency=high
diff --git a/path2desktop-profiles-metadata b/path2desktop-profiles-metadata
deleted file mode 100644
index 9b5fb77..0000000
--- a/path2desktop-profiles-metadata
+++ /dev/null
@@ -1,333 +0,0 @@
-#! /bin/sh
-# This script is ment to allow you to setup gconf to manage confiuration
-# sources through desktop-profiles.
-#
-# It will read your a path file (the global gconf one by default) and will:
-# - generate the necessary metadata to manage all profiles through
-# desktop-profiles
-# - adapt the global path file to manage all configuration sources with
-# desktop-profiles (unless told not to)
-#
-# (c) 2005 Bart Cornelis <cobaco AT skolelinux no>
-#########################################################################
-
-ROOT_PATH_FILE=/etc/gconf/2/path
-CUSTOM_LISTINGS=/etc/desktop-profiles/path2listing_generated.listing
-DEFAULT_LISTINGS=/etc/desktop-profiles/desktop-profiles.listing
-
-# default distance to leave between 2 successive priority sources
-# we're leaving some distance to allow the easy insertion of later profiles
-SOURCE_DISTANCE=50;
-
-print_help () {
-cat <<EOF
-Usage: path2listing [OPTIONS]
- This script facilitates the conversion from:
- - managing gconf configuration sources directly through path files,
- - to managing them with the desktop-profiles package
- and will thus generaly be run only once directly after installing
- desktop-profiles
-
- It will generate the metadata (listing file) needed by desktop-profiles to
- manage the configuration sources that are activated directly or indirectly
- (i.e. through included path files) by the path file it is run on.
-
- After the generation of the metadata the converted path file will be
- replaced by one assuming that desktop-profiles manages activation of
- configuration sources (unless you tell it not to).
-
-Options:
- -d, --distance : precedence distance between different configuration
- sources (defaults to $SOURCE_DISTANCE),
- The idea is to leave some space between precedences so you
- can easily insert other configuration sources later on.
- -f, --file : path file to start conversion from
- (defaults to $ROOT_PATH_FILE)
- -o, --output-file: file to put the generated metadata in (defaults to
- $CUSTOM_LISTINGS)
- --no-replace-file: don't replace path file from which we start the conversion
- with one that manages everything through desktop-profiles
- -h, --help : display this helpmessage
-EOF
-}
-
-# $1 is the path file to look at
-# output is the reverse-priority ordered list of configuration sources that $1
-# contains (directly, or indirectly through nested include directives). The
-# output will ignore the hooks for desktop-profiles if present (as we don't
-# need to generate any metadata for them).
-#
-# Note: not recursing down includes referring to environment variables as we
-# can't be sure they'll resolve the same way when converting, and when
-# running as $random_user, keep them as includes
-# Note: also don't recurse down includes referring to $(HOME) or $(USER), as
-# those are likely user-controlled, keeping as includes
-#############################################################################
-list_sources_in_path_file () {
- # if it's an existing file, process it, otherwise ignore it
- if (test -r "$1"); then
- # strip out comments & empty lines, leave only config sources and includes
- tac "$1" | sed -e "s/^[[:space:]]*//g" -e "s/[[:space:]]*$//g" | \
- grep -v "^#.*\|^$" | while read CONFIG_SOURCE; do
- # ignore desktop-profiles hooks (new and old) as they don't need metadata
- if ( (test "$CONFIG_SOURCE" = 'include $(ENV_MANDATORY_PATH)') ||
- (test "$CONFIG_SOURCE" = 'include *\$(ENV_DEFAULTS_PATH)') ||
- (test "$CONFIG_SOURCE" = 'include /var/cache/desktop-profiles/\$(USER)_mandatory.path') ||
- (test "$CONFIG_SOURCE" = 'include /var/cache/desktop-profiles/\$(USER)_defaults.path') ); then
- true;
- # process nested path files
- elif (echo "$CONFIG_SOURCE" | grep "^include[[:space:]]*" > /dev/null); then
- # check if recursing makes sense (don't recurse when user-controlled or
- # dependend on current environment (which might be influenced by user)
- if (echo "$CONFIG_SOURCE" | grep -e "\$(HOME)" -e "\$(USER)" -e "\$(ENV_.*)" > /dev/null); then
- echo "$CONFIG_SOURCE";
- else
- list_sources_in_path_file $(echo "$CONFIG_SOURCE" | sed "s/^include[[:space:]]*//");
- fi;
- # process regular config sources
- else
- echo $CONFIG_SOURCE;
- fi;
- done;
- fi;
-}
-
-# $1 is the confiuration source that makes up the new profile
-# $2 is the precedence value
-# $3 is the file where it should be added into
-add_as_profile () {
- if (test -r "$3"); then
- declare -i mandatory_number="$(cat "$3" | grep '^mandatory' | wc -l) + 1";
- declare -i default_number="$(cat "$3" | grep '^default' | wc -l) + 1";
- else
- declare -i mandatory_number=1;
- declare -i default_number=1;
- fi;
-
- if (test 0 -lt $2 ); then
- echo "mandatory_$mandatory_number;GCONF;$1;$2;;" >> "$3";
- else
- echo "default_$default_number;GCONF;$1;$2;;" >> "$3";
- fi;
-}
-
-# $1 is the configuration source whose metadata we want to update
-# $2 is the new precedence value
-# $3 is the file where the configuration sources' metadata is to be found
-update_precedence () {
- if (test -w "$3"); then
- sed -i "s|\(.*\);GCONF;$1;.*;\(.*\);\(.*\)|\1;GCONF;$1;$2;\2;\3|" "$3";
- else
- echo "Don't have sufficient permissions to adapt the precedence of $1 in $3 to $2";
- fi;
-}
-
-# $1 is the configuration source of the profile we want to deactivate
-# $2 is the file where the configuration sources' metadata is to be found
-set_inactive () {
- sed -i "s|\(.*\);GCONF;$1;\(.*\);\(.*\);\(.*\)|\1;GCONF;$1;\2;! \3;\4|" "$2";
-}
-
-# $1 is the file to backup
-# $2 is the reason
-make_backup_of () {
- if (test -e "$1"); then
- # tell user what we're doing
- echo "$1 already exists, and this script wil $2 it."
- echo "-> a backup of named $1.$(date --iso-8601=seconds) will be created."
- echo ;
-
- # make backup of current version
- mv "$1" "$1.$(date --iso-8601=seconds)";
- fi;
-}
-
-# we're processing the global path file by default
-# -> so unless asked not to we'll want to replace it
-GLOBAL_PATH_FILE=true;
-REPLACE_PATH_FILE=true;
-
-#####################
-# Parse command line
-#####################
-while test $# -ge 1; do
- case $1 in
- -d | --distance)
- # takes positive integer as distance (between configuration sources)
- if (test $# -lt 2) || !(echo "$2" | grep -E '^[0-9]+$' > /dev/null); then
- print_help;
- exit;
- else # valid distance -> set it
- SOURCE_DISTANCE="$2";
- fi;
- shift 2;
- ;;
-
- # takes path file to be converted as argument
- -f | --file)
- #validate argument, should be a readable path file
- if (test $# -lt 2) || !(test -r $2); then
- print_help;
- exit;
- else #valid filename -> add to list of files to convert
- ROOT_PATH_FILE="$2";
- if (test "$ROOT_PATH_FILE" != /etc/gconf/2/path) || \
- (test "$ROOT_PATH_FILE" != /etc/gconf/1/path); then
- GLOBAL_PATH_FILE=false;
- fi;
- fi;
- shift 2;
- ;;
-
- # takes name of file that will contain the metada for the
- # converted configuration sources
- -o | --output-file)
- #check for argument
- if (test $# -lt 2); then
- print_help;
- exit;
- else #Change name of metadata file accordingly
- CUSTOM_LISTINGS="$2";
- fi;
- shift 2;
- ;;
-
- # takes boolean value
- --no-replace-file)
- REPLACE_PATH_FILE=false;
- shift;
- ;;
-
- -h| --help | *)
- print_help;
- exit;
- ;;
- esac;
-done;
-
-######################################
-# Check if we need to do anything,
-# and communicate that with the admin
-######################################
- # Check if ROOT_PATH_FILE is same as path file we want
- if (diff $ROOT_PATH_FILE /usr/share/desktop-profiles/path 2>&1 > /dev/null); then
- #same -> nothing to do
- echo "$ROOT_PATH_FILE file is already converted to desktop-profiles:";
- echo " -> nothing to do";
- echo " -> exiting";
- exit;
- # check for precense of current desktop-profiles hooks
- # if so warn that the precedence might not be correct
- # they're different -> so we need to convert
- elif
- (grep 'include *\$(ENV_MANDATORY_PATH)' "$ROOT_PATH_FILE" 2>&1 > /dev/null) ||
- (grep 'include *\$(ENV_DEFAULTS_PATH)' "$ROOT_PATH_FILE" 2>&1 > /dev/null); then
- true;#FIXME;
- # check for precense of old desktop-profiles hooks
- # if so warn that the precedence might not be correct
- # they're different -> so we need to convert
- elif
- (grep 'include /var/cache/desktop-profiles/\$(USER)_mandatory.path' "$ROOT_PATH_FILE" 2>&1 > /dev/null) ||
- (grep 'include /var/cache/desktop-profiles/\$(USER)_defaults.path' "$ROOT_PATH_FILE" 2>&1 > /dev/null); then
- true;#FIXME;
- else
- echo "Metadata for all configuration sources contained in $ROOT_PATH_FILE";
- echo "(wether contained directly, or indirectly through includes) will be"
- echo "generated and put in $CUSTOM_LISTINGS."
- echo;
- fi;
-
-################################
-# Deal with generating metadata
-################################
- USER_SOURCE_RANK=$(list_sources_in_path_file $ROOT_PATH_FILE | nl | \
- grep 'xml:readwrite:\$(HOME)/.gconf' | sed "s/^[[:space:]]*//g" | cut --fields 1);
-
- # flags indicating wether we've encountered the default sources yet puth in
- # tempfile, as we need to change them from within a pipe, which means subshell,
- # which means setting a variable doesn't carry outside of loop
- export AID_TMP=$(tempfile);
- echo SEEN_GCONF_MANDATORY="false" >> "$AID_TMP";
- echo SEEN_GCONF_DEFAULTS="false" >> "$AID_TMP";
- echo SEEN_GCONF_USER_PATH="false" >> "$AID_TMP";
- echo SEEN_GCONF_USER="false" >> "$AID_TMP";
-
- # check if file, we'll be messing with already exists, if so create backup
- make_backup_of "$CUSTOM_LISTINGS" regenerate
-
- # iterate over all confguration sources, listed directly or indirectly by the
- # $ROOT_PATH_FILE (by default = /etc/gconf/2/path)
- list_sources_in_path_file $ROOT_PATH_FILE | nl | sed "s/^[[:space:]]*//g" | \
- while read ITEM; do
- # the '- USER_SOURCE_RANK * SOURCE_DISTANCE' at the end is to ensure that
- # the user-source ends up with precedence 0, yielding all mandatory sources
- # with a positive precedence, and all default sources with a negative one
- declare -i PRECEDENCE="$(echo "$ITEM" | cut --fields 1) * $SOURCE_DISTANCE - $USER_SOURCE_RANK * $SOURCE_DISTANCE";
- CONFIG_SOURCE="$(echo "$ITEM" | cut --fields 2)";
-
- # If one of the default source -> update precedence
- # else add a profile-metadata entry for this configuration source
- if (test "$CONFIG_SOURCE" = "xml:readonly:/etc/gconf/gconf.xml.mandatory") ; then
- echo 'SEEN_GCONF_MANDATORY="true"' >> "$AID_TMP";
- update_precedence "$CONFIG_SOURCE" "$PRECEDENCE" "$DEFAULT_LISTINGS";
- elif (test "$CONFIG_SOURCE" = 'include "$(HOME)/.gconf.path"'); then
- echo 'SEEN_GCONF_USER_PATH="true"' >> "$AID_TMP";
- update_precedence "$CONFIG_SOURCE" "$PRECEDENCE" "$DEFAULT_LISTINGS";
- elif (test "$CONFIG_SOURCE" = 'xml:readwrite:$(HOME)/.gconf'); then
- echo 'SEEN_GCONF_USER="true"' >> "$AID_TMP";
- update_precedence "$CONFIG_SOURCE" "$PRECEDENCE" "$DEFAULT_LISTINGS";
- elif (test "$CONFIG_SOURCE" = "xml:readonly:/etc/gconf/gconf.xml.defaults"); then
- echo 'SEEN_GCONF_DEFAULTS="true"' >> "$AID_TMP";
- update_precedence "$CONFIG_SOURCE" "$PRECEDENCE" "$DEFAULT_LISTINGS";
- else
- add_as_profile "$CONFIG_SOURCE" "$PRECEDENCE" "$CUSTOM_LISTINGS";
- fi;
- done;
-
- # Activate/Deactivate default sources as requiered
- # If and only if, we're processing the global path file
- if (test "$GLOBAL_PATH_FILE" = true); then
- # deactivate any of the default configuration sources we didn't encounter
- . "$AID_TMP";#get seen flags
- if (test "$SEEN_GCONF_MANDATORY" = false) || (test "$SEEN_GCONF_USER_PATH" = false) ||
- (test "$SEEN_GCONF_USER" = false) || (test "$SEEN_GCONF_DEFAULTS" = false); then
- make_backup_of "$DEFAULT_LISTING" "make changes to"
- fi;
-
- if (test "$SEEN_GCONF_MANDATORY" = false); then
- set_inactive "xml:readonly:/etc/gconf/gconf.xml.mandatory" "$DEFAULT_LISTINGS";
- fi;
- if (test "$SEEN_GCONF_USER_PATH" = false); then
- set_inactive 'include "$(HOME)/.gconf.path"' "$DEFAULT_LISTINGS";
- fi;
- if (test "$SEEN_GCONF_USER" = false); then
- set_inactive 'xml:readwrite:$(HOME)/.gconf' "$DEFAULT_LISTINGS";
- fi;
- if (test "$SEEN_GCONF_DEFAULTS" = false); then
- set_inactive "xml:readonly:/etc/gconf/gconf.xml.defaults" "$DEFAULT_LISTINGS";
- fi;
- fi;
-
- # cleanup
- rm "$AID_TMP";
- unset AID_TMP;
-
-######################################
-# Deal with changing global path file
-######################################
-if (test $REPLACE_PATH_FILE = true); then
- # make backup-copy of $ROOT_PATH_FILE, before changing it
- if (test -e "$ROOT_PATH_FILE"); then
- # tell user what we're doing
- echo "The global path file will now be replaced with one assuming all "
- echo "configuration sources are managed by desktop-profiles."
- echo "-> a backup named $ROOT_PATH_FILE.$(date --iso-8601=seconds) will be created."
- echo ;
-
- # make backup of current version
- mv "$ROOT_PATH_FILE" "$ROOT_PATH_FILE.$(date --iso-8601=seconds)";
- fi;
-
- # actually replace global path file
- cp /usr/share/desktop-profiles/path "$ROOT_PATH_FILE";
-fi;
--
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