diff options
author | Darrell Anderson <[email protected]> | 2012-07-18 00:31:32 -0500 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2012-07-18 00:31:32 -0500 |
commit | 4c855e4813956d4178f60c58ad27f2e3a38ab263 (patch) | |
tree | 961bbf1920db0213660143ed00f718d0277e82c1 | |
parent | e6dd2c450879b25f4e4cfe72d7e2acd07cb54676 (diff) | |
download | tdebase-4c855e4813956d4178f60c58ad27f2e3a38ab263.tar.gz tdebase-4c855e4813956d4178f60c58ad27f2e3a38ab263.zip |
Additional fixes to the migratekde3 and r14-xdg-update scripts.
-rw-r--r-- | migratekde3 | 8 | ||||
-rw-r--r-- | r14-xdg-update | 18 |
2 files changed, 23 insertions, 3 deletions
diff --git a/migratekde3 b/migratekde3 index 886e7d29e..7e5969def 100644 --- a/migratekde3 +++ b/migratekde3 @@ -199,7 +199,8 @@ if [ -n "$KDE3_PROFILE" ]; then echo "Cleaning config files (but not KMail mail files. :-))" 1>&2 echo "Cleaning, first pass..." 1>&2 find $HOME/.trinity -path $HOME/.trinity/share/apps/kmail/mail -prune -o -type f -exec sed -i "s|/${KDE3_PROFILE}|/\.trinity|g" {} \; - if [ "$?" = "0" ]; then + EXIT_CODE="$?" + if [ "$EXIT_CODE" = "0" ]; then echo "Done." 1>&2 else echo "There was an error with the first pass." 1>&2 @@ -209,8 +210,11 @@ if [ -n "$KDE3_PROFILE" ]; then echo "The \$TDEDIR environment variable does not exist. Can't complete the cleanup." 1>&2 else echo "Cleaning, second pass..." 1>&2 + find $HOME/.trinity -path $HOME/.trinity/share/apps/kmail/mail -prune -o -type f -exec sed -i "s|/opt/kde/|${TDEDIR}/|g" {} \; + EXIT_CODE_1="$?" find $HOME/.trinity -path $HOME/.trinity/share/apps/kmail/mail -prune -o -type f -exec sed -i "s|/opt/kde3/|${TDEDIR}/|g" {} \; - if [ "$?" = "0" ]; then + EXIT_CODE_2="$?" + if [ "$EXIT_CODE_1" = "0" ] && [ "$EXIT_CODE_2" = "0" ]; then echo "Done." 1>&2 else echo "There was an error with the second pass." 1>&2 diff --git a/r14-xdg-update b/r14-xdg-update index faedfdad8..f383f717c 100644 --- a/r14-xdg-update +++ b/r14-xdg-update @@ -114,6 +114,8 @@ if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then echo -e "Updating *.desktop files." find "$PROFILE_DIR" -name "*.desktop" -exec sed -i 's|X-KDE-|X-TDE-|g' {} \; 2>/dev/null find "$PROFILE_DIR" -name "*.desktop" -exec sed -i 's|KDE\;|TDE\;|g' {} \; 2>/dev/null + find "$HOME/.local" -name "*.desktop" -exec sed -i 's|X-KDE-|X-TDE-|g' {} \; 2>/dev/null + find "$HOME/.local" -name "*.desktop" -exec sed -i 's|KDE\;|TDE\;|g' {} \; 2>/dev/null Message_Prefix echo -e "Updating references of $TDEDIR/share/applications/kde to share/applications/tde." # Exclude KMail mail files --- we don't want to touch those files. @@ -125,6 +127,8 @@ if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then sed -i 's|CommandURL=kde-|CommandURL=tde-|g' "$PROFILE_DIR/share/config/khotkeysrc" 2>/dev/null sed -i 's|K Menu - kde-|TDE Menu - tde-|g' "$PROFILE_DIR/share/config/khotkeysrc" 2>/dev/null sed -i 's|Name=K Menu|Name=TDE Menu|g' "$PROFILE_DIR/share/config/khotkeysrc" 2>/dev/null + sed -i 's|in KDE stands|in TDE stands|g' "$PROFILE_DIR/share/config/khotkeysrc" 2>/dev/null + sed -i 's| use KDE| use TDE|g' "$PROFILE_DIR/share/config/khotkeysrc" 2>/dev/null Message_Prefix echo -e "Updating some text strings in khotkeysrc." sed -i 's|Go to KDE Website|Go to TDE Website|g' "$PROFILE_DIR/share/config/khotkeysrc" 2>/dev/null @@ -179,6 +183,11 @@ if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then done ) + # Update the user's customized menu. + if [ -r $HOME/.config/menus/applications-kmenuedit.menu ]; then + sed -i 's|<Filename>kde-|<Filename>tde-|g' $HOME/.config/menus/applications-kmenuedit.menu + fi + # 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`" @@ -223,9 +232,16 @@ if [ "$R14_UPDATED" != "true" ] || [ "$FORCE" = "true" ]; then Display_Message "$MESSAGE" fi fi + if [ -r $HOME/.config/menus/applications-kmenuedit.menu ]; then + R14_UPDATE_TEST9="`grep -q \"<Filename>kde-\" \"$HOME/.config/menus/applications-kmenuedit.menu\" 2>/dev/null`" + 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" + 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" = "" ]; then + && [ "$R14_UPDATE_TEST7" = "" ] && [ "$R14_UPDATE_TEST8" = "" ] && [ "$R14_UPDATE_TEST9" = "" ]; then $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' |