summaryrefslogtreecommitdiffstats
path: root/r14-xdg-update
diff options
context:
space:
mode:
Diffstat (limited to 'r14-xdg-update')
-rw-r--r--r14-xdg-update56
1 files changed, 44 insertions, 12 deletions
diff --git a/r14-xdg-update b/r14-xdg-update
index e9f4ab735..f51a81df6 100644
--- a/r14-xdg-update
+++ b/r14-xdg-update
@@ -3,7 +3,7 @@
# A script to perform R14.0.0 XDG compliance updates.
SCRIPT_NAME="$(basename -- "$0")"
-SCRIPT_VERSION=202003170
+SCRIPT_VERSION=202307100
# This script should be needed to run only once, but corner cases
# and file/directory permissions could cause incomplete updates.
@@ -239,7 +239,7 @@ if [ "$R14_VERSION" -lt "$SCRIPT_VERSION" ] || [ "$R14_UPDATED" != "true" ] || [
# As a previous attempt failed, try again to perform a full update.
FORCE="true"
fi
- MESSAGE="The r14-xdg-update script has been run at least once.\n\nThe script is not successfully updating.\n\nThe script will run with each login until corrected.\n\nPlease contact an administrator or take appropriate\nadmininstrative action to correct the problem.\n\nThe error code is $R14_UPDATED."
+ MESSAGE="The r14-xdg-update script will attempt to repair the problems found during the previous\nsession and will run with each login until all issues are corrected\n(usually one time is enough).\n\nPlease contact an administrator or take appropriate admininstrative\naction should the problems persist for more than three reboot attempts.\n\nThe error code is $R14_UPDATED."
# Are we in X? Display an X dialog explaining breakage.
if [ "$USER_DIR" = "$HOME" ] && [ "$DISPLAY" != "" ]; then
printf "%b" "$MESSAGE" | xmessage -center -file - -buttons Continue,Quit > /dev/null 2>/dev/null
@@ -731,7 +731,7 @@ if [ "$R14_VERSION" -lt "201310190" ]; then
mv $PROFILE_DIR/share/config/kwinrulesrc $PROFILE_DIR/share/config/twinrulesrc 2>/dev/null
mv $PROFILE_DIR/share/config/kwin_rules_dialogrc $PROFILE_DIR/share/config/twin_rules_dialogrc 2>/dev/null
sed -i 's|PluginLib=kwin_|PluginLib=twin_|' $PROFILE_DIR/share/config/twinrc
- sed -i 's|PluginLib=kwin3_|PluginLib=twin3_|' $PROFILE_DIR/share/config/twinrc
+ sed -i 's|PluginLib=kwin3_|PluginLib=twin_|' $PROFILE_DIR/share/config/twinrc
fi
fi
if [ "$R14_VERSION" -lt "201309150" ]; then
@@ -824,15 +824,14 @@ if [ "$R14_VERSION" -lt "201401070" ]; then
mv $PROFILE_DIR/share/apps/kstyle $PROFILE_DIR/share/apps/tdestyle 2>/dev/null
fi
fi
-if [ "$R14_VERSION" -lt "201309150" ]; then
- # Copy the following two rc files rather than move because the older versions are needed for HAL systems.
+if [ "$R14_VERSION" -lt "202202130" ]; then
if [ ! -f $PROFILE_DIR/share/config/tdenetworkmanagerrc ] && [ -f $PROFILE_DIR/share/config/knetworkmanagerrc ]; then
Log " knetworkmanager->tdenetworkmanager"
- cp -a $PROFILE_DIR/share/config/knetworkmanagerrc $PROFILE_DIR/share/config/tdenetworkmanagerrc 2>/dev/null
+ mv $PROFILE_DIR/share/config/knetworkmanagerrc $PROFILE_DIR/share/config/tdenetworkmanagerrc 2>/dev/null
fi
if [ ! -f $PROFILE_DIR/share/config/tdepowersaverc ] && [ -f $PROFILE_DIR/share/config/kpowersaverc ]; then
Log " kpowersave->tdepowersave"
- cp -a $PROFILE_DIR/share/config/kpowersaverc $PROFILE_DIR/share/config/tdepowersaverc 2>/dev/null
+ mv $PROFILE_DIR/share/config/kpowersaverc $PROFILE_DIR/share/config/tdepowersaverc 2>/dev/null
fi
fi
if [ "$R14_VERSION" -lt "201401050" ]; then
@@ -884,11 +883,26 @@ if [ "$R14_VERSION" -lt "201401052" ]; then
fi
fi
-if [ "$R14_VERSION" -lt "201401052" ]; then
+if [ "$R14_VERSION" -lt "202004080" ]; then
# Update the user's custom menu. Any custom menu should have been renamed a few lines above.
- if [ -r $USER_DIR/.config/menus/applications-tdemenuedit.menu ] && [ "$CUSTOM_MENU" != "TDE" ]; then
- # KDE/TDE 3.5.x or converted KDE4. No need to update a pre R14 menu.
- sed -i 's|<Filename>kde-|<Filename>tde-|g' $USER_DIR/.config/menus/applications-tdemenuedit.menu
+ if [ -r $USER_DIR/.config/menus/applications-tdemenuedit.menu ]; then
+ sed -n "s|^\s*<Filename>kde-\(.*\)<\/Filename>\s*$|\1|p" \
+ < "$USER_DIR/.config/menus/applications-tdemenuedit.menu" \
+ > "${CACHE_DIR}/${SCRIPT_NAME}-tdemenu-rename.txt"
+ cat "${CACHE_DIR}/${SCRIPT_NAME}-tdemenu-rename.txt" | \
+ while read kde_filename; do
+ if [ -f "$USER_DIR/.local/share/applications/kde-$kde_filename" ]; then
+ if [ -f "$USER_DIR/.local/share/applications/tde-$kde_filename" ]; then
+ continue
+ else
+ mv "$USER_DIR/.local/share/applications/kde-$kde_filename" \
+ "$USER_DIR/.local/share/applications/tde-$kde_filename"
+ fi
+ fi
+ sed -i 's|<Filename>kde-$kde_filename|<Filename>tde-$kde_filename|g' \
+ $USER_DIR/.config/menus/applications-tdemenuedit.menu
+ done
+ rm "${CACHE_DIR}/${SCRIPT_NAME}-tdemenu-rename.txt"
fi
fi
@@ -994,6 +1008,24 @@ if [ "$R14_VERSION" -lt "201811010" ]; then
fi
fi
+# Remove Konqueror's icon cache entry for / (issue TDE/tdebase#1)
+if [ "$R14_VERSION" -lt "202103280" ]; then
+ if [ "`grep \"\([=,]\)/,[^,\n]*[,]*\" ${PROFILE_DIR}/share/config/konq_history`" ]; then
+ sed -i "s|\([=,]\)/,[^,\n]*[,]*|\1|" ${PROFILE_DIR}/share/config/konq_history
+ Log " Removed icon cache entry for root directory (Gitea issue TDE/tdebase#1)"
+ fi
+fi
+
+# Rename twin3_ to twin_ in theme config files
+if [ "$R14_VERSION" -lt "202307100" ]; then
+ find "${PROFILE_DIR}/share/apps/tdestyle/themes/" -type f -iname "*.xml" -print0 2>/dev/null | \
+ xargs -r0 sed -ri "s|twin3_|twin_|g"
+ if [ -f $PROFILE_DIR/share/config/twinrc ]; then
+ sed -i 's|PluginLib=twin3_|PluginLib=twin_|' $PROFILE_DIR/share/config/twinrc
+ fi
+ Log " Renamed twin3_ to twin_ in theme files"
+fi
+
# Perform some nominal update validations.
# First clean house from any previous failures.
if [ "$CACHE_DIR" = "" ]; then
@@ -1144,7 +1176,7 @@ if [ "$R14_UPDATE_TEST1" = "" ] && [ "$R14_UPDATE_TEST2" = "" ] && [ "$R14_UPDAT
else
# Don't use the --type parameter here because the value no longer is boolean.
$TDEDIR/bin/kwriteconfig --file "$PROFILE_DIR/share/config/kdeglobals" --group "R14 XDG Updates" --key Updated "$KDEGLOBALS_KEY_VALUE"
- MESSAGE="\n\nThe r14-xdg-update script did not complete successfully.\n\nThe script will run with each login until corrected.\n\nPlease contact an administrator or take appropriate\nadmininstrative action to correct the problem.\n\nThe error code is $KDEGLOBALS_KEY_VALUE.\n\nCommon failures include file and directory permissions.\n\n"
+ MESSAGE="The r14-xdg-update script did not complete successfully.\n\nThe script will run with each login until all issues are corrected\n(usually one more time is enough).\n\nPlease contact an administrator or take appropriate admininstrative\naction should the problems persist for more than three reboot attempts.\n\nThe error code is $KDEGLOBALS_KEY_VALUE.\n\nCommon failures include file and directory permissions.\n\n"
# Are we in X? Display an X dialog explaining breakage.
if [ "$USER_DIR" = "$HOME" ] && [ "$DISPLAY" != "" ]; then
printf "%b" "$MESSAGE" | xmessage -center -file - -buttons OK > /dev/null 2>/dev/null