[debian-edu-commits] debian-edu/ 70/183: - Changed section to x11 (as per override from ftp-admin) - Begin complete conversion script to move over all current configuration sources to be managed by desktop-profiles, and take out the hook allowing the admin to mess with the path file from within the maintainerscript NOTE: still needs man-page, and replacing of global path file, but the conversion itself works
Alexander Alemayhu
ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:34 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 4da996fa301c8b0c33d6a115f24d1fd0689e4306
Author: Bart Cornelis <cobaco at linux.be>
Date: Sun May 29 13:33:11 2005 +0000
- Changed section to x11 (as per override from ftp-admin)
- Begin complete conversion script to move over all current configuration
sources to be managed by desktop-profiles, and take out the hook allowing
the admin to mess with the path file from within the maintainerscript
NOTE: still needs man-page, and replacing of global path file, but the
conversion itself works
---
README | 15 ++--
TODO | 6 +-
debian/changelog | 14 ++-
debian/control | 2 +-
debian/listing | 9 +-
debian/po/nl.po | 66 ++++++++++----
debian/po/templates.pot | 48 ++++++-----
debian/rules | 1 +
debian/templates | 28 +++---
path | 10 +--
path2desktop-profiles-metadata | 190 +++++++++++++++++++++++++++++++++++++++++
11 files changed, 317 insertions(+), 72 deletions(-)
diff --git a/README b/README
index 193e731..986c988 100644
--- a/README
+++ b/README
@@ -33,11 +33,16 @@ path file (/etc/gconf/2/path) to:
the system-wide path file, managing any additional configuration sources with
desktop-profiles.
-A Path file that assumes the latter option, and that will reproduce the default
-behavior of gconf (when no additional sources are known to desktop-profiles)
-is available in /urs/share/doc/desktop-profiles/examples.
-Running `dpkg-reconfigure desktop-profiles` provides a hook to activate the path
-file proposed by this 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. All it does is
+make it so the admin can manage all configuration sources through
+desktop-profiles.
+A backup of the current path file will be made with the name
+/etc/gconf/2/path.pre-converion, restoring that will revert to the pre-desktop
+profiles situation.
NOTE FOR DEBIAN-EDU USERS
=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/TODO b/TODO
index 0506bc2..1e8edc4 100644
--- a/TODO
+++ b/TODO
@@ -3,11 +3,9 @@
-> panel: http://www.loculus.nl/xfce/documentation/docs-4.2/xfce4-panel.html#panel-kiosk
-> xfce4-session:
-- figure out where to place l10n data in order to localize kommander script
-- make call for translation + add translations to package
-
-After package enters Debian:
- switch debian-edu-config + desktop-base to use desktop-profiles
- talk to gconf-maintainers, to have gconf support this package
(current system-wide gconf path file needs replacing with the one from this package)
+ -> in progress see bug #310065
- build usefull (example) profiles and point to them in docu (for accessibility?)
+- make call for translation + add translations to package
diff --git a/debian/changelog b/debian/changelog
index c0bab7a..0ee8097 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,13 @@
-desktop-profiles (1.4.6) UNRELEASED; urgency=low
+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)
+
+ -- Bart Cornelis (cobaco) <cobaco at linux.be> Sun, 29 May 2005 14:14:49 +0200
+
+desktop-profiles (1.4.6) unstable; urgency=high
* Put generated path files into XDG_CACHE_HOME, and randomize file names
to avoid succesfull attack, and put proposed path file into
@@ -7,8 +16,9 @@ desktop-profiles (1.4.6) UNRELEASED; urgency=low
* Added extended note about replacing/changing default gconf path file
in README file, also changed wording of debconf to be more informative
about why this is necessary
+ * Changed section to x11 (as per the override by ftp-masters)
- -- Bart Cornelis (cobaco) <cobaco at linux.be> Sat, 21 May 2005 03:14:47 +0200
+ -- Bart Cornelis (cobaco) <cobaco at linux.be> Sun, 29 May 2005 14:14:33 +0200
desktop-profiles (1.4.5) unstable; urgency=low
diff --git a/debian/control b/debian/control
index 7423f5c..a3dd7df 100644
--- a/debian/control
+++ b/debian/control
@@ -1,5 +1,5 @@
Source: desktop-profiles
-Section: admin
+Section: x11
Priority: optional
Maintainer: Bart Cornelis (cobaco) <cobaco at linux.be>
Build-Depends: debhelper (>= 4.0.0)
diff --git a/debian/listing b/debian/listing
index 3f5119d..812f209 100644
--- a/debian/listing
+++ b/debian/listing
@@ -30,8 +30,7 @@ gnustep-local-domain;GNUSTEP;${GNUSTEP_LOCAL_ROOT};20;;Default location of local
gnustep-network-domain;GNUSTEP;${GNUSTEP_NETWORK_ROOT};10;;Default location of network domain, evaluates to /usr/local/lib/GNUstep/Network by default
gnustep-system-domain;GNUSTEP;${GNUSTEP_SYSTEM_ROOT};0;;Default location of system domain, evaluates to /usr/lib/GNUstep/System by default
-gconf-mandatory;GCONF;xml:readonly:/etc/gconf/gconf.xml.mandatory;101;;Configuration source with the mandatory system-wide settings
-gconf-sysadmin-mandatory;GCONF;include /etc/gconf/2/local-mandatory.path;100;;Extra mandatory settings defined by sysadmin
-gconf-user;GCONF;xml:readwrite:$(HOME)/.gconf;50;;The normal user configuration source
-gconf-sysadmin-defaults;GCONF;include /etc/gconf/2/local-defaults.path;-1;;Extra default settings defined by sysadmin
-gconf-defaults;GCONF;xml:readonly:/etc/gconf/gconf.xml.defaults;-2;;Configuration source with the default systemwide settings
+gconf-mandatory;GCONF;xml:readonly:/etc/gconf/gconf.xml.mandatory;100;;Configuration source with the mandatory system-wide settings
+gconf-user-path;GCONF;include "$(HOME)/.gconf.path";50;;The normal user configuration source
+gconf-user;GCONF;xml:readwrite:$(HOME)/.gconf;0;;The normal user configuration source
+gconf-defaults;GCONF;xml:readonly:/etc/gconf/gconf.xml.defaults;-50;;Configuration source with the default systemwide settings
diff --git a/debian/po/nl.po b/debian/po/nl.po
index 0dae745..e373f47 100644
--- a/debian/po/nl.po
+++ b/debian/po/nl.po
@@ -15,8 +15,8 @@ msgid ""
msgstr ""
"Project-Id-Version: desktop-profiles\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-05-21 03:23+0200\n"
-"PO-Revision-Date: 2005-05-21 03:23+0100\n"
+"POT-Creation-Date: 2005-05-29 15:04+0200\n"
+"PO-Revision-Date: 2005-05-29 15:21+0100\n"
"Last-Translator: Bart Cornelis <cobaco at linux.be>\n"
"Language-Team: debian-l10n-dutch <debian-l10n-dutch at lists.debian.org>\n"
"MIME-Version: 1.0\n"
@@ -24,27 +24,61 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: nl\n"
-#. Type: boolean
+#. Type: note
#. Description
-#: ../templates:4
-msgid "Replace the default system-wide 'path' file?"
-msgstr "Systeemwijd 'path'-bestand vervangen?"
+#: ../templates:3
+msgid "gconf profiles won't work by default"
+msgstr "gconf-profielen werken standaard niet"
-#. Type: boolean
+#. Type: note
#. Description
-#: ../templates:4
+#: ../templates:3
msgid "The default gconf (i.e. GNOME) setup doesn't facilitate the use of profiles for certain groups only. This package provides an alternative way to manage gconf configuration sources that does. In order to activate this alternative way of managing your configuration sources the system-wide gconf 'path' file (/etc/gconf/<gconf-version>/path) needs to be adapted."
msgstr "De standaard manier waarmee gconf (en dus GNOME) configuratiebronnen beheert biedt geen ondersteunen voor het conditioneel activeren van bronnen. Dit pakket voorziet een alternatieve aanpak die dit wel ondersteund. Om ervoor te zorgen dat gconf de aanpak van dit pakket gebruikt dient het systeemwijde 'path'-bestand (/etc/gconf.<gconf-version>/path) aangepast te worden."
-#. Type: boolean
+#. Type: note
#. Description
-#: ../templates:4
-msgid "This package includes an replacement system-wide gconf 'path' file that will reproduce the default behaviour of gconf, but will also allow the subsequent installation and activation of gconf configuration sources through desktop-profiles. It is recommended that you let me replace the default system-wide gconf 'path' file."
-msgstr "Dit pakket bevat een voorgestelde vervanging voor het systeemwijde 'path'-bestand, dat het standaardgedrag van gconf behoud, en bijkomend de installatie van extra configuratiebronnen via desktop-profiles toelaat. U wordt aangeraden om het standaard systeem-wijde gconf 'path'-bestand te vervangen."
+#: ../templates:3
+msgid "This package includes a conversion script that wil create the necessary metadata to have all your configuration sources managed by desktop-profiles (/usr/sbin/path2desktop-profiles-metadata). It will also replace the global path file with one that is setup for managing all configuration sources through desktop-profiles."
+msgstr "Dit pakket bevat een conversie-script. Het script (/usr/sbin/path2desktop-profiles-metadata) genereert de metadata die nodig is om alle configuratiebronnen te beheren via desktop-profiles, en vervangt het globale 'path'-bestand met een 'path'-bestand dat reflecteerd dat alle configuratiebronnen beheerd worden via desktop-profiles."
-#. Type: boolean
+#. Type: note
#. Description
-#: ../templates:4
-msgid "If you choose not to replace the default gconf 'path' file at this point, you can always do this later by running `dpkg-reconfigure desktop-profiles', or by manually replacing /etc/gconf/<gconf-version>/path with /usr/share/desktop-profiles/path, or another 'path' file as described in /usr/share/doc/desktop-profiles/README."
-msgstr "Als u ervoor kiest om het standaard gconf 'path'-bestand nu niet te vervangen, kunt u dit altijd later doen via het commando 'desktop-reconfigure desktop-profiles', of door handmatig /etc/gconf/<gconf-version>path te vervangen door /usr/share/desktop-profiles/path, of een ander 'path'-bestand zoals beschreven in /usr/share/doc/desktop-profiles/README"
+#: ../templates:3
+msgid "Running this script shouldn't create any user-visible differences. But will allow the admin to manage all configuration sources through desktop-profiles. A backup of the old path file will be made with the name /etc/gconf/2/path.pre-conversion, you can always go back to managing configuration sources directly by putting that back."
+msgstr "Het uitvoeren van dit script geeft geen voor gebruikers zichtbare veranderingen, maar laat de beheerder wel toe om alle configuratiebronnen te beherenvia desktop-profiles. Een reservekopie van het huidige globale 'path'-bestand wordt gemaakt met de naam /etc/gconf/2/path.pre-conversion. U kunt altijdterugkeren naar de oude situatie zonder door desktop-profiles beheerde configuratiebronnen door deze reservekopie terug te plaatsen."
+
+#. Type: note
+#. Description
+#: ../templates:3
+msgid "If you want to do the conversion manually this is off course possible, see /usr/share/doc/desktop-profiles/README for more information."
+msgstr "Deze conversie handmatig uitvoeren is natuurlijk ook mogelijk, zie /usr/share/doc/desktop-profiles/README voor meer informatie."
+
+#~ msgid "Replace the default system-wide 'path' file?"
+#~ msgstr "Systeemwijd 'path'-bestand vervangen?"
+#~ msgid ""
+#~ "This package includes an replacement system-wide gconf 'path' file that "
+#~ "will reproduce the default behaviour of gconf, but will also allow the "
+#~ "subsequent installation and activation of gconf configuration sources "
+#~ "through desktop-profiles. It is recommended that you let me replace the "
+#~ "default system-wide gconf 'path' file."
+#~ msgstr ""
+#~ "Dit pakket bevat een voorgestelde vervanging voor het systeemwijde 'path'-"
+#~ "bestand, dat het standaardgedrag van gconf behoud, en bijkomend de "
+#~ "installatie van extra configuratiebronnen via desktop-profiles toelaat. U "
+#~ "wordt aangeraden om het standaard systeem-wijde gconf 'path'-bestand te "
+#~ "vervangen."
+#~ msgid ""
+#~ "If you choose not to replace the default gconf 'path' file at this point, "
+#~ "you can always do this later by running `dpkg-reconfigure desktop-"
+#~ "profiles', or by manually replacing /etc/gconf/<gconf-version>/path with /"
+#~ "usr/share/desktop-profiles/path, or another 'path' file as described in /"
+#~ "usr/share/doc/desktop-profiles/README."
+#~ msgstr ""
+#~ "Als u ervoor kiest om het standaard gconf 'path'-bestand nu niet te "
+#~ "vervangen, kunt u dit altijd later doen via het commando 'desktop-"
+#~ "reconfigure desktop-profiles', of door handmatig /etc/gconf/<gconf-"
+#~ "version>path te vervangen door /usr/share/desktop-profiles/path, of een "
+#~ "ander 'path'-bestand zoals beschreven in /usr/share/doc/desktop-profiles/"
+#~ "README"
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
index 589ebfb..9aadaa3 100644
--- a/debian/po/templates.pot
+++ b/debian/po/templates.pot
@@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-05-21 03:23+0200\n"
+"POT-Creation-Date: 2005-05-29 15:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
"Language-Team: LANGUAGE <LL at li.org>\n"
@@ -24,15 +24,15 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#. Type: boolean
+#. Type: note
#. Description
-#: ../templates:4
-msgid "Replace the default system-wide 'path' file?"
+#: ../templates:3
+msgid "gconf profiles won't work by default"
msgstr ""
-#. Type: boolean
+#. Type: note
#. Description
-#: ../templates:4
+#: ../templates:3
msgid ""
"The default gconf (i.e. GNOME) setup doesn't facilitate the use of profiles "
"for certain groups only. This package provides an alternative way to manage "
@@ -41,24 +41,32 @@ msgid ""
"gconf 'path' file (/etc/gconf/<gconf-version>/path) needs to be adapted."
msgstr ""
-#. Type: boolean
+#. Type: note
#. Description
-#: ../templates:4
+#: ../templates:3
msgid ""
-"This package includes an replacement system-wide gconf 'path' file that will "
-"reproduce the default behaviour of gconf, but will also allow the subsequent "
-"installation and activation of gconf configuration sources through desktop-"
-"profiles. It is recommended that you let me replace the default system-wide "
-"gconf 'path' file."
+"This package includes a conversion script that wil create the necessary "
+"metadata to have all your configuration sources managed by desktop-profiles "
+"(/usr/sbin/path2desktop-profiles-metadata). It will also replace the global "
+"path file with one that is setup for managing all configuration sources "
+"through desktop-profiles."
msgstr ""
-#. Type: boolean
+#. Type: note
#. Description
-#: ../templates:4
+#: ../templates:3
msgid ""
-"If you choose not to replace the default gconf 'path' file at this point, "
-"you can always do this later by running `dpkg-reconfigure desktop-profiles', "
-"or by manually replacing /etc/gconf/<gconf-version>/path with /usr/share/"
-"desktop-profiles/path, or another 'path' file as described in /usr/share/"
-"doc/desktop-profiles/README."
+"Running this script shouldn't create any user-visible differences. But will "
+"allow the admin to manage all configuration sources through desktop-"
+"profiles. A backup of the old path file will be made with the name /etc/"
+"gconf/2/path.pre-conversion, you can always go back to managing "
+"configuration sources directly by putting that back."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../templates:3
+msgid ""
+"If you want to do the conversion manually this is off course possible, see /"
+"usr/share/doc/desktop-profiles/README for more information."
msgstr ""
diff --git a/debian/rules b/debian/rules
index 6ccc664..d679b18 100755
--- a/debian/rules
+++ b/debian/rules
@@ -45,6 +45,7 @@ binary-indep: build install
dh_install profile-manager.kmdr usr/share/desktop-profiles/kommander-scripts/
dh_install desktop-profiles etc/default
dh_install 20desktop-profiles_activateDesktopProfiles etc/X11/Xsession.d/
+ dh_install path2desktop-profiles-metadata usr/sbin
./dh_installlisting
dh_installdebconf
dh_compress
diff --git a/debian/templates b/debian/templates
index 00a6b98..1566aaf 100644
--- a/debian/templates
+++ b/debian/templates
@@ -1,21 +1,23 @@
Template: desktop-profiles/replace-gconf-system-wide-path-file
-Type: boolean
-Default: false
-_Description: Replace the default system-wide 'path' file?
+Type: note
+_Description: gconf profiles won't work by default
The default gconf (i.e. GNOME) setup doesn't facilitate the use of
profiles for certain groups only. This package provides an alternative way to
manage gconf configuration sources that does. In order to activate this
alternative way of managing your configuration sources the system-wide
gconf 'path' file (/etc/gconf/<gconf-version>/path) needs to be adapted.
.
- This package includes an replacement system-wide gconf 'path' file that will
- reproduce the default behaviour of gconf, but will also allow the subsequent
- installation and activation of gconf configuration sources through
- desktop-profiles. It is recommended that you let me replace the default
- system-wide gconf 'path' file.
+ This package includes a conversion script that wil create the necessary
+ metadata to have all your configuration sources managed by desktop-profiles
+ (/usr/sbin/path2desktop-profiles-metadata). It will also replace the global
+ path file with one that is setup for managing all configuration sources through
+ desktop-profiles.
.
- If you choose not to replace the default gconf 'path' file at this point, you
- can always do this later by running `dpkg-reconfigure desktop-profiles', or
- by manually replacing /etc/gconf/<gconf-version>/path with
- /usr/share/desktop-profiles/path, or another 'path' file as
- described in /usr/share/doc/desktop-profiles/README.
+ Running this script shouldn't create any user-visible differences. But will
+ allow the admin to manage all configuration sources through desktop-profiles.
+ A backup of the old path file will be made with the name
+ /etc/gconf/2/path.pre-conversion, you can always go back to managing
+ configuration sources directly by putting that back.
+ .
+ If you want to do the conversion manually this is off course possible, see
+ /usr/share/doc/desktop-profiles/README for more information.
diff --git a/path b/path
index aca5dc1..e10d1e6 100644
--- a/path
+++ b/path
@@ -10,15 +10,13 @@
# See the desktop-profiles (7) man page for more information
###############################################################################
-# Look for mandatory "configuration sources" from desktop-profiles
+# Look first at mandatory 'configuration sources' managed by desktop-profiles
+# (those with higher precedence then the user source)
include $(ENV_MANDATORY_PATH)
-# Now see where users want us to look - basically the user can stick arbitrary
-# sources in a ~/.gconf.path file and they're inserted here
-include "$(HOME)/.gconf.path"
-
# Give users a default storage location, ~/.gconf
xml:readwrite:$(HOME)/.gconf
-# Look for default "configuration sources" from desktop-profiles
+# Look for default 'configuration sources' managed by desktop-profiles
+# (those with lower precedence then the user source
include $(ENV_DEFAULTS_PATH)
diff --git a/path2desktop-profiles-metadata b/path2desktop-profiles-metadata
new file mode 100644
index 0000000..0a99e6d
--- /dev/null
+++ b/path2desktop-profiles-metadata
@@ -0,0 +1,190 @@
+#! /bin/sh
+# This script is ment to allow you to setup gconf to manage confiuration
+# sources through desktop-profiles.
+#
+# It will read your current gconf configuration and will:
+# - check wether it will use the configuration sources managed by
+# desktop-profiles
+# - offer to generate the necessary metadata to manage all profiles
+# (that aren't already) through desktop-profiles
+# - offer to adapt the global path file accordingly
+#
+# (c) 2005 Bart Cornelis <cobaco AT skolelinux no>
+#########################################################################
+
+print_help () {
+cat <<EOF
+FIXME
+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).
+#
+# 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 and empty lines, leaving only config sources and includes
+ tac "$1" | sed -e "s/^[[:space:]]*//g" -e "s/[[:space:]]*$//g" | \
+ grep -v "^#.*\|^$" | while read CONFIG_SOURCE; do
+ # if nested path file
+ if (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;
+ else #regular config source, just output
+ 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 () {
+ echo "source-$2;GCONF;$1;$2;;" >> "$3";
+}
+
+# $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 () {
+ sed -i "s|\(.*\);GCONF;$1;.*;\(.*\);\(.*\)|\1;GCONF;$1;$2;\2;\3|" "$3";
+}
+
+# $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";
+}
+############################
+# Start of script execution
+############################
+
+ROOT_PATH_FILE=/etc/gconf/2/path
+CUSTOM_LISTINGS=/etc/desktop-profiles/path2desktop-profiles_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;
+
+# 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;
+ ;;
+
+ # 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";
+ fi;
+ ;;
+
+ -h| --help)
+ print_help;exit;
+ ;;
+
+ # listing-file to put converted sources in
+ -o|--output-file)
+ #validate argument
+ if (test $# -lt 2); then
+ print_help;exit;
+ else #valid filename -> add to list of files to convert
+ CUSTOM_LISTINGS="$2";
+ echo;
+ fi;
+ ;;
+
+ *)
+ print_help;exit;
+ ;;
+ esac;
+
+ # All options take an argument so we should always shift twice
+ # (except --help, but then we don't get here)
+ shift 2;
+done;
+
+# 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
+TMP=$(tempfile);
+echo SEEN_GCONF_MANDATORY="false" >> "$TMP";
+echo SEEN_GCONF_DEFAULTS="false" >> "$TMP";
+echo SEEN_GCONF_USER_PATH="false" >> "$TMP";
+echo SEEN_GCONF_USER="false" >> "$TMP";
+
+# make backup-copy of current files to be touched
+if (test -e "$CUSTOM_LISTINGS"); then
+ mv "$CUSTOM_LISTINGS" "$CUSTOM_LISTINGS.$(date --iso-8601=seconds).conversion";
+fi;
+
+# 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 '- 2 * SOURCE_DISTANCE' at the end is to get the user-source with
+ # priority 0 in the default situation
+ declare -i PRECEDENCE="$(echo "$ITEM" | cut --fields 1) * $SOURCE_DISTANCE - 2 * $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"' >> "$TMP";
+ update_precedence "$CONFIG_SOURCE" "$PRECEDENCE" "$DEFAULT_LISTINGS";
+ elif (test "$CONFIG_SOURCE" = 'include "$(HOME)/.gconf.path"'); then
+ echo 'SEEN_GCONF_USER_PATH="true"' >> "$TMP";
+ update_precedence "$CONFIG_SOURCE" "$PRECEDENCE" "$DEFAULT_LISTINGS";
+ elif (test "$CONFIG_SOURCE" = 'xml:readwrite:$(HOME)/.gconf'); then
+ echo 'SEEN_GCONF_USER="true"' >> "$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"' >> "$TMP";
+ update_precedence "$CONFIG_SOURCE" "$PRECEDENCE" "$DEFAULT_LISTINGS";
+ else #split in default and my-gconf listings
+ add_as_profile "$CONFIG_SOURCE" "$PRECEDENCE" "$CUSTOM_LISTINGS";
+ fi;
+done;
+
+# deactivate any of the default configuration sources we didn't encounter
+. "$TMP";#get seen flags
+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;
+rm "$TMP";#cleanup
+
+#FIXME: take our global path file in the place of the global path file
+#cp $DEFAULT_LISTINGS $DEFAULT_LISTINGS.pre-conversion
--
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