summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-04-09 10:24:35 +0200
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-04-09 18:19:27 +0900
commit89f20417fbbe2f57254301f5fb1744e2fd0ddf01 (patch)
treec093a077e92a03f0120cde8f96d289fbc1dee0f9
parent1f4a1fb417e7caa5f9f1874e8414f9f4154c6629 (diff)
downloadtdebase-r14.0.x.tar.gz
tdebase-r14.0.x.zip
Rename "<Filename>kde-" in the menu only if the original file is not preserved.r14.0.x
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 2d8b5af5068ad96b1729aefa3476c2df87084bb6)
-rw-r--r--r14-xdg-update19
1 files changed, 13 insertions, 6 deletions
diff --git a/r14-xdg-update b/r14-xdg-update
index b3313381..69f599fa 100644
--- a/r14-xdg-update
+++ b/r14-xdg-update
@@ -887,14 +887,21 @@ fi
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
- 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" | \
+ 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" ] && \
- [ ! -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"
+ 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