tdebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

migratekde3 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. #!/bin/sh
  2. #
  3. # Overall, this script works quite nicely, but please help to
  4. # make this script more robust!
  5. # Testers: need help to ensure this script remains POSIX compliant.
  6. # Some distros do not use bash as a default shell.
  7. #===============================================================
  8. # This is a modest attempt to migrate a KDE3 profile to Trinity.
  9. # If $HOME/.trinity exists then skip this one-time migration.
  10. # Can this script be run from within starttde?
  11. # Challenge: to run this script from within starttde requires
  12. # graphical dialog boxes. When is the underlying TDE system
  13. # sufficiently operational in the starttde script to use KDialog?
  14. # If KDialog is unavailable then that leaves xmessage, which is
  15. # ugly although possibly adequate.
  16. # If KDialog is unavailable until after $HOME/.trinity exists, such
  17. # as after running KPersonalizer, then this script will not help.
  18. # Also, KPersonalizer automatically creates a skeleton profile directory
  19. # when launched, as does some command line tools such as tdeconf_update.
  20. #
  21. # Additionally, this script was written mainly from a command line
  22. # login perspective. This script and concept needs testing and
  23. # improvements to support graphical login systems.
  24. #===============================================================
  25. # Known Quirks:
  26. # When testing the same user account between two different systems, such
  27. # as a real and virtual machine or two different physical machines,
  28. # after a migration KMix is always muted because the sound devices differ.
  29. # Not sure, but forced window sizes saved in kwinrulesc seem to break after
  30. # a migration.
  31. #===============================================================
  32. Wait_For_Response () {
  33. unset response
  34. # -r Backslash does not act as an escape character.
  35. # -p Display "PROMPT" without a trailing newline, before attempting to read any input.
  36. while true; do
  37. read -r -p "$1 (y/n): " yn
  38. case $yn in
  39. [Yy]* ) response=y; break;;
  40. [Nn]* ) response=n; break;;
  41. * ) echo "Please answer yes (y/Y) or no (n/N).";;
  42. esac
  43. done
  44. }
  45. Proceed_From_Response () {
  46. if [ "$response" = "n" -o "$response" = "N" ]; then
  47. echo "Exiting."
  48. echo
  49. exit 0
  50. else
  51. echo "Continuing."
  52. echo
  53. fi
  54. }
  55. # Need help here to make the disk space test more robust!
  56. disk_space_test () {
  57. echo
  58. echo "Testing available disk space."
  59. # Find the remaining space on the partition.
  60. AVAILABLE="`df $HOME/$KDE3_PROFILE | grep '\/' | awk '{print $4}'`"
  61. # Find the size of the profile directory.
  62. PROFILE_SIZE="`du -s $HOME/$KDE3_PROFILE | awk '{print $1}'`"
  63. # Determine remaining partition space after migrating.
  64. REMAINING_SPACE=$(($AVAILABLE - $PROFILE_SIZE))
  65. # Convert to human friendly numbers (MBs).
  66. PROFILE_SIZE=$(( ${PROFILE_SIZE} / 1024 ))
  67. REMAINING_SPACE=$(( $REMAINING_SPACE / 1024 ))
  68. # Let the user know the results.
  69. echo "Remaining disk space: ${REMAINING_SPACE} MB"
  70. echo "Space required for new profile: ${PROFILE_SIZE} MB"
  71. # If obvious insufficient space then inform and quit.
  72. if [ $PROFILE_SIZE -gt $REMAINING_SPACE ]; then
  73. echo "Insufficient disk space. Exiting."
  74. echo
  75. exit 0
  76. else
  77. echo "Sufficient disk space exists. Continuing."
  78. echo
  79. fi
  80. # Ask whether to proceed.
  81. # Wait_For_Response "Migrate?"
  82. # Proceed_From_Response
  83. # User wants to migrate.
  84. echo "Migrating an existing KDE3 profile directory:" 1>&2
  85. echo "Copying \$HOME/$KDE3_PROFILE to \$HOME/.trinity." 1>&2
  86. cp -a $HOME/$KDE3_PROFILE $HOME/.trinity
  87. }
  88. # Require a backup of the profile.
  89. if [ "$1" = "backup" ]; then
  90. BACKUP="true"
  91. fi
  92. # Avoid any possible conflict with KDE4. Therefore within this script
  93. # use full path names to all binaries used.
  94. # The binaries for TDE are located in the same place as this script.
  95. # To determine that location use the following method rather than presuming
  96. # the existence of $TDEDIR. That environment variable might not be
  97. # defined or defined to point to KDE4 binaries.
  98. BIN_DIR="`dirname \`readlink -f $0\``"
  99. if [ -x $BIN_DIR/tde-config ]; then
  100. TDE_VERSION="`$BIN_DIR/tde-config --version | grep TDE | awk '{print $2}'`"
  101. echo "Trinity Desktop Environment version is $TDE_VERSION" 1>&2
  102. export TDEDIR=${BIN_DIR%/bin}
  103. echo "Trinity Desktop Environment base directory is $TDEDIR" 1>&2
  104. else
  105. # This might be a Trinity version before kde-config was renamed to tde-config.
  106. # Don't use kde-config because of a bug that always creates a $TDEHOME directory.
  107. if [ -x $BIN_DIR/konqueror ]; then
  108. TDE_VERSION="`$BIN_DIR/konqueror --version | grep KDE | awk '{print $2}'`"
  109. echo "Trinity Desktop Environment version is $TDE_VERSION" 1>&2
  110. export TDEDIR=${BIN_DIR%/bin}
  111. echo "Trinity Desktop Environment base directory is $TDEDIR" 1>&2
  112. else
  113. echo "Unable to determine the TDE bin directory, where this script should be installed."
  114. echo "This script should be installed in the same directory."
  115. echo "Exiting."
  116. exit 1
  117. fi
  118. fi
  119. unset BIN_DIR
  120. # Trap when the user runs this script while in a Trinity session.
  121. # Most files can be updated "live" but some can't, such as kdeglobals.
  122. if [ "$TDE_FULL_SESSION" != "" ] && [ "$TDE_SESSION_UID" != "" ] && [ "`ps ax | grep \`tail -n1 $HOME/.DCOPserver_\`uname -n\`__0 2>/dev/null\` | grep -v grep`" != "" ]; then
  123. MESSAGE="You are running this script while a Trinity session is active.\nMost files can be updated \"live\" but some cannot, such as kdeglobals.\n\nThis script probably will not complete successfully. :-)"
  124. # Are we in X? Display an X dialog explaining breakage.
  125. printf "%b" "$MESSAGE\n"
  126. Wait_For_Response "Continue?"
  127. Proceed_From_Response
  128. fi
  129. echo
  130. echo "This script migrates an existing KDE3 profile directory."
  131. echo "The definition of a KDE3 profile directory includes some"
  132. echo "older Trinity profile directories."
  133. echo
  134. echo "The KDE3 profile directory will be copied/duplicated"
  135. echo "and then cleaned/scrubbed to remove remnants of KDE3."
  136. echo "KMail config files will be scrubbed but not the mail files."
  137. echo "Likewise with other data files, such as for Amarok, Basket,"
  138. echo "Juk, KGet, KNotes, and Kopete."
  139. echo "The result is a new Trinity profile directory. :-)"
  140. echo
  141. # We need to make this first test more robust. Some TDE tools create
  142. # a skeleton profile directory ($TDEHOME/share/config) with no files.
  143. # Thus, the mere existence of $HOME/.trinity will cause this script
  144. # to terminate despite an existing profile directory possibly being
  145. # nothing more than a skeleton. Possibly like the KDE4 profile directory
  146. # test below, we can test for several knowable TDE files that also don't
  147. # exist in KDE4. If those files don't exist then presume a skeleton
  148. # profile directory.
  149. # Do not migrate when $TDEHOME is a sym link to another profile directory.
  150. # Trinity should have full reign within its own profile directory
  151. # (limited to administrative locking), but an error check is a
  152. # conservative approach.
  153. TDEHOME_LINK="`readlink \"$HOME/.trinity\"`"
  154. if [ "$TDEHOME_LINK" != "" ]; then
  155. echo "Warning! The profile directory $HOME/.trinity is a" 1>&2
  156. echo "sym link to $TDEHOME_LINK!" 1>&2
  157. echo "Please break this sym link to perform the profile migration." 1>&2
  158. echo
  159. Wait_For_Response "Break the sym link now and continue with migrating?"
  160. Proceed_From_Response
  161. unlink "$HOME/.trinity" 2>/dev/null
  162. if [ "`readlink \"$HOME/.trinity\"`" != "" ]; then
  163. echo "Unable to break the sym link. Check your file and directory privileges. Quitting."
  164. unset KDE3_PROFILE
  165. unset TDEHOME_LINK
  166. exit 0
  167. fi
  168. fi
  169. if [ -d "$HOME/.trinity" ] && [ "$BACKUP" = "true" ]; then
  170. echo "$HOME/.trinity already exists." 1>&2
  171. echo "User requested a backup copy."
  172. if [ -d $HOME/.trinity.old ]; then
  173. echo "Creating backup copy $HOME/.trinity.old2..." 1>&2
  174. cp -a $HOME/.trinity $HOME/.trinity.old2
  175. else
  176. echo "Creating backup copy $HOME/.trinity.old..." 1>&2
  177. cp -a $HOME/.trinity $HOME/.trinity.old
  178. fi
  179. echo
  180. KDE3_PROFILE=".trinity"
  181. elif [ -d "$HOME/.trinity" ]; then
  182. echo "$HOME/.trinity already exists." 1>&2
  183. echo "No migration required, but running to update an older Trinity profile." 1>&2
  184. echo
  185. KDE3_PROFILE=".trinity"
  186. else
  187. echo "$HOME/.trinity does not exist." 1>&2
  188. # If $HOME/.kde3 or $HOME/.kdemod3 exists, probably safe to presume a profile from KDE3 or a previous Trinity.
  189. if [ -d "$HOME/.kde3" ]; then
  190. echo "Found $HOME/.kde3."
  191. KDE3_PROFILE=".kde3"
  192. disk_space_test
  193. elif [ -d "$HOME/.kdemod3" ]; then
  194. echo "Found $HOME/.kdemod3."
  195. KDE3_PROFILE=".kdemod3"
  196. disk_space_test
  197. elif [ -d "$HOME/.kde" ]; then
  198. # This is tricky --- ensure this profile directory is NOT KDE4.
  199. echo "Found $HOME/.kde."
  200. if [ ! -d $HOME/.kde/share/kde4 ] && \
  201. [ ! -f $HOME/.kde/share/config/nepomukserverrc ] && \
  202. [ ! -f $HOME/.kde/share/config/phonondevicesrc ] && \
  203. [ ! -f $HOME/.kde/share/config/plasma-desktop-appletsrc ] && \
  204. [ ! -f $HOME/.kde/share/config/specialmailcollectionsrc ]; then
  205. # That was five different tests. Probably not a KDE4 profile. There is a chance
  206. # the user's KDE3 profile got contaminated testing KDE4. If that is the case then
  207. # too bad --- the safe route here is not to migrate. Otherwise if this 5-point
  208. # test passes then migrate the profile.
  209. KDE3_PROFILE=".kde"
  210. echo "$HOME/$KDE3_PROFILE does not look like a KDE4 profile directory."
  211. disk_space_test
  212. else
  213. echo "$HOME/.kde probably is a KDE4 profile directory."
  214. fi
  215. else
  216. echo "Found no KDE3 profile directory to migrate." 1>&2
  217. fi
  218. fi
  219. if [ -n "$KDE3_PROFILE" ] && [ -d "$KDE3_PROFILE" ]; then
  220. # Remove KDE3 remnants.
  221. echo "Cleaning temp file locations." 1>&2
  222. # All three directories are for temporary files. The cache directory is
  223. # intended for persistent temporary data (is expected to remain across reboots
  224. # and shutdowns). The other two directories are for non-persistent data and
  225. # can be deleted across reboots and shutdowns.
  226. CACHE_DIR="`readlink $HOME/.trinity/cache-\`uname -n\``"
  227. SOCKET_DIR="`readlink $HOME/.trinity/socket-\`uname -n\``"
  228. TMP_DIR="`readlink $HOME/.trinity/tmp-\`uname -n\``"
  229. # Delete the non-persistent temporary directories. This is safe at any time.
  230. unlink $HOME/.trinity/socket-`uname -n` 2>/dev/null
  231. unlink $HOME/.trinity/tmp-`uname -n` 2>/dev/null
  232. if [ "$SOCKET_DIR" != "" ]; then
  233. rm -fr $SOCKET_DIR 2>/dev/null
  234. fi
  235. if [ "$TMP_DIR" != "" ]; then
  236. rm -fr $TMP_DIR 2>/dev/null
  237. fi
  238. # Remove the obsolete ksycoca and tdesycoca files from the cache directory.
  239. # The KDE3 and Trinity cache directories will be linked to the same location,
  240. # but deleting the ksycoca/tdesycoca files is non-destructive.
  241. rm -f $HOME/.trinity/cache-`uname -n`/ksycoca* 2>/dev/null
  242. rm -f $HOME/.trinity/cache-`uname -n`/tdesycoca* 2>/dev/null
  243. # Fix config files.
  244. # Exclude KMail mail files --- we don't want to touch those files.
  245. # I'm using maildir --- do these commands work for mbox too?
  246. echo "Cleaning config files (but not files with user data, e.g. KMail mail files. :-))" 1>&2
  247. echo "Cleaning, first pass..." 1>&2
  248. KDE3_PROFILE_R=$(echo $KDE3_PROFILE | sed "s|\.|\\\\.|g")
  249. find $HOME/.trinity \
  250. -path $HOME/.trinity/share/apps/amarok/albumcovers -prune -o \
  251. -path $HOME/.trinity/share/apps/basket/baskets -prune -o \
  252. -path $HOME/.trinity/share/apps/juk/covers -prune -o \
  253. -path $HOME/.trinity/share/apps/kget/logs -prune -o \
  254. -path $HOME/.trinity/share/apps/kmail/autosave -prune -o \
  255. -path $HOME/.trinity/share/apps/kmail/dimap -prune -o \
  256. -path $HOME/.trinity/share/apps/kmail/imap -prune -o \
  257. -path $HOME/.trinity/share/apps/kmail/mail -prune -o \
  258. -path $HOME/.trinity/share/apps/kmail/search -prune -o \
  259. -path $HOME/.trinity/share/apps/knotes -prune -o \
  260. -path $HOME/.trinity/share/apps/kopete/logs -prune -o \
  261. -type f -print0 | \
  262. xargs -r0 grep -ZIFl "/${KDE3_PROFILE}" | \
  263. xargs -r0 sed -i "s|/${KDE3_PROFILE_R}|/\.trinity|g"
  264. EXIT_CODE="$?"
  265. if [ "$EXIT_CODE" = "0" ]; then
  266. echo "Done." 1>&2
  267. else
  268. echo "There was an error with the first pass." 1>&2
  269. fi
  270. # What if $TDEDIR is not defined? Bummer.
  271. if [ -z "$TDEDIR" ]; then
  272. echo "The \$TDEDIR environment variable does not exist. Cannot complete the second pass." 1>&2
  273. else
  274. echo "Cleaning, second pass..." 1>&2
  275. find $HOME/.trinity \
  276. -path $HOME/.trinity/share/apps/amarok/albumcovers -prune -o \
  277. -path $HOME/.trinity/share/apps/basket/baskets -prune -o \
  278. -path $HOME/.trinity/share/apps/juk/covers -prune -o \
  279. -path $HOME/.trinity/share/apps/kget/logs -prune -o \
  280. -path $HOME/.trinity/share/apps/kmail/autosave -prune -o \
  281. -path $HOME/.trinity/share/apps/kmail/dimap -prune -o \
  282. -path $HOME/.trinity/share/apps/kmail/imap -prune -o \
  283. -path $HOME/.trinity/share/apps/kmail/mail -prune -o \
  284. -path $HOME/.trinity/share/apps/kmail/search -prune -o \
  285. -path $HOME/.trinity/share/apps/knotes -prune -o \
  286. -path $HOME/.trinity/share/apps/kopete/logs -prune -o \
  287. -type f -print0 | \
  288. xargs -r0 grep -ZIFl "/opt/kde/" | \
  289. xargs -r0 sed -i "s|/opt/kde/|${TDEDIR}/|g"
  290. EXIT_CODE_1="$?"
  291. find $HOME/.trinity \
  292. -path $HOME/.trinity/share/apps/amarok/albumcovers -prune -o \
  293. -path $HOME/.trinity/share/apps/basket/baskets -prune -o \
  294. -path $HOME/.trinity/share/apps/juk/covers -prune -o \
  295. -path $HOME/.trinity/share/apps/kget/logs -prune -o \
  296. -path $HOME/.trinity/share/apps/kmail/autosave -prune -o \
  297. -path $HOME/.trinity/share/apps/kmail/dimap -prune -o \
  298. -path $HOME/.trinity/share/apps/kmail/imap -prune -o \
  299. -path $HOME/.trinity/share/apps/kmail/mail -prune -o \
  300. -path $HOME/.trinity/share/apps/kmail/search -prune -o \
  301. -path $HOME/.trinity/share/apps/knotes -prune -o \
  302. -path $HOME/.trinity/share/apps/kopete/logs -prune -o \
  303. -type f -print0 | \
  304. xargs -r0 grep -ZIFl "/opt/kde3/" | \
  305. xargs -r0 sed -i "s|/opt/kde3/|${TDEDIR}/|g"
  306. EXIT_CODE_2="$?"
  307. if [ "$EXIT_CODE_1" = "0" ] && [ "$EXIT_CODE_2" = "0" ]; then
  308. echo "Done." 1>&2
  309. else
  310. echo "There was an error with the second pass." 1>&2
  311. fi
  312. echo "Cleaning, third pass..." 1>&2
  313. # Prevent an anomaly with the kicker Firefox icon. Firefox likely is installed to /usr.
  314. # The following update will change that to /opt/trinity. We need to restore that location.
  315. KICKER_FIREFOX="$HOME/$KDE3_PROFILE/share/apps/kicker/mozilla-firefox.desktop"
  316. if [ -e "$KICKER_FIREFOX" ]; then
  317. FIREFOX_PNG_LOCATION="`grep \"Icon=\" \"$KICKER_FIREFOX\"`"
  318. fi
  319. find $HOME/.trinity \
  320. -path $HOME/.trinity/share/apps/amarok/albumcovers -prune -o \
  321. -path $HOME/.trinity/share/apps/basket/baskets -prune -o \
  322. -path $HOME/.trinity/share/apps/juk/covers -prune -o \
  323. -path $HOME/.trinity/share/apps/kget/logs -prune -o \
  324. -path $HOME/.trinity/share/apps/kmail/autosave -prune -o \
  325. -path $HOME/.trinity/share/apps/kmail/dimap -prune -o \
  326. -path $HOME/.trinity/share/apps/kmail/imap -prune -o \
  327. -path $HOME/.trinity/share/apps/kmail/mail -prune -o \
  328. -path $HOME/.trinity/share/apps/kmail/search -prune -o \
  329. -path $HOME/.trinity/share/apps/knotes -prune -o \
  330. -path $HOME/.trinity/share/apps/kopete/logs -prune -o \
  331. -type f -print0 | \
  332. xargs -r0 grep -ZIFl "/usr/share/" | \
  333. xargs -r0 sed -i "s|/usr/share/|${TDEDIR}/share/|g"
  334. if [ "$?" = "0" ]; then
  335. if [ "$FIREFOX_PNG_LOCATION" != "" ]; then
  336. FIREFOX_PNG_LOCATION_NEW="`grep \"Icon=\" \"$HOME/.trinity/share/apps/kicker/mozilla-firefox.desktop\"`"
  337. FIREFOX_PNG_LOCATION_NEW_R=$(echo $FIREFOX_PNG_LOCATION_NEW | sed "s|\.|\\\\.|g")
  338. sed -i "s|$FIREFOX_PNG_LOCATION_NEW_R|$FIREFOX_PNG_LOCATION|" $HOME/.trinity/share/apps/kicker/mozilla-firefox.desktop
  339. fi
  340. echo "Done." 1>&2
  341. else
  342. echo "There was an error with the third pass." 1>&2
  343. fi
  344. fi
  345. # Need to update files in $HOME/.trinity/Autostart.
  346. # Some files might be *.desktop files and can be cleaned in place.
  347. # Some files might be sym links to a previous KDE3 location.
  348. # Recreate those links to the correct Trinity location.
  349. # This needs improvement for apps not in /usr/bin.
  350. echo "Attempting to update *.desktop files in Autostart." 1>&2
  351. find $HOME/.trinity/Autostart -! -type l -type f -print0 | \
  352. xargs -r0 grep -ZIFl "/usr/bin/" | \
  353. xargs -r0 sed -i "s|/usr/bin/|${TDEDIR}/bin/|g"
  354. echo "Attempting to update sym links in Autostart." 1>&2
  355. ( cd $HOME/.trinity/Autostart
  356. for i in `find . -type l`; do
  357. LINK="`readlink $i`"
  358. echo "Found a sym link to $LINK." 1>&2
  359. LINK_PATH="`dirname $LINK`"
  360. LINK_NAME="`basename $LINK`"
  361. if [ -n "`echo $LINK_PATH | grep \"/usr\"`" ]; then
  362. echo "Sym link points to /usr." 1>&2
  363. NEW_LINK_PATH="`echo $LINK_PATH | sed \"s|/usr|${TDEDIR}|\"`"
  364. elif [ -n "`echo $LINK_PATH | grep \"/opt/kde\"`" ]; then
  365. echo "Sym link points to /opt/kde." 1>&2
  366. NEW_LINK_PATH="`echo $LINK_PATH | sed \"s|/opt/kde|${TDEDIR}|\"`"
  367. elif [ -n "`echo $LINK_PATH | grep \"/opt/kde3\"`" ]; then
  368. echo "Sym link points to /opt/kde3." 1>&2
  369. NEW_LINK_PATH="`echo $LINK_PATH | sed \"s|/opt/kde3|${TDEDIR}|\"`"
  370. elif [ -n "`echo $LINK_PATH | grep \"${TDEDIR}\"`" ]; then
  371. echo "Sym link points to ${TDEDIR}." 1>&2
  372. else
  373. echo "Cannot establish a path for a new link." 1>&2
  374. fi
  375. if [ "$NEW_LINK_PATH" != "" ] && [ "$LINK_NAME" != "" ]; then
  376. unlink $i
  377. echo "Attempting to create a sym link to $NEW_LINK_PATH/$LINK_NAME." 1>&2
  378. ln -sf $NEW_LINK_PATH/$LINK_NAME $LINK_NAME
  379. if [ "$?" = "0" ]; then
  380. echo "Link created." 1>&2
  381. else
  382. echo "There was an error with creating the link." 1>&2
  383. fi
  384. else
  385. echo "Not updating the link."
  386. fi
  387. done
  388. if [ -f kmix.desktop ]; then
  389. $TDEDIR/bin/kwriteconfig --file kmixrc --key Autostart --type bool "true"
  390. fi
  391. rm -f kmix.desktop
  392. )
  393. # Ensure all KDED services are accounted for in the user's profile. Any that are missing
  394. # are defaulted to not auto-loading (false). Refer to bug report 1210. This same test is
  395. # performed in the r14-xdg-update script, but notice the r14-xdg-update script uses the
  396. # key of X-TDE-Kded-autoload whereas X-KDE-Kded-autoload is used here.
  397. if [ -d $HOME/.trinity/share/services/kded ]; then
  398. if [ "`find $HOME/.trinity/share/services/kded -name *.desktop`" != "" ]; then
  399. echo "Validating KDED services."
  400. for i in `/bin/ls -1 $HOME/.trinity/share/services/kded/*.desktop`; do
  401. SERVICE_NAME=`basename $i`
  402. if [ ! -f $TDEDIR/share/services/kded/$SERVICE_NAME ]; then
  403. $TDEDIR/bin/kwriteconfig --file $i --group "Desktop Entry" --key "X-KDE-Kded-autoload" --type bool "false"
  404. fi
  405. done
  406. fi
  407. fi
  408. # Preserve kicker/panel icons.
  409. if [ -r $HOME/.trinity/share/config/kickerrc ]; then
  410. echo "Updating kicker/panel customizations in kickerrc."
  411. if [ -r "$HOME/.trinity/share/config/kickerrc" ]; then
  412. sed -i "s|/usr/share/|${TDEDIR}/share/|g" "$HOME/.trinity/share/config/kickerrc" 2>/dev/null
  413. else
  414. echo "kickerrc does not exist."
  415. fi
  416. fi
  417. echo "Renaming some configuration files and directories."
  418. # Note: The only rebranding that occurred before starting the R14 branch was krita. All other
  419. # rebranding updates belong in the r14-xdg-update script.
  420. if [ ! -f $HOME/.trinity/share/config/chalkrc ] && [ -f $HOME/.trinity/share/config/kritarc -o -d $HOME/.trinity/share/apps/krita ]; then
  421. echo " krita->chalk"
  422. mv $HOME/.trinity/share/config/kritarc $HOME/.trinity/share/config/chalkrc 2>/dev/null
  423. mv $HOME/.trinity/share/apps/krita $HOME/.trinity/share/apps/chalk 2>/dev/null
  424. fi
  425. # Note: Don't run tdeconf_update, which is run automatically when starting TDE.
  426. # Note: Don't run any profile R14 updates: starttde does that through the r14-xdg-update script.
  427. echo
  428. echo "Done!" 1>&2
  429. echo
  430. echo "If any button icons to non Trinity apps in the kicker/panel"
  431. echo "or system tray are incorrect, select the correct icon from the"
  432. echo "button's configure menu option. The button's path to the app should"
  433. echo "remain correct. (Note: please report any such anomalies.)"
  434. fi
  435. echo
  436. unset KDE3_PROFILE
  437. unset KDE3_PROFILE_R
  438. unset TDEHOME_LINK
  439. unset KICKER_FIREFOX
  440. unset FIREFOX_PNG_LOCATION
  441. unset FIREFOX_PNG_LOCATION_NEW
  442. unset FIREFOX_PNG_LOCATION_NEW_R
  443. unset SERVICE_NAME
  444. unset NEW_LINK_PATH
  445. unset LINK_NAME
  446. unset AVAILABLE
  447. unset PROFILE_SIZE
  448. unset REMAINING_SPACE
  449. unset BIN_DIR
  450. unset TDE_VERSION
  451. unset TDEHOME_LINK
  452. unset CACHE_DIR
  453. unset SOCKET_DIR
  454. unset TMP_DIR
  455. unset EXIT_CODE