summaryrefslogtreecommitdiffstats
path: root/migratekde3
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2012-11-21 01:15:09 +0100
committerSlávek Banko <slavek.banko@axis.cz>2012-11-21 01:15:09 +0100
commit71444cdcbe12e32679e6cadbfd170a8abefe7a36 (patch)
tree6ceb4245a48e7d44cb15989bd008941c35cfc173 /migratekde3
parentcb0beb763f41a02425bd47769f312893087b3e1c (diff)
downloadtdebase-71444cdcbe12e32679e6cadbfd170a8abefe7a36.tar.gz
tdebase-71444cdcbe12e32679e6cadbfd170a8abefe7a36.zip
Fix migratekde3 with nonexistent cache folder
Fix unwanted rebranding when run on 3.5.x
Diffstat (limited to 'migratekde3')
-rw-r--r--migratekde324
1 files changed, 14 insertions, 10 deletions
diff --git a/migratekde3 b/migratekde3
index aa69b17d6..9070013e0 100644
--- a/migratekde3
+++ b/migratekde3
@@ -72,8 +72,8 @@ PROFILE_SIZE="`du -s $HOME/$KDE3_PROFILE | awk '{print $1}'`"
# Determine remaining partition space after migrating.
REMAINING_SPACE=$(($AVAILABLE - $PROFILE_SIZE))
# Convert to human friendly numbers (MBs).
-PROFILE_SIZE="`echo \"${PROFILE_SIZE} / 1024\" | bc`"
-REMAINING_SPACE="`echo \"$REMAINING_SPACE / 1024\" | bc`"
+PROFILE_SIZE=$(( ${PROFILE_SIZE} / 1024 ))
+REMAINING_SPACE=$(( $REMAINING_SPACE / 1024 ))
# Let the user know the results.
echo "Remaining disk space: ${REMAINING_SPACE} MB"
echo "Space required for new profile: ${PROFILE_SIZE} MB"
@@ -209,13 +209,17 @@ if [ -n "$KDE3_PROFILE" ] && [ -d "$KDE3_PROFILE" ]; then
CACHE_DIR="`readlink $HOME/.trinity/cache-\`uname -n\``"
SOCKET_DIR="`readlink $HOME/.trinity/socket-\`uname -n\``"
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/cache-`uname -n` 2>/dev/null
unlink $HOME/.trinity/socket-`uname -n` 2>/dev/null
unlink $HOME/.trinity/tmp-`uname -n` 2>/dev/null
+ if [ -n "$CACHE_DIR" ] && [ -d "$CACHE_DIR" ]; then
+ rm -f ${CACHE_DIR}/ksycoca* 2>/dev/null
+ if [ -n "$TDE_REBRAND" ]; then
+ mkdir `dirname $CACHE_DIR`/tdecache-$USER 2>/dev/null
+ ln -s `dirname $CACHE_DIR`/tdecache-$USER $HOME/.trinity/cache-`uname -n`
+ cp -a $CACHE_DIR/* `dirname $CACHE_DIR`/tdecache-$USER/ 2>/dev/null
+ fi
+ fi
# Fix config files.
# Exclude KMail mail files --- we don't want to touch those files.
@@ -374,12 +378,12 @@ if [ -n "$KDE3_PROFILE" ] && [ -d "$KDE3_PROFILE" ]; then
fi
echo "Renaming various configuration files and directories."
# Don't force renaming in case this cript is used to update an existing Trinity profile.
- if [ -f $HOME/.trinity/share/config/kritarc ] || [ -d $HOME/.trinity/share/apps/krita ]; then
+ if [ -f $HOME/.trinity/share/config/kritarc -o -d $HOME/.trinity/share/apps/krita ]; then
echo " krita->chalk"
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
fi
- if [ "$TDE_REBRAND" != "" ] && [ -f $HOME/.trinity/share/config/kdeprintrc ] || [ -d $HOME/.trinity/share/apps/kdeprint ]; then
+ if [ "$TDE_REBRAND" != "" ] && [ -f $HOME/.trinity/share/config/kdeprintrc -o -d $HOME/.trinity/share/apps/kdeprint ]; then
echo " kdeprint->tdeprint"
mv $HOME/.trinity/share/config/kdeprintrc $HOME/.trinity/share/config/tdeprintrc 2>/dev/null
mv $HOME/.trinity/share/apps/kdeprint $HOME/.trinity/share/apps/tdeprint 2>/dev/null
@@ -392,7 +396,7 @@ if [ -n "$KDE3_PROFILE" ] && [ -d "$KDE3_PROFILE" ]; then
echo " kdevelop->tdevelop"
mv $HOME/.trinity/share/config/kdeveloprc $HOME/.trinity/share/config/tdeveloprc 2>/dev/null
fi
- if [ "$TDE_REBRAND" != "" ] && [ -f $HOME/.trinity/share/config/kwinrc ] || [ -d $HOME/.trinity/share/apps/kwinrulesrc ]; then
+ if [ "$TDE_REBRAND" != "" ] && [ -f $HOME/.trinity/share/config/kwinrc -o -d $HOME/.trinity/share/apps/kwinrulesrc ]; then
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