summaryrefslogtreecommitdiffstats
path: root/r14-xdg-update
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-04-09 01:17:54 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-04-09 18:19:14 +0900
commit1f4a1fb417e7caa5f9f1874e8414f9f4154c6629 (patch)
tree6497967c7f6eb518df1a7795aa42962d0e8802fc /r14-xdg-update
parent4d786ad031a78ab5e8f9c86af8e0106d51aa865a (diff)
downloadtdebase-1f4a1fb417e7caa5f9f1874e8414f9f4154c6629.tar.gz
tdebase-1f4a1fb417e7caa5f9f1874e8414f9f4154c6629.zip
Fixed handling of kde- entries in menu. This relates to test 9 in bug 3083.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit df2406a474c73b1b380e7dec59ccf7b35d9eb360)
Diffstat (limited to 'r14-xdg-update')
-rw-r--r--r14-xdg-update14
1 files changed, 11 insertions, 3 deletions
diff --git a/r14-xdg-update b/r14-xdg-update
index 4734f9e52..b33133810 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=202004050
+SCRIPT_VERSION=202004080
# This script should be needed to run only once, but corner cases
# and file/directory permissions could cause incomplete updates.
@@ -884,11 +884,19 @@ if [ "$R14_VERSION" -lt "201401052" ]; then
fi
fi
-if [ "$R14_VERSION" -lt "202004050" ]; 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 ]; then
- # KDE/TDE 3.5.x or converted KDE4. No need to update a pre R14 menu.
+ grep "<Filename>kde-" "$USER_DIR/.config/menus/applications-tdemenuedit.menu" > "${CACHE_DIR}/${SCRIPT_NAME}-tdemenu-rename.txt" 2>&1
sed -i 's|<Filename>kde-|<Filename>tde-|g' $USER_DIR/.config/menus/applications-tdemenuedit.menu
+ cat "${CACHE_DIR}/${SCRIPT_NAME}-tdemenu-rename.txt" | sed -n "s|^\s*<Filename>kde-\(.*\)<\/Filename>\s*$|\1|p" | \
+ while read kde_filename; do
+ if [ -f "$USER_DIR/.local/share/applications/kde-$kde_filename" ] && \
+ [ ! -f "$USER_DIR/.local/share/applications/tde-$kde_filename" ]; then
+ mv "$USER_DIR/.local/share/applications/kde-$kde_filename" "$USER_DIR/.local/share/applications/tde-$kde_filename"
+ fi
+ done
+ rm "${CACHE_DIR}/${SCRIPT_NAME}-tdemenu-rename.txt"
fi
fi