Additional fixes to the migratekde3 and r14-xdg-update scripts.

pull/2/head
Darrell Anderson 12 years ago
parent e6dd2c4508
commit 4c855e4813

@ -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

@ -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'

Loading…
Cancel
Save