Incorrect Exec entry transformation in .desktop file
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
Changes made to the Exec entry for a .desktop file can result in an invalid entry:
For example, with this input:
[Desktop Entry]
Name=egmde (confined)
Comment=The example Mir server
Exec=snap run egmde-confined-desktop
Type=Application
The result is:
$ cat /snap/egmde-confined-desktop/current/meta/gui/egmde-confined-desktop.desktop
[Desktop Entry]
Name=egmde (confined)
Comment=The example Mir server
Exec=egmde-confined-desktop run egmde-confined-desktop
Type=Application
$ cat /var/lib/snapd/desktop/applications/egmde-confined-desktop_egmde-confined-desktop.desktop
[Desktop Entry]
X-SnapInstanceName=egmde-confined-desktop
Name=egmde (confined)
Comment=The example Mir server
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/egmde-confined-desktop_egmde-confined-desktop.desktop /snap/bin/egmde-confined-desktop run egmde-confined-desktop
Type=Application
But trying to run `env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/egmde-confined-desktop_egmde-confined-desktop.desktop /snap/bin/egmde-confined-desktop run egmde-confined-desktop` will fail:
$ env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/egmde-confined-desktop_egmde-confined-desktop.desktop /snap/bin/egmde-confined-desktop run egmde-confined-desktop
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
Unknown command line options: run egmde-confined-desktop
Evaluation history
No evaluation history available.