#!/bin/sh

# source debconf library
. /usr/share/debconf/confmodule

# if gconf path file needs changes in order to activate the gnome profiles 
# then warn the user of that (critical-priority if changing from old variables
# as not changing in that case potentially breaks gnome)
if (test -e /etc/gconf/2/path) ; then
  if ! ( (grep 'include *\$(ENV_MANDATORY_PATH)' /etc/gconf/2/path 2>&1 > /dev/null ) ||
         (grep 'include *\$(ENV_DEFAULTS_PATH)'  /etc/gconf/2/path 2>&1 > /dev/null ) ); then
    if ( (grep 'include /var/cache/desktop-profiles/\$(USER)_mandatory.path' /etc/gconf/2/path 2>&1 > /dev/null ) ||
         (grep 'include /var/cache/desktop-profiles/\$(USER)_defaults.path'  /etc/gconf/2/path 2>&1 > /dev/null ) ); then
      db_input critical desktop-profiles/replace-old-vars || true;
      db_go || true;
    fi;  
  fi;	 
elif (test -e /etc/gconf/1/path) ; then
  if ! ( (grep 'include *\$(ENV_MANDATORY_PATH)' /etc/gconf/1/path 2>&1 > /dev/null ) ||
         (grep 'include *\$(ENV_DEFAULTS_PATH)'  /etc/gconf/1/path 2>&1 > /dev/null ) ); then
    if ( (grep 'include /var/cache/desktop-profiles/\$(USER)_mandatory.path' /etc/gconf/1/path 2>&1 > /dev/null ) ||
         (grep 'include /var/cache/desktop-profiles/\$(USER)_defaults.path'  /etc/gconf/1/path 2>&1 > /dev/null ) ); then
      db_input critical desktop-profiles/replace-old-vars || true;
      db_go || true;
    fi;  
  fi;
fi;  

#DEBHELPER#
