Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrectly parsed DESKTOP_COMMENT leads to YAML syntax error front matter #3438

Open
overheadhunter opened this issue Jan 22, 2025 · 4 comments
Labels

Comments

@overheadhunter
Copy link
Contributor

After #3437 got merged, I noticed that the app has been unlisted. Looking at this build log it seems like the Comment from the *.desktop file is incorrectly parsed:

# Description
  DESKTOP_COMMENT=$(grep "^Comment=.*" database/$INPUTBASENAME/*.desktop | cut -d '=' -f 2- )
++ grep '^Comment=.*' database/Cryptomator/Cryptomator.desktop database/Cryptomator/cryptomator.desktop
++ cut -d = -f 2-
+ DESKTOP_COMMENT='Cloud Storage Encryption Utility
Cloud Storage Encryption Utility'

This results in a syntax error in the generated /app/*.md file:

description: Cloud Storage Encryption Utility
Cloud Storage Encryption Utility

Note that the original desktop file has always been Comment=Cloud Storage Encryption Utility, no line breaks or duplications involved (as can be shown with this git blame).

The same desktop file was parsed correctly in the past (last time with #2828).

@overheadhunter
Copy link
Contributor Author

Just to confirm, I ran --appimage-extract and looked at the included desktop file, which does not contain any such duplications:

# cat squashfs-root/Cryptomator.desktop
[Desktop Entry]
Name=Cryptomator
Comment=Cloud Storage Encryption Utility
Exec=cryptomator %F
Icon=org.cryptomator.Cryptomator
Terminal=false
Type=Application
Categories=Utility;Security;FileTools;
StartupNotify=true
StartupWMClass=org.cryptomator.launcher.Cryptomator$MainApp
MimeType=application/vnd.cryptomator.encrypted;application/vnd.cryptomator.vault;

@probonopd probonopd added the bug label Jan 25, 2025
@probonopd
Copy link
Member

Thanks for analyzing this @overheadhunter. Possibly we need to preprocess the desktop files with sed to remove lines starting with # or ;

A PR would be appreciated.

@overheadhunter
Copy link
Contributor Author

overheadhunter commented Jan 25, 2025

In preparation for a PR, I attempted to find the problem with the parser. It works just fine, though. The problem can be seen here in the build log:

ls -lh database/$INPUTBASENAME/
total 40K
-rw-r--r-- 1 runner docker  799 Jan 18 12:17 Cryptomator.desktop
-rw-r--r-- 1 runner docker  628 Jan 18 12:15 cryptomator.desktop
drwxr-xr-x 3 runner docker 4.0K Jan 18 12:15 icons
-rw-r--r-- 1 runner docker 8.2K Jan 18 12:17 org.cryptomator.Cryptomator.metainfo.xml
-rw-r--r-- 1 runner docker  14K Jan 18 12:17 screenshot.png

Note there are two .desktop files, which leads to grep "^Comment=.*" database/$INPUTBASENAME/*.desktop being resolved to grep '^Comment=.*' database/Cryptomator/Cryptomator.desktop database/Cryptomator/cryptomator.desktop.

So the new question is: Why are there two files. Apparently the lowercase one is 7 years old.

We have two options: Either make the script clean clean the directory before parsing metadata or simply delete the legacy file and leave the script as is.

@probonopd
Copy link
Member

probonopd commented Jan 27, 2025

I guess they changed the upper/lowercase in an update of the AppImage.

make the script clean clean the directory before parsing metadata

That's what we should do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants