From 5464fc6fc60ac3f0dbc95992369200f1f53bdbb9 Mon Sep 17 00:00:00 2001 From: Darrell Anderson Date: Fri, 15 Jun 2012 22:00:14 -0500 Subject: starttde updates: Add quotation marks to ensure $tdehome variable won't break with spaces in the directory name. Moved R14 XDG updating snippets to a separate script named r14-xdg-update. --- cmake | 2 +- starttde | 66 +++++++++++++++++++++------------------------------------------- 2 files changed, 22 insertions(+), 46 deletions(-) diff --git a/cmake b/cmake index 477d071b5..07921f23f 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 477d071b5db5544ace5449f0c2eea6d5c01d693b +Subproject commit 07921f23f88ede05bf40f01d870e18dee8868902 diff --git a/starttde b/starttde index 086f70c4b..5f2cd4084 100644 --- a/starttde +++ b/starttde @@ -251,46 +251,23 @@ test -n "$TDEHOME" && tdehome=`echo "$TDEHOME" | sed "s,^~/,$HOME/,"` # to know that this is a Trinity desktop and not a TDE one. export DESKTOP_SESSION=trinity -# Please see kstartupconfig source for usage. if [ -d "$tdehome" ]; then - # Run some R14 updates but only once. + # Possibly run some R14 XDG compliance updates. R14_UPDATED="`$TDEDIR/bin/kreadconfig --file kdeglobals --group "R14 XDG Updates" --key Updated`" if [ "$R14_UPDATED" != "true" ]; then - echo "[starttde] Updating profile for R14 XDG changes. This is a one-time event." - find $tdehome -name "*.desktop" -exec sed -i 's|X-KDE-|X-TDE-|g' {} \; 2>/dev/null - find $tdehome -name "*.desktop" -exec sed -i 's|KDE\;|TDE\;|g' {} \; 2>/dev/null - # Exclude KMail mail files --- we don't want to touch those files. - find $tdehome $tdehome/share/apps/kmail/mail -prune -o -type f -exec sed -i "s|$TDEDIR/share/applications/kde|$TDEDIR/share/applications/tde|g" {} \; 2>/dev/null - # Try to preserve keyboard shortcuts. - sed -i -e 's|CommandURL=kde-|CommandURL=tde-|g' -e 's|K Menu - kde-|K Menu - tde-|g' $tdehome/share/config/khotkeysrc 2>/dev/null - # Try to preserve profilerc. - sed -i -e 's|Application=kde-|Application=tde-|g' $tdehome/share/config/profilerc 2>/dev/null - # Update sym link files in $HOME/.trinity/Autostart. - ( cd $tdehome/Autostart - for i in `find . -type l`; do - LINK="`readlink $i`" - LINK_PATH="`dirname $LINK`" - LINK_NAME="`basename $LINK`" - if [ -n "`echo $LINK_PATH | grep \"$TDEDIR/share/applications/kde\"`" ]; then - NEW_LINK_PATH="`echo $LINK_PATH | sed 's|/share/applications/kde|/share/applications/tde|'`" - fi - unlink $i - ln -sf $NEW_LINK_PATH/$LINK_NAME $LINK_NAME - if [ "$?" != "0" ]; then - echo "There was an error with creating a new sym link for $LINK." 1>&2 - fi - done - ) - $TDEDIR/bin/kwriteconfig --file kdeglobals --group "R14 XDG Updates" --key Updated --type bool 'true' + sh $TDEDIR/bin/r14-xdg-update + if [ "$?" != "0" ]; then + exit 1 + fi fi - unset R14_UPDATED else echo "[starttde] Creating $tdehome" 1>&2 fi -mkdir -m 700 -p $tdehome -mkdir -m 700 -p $tdehome/share -mkdir -m 700 -p $tdehome/share/config -cat >$tdehome/share/config/startupconfigkeys <"$tdehome/share/config/startupconfigkeys" <$tdehome/share/config/kdesktoprc <"$tdehome/share/config/kdesktoprc" <