Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/external/mit/ctwm/libexec Pull up following revision(s) (...



details:   https://anonhg.NetBSD.org/src/rev/6f410ef37cc5
branches:  netbsd-9
changeset: 368648:6f410ef37cc5
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jul 24 11:51:22 2022 +0000

description:
Pull up following revision(s) (requested by nia in ticket #1481):

        external/mit/ctwm/libexec/ctwm_app_menu: revision 1.5 (via patch)

ctwm_app_menu: Work around "emacs being installed results in the
generated ctwmrc containing invalid syntax" problem. Emacs installs
a desktop file called "emacsclient" that contains "doublequotes"
in its exec string. Pending a better solution for dumping escaped
shell lines into the config file, hide or sanitize desktop entires
that might mess up the internal ctwmrc quoting rules.

diffstat:

 external/mit/ctwm/libexec/ctwm_app_menu |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 002d3bdbc54d -r 6f410ef37cc5 external/mit/ctwm/libexec/ctwm_app_menu
--- a/external/mit/ctwm/libexec/ctwm_app_menu   Sun Jul 17 12:56:05 2022 +0000
+++ b/external/mit/ctwm/libexec/ctwm_app_menu   Sun Jul 24 11:51:22 2022 +0000
@@ -1,12 +1,13 @@
 #!/bin/sh
-#      $NetBSD: ctwm_app_menu,v 1.1.2.2 2020/10/08 16:04:07 martin Exp $
+#      $NetBSD: ctwm_app_menu,v 1.1.2.3 2022/07/24 11:51:22 martin Exp $
 OFS=$IFS
 IFS='
 '
 printf 'menu "appmenu"\n'
 printf '{\n'
 printf '\t"Applications"\tf.title\n'
-for app in $(find /usr/pkg/share/applications -name '*.desktop');
+LOCALBASE=$(pkg_info -Q LOCALBASE pkg_install 2>/dev/null || echo /usr/pkg)
+for app in $(find $LOCALBASE/share/applications -name '*.desktop')
 do
        name=""
        exec=""
@@ -18,13 +19,18 @@
                        Name=*)
                                if ! [ -n "$name" ];
                                then
-                                       name=$(printf '%s' "$line" | cut -c6- | tr -d '\r')
+                                       name=$(printf '%s' "$line" | cut -c6- | tr -d '\r"')
                                fi
                        ;;
                        Exec=*)
                                if ! [ -n "$exec" ];
                                then
                                        exec=$(printf '%s' "$line" | cut -c6- | sed -e 's/ %.*//g' | tr -d '\r')
+                                       if printf '%s' "$exec" | grep -q '"'; then
+                                               # results in malformed config file, better way
+                                               # to handle this...?
+                                               nodisplay="true"
+                                       fi
                                fi
                        ;;
                        Terminal=true)



Home | Main Index | Thread Index | Old Index