# Are we in X? Display an X dialog explaining breakage.
# Are we in X? Display an X dialog explaining breakage.
if [ "$DISPLAY" != "" ]; then
if [ "$UID" != "0" ] && [ "$USER_DIR" = "$HOME" ] && [ "$DISPLAY" != "" ]; then
echo "[r14-xdg-update] Warning! The profile directory $PROFILE_DIR is a" 1>&2
echo "[r14-xdg-update] Warning! The profile directory $PROFILE_DIR is a" 1>&2
echo " sym link to $TDEHOME_LINK!" 1>&2
echo " sym link to $TDEHOME_LINK!" 1>&2
echo " R14 updates will not be performed because Trinity needs its own" 1>&2
echo " R14 updates will not be performed because Trinity needs its own" 1>&2
@ -141,7 +160,7 @@ if [ "$TDEHOME_LINK" != "" ]; then
fi
fi
MESSAGE="Oops! The profile directory $PROFILE_DIR is a sym link to $TDEHOME_LINK.\n\n${WARNING_MESSAGE}\nPossible remedies:\n\n* Contact your system administrator.\n\n* Break the sym link to force creating a fresh Trinity profile.\n\n* Use the migratekde3 script to migrate a KDE3 profile to Trinity."
MESSAGE="Oops! The profile directory $PROFILE_DIR is a sym link to $TDEHOME_LINK.\n\n${WARNING_MESSAGE}\nPossible remedies:\n\n* Contact your system administrator.\n\n* Break the sym link to force creating a fresh Trinity profile.\n\n* Use the migratekde3 script to migrate a KDE3 profile to Trinity."
# Are we in X? Display an X dialog explaining breakage.
# Are we in X? Display an X dialog explaining breakage.
if [ "$DISPLAY" != "" ]; then
if [ "$UID" != "0" ] && [ "$USER_DIR" = "$HOME" ] && [ "$DISPLAY" != "" ]; then
MESSAGE="${MESSAGE}\n\nSelecting the Continue button means retaining the KDE3 profile and\nbreaking the sym link. With the sym link broken, run the migratekde3\nscript before restarting Trinity to migrate a KDE3 profile or\nallow Trinity to create a fresh profile."
MESSAGE="${MESSAGE}\n\nSelecting the Continue button means retaining the KDE3 profile and\nbreaking the sym link. With the sym link broken, run the migratekde3\nscript before restarting Trinity to migrate a KDE3 profile or\nallow Trinity to create a fresh profile."
@ -167,17 +186,17 @@ if [ "$TDEHOME_LINK" != "" ]; then
BREAK_SYMLINK="true"
BREAK_SYMLINK="true"
fi
fi
if [ "$BREAK_SYMLINK" = "true" ]; then
if [ "$BREAK_SYMLINK" = "true" ]; then
unlink "$HOME/.trinity" 2>/dev/null
unlink "$USER_DIR/.trinity" 2>/dev/null
if [ "`readlink \"$HOME/.trinity\"`" = "" ]; then
if [ "`readlink \"$USER_DIR/.trinity\"`" = "" ]; then
MESSAGE="Sym link broken. With the sym link broken, run the migratekde3\nscript before restarting Trinity to migrate a KDE3 profile or\nallow Trinity to create a fresh profile."
MESSAGE="Sym link broken. With the sym link broken, run the migratekde3\nscript before restarting Trinity to migrate a KDE3 profile or\nallow Trinity to create a fresh profile."
if [ "$DISPLAY" != "" ]; then
if [ "$UID" != "0" ] && [ "$USER_DIR" = "$HOME" ] && [ "$DISPLAY" != "" ]; then
Message_Prefix
Message_Prefix
fi
fi
echo -e "$MESSAGE"
echo -e "$MESSAGE"
echo
echo
else
else
MESSAGE="Unable to break the sym link. Check file and directory privileges. Quitting."
MESSAGE="Unable to break the sym link. Check file and directory privileges. Quitting."
if [ "$DISPLAY" != "" ]; then
if [ "$UID" != "0" ] && [ "$USER_DIR" = "$HOME" ] && [ "$DISPLAY" != "" ]; then
Message_Prefix
Message_Prefix
fi
fi
echo "$MESSAGE"
echo "$MESSAGE"
@ -190,7 +209,7 @@ if [ "$TDEHOME_LINK" != "" ]; then
if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then
if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then
if [ "$R14_UPDATED" != "true" ] && [ "$R14_UPDATED" != "false" ] && [ "$R14_UPDATED" != "" ]; then
if [ "$R14_UPDATED" != "true" ] && [ "$R14_UPDATED" != "false" ] && [ "$R14_UPDATED" != "" ]; then
Message_Prefix
Message_Prefix
@ -200,7 +219,7 @@ if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then
echo
echo
MESSAGE="The r14-xdg-update script has been run at least once.\n\nThe script is not successfully updating.\n\nThe script will run with each login until corrected.\n\nPlease contact an administrator or take appropriate\nadmininstrative action to correct the problem.\n\nThe error code is $R14_UPDATED."
MESSAGE="The r14-xdg-update script has been run at least once.\n\nThe script is not successfully updating.\n\nThe script will run with each login until corrected.\n\nPlease contact an administrator or take appropriate\nadmininstrative action to correct the problem.\n\nThe error code is $R14_UPDATED."
# Are we in X? Display an X dialog explaining breakage.
# Are we in X? Display an X dialog explaining breakage.
if [ "$DISPLAY" != "" ]; then
if [ "$UID" != "0" ] && [ "$USER_DIR" = "$HOME" ] && [ "$DISPLAY" != "" ]; then
# Trap when the user runs this script while in a Trinity session.
# Trap when the user runs this script while in a Trinity session.
# Most files can be updated "live" but some can't, such as kdeglobals.
# Most files can be updated "live" but some can't, such as kdeglobals.
if [ "$TDE_FULL_SESSION" != "" ] || [ "$TDE_SESSION_UID" != "" ]; then
if [ "$USER_DIR" = "$HOME" ] && [ "$UID" != "0" ]; then
MESSAGE="You are running this script from within a Trinity session.\n\nMost files can be updated \"live\" but some cannot, such as kdeglobals.\n\nThis script might complete successfully and might not."
if [ "$TDE_FULL_SESSION" != "" ] || [ "$TDE_SESSION_UID" != "" ]; then
# Are we in X? Display an X dialog explaining breakage.
MESSAGE="You are running this script from within a Trinity session.\n\nMost files can be updated \"live\" but some cannot, such as kdeglobals.\n\nThis script might complete successfully and might not."
if [ "$DISPLAY" != "" ]; then
# Are we in X? Display an X dialog explaining breakage.
# As we are in a Trinity session then use kdialog.
if [ "$UID" != "0" ] && [ "$USER_DIR" = "$HOME" ] && [ "$DISPLAY" != "" ]; then
MESSAGE="The r14-xdg-update script did not complete successfully.\n\nThe script will run with each login until corrected.\n\nPlease contact an administrator or take appropriate\nadmininstrative action to correct the problem.\n\nThe error code is $KDEGLOBALS_KEY_VALUE.\n\nBe sure to check file and directory permissions."
MESSAGE="The r14-xdg-update script did not complete successfully.\n\nThe script will run with each login until corrected.\n\nPlease contact an administrator or take appropriate\nadmininstrative action to correct the problem.\n\nThe error code is $KDEGLOBALS_KEY_VALUE.\n\nBe sure to check file and directory permissions."
# Are we in X? Display an X dialog explaining breakage.
# Are we in X? Display an X dialog explaining breakage.
if [ "$DISPLAY" != "" ]; then
if [ "$UID" != "0" ] && [ "$USER_DIR" = "$HOME" ] && [ "$DISPLAY" != "" ]; then