Update migratekde3 script with additional file/directory renaming and

add preliminary foundational support for updating 3.5.11->3.5.13 profiles.
pull/2/head
Darrell Anderson 12 years ago
parent eecd65119c
commit 0e11879b04

@ -91,7 +91,6 @@ fi
# Proceed_From_Response # Proceed_From_Response
# User wants to migrate. # User wants to migrate.
echo "Migrating an existing KDE3 profile directory:" 1>&2 echo "Migrating an existing KDE3 profile directory:" 1>&2
echo "This is a one-time event." 1>&2
echo "Copying \$HOME/$KDE3_PROFILE to \$HOME/.trinity." 1>&2 echo "Copying \$HOME/$KDE3_PROFILE to \$HOME/.trinity." 1>&2
cp -a $HOME/$KDE3_PROFILE $HOME/.trinity cp -a $HOME/$KDE3_PROFILE $HOME/.trinity
} }
@ -155,8 +154,9 @@ if [ "$TDEHOME_LINK" != "" ]; then
fi fi
if [ -d "$HOME/.trinity" ]; then if [ -d "$HOME/.trinity" ]; then
echo "$HOME/.trinity already exists." 1>&2 echo "$HOME/.trinity already exists." 1>&2
echo "No migration required." 1>&2 echo "No migration required, but running to update an older Trinity profile." 1>&2
echo echo
KDE3_PROFILE=".trinity"
else else
echo "$HOME/.trinity does not exist." 1>&2 echo "$HOME/.trinity does not exist." 1>&2
# If $HOME/.kde3 or $HOME/.kdemod3 exists, probably safe to presume a profile from KDE3 or a previous Trinity. # If $HOME/.kde3 or $HOME/.kdemod3 exists, probably safe to presume a profile from KDE3 or a previous Trinity.
@ -190,14 +190,23 @@ else
echo "Found no KDE3 profile directory to migrate." 1>&2 echo "Found no KDE3 profile directory to migrate." 1>&2
fi fi
fi fi
if [ -n "$KDE3_PROFILE" ]; then
# Let's remove any KDE3 "contamination." if [ -n "$KDE3_PROFILE" ] && [ -d "$KDE3_PROFILE" ]; then
echo "Removing KDE3 remnants from the new Trinity profile:" 1>&2 # Remove any KDE3 "contamination."
echo "Removing cache and temp files." 1>&2
rm -fr $HOME/.trinity/cache-* echo "Cleaning temp file locations." 1>&2
rm -fr $HOME/.trinity/socket-* CACHE_DIR="`readlink $HOME/.trinity/cache-\`uname -n\``"
rm -fr $HOME/.trinity/tmp-* SOCKET_DIR="`readlink $HOME/.trinity/socket-\`uname -n\``"
# Need to fix config files. TMP_DIR="`readlink $HOME/.trinity/tmp-\`uname -n\``"
rm -f ${CACHE_DIR}/ksycoca* 2>/dev/null
mkdir `dirname $CACHE_DIR`/tdecache-$USER 2>/dev/null
cp -a $CACHE_DIR/* `dirname $CACHE_DIR`/tdecache-$USER/ 2>/dev/null
unlink $HOME/.trinity/cache-`uname -n`
ln -s `dirname $CACHE_DIR`/tdecache-$USER $HOME/.trinity/cache-`uname -n`
unlink $HOME/.trinity/socket-`uname -n` 2>/dev/null
unlink $HOME/.trinity/tmp-`uname -n` 2>/dev/null
# Fix config files.
# Exclude KMail mail files --- we don't want to touch those files. # Exclude KMail mail files --- we don't want to touch those files.
# I'm using maildir --- do these commands work for mbox too? # I'm using maildir --- do these commands work for mbox too?
echo "Cleaning config files (but not KMail mail files. :-))" 1>&2 echo "Cleaning config files (but not KMail mail files. :-))" 1>&2
@ -211,7 +220,7 @@ if [ -n "$KDE3_PROFILE" ]; then
fi fi
# What if $TDEDIR is not defined? Bummer. # What if $TDEDIR is not defined? Bummer.
if [ -z "$TDEDIR" ]; then if [ -z "$TDEDIR" ]; then
echo "The \$TDEDIR environment variable does not exist. Can't complete the cleanup." 1>&2 echo "The \$TDEDIR environment variable does not exist. Cannot complete the second pass." 1>&2
else else
echo "Cleaning, second pass..." 1>&2 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" {} \; find $HOME/.trinity -path $HOME/.trinity/share/apps/kmail/mail -prune -o -type f -exec sed -i "s|/opt/kde/|${TDEDIR}/|g" {} \;
@ -264,40 +273,59 @@ if [ -n "$KDE3_PROFILE" ]; then
elif [ -n "`echo $LINK_PATH | grep \"/opt/kde3\"`" ]; then elif [ -n "`echo $LINK_PATH | grep \"/opt/kde3\"`" ]; then
echo "Sym link points to /opt/kde3." 1>&2 echo "Sym link points to /opt/kde3." 1>&2
NEW_LINK_PATH="`echo $LINK_PATH | sed \"s|/opt/kde3|${TDEDIR}|\"`" NEW_LINK_PATH="`echo $LINK_PATH | sed \"s|/opt/kde3|${TDEDIR}|\"`"
elif [ -n "`echo $LINK_PATH | grep \"${TDEDIR}\"`" ]; then
echo "Sym link points to ${TDEDIR}." 1>&2
else else
echo "Can't establish a path for a new link." 1>&2 echo "Cannot establish a path for a new link." 1>&2
fi fi
if [ "$NEW_LINK_PATH" != "" ] && [ "$LINK_NAME" != "" ]; then
unlink $i unlink $i
echo "Attempting to create sym link to $NEW_LINK_PATH/$LINK_NAME." 1>&2 echo "Attempting to create a sym link to $NEW_LINK_PATH/$LINK_NAME." 1>&2
ln -sf $NEW_LINK_PATH/$LINK_NAME $LINK_NAME ln -sf $NEW_LINK_PATH/$LINK_NAME $LINK_NAME
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
echo "Link created." 1>&2 echo "Link created." 1>&2
else else
echo "There was an error with creating the link." 1>&2 echo "There was an error with creating the link." 1>&2
fi fi
else
echo "Not updating the link."
fi
done done
if [ -f kmix.desktop ]; then
$TDEDIR/bin/kwriteconfig --file kmixrc --key Autostart --type bool "true"
fi
rm -f kmix.desktop
) )
echo "Renaming krita configuration files to chalk."
echo "Renaming various configuration files and directories."
# Don't force renaming in case this cript is used to update an existing Trinity profile.
echo " krita->chalk"
mv $HOME/.trinity/share/config/kritarc $HOME/.trinity/share/config/chalkrc 2>/dev/null mv $HOME/.trinity/share/config/kritarc $HOME/.trinity/share/config/chalkrc 2>/dev/null
mv $HOME/.trinity/share/apps/krita $HOME/.trinity/share/apps/chalk 2>/dev/null mv $HOME/.trinity/share/apps/krita $HOME/.trinity/share/apps/chalk 2>/dev/null
rm -fr $HOME/.trinity/cache-`uname -n`/ksycoca* 2>/dev/null echo " kdeprint->tdeprint"
rm -fr $HOME/.trinity/socket-* 2>/dev/null mv $HOME/.trinity/share/config/kdeprintrc $HOME/.trinity/share/config/tdeprintrc 2>/dev/null
rm -fr $HOME/.trinity/tmp-* 2>/dev/null mv $HOME/.trinity/share/apps/kdeprint $HOME/.trinity/share/apps/tdeprint 2>/dev/null
rm -fr $TMP/kde-$USER 2>/dev/null echo " kdesurc->tdesurc"
rm -fr $TMP/ksocket-$USER 2>/dev/null mv $HOME/.trinity/share/config/kdesurc $HOME/.trinity/share/config/tdesurc 2>/dev/null
rm -fr $TMP/tde-$USER 2>/dev/null echo " kdevelop->tdevelop"
rm -fr $TMP/tdesocket-$USER 2>/dev/null mv $HOME/.trinity/share/config/kdeveloprc $HOME/.trinity/share/config/tdeveloprc 2>/dev/null
echo " kwin->twin"
mv $HOME/.trinity/share/config/kwinrc $HOME/.trinity/share/config/twinrc 2>/dev/null
mv $HOME/.trinity/share/config/kwinrc.eventsrc $HOME/.trinity/share/config/twinrc.eventsrc 2>/dev/null
mv $HOME/.trinity/share/config/kwinrc $HOME/.trinity/share/config/twinrc 2>/dev/null
mv $HOME/.trinity/share/apps/kwinrulesrc $HOME/.trinity/share/apps/twinrulesrc 2>/dev/null
echo " kwin4->twin4"
mv $HOME/.trinity/share/config/kwin4rc $HOME/.trinity/share/config/twin4rc 2>/dev/null
# Note: Don't run kconf_update, which is run automatically when starting TDE. # Note: Don't run kconf_update, which is run automatically when starting TDE.
# Note: Don't run any profile R14 updates: starttde does that through the r14-xdg-update script. # Note: Don't run any profile R14 updates: starttde does that through the r14-xdg-update script.
echo echo
echo "Migrated!" 1>&2 echo "Done!" 1>&2
echo echo
fi
echo "If any button icons to non Trinity apps in the kicker/panel" echo "If any button icons to non Trinity apps in the kicker/panel"
echo "or system tray are incorrect, select the correct icon from the" echo "or system tray are incorrect, select the correct icon from the"
echo "button's configure menu option. The button's path to the app should" echo "button's configure menu option. The button's path to the app should"
echo "remain correct. (Note: please report any such anomalies.)" echo "remain correct. (Note: please report any such anomalies.)"
fi
echo echo
unset KDE3_PROFILE unset KDE3_PROFILE

@ -296,10 +296,13 @@ if [ -r "$PROFILE_DIR/share/config/kickerrc" ]; then
QUICK_LAUNCH_CONFIG="`grep launcher_panelapplet $PROFILE_DIR/share/config/kickerrc | awk -F = '{print $2}'`" QUICK_LAUNCH_CONFIG="`grep launcher_panelapplet $PROFILE_DIR/share/config/kickerrc | awk -F = '{print $2}'`"
if [ "$QUICK_LAUNCH_CONFIG" != "" ]; then if [ "$QUICK_LAUNCH_CONFIG" != "" ]; then
sed -i 's|,kde-|,tde-|g' "$PROFILE_DIR/share/config/$QUICK_LAUNCH_CONFIG" 2>/dev/null sed -i 's|,kde-|,tde-|g' "$PROFILE_DIR/share/config/$QUICK_LAUNCH_CONFIG" 2>/dev/null
else
Message_Prefix
echo "Quick Launch is not installed."
fi fi
else else
Message_Prefix Message_Prefix
echo "Quick Launch does not exist." echo "Quick Launch is not installed."
fi fi
# Update sym link files in $HOME/.trinity/Autostart. # Update sym link files in $HOME/.trinity/Autostart.
@ -325,7 +328,7 @@ if [ -d "$PROFILE_DIR/Autostart" ]; then
) )
else else
Message_Prefix Message_Prefix
echo "Autostart does not exist." echo "Autostart directory not found."
fi fi
# Update the user's customized menu. # Update the user's customized menu.

Loading…
Cancel
Save