( cd usr/share/gnome/help/sabayon/de/figures ; rm -rf menu.png )
( cd usr/share/gnome/help/sabayon/de/figures ; ln -sf ../../C/figures/menu.png menu.png )
( cd usr/share/gnome/help/sabayon/el/figures ; rm -rf menu.png )
( cd usr/share/gnome/help/sabayon/el/figures ; ln -sf ../../C/figures/menu.png menu.png )
( cd usr/share/gnome/help/sabayon/el/figures ; rm -rf apply-by-user.png )
( cd usr/share/gnome/help/sabayon/el/figures ; ln -sf ../../C/figures/apply-by-user.png apply-by-user.png )
( cd usr/share/gnome/help/sabayon/el/figures ; rm -rf main-window.png )
( cd usr/share/gnome/help/sabayon/el/figures ; ln -sf ../../C/figures/main-window.png main-window.png )
( cd usr/share/gnome/help/sabayon/el/figures ; rm -rf main-window-edit.png )
( cd usr/share/gnome/help/sabayon/el/figures ; ln -sf ../../C/figures/main-window-edit.png main-window-edit.png )
( cd usr/share/gnome/help/sabayon/el/figures ; rm -rf apply-by-group.png )
( cd usr/share/gnome/help/sabayon/el/figures ; ln -sf ../../C/figures/apply-by-group.png apply-by-group.png )
( cd usr/share/gnome/help/sabayon/el/figures ; rm -rf edit-desktop.png )
( cd usr/share/gnome/help/sabayon/el/figures ; ln -sf ../../C/figures/edit-desktop.png edit-desktop.png )
( cd usr/share/gnome/help/sabayon/el/figures ; rm -rf lockdown.png )
( cd usr/share/gnome/help/sabayon/el/figures ; ln -sf ../../C/figures/lockdown.png lockdown.png )
( cd usr/share/gnome/help/sabayon/el/figures ; rm -rf add-profile.png )
( cd usr/share/gnome/help/sabayon/el/figures ; ln -sf ../../C/figures/add-profile.png add-profile.png )
( cd usr/share/gnome/help/sabayon/el/figures ; rm -rf changes.png )
( cd usr/share/gnome/help/sabayon/el/figures ; ln -sf ../../C/figures/changes.png changes.png )
( cd usr/share/gnome/help/sabayon/es/figures ; rm -rf menu.png )
( cd usr/share/gnome/help/sabayon/es/figures ; ln -sf ../../C/figures/menu.png menu.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; rm -rf menu.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; ln -sf ../../C/figures/menu.png menu.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; rm -rf apply-by-user.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; ln -sf ../../C/figures/apply-by-user.png apply-by-user.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; rm -rf main-window.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; ln -sf ../../C/figures/main-window.png main-window.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; rm -rf main-window-edit.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; ln -sf ../../C/figures/main-window-edit.png main-window-edit.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; rm -rf apply-by-group.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; ln -sf ../../C/figures/apply-by-group.png apply-by-group.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; rm -rf edit-desktop.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; ln -sf ../../C/figures/edit-desktop.png edit-desktop.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; rm -rf lockdown.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; ln -sf ../../C/figures/lockdown.png lockdown.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; rm -rf add-profile.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; ln -sf ../../C/figures/add-profile.png add-profile.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; rm -rf changes.png )
( cd usr/share/gnome/help/sabayon/sv/figures ; ln -sf ../../C/figures/changes.png changes.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; rm -rf menu.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; ln -sf ../../C/figures/menu.png menu.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; rm -rf apply-by-user.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; ln -sf ../../C/figures/apply-by-user.png apply-by-user.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; rm -rf main-window.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; ln -sf ../../C/figures/main-window.png main-window.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; rm -rf main-window-edit.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; ln -sf ../../C/figures/main-window-edit.png main-window-edit.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; rm -rf apply-by-group.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; ln -sf ../../C/figures/apply-by-group.png apply-by-group.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; rm -rf edit-desktop.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; ln -sf ../../C/figures/edit-desktop.png edit-desktop.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; rm -rf lockdown.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; ln -sf ../../C/figures/lockdown.png lockdown.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; rm -rf add-profile.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; ln -sf ../../C/figures/add-profile.png add-profile.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; rm -rf changes.png )
( cd usr/share/gnome/help/sabayon/uk/figures ; ln -sf ../../C/figures/changes.png changes.png )

# If the sabayon user doesn't exist, add it.
if ! grep "^sabayon:" etc/passwd 1>/dev/null 2>&1; then
  echo "sabayon:x:63:100:sabayon:/var/sabayon:/bin/false" >>etc/passwd
fi
if ! grep "^sabayon:" etc/shadow 1>/dev/null 2>&1; then
  echo "sabayon:*:9797:0:::::" >>etc/shadow
fi

# Needed for 'enforce mandatory' setting
if ! grep "gconf.path.mandatory" etc/gconf/2/local-madatory.path >/dev/null 2>&1; then
  echo "include \"\$(HOME)/.gconf.path.mandatory\"" >> etc/gconf/2/local-madatory.path ;
fi
if ! grep "gconf.path.defaults" etc/gconf/2/local-defaults.path >/dev/null 2>&1; then
  echo "include \"\$(HOME)/.gconf.path.defaults\"" >> etc/gconf/2/local-defaults.path ;
fi

# update desktop entries
if [ -x usr/bin/update-desktop-database ]; then
  usr/bin/update-desktop-database 1> /dev/null 2> /dev/null
fi

# update hicolor icons
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
	rm -f usr/share/icons/hicolor/icon-theme.cache
fi
usr/bin/gtk-update-icon-cache -f -q usr/share/icons/hicolor
