diff options
author | Darrell Anderson <[email protected]> | 2012-07-20 13:38:48 -0500 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2012-07-20 13:38:48 -0500 |
commit | 81dc4c09e208644442c58d38a02c63bb25e86b60 (patch) | |
tree | 2e09034848627f0463832708fcff64aeb0eec415 /r14-xdg-update | |
parent | 4c855e4813956d4178f60c58ad27f2e3a38ab263 (diff) | |
download | tdebase-81dc4c09e208644442c58d38a02c63bb25e86b60.tar.gz tdebase-81dc4c09e208644442c58d38a02c63bb25e86b60.zip |
Update r14-xdg-update script with feedback when failures occur.
Diffstat (limited to 'r14-xdg-update')
-rw-r--r-- | r14-xdg-update | 69 |
1 files changed, 65 insertions, 4 deletions
diff --git a/r14-xdg-update b/r14-xdg-update index f383f717c..93dc9bbd4 100644 --- a/r14-xdg-update +++ b/r14-xdg-update @@ -108,6 +108,24 @@ fi R14_UPDATED="`$TDEDIR/bin/kreadconfig --file kdeglobals --group "R14 XDG Updates" --key Updated`" if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then + if [ "$R14_UPDATED" != "true" ] && [ "$R14_UPDATED" != "false" ] && [ "$R14_UPDATED" != "" ]; then + Message_Prefix + echo -e "The r14-xdg-update script has been run at least once." + Message_Prefix + echo -e "The 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. + if [ "$DISPLAY" != "" ]; then + echo -e "$MESSAGE" | xmessage -center -file - -buttons Continue,Quit > /dev/null 2>/dev/null + if [ "$?" = "102" ]; then + # User select the Quit button: quit this script. + unset PROFILE_DIR + unset R14_UPDATED + unset TDEHOME_LINK + exit 1 + fi + fi + fi Message_Prefix echo -e "Performing a profile update for Trinity release R14 XDG compliance." Message_Prefix @@ -172,10 +190,10 @@ if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then LINK_PATH="`dirname $LINK`" LINK_NAME="`basename $LINK`" if [ -n "`echo $LINK_PATH | grep \"$TDEDIR/share/applications/kde\"`" ]; then - NEW_LINK_PATH="`echo $LINK_PATH | sed 's|/share/applications/kde|/share/applications/tde|'`" + NEW_LINK_PATH="`echo \"$LINK_PATH\" | sed 's|/share/applications/kde|/share/applications/tde|'`" fi unlink $i - ln -sf $NEW_LINK_PATH/$LINK_NAME $LINK_NAME + ln -sf "$NEW_LINK_PATH/$LINK_NAME" "$LINK_NAME" if [ "$?" != "0" ]; then Message_Prefix echo "There was an error with creating a new sym link for $LINK." 1>&2 @@ -188,48 +206,85 @@ if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then sed -i 's|<Filename>kde-|<Filename>tde-|g' $HOME/.config/menus/applications-kmenuedit.menu fi + unset KDEGLOBALS_KEY_VALUE # Perform some nominal update validations. # This test includes *.desktop files in the profile Autostart directory. R14_UPDATE_TEST1="`find \"$PROFILE_DIR\" -name \"*.desktop\" -exec grep \"X-KDE\" {} \; 2>/dev/null`" if [ "$R14_UPDATE_TEST1" != "" ]; then MESSAGE="Some Trinity profile R14 XDG compliance updates failed.\n\n(Check *.desktop files for 'X-KDE'.)" Display_Message "$MESSAGE" + KDEGLOBALS_KEY_VALUE="1" fi R14_UPDATE_TEST2="`find \"$PROFILE_DIR\" -name \"*.desktop\" -exec grep -q \"KDE;\" {} \; 2>/dev/null`" if [ "$R14_UPDATE_TEST2" != "" ]; then MESSAGE="Some Trinity profile R14 XDG compliance updates failed.\n\n(Check *.desktop files for 'KDE;'.)" Display_Message "$MESSAGE" + if [ "$KDEGLOBALS_KEY_VALUE" = "" ]; then + KDEGLOBALS_KEY_VALUE="2" + else + KDEGLOBALS_KEY_VALUE="$KDEGLOBALS_KEY_VALUE;2" + fi fi R14_UPDATE_TEST3="`find \"$PROFILE_DIR\" \"$PROFILE_DIR/share/apps/kmail/mail\" -prune -o -type f -exec grep -q \"$TDEDIR/share/applications/kde\" {} \; 2>/dev/null`" if [ "$R14_UPDATE_TEST3" != "" ]; then MESSAGE="Some Trinity profile R14 XDG compliance updates failed.\n\n(Check files for '$TDEDIR/share/applications/kde'.)" Display_Message "$MESSAGE" + if [ "$KDEGLOBALS_KEY_VALUE" = "" ]; then + KDEGLOBALS_KEY_VALUE="3" + else + KDEGLOBALS_KEY_VALUE="$KDEGLOBALS_KEY_VALUE;3" + fi fi R14_UPDATE_TEST4="`grep -q \"CommandURL=kde-\" \"$PROFILE_DIR/share/config/khotkeysrc\" 2>/dev/null`" if [ "$R14_UPDATE_TEST4" != "" ]; then MESSAGE="Some Trinity profile R14 XDG compliance updates failed.\n\n(Check khotkeysrc for 'CommandURL=kde-'.)" Display_Message "$MESSAGE" + if [ "$KDEGLOBALS_KEY_VALUE" = "" ]; then + KDEGLOBALS_KEY_VALUE="4" + else + KDEGLOBALS_KEY_VALUE="$KDEGLOBALS_KEY_VALUE;4" + fi fi R14_UPDATE_TEST5="`grep -q \"K Menu - kde-\" \"$PROFILE_DIR/share/config/khotkeysrc\" 2>/dev/null`" if [ "$R14_UPDATE_TEST5" != "" ]; then MESSAGE="Some Trinity profile R14 XDG compliance updates failed.\n\n(Check khotkeysrc for 'K Menu - kde-'.)" Display_Message "$MESSAGE" + if [ "$KDEGLOBALS_KEY_VALUE" = "" ]; then + KDEGLOBALS_KEY_VALUE="5" + else + KDEGLOBALS_KEY_VALUE="$KDEGLOBALS_KEY_VALUE;5" + fi fi R14_UPDATE_TEST6="`grep -q \"Application=kde-\" \"$PROFILE_DIR/share/config/profilerc\" 2>/dev/null`" if [ "$R14_UPDATE_TEST6" != "" ]; then MESSAGE="Some Trinity profile R14 XDG compliance updates failed.\n\n(Check profilerc for 'Application=kde-'.)" Display_Message "$MESSAGE" + if [ "$KDEGLOBALS_KEY_VALUE" = "" ]; then + KDEGLOBALS_KEY_VALUE="6" + else + KDEGLOBALS_KEY_VALUE="$KDEGLOBALS_KEY_VALUE;6" + fi fi R14_UPDATE_TEST7="`grep -q \"StorageId\[\$e\]=kde-\" \"$PROFILE_DIR/share/config/kickerrc\" 2>/dev/null`" if [ "$R14_UPDATE_TEST7" != "" ]; then MESSAGE="Some Trinity profile R14 XDG compliance updates failed.\n\n(Check kickerrc for 'StorageId[$e]=kde-'.)" Display_Message "$MESSAGE" + if [ "$KDEGLOBALS_KEY_VALUE" = "" ]; then + KDEGLOBALS_KEY_VALUE="7" + else + KDEGLOBALS_KEY_VALUE="$KDEGLOBALS_KEY_VALUE;7" + fi fi if [ "$QUICK_LAUNCH_CONFIG" != "" ]; then R14_UPDATE_TEST8="`grep -q \"kde-\" \"$PROFILE_DIR/share/config/$QUICK_LAUNCH_CONFIG\" 2>/dev/null`" if [ "$R14_UPDATE_TEST8" != "" ]; then MESSAGE="Some Trinity profile R14 XDG compliance updates failed.\n\n(Check $QUICK_LAUNCH_CONFIG for 'kde-'.)" Display_Message "$MESSAGE" + if [ "$KDEGLOBALS_KEY_VALUE" = "" ]; then + KDEGLOBALS_KEY_VALUE="8" + else + KDEGLOBALS_KEY_VALUE="$KDEGLOBALS_KEY_VALUE;8" + fi fi fi if [ -r $HOME/.config/menus/applications-kmenuedit.menu ]; then @@ -237,14 +292,19 @@ if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then if [ "$R14_UPDATE_TEST9" != "" ]; then MESSAGE="Some Trinity profile R14 XDG compliance updates failed.\n\n(Check applications-kmenuedit.menu for '<Filename>kde-'.)" Display_Message "$MESSAGE" + if [ "$KDEGLOBALS_KEY_VALUE" = "" ]; then + KDEGLOBALS_KEY_VALUE="9" + else + KDEGLOBALS_KEY_VALUE="$KDEGLOBALS_KEY_VALUE;9" + fi fi fi if [ "$R14_UPDATE_TEST1" = "" ] && [ "$R14_UPDATE_TEST2" = "" ] && [ "$R14_UPDATE_TEST3" = "" ] \ && [ "$R14_UPDATE_TEST4" = "" ] && [ "$R14_UPDATE_TEST5" = "" ] && [ "$R14_UPDATE_TEST6" = "" ] \ && [ "$R14_UPDATE_TEST7" = "" ] && [ "$R14_UPDATE_TEST8" = "" ] && [ "$R14_UPDATE_TEST9" = "" ]; then - $TDEDIR/bin/kwriteconfig --file kdeglobals --group "R14 XDG Updates" --key Updated --type bool 'true' + $TDEDIR/bin/kwriteconfig --file kdeglobals --group "R14 XDG Updates" --key Updated --type bool "true" else - $TDEDIR/bin/kwriteconfig --file kdeglobals --group "R14 XDG Updates" --key Updated --type bool 'false' + $TDEDIR/bin/kwriteconfig --file kdeglobals --group "R14 XDG Updates" --key Updated --type bool "$KDEGLOBALS_KEY_VALUE" fi else echo "This script has been run at least once previously. To run manually pass the 'force' parameter." @@ -259,4 +319,5 @@ unset R14_UPDATE_TEST3 unset R14_UPDATE_TEST4 unset R14_UPDATE_TEST5 unset R14_UPDATE_TEST6 +unset KDEGLOBALS_KEY_VALUE exit 0 |