fixed qubes.GetAppmenus ignoring some correct .desktop files

.desktop files can have spaces around '=' symbols; previously
GetAppmenus discarded such files.

references QubesOS/qubes-issues#5692
This commit is contained in:
Marta Marczykowska-Górecka 2020-06-03 18:27:34 +02:00
parent 464f8f6afe
commit 6e724f76f0
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -60,7 +60,7 @@ find "${apps_dirs[@]}" -name '*.desktop' -print0 2>/dev/null | \
xargs -0 awk '
BEGINFILE { if (ERRNO) nextfile; entry="" }
/^\[/ { if (tolower($0) != "\[desktop entry\]") nextfile }
/^Exec=/ { entry = entry FILENAME ":Exec=qubes-desktop-run " FILENAME "\n"; next }
/^Exec *=/ { entry = entry FILENAME ":Exec=qubes-desktop-run " FILENAME "\n"; next }
/^NoDisplay *= *true$/ { entry=""; nextfile }
/=/ { entry = entry FILENAME ":" $0 "\n" }
ENDFILE { print entry }