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

Guessing origin name is almost always wrong in the as_utils_install_metadata_file() #683

Open
mcrha opened this issue Nov 13, 2024 · 0 comments

Comments

@mcrha
Copy link

mcrha commented Nov 13, 2024

The code looks like this right now:

			/* guess origin */
			tmp2 = g_strdup_printf ("_icons-%s.tar.gz", icons_size_id);
			tmp = g_strstr_len (basename, -1, tmp2);

There are couple problems with it:

  • you expect file names as generated by the appstream-generator, but it names them:
-rw-r--r--. 1 user user  105 Nov 13 15:36 CID-Index-x86_64.json.gz
-rw-r--r--. 1 user user 1030 Nov 13 15:36 Components-x86_64.xml.gz
-rw-r--r--. 1 user user 1084 Nov 13 15:36 Components-x86_64.xml.xz
-rw-r--r--. 1 user user   29 Nov 13 15:36 icons-128x128@2.tar.gz
-rw-r--r--. 1 user user   29 Nov 13 15:36 icons-48x48@2.tar.gz
-rw-r--r--. 1 user user 2482 Nov 13 15:36 icons-48x48.tar.gz
-rw-r--r--. 1 user user   29 Nov 13 15:36 icons-64x64@2.tar.gz
-rw-r--r--. 1 user user 3506 Nov 13 15:36 icons-64x64.tar.gz
  • you use an underscore, but a common "separator" is a dash character
  • common name used to be appstream-icons.tar (with a dash), where the appstream is not the origin name.

I suggest to not guess, simply require the origin name to be provided by the caller.

mcrha added a commit to mcrha/appstream that referenced this issue Jan 16, 2025
The dash (`-`) is used in the appstream generated files, thus expect it.

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

No branches or pull requests

1 participant